JoeBlood Posted November 24, 2010 Share Posted November 24, 2010 Hi, I'm new to php / html, and came here to find help. I've programmed in C and VB / VBA, but want to build a web application, so am reading a couple of php books and giving myself a crash course. But I crashed before I got going... I'm using WAMP to test the tutorials, and am just setting up an order processing form. In the output page I'm failing in what should be the simplest line of code in the world: <?php echo '<p>Order Processed</p>'; ?> But the browser literally echoes everything from the first <p> tag to the end, outputting: Order Processed '; ?> Is there anything obvious I'm missing or typing incorrectly? (Gets same results using print instead of echo.) Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/219676-browser-is-reading-outside-the-php-tags/ Share on other sites More sharing options...
trq Posted November 24, 2010 Share Posted November 24, 2010 Are you accessing the file via a url like http://localhost/file.php ? Quote Link to comment https://forums.phpfreaks.com/topic/219676-browser-is-reading-outside-the-php-tags/#findComment-1138899 Share on other sites More sharing options...
JoeBlood Posted November 24, 2010 Author Share Posted November 24, 2010 Well hot damn, no I wasn't. But when I do, it works fine. I was accessing it thru the file --> open command in Firefox, but the http://method is great - thank you very much. Mind if I ask why there is a difference in how they respond? Quote Link to comment https://forums.phpfreaks.com/topic/219676-browser-is-reading-outside-the-php-tags/#findComment-1139192 Share on other sites More sharing options...
trq Posted November 25, 2010 Share Posted November 25, 2010 PHP needs to be processed by the web server (Apache in your case). Accessing the file directly does not do this, a url on the other hand is process and served up by Apache. Quote Link to comment https://forums.phpfreaks.com/topic/219676-browser-is-reading-outside-the-php-tags/#findComment-1139246 Share on other sites More sharing options...
JoeBlood Posted November 25, 2010 Author Share Posted November 25, 2010 Thank you, I appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/219676-browser-is-reading-outside-the-php-tags/#findComment-1139510 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.