olympikdude
2006-08-26 12:05:57 UTC
Everytime I fill out the information (name, email, password, etc.) I click the button "register me" and a box pops up asking me to open the associated PHP file. Why? Why wouldnt the PHP script just run and create the user registration in the database? It always asks me if I want to open or save the PHP file.
Here's my HTML since I know this is somehow the problem.
Five answers:
Michael Darnell
2006-08-26 12:39:32 UTC
(eg. "http://test-server/your-testing-folder/testform.php"
or
"http://192.168.0.2/your-testing-folder/testform.php"
)
On the other hand if this is a development server on the same machine (ie your own workstation) try using the loopback ip address into the browser address bar,
as; "http://127.0.0.1/your-testing-folder/testform.php"
Instead of tying to browse to the local drive location of;
"c:\apache\www\your-testing-folder\testform.php"
Php is a server-side scripting language so anything you do in a php script has to be processed by the server. It's not like javascript where it can be processed locally.
ce
2006-08-26 12:20:19 UTC
Have you uncommented the lines in the Apache configuration file (httpd.conf) that relate to PHP? This is not done by default. The lines look like :
# LoadModule php4_module libexec/httpd/libphp4.so
# AddModule mod_php4.c
Remove the # sign at the beginning of the line to uncomment. Also, look through that file and you'll also see a spot that defines the different file extensions that your server will accept. Make sure .php is in there.
To confirm whether the server is processing the PHP file, make a one line script like this:
phpinfo();
?>
and save it as info.php. Then open this file in your web browser and see if it displays a page of details about your php configuration. If it doesn't, then check your Apache configuration files.
------
Edit: The suggestion of trying it through the 127 ip address is a good idea.
I looked at some of the WAMP packages, and noticed that some include an Apache modules manager that allows you to enable modules.
http://www.wampserver.com/en/index.php
Is this the one you are using?
Kush
2006-08-26 12:15:39 UTC
Everything looks ok, but I don't have all the info. It would be nice if you could link to the full source of the pages, I know there's a limit here.
Stuff I can think of:
-Try the page in another browser
-Make sure the form page is .php even though it doesn't actually have any PHP in it. I've gotten problems having .html post to .php .
The problem I guess could be in register.php, I just don't know.
Good luck!
Jeffrey F
2006-08-26 12:37:15 UTC
in your httpd.conf file, add the following and restart the apache server:
AddType application/x-httpd-php .php
This directive tells apache that if the browser requests a .php, stream it to the browser as html.
I hope this helps
Random
2006-08-26 12:12:13 UTC
try making a file name test.php
and put the following in it.
echo "Hello World";
?>
All you should see is Hello World.
If you don't.... they you probably don't have a php engine installed.
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.