Jump to content

installed xampp, tried php tutorial, no php works


quadlo

Recommended Posts

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

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.