Dragosvr92 Posted August 12, 2010 Share Posted August 12, 2010 Hello i said to replace the short php tags (<??>) with long php tags (<?php ?>) but it is giving me Parse errors -.- the parse error apears if i have <?php//NOTE ?> With <?//NOTE?> Is all ok and it dosnt give me that error .. could anyone please tell me why dos it give the error and some more details about the tags etc Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/ Share on other sites More sharing options...
Pikachu2000 Posted August 12, 2010 Share Posted August 12, 2010 Put in a space. <?php //NOTE ?> Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098376 Share on other sites More sharing options...
PFMaBiSmAd Posted August 12, 2010 Share Posted August 12, 2010 None of - <?php//NOTE?> or <?php//NOTE ?> or <?php //NOTE ?> produce a parse error (edit: on a system with short_open_tags turned off, I did not test on a system with them on.) You likely have some other syntax error prior to that point that is being detected when the <?php tag is being encountered. Please post the actual error and the code up to the point where the error is being reported. edit: on a system with short_open_tags turned ON, you do get runtime notices for the <?php//NOTE?> and <?php//NOTE ?> versions about php being an undefined constant, but those are not parse errors. Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098380 Share on other sites More sharing options...
Pikachu2000 Posted August 12, 2010 Share Posted August 12, 2010 I didn't run it, but Zend Studio shows a Use of undefined constant php - assumed 'php' without the space in it. Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098381 Share on other sites More sharing options...
Dragosvr92 Posted August 12, 2010 Author Share Posted August 12, 2010 @ Pikachu2000 i know that works but i was wondering why <?php//MESAGE?> Isnt working without the space @PFMaBiSmAd It dos produce the error ........ otherwise i wouldnt post if i wasnt sure it produced the error Well i have short tags enabled And it did gaved a parse error here are the exact errors and code ... <?php//Login error_reporting(0); //$KEY = 'blablaaahhhhhhhhhhhhhhhhhhhhhhhh'; $KEY = 'BLAAAAHHHHHHHHHHHHHHHHHHHHHHHh';//Localhost With <?php//Login it gives the error bellow Parse error: parse error in C:\wamp\www\IP\index.php on line 2 if i remove line 2 it gives a same error at line 4 they arent serious errors but i said that it'll be safer with the full php tags in my script Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098385 Share on other sites More sharing options...
PFMaBiSmAd Posted August 12, 2010 Share Posted August 12, 2010 With short_open_tags ON, the php code you have written cannot be parsed. With short_open_tags OFF, the php code you have written can be parsed. Short-answer: Don't put a comment immediately following a php tag without any white-space between the tag and the comment. Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098388 Share on other sites More sharing options...
Dragosvr92 Posted August 12, 2010 Author Share Posted August 12, 2010 ok thanks i will continue the short php tags as they are prettier and they work better if they are enabled Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098401 Share on other sites More sharing options...
Daniel0 Posted August 12, 2010 Share Posted August 12, 2010 ok thanks i will continue the short php tags as they are prettier and they work better if they are enabled That's fine. Just remember that you might run into trouble if you're writing code that other people are going to use seeing as they're turned off by default. Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098405 Share on other sites More sharing options...
Dragosvr92 Posted August 12, 2010 Author Share Posted August 12, 2010 neah .. i am writing the code for my personal use only and if i will ever get on a dumb host that dosnt activate them (which i doubt) i'll use Notepad++'s replacement tool to change them into long tags Quote Link to comment https://forums.phpfreaks.com/topic/210514-php-tags/#findComment-1098439 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.