clankill3r Posted October 29, 2011 Share Posted October 29, 2011 i have this in the adressbar: truncate.php?msg=historer_words but on screen i get, why instead of the expected: Truncated <? $_GET['mgs'] ?> Does someone sees what's wrong in my script? <?php ?> <html> <head> <title>Historer : Truncate</title> </head> <body> <? if(isset($_GET['mgs'])) { ?><div id="message">Truncated <? $_GET['mgs'] ?></div> <? } else { ?><div id="message">why </div> <? } ?> <div id="container"> <a href="inc/php/utils/truncate.php?table=historer_words">Truncate words</a> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/ Share on other sites More sharing options...
ManiacDan Posted October 29, 2011 Share Posted October 29, 2011 Note that you spelled "address" wrong in your thread title. Note also that you spelled "msg" wrong in your code. Programming takes an enormous amount of precision. if you're off by one letter, like you are here, nothing will work. Make sure you are more careful. Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283340 Share on other sites More sharing options...
clankill3r Posted October 30, 2011 Author Share Posted October 30, 2011 i know it is important :'( I just need sleep, i have been working 12 hours now and i get sloppy then... Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283354 Share on other sites More sharing options...
MasterACE14 Posted October 30, 2011 Share Posted October 30, 2011 Also 'short tags' are a bad habit worth kicking. <?php // always... ?> Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283385 Share on other sites More sharing options...
clankill3r Posted October 30, 2011 Author Share Posted October 30, 2011 why is that? Is it slower? Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283409 Share on other sites More sharing options...
MasterACE14 Posted October 30, 2011 Share Posted October 30, 2011 php.net: Escaping from HTML while some people find short tags and ASP style tags convenient, they are less portable, and generally not recommended. Also note that if you are embedding PHP within XML or XHTML you will need to use the <?php ?> tags to remain compliant with standards. Short tags (example three) are only available when they are enabled via the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option. 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. however Starting with PHP 5.4, short echo tag <?= is always recognized and valid, regardless of the short_open_tag setting. Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283435 Share on other sites More sharing options...
clankill3r Posted October 30, 2011 Author Share Posted October 30, 2011 ok good to know, thanks Quote Link to comment https://forums.phpfreaks.com/topic/250071-something-wrong-with-getting-a-value-from-adres-bar/#findComment-1283437 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.