bubblegum.anarchy Posted January 5, 2010 Share Posted January 5, 2010 Hi There, Why does the following PHP code display nothing in a browser? <?php print "<?php //username:password ?>"; ?> Link to comment https://forums.phpfreaks.com/topic/187307-basic-php-question/ Share on other sites More sharing options...
premiso Posted January 5, 2010 Share Posted January 5, 2010 Because < and > are html characters. Use htmlentities on the text: <?php print htmlentities("<?php //username:password ?>"); ?> Should show it to the browser. Link to comment https://forums.phpfreaks.com/topic/187307-basic-php-question/#findComment-989130 Share on other sites More sharing options...
bubblegum.anarchy Posted January 5, 2010 Author Share Posted January 5, 2010 Hi premiso, Then shouldn't the string content in quotes appear in the HTML source as a tag? I actually do not want the username and password to appear in the source or be displayed in the browser so the code does what is required, i'm just trying to understand why for security reasons... <?php //username:password ?> makes more sense but does not work on the remote server (but works locally for some strange reason) in the particular API (AS3's URLRequest and URLLoader classes) used. premiso, would you agree that the username and password values are inaccessible and secure? Thank you for responding. Link to comment https://forums.phpfreaks.com/topic/187307-basic-php-question/#findComment-989140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.