quadlo Posted May 10, 2008 Share Posted May 10, 2008 Ok, So I'm a dummy - I installed xampp latest distribution (2 days ago), and am trying to learn php. I copied the following script, added an additional display line, and the only thing that happens is "You entered:" (without the quotes) is displayed. Seems like PHP just is not picking up and running with it's code. I've made no changes to xampp, have installed apache and mysql as services. I'm running windows xp pro, sp2. The file is named test.php (and yes, hide know file types is turned off) I have copied and tried to run all kinds of scripts from tutorials with the same result - so, what stooooooopid thing has this dummy not done right to get php to recognize/act on it's code? Quadlo <?php session_start(); ?> <html> <title>Sample title</title> <body> <p>You entered: <?php echo "This should print out from php"; ?> </p> </body> </html Link to comment https://forums.phpfreaks.com/topic/105062-installed-xampp-tried-php-tutorial-no-php-works/ Share on other sites More sharing options...
p2grace Posted May 10, 2008 Share Posted May 10, 2008 How are you viewing the page? Are you simple double-clicking the file and viewing it in IE or Firefox, because that won't work. You need to move the script to the xampp fileserver and then access it at http://localhost/test.php instead of simply viewing as c:\xampp\test.php. I imagine that you're viewing it correctly and there's something else wrong, but this would be an obvious thing to check. Link to comment https://forums.phpfreaks.com/topic/105062-installed-xampp-tried-php-tutorial-no-php-works/#findComment-537825 Share on other sites More sharing options...
quadlo Posted May 10, 2008 Author Share Posted May 10, 2008 If you could see how red my face is. I have been dragging and dropping the php file into my browser. I changed (ok, so I'm really lazy) and typed in localhost....... and imaginge what happened - yup - works Boy am I ever ashamed Thanks for the prod in the right direction. Quadlo Link to comment https://forums.phpfreaks.com/topic/105062-installed-xampp-tried-php-tutorial-no-php-works/#findComment-537836 Share on other sites More sharing options...
p2grace Posted May 10, 2008 Share Posted May 10, 2008 lol don't worry about it, we all have those moments. Could you mark the topic as solved when you get a chance Thanks Link to comment https://forums.phpfreaks.com/topic/105062-installed-xampp-tried-php-tutorial-no-php-works/#findComment-537854 Share on other sites More sharing options...
DarkWater Posted May 10, 2008 Share Posted May 10, 2008 If you're curious as to why that happens, it's because PHP is a server-side language, and it needs the server to initiate the parser. =) Link to comment https://forums.phpfreaks.com/topic/105062-installed-xampp-tried-php-tutorial-no-php-works/#findComment-537856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.