Irish SEO,  Marketing & Webmaster Discussion

 

PHP includes - correct formatting

This is a discussion on PHP includes - correct formatting within the Coding Help forums, part of the Webmaster Help category; I not a bona fide coder so forgive this if it's a really dumb question. I use Easy PHP and ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2007, 03:47 PM
EdenWeb's Avatar
Wannabe Geek
Recent Blog: Golden Spider Awards
 
Join Date: Jul 2006
Location: Dublin, WIcklow
Posts: 343
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
EdenWeb will become famous soon enough
Default PHP includes - correct formatting

I not a bona fide coder so forgive this if it's a really dumb question.

I use Easy PHP and WAMP server here to make my local machine run ssi scripts and act as a server.
Normally, I format a PHP include as follows

<? include("../folder/file.php") ?>

and that worked fine until I updated a version of one of these applications and now I need to ammend that to be as follows (extra p h p after opening statement...

<? php include("../folder/file.php") ?>

Any ideas why the change?
__________________
Peter Knight - Web Designer
.................................................. ..................................................
Eden Web - Web Design Ireland Virtual Tour Company Dublin Photographer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-08-2007, 03:52 PM
Coder
Recent Blog:
 
Join Date: Mar 2007
Location: Kildare Ireland
Posts: 59
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Ciarán Mc Cann will become famous soon enough
Send a message via MSN to Ciarán Mc Cann
Default

I too use WAMP and I have come across the problem, myself. Still not sure why it changes tho.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-08-2007, 05:46 PM
EdenWeb's Avatar
Wannabe Geek
Recent Blog: Golden Spider Awards
 
Join Date: Jul 2006
Location: Dublin, WIcklow
Posts: 343
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
EdenWeb will become famous soon enough
Default

Thanks Ciaran
I'll have a look at the forums and see if there's any info there.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 07-08-2007, 05:51 PM
georgiecasey's Avatar
Member
 
Join Date: Jul 2006
Location: Galway / Ennis
Posts: 277
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
georgiecasey will become famous soon enough
Send a message via ICQ to georgiecasey
Default

The <? has been deprecated for a while because it can get mixed up for an XML file. Recommended to use <?php. There's a setting in php.ini that allows the <? or not, it must be turned off in the new installtion or something
__________________

My Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-08-2007, 09:04 PM
404 username not found's Avatar
Undefined offset:
 
Join Date: Jan 2007
Location: localhost
Posts: 69
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
404 username not found will become famous soon enough
Default

Yeah, here's a comment section from my php.ini file... just above the short_open_tag = Off option.
Quote:
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
The book I learned most of my PHP from warned against using short tags as well, so I've been spared this particular headache.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 15-08-2007, 03:48 PM
EdenWeb's Avatar
Wannabe Geek
Recent Blog: Golden Spider Awards
 
Join Date: Jul 2006
Location: Dublin, WIcklow
Posts: 343
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
EdenWeb will become famous soon enough
Default

Great - thanks for that.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 16-08-2007, 12:02 AM
Wannabe Geek
Recent Blog: M6 (England) Crash
 
Join Date: May 2006
Posts: 215
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
enzo will become famous soon enough
Send a message via Skype™ to enzo
Default

George is right (not that I know an awful lot about php), short tags aren't recommended cos they conflict with the xml tag.

Quote:
hort_open_tag boolean Tells whether the short form (<? ?>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use <?xml ?> inline. Otherwise, you can print it with PHP, for example: <?php echo '<?xml version="1.0"'; ?>. Also if disabled, you must use the long form of the PHP open tag (<?php ?>).
Note: This directive also affects the shorthand <?=, which is identical to <? echo. Use of this shortcut requires short_open_tag to be on.
__________________
CSS Templates
emcguinness.ie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
correct, formatting, includes, php

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Adsense served through php includes? ButtermilkJack Google Adsense 3 03-04-2007 05:21 PM
PHP Include (Most Recent HTML File)? ButtermilkJack Coding Help 6 29-03-2007 09:19 AM
Simple PHP Breadcrumb Script? ButtermilkJack Coding Help 4 17-03-2007 06:50 PM
PHP woes : checking if value is numeric paul Coding Help 9 26-02-2007 02:50 PM
WTF - Some PHP Obfuscation. daviddoran General Chat 8 20-02-2007 05:45 PM


Sponsored links

Paid On Results


All times are GMT +1. The time now is 05:05 AM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0