Page 2 of 2

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:38
by dr-tbird
Reinstalled, rebooted...same problem. Nothing is showing in php.

Ironically it was working about two weeks ago and then stopped. I've made no other changes to my system between then and now. Not so much as installing a game or utility. Nothing.

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:40
by Altrea
One step after another.

Can you start your Apache in the control panel? is there a green running label?

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:41
by dr-tbird
Both apache and mysql are running

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:44
by Altrea
Thats good.

Start your browser and type in http://localhost/
Does the XAMPP Administration Page start correctly? Can you use the XAMPP example scripts in there?

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:49
by dr-tbird
I get the index page from XAMPP and can view the info pages easily. Sample scripts are running.

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:51
by Altrea
Okay.
That shows that PHP is running and get parsed without errors.

Where do you save your php files for your xampp?
And how do you open them in the browser?

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:54
by dr-tbird
They are in subfolders in htdocs
All my files have a php extension
I tried one on the root of htdocs and cannot view the php. The html is fine:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> testing </title>
</head>
<body>
HTML here. No biggie.

<?php

echo "This is a test of php.";

?>


</body>
</html>

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:55
by Altrea
We are getting close.

Altrea wrote:how do you open them in the browser?

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:56
by dr-tbird
Either dragging to the window (I use Firefox, btw) or right clicking them.

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 18:59
by Altrea
And exactly here is the problem :D

PHP had to be requested through the Webserver to get parsed by the php parser.
localhost is the alias for your own computer. And Apache knows, that requests goes directly to the htdocs folder.

So, if you have a file C:\xampp\htdocs\subfolder\test.php, the correct url is http://localhost/subfolder/test.php

You can't open your files directly in the Browser. That can't work with php

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 19:08
by dr-tbird
Thank you so much! I feel so silly. :oops:

I truly appreciate your help on this and promise to "pay it forward" when I am in the position of helping others.

Re: Passing Variable on PHP pages

PostPosted: 21. October 2010 19:09
by Altrea
I'm glad that your problem could be solved :D
Have fun with XAMPP and PHP and don't get too frustrated :wink: