Another file on server is phpTest1.php in the same location where phpTest.html is
When I feed data in two text fields in phpTest.html form and click submit, I dont get message from phpTest1.php. Instead of that, I get message "Do you want to open or save phpTest1.php(299 bytes) from My-PC ?"
When I click on open it opens source file phpTest1.php from server instead of displaying message. Why is that ?
How can I get message displayed from php script ? Apache server is running and WAMP is server is started (Apache MySQL, PHP for windows).
Sounds like PHP is not configured correctly - instead of it being execute don the server the Apache server apparently serves it to the client. Check the PHP installation documentation to see if everything concerning mod_php is set up correctly.
Check the httpd.conf file and make sure you have lines that look like this (your paths might be different):
The second line enables PHP within Apache. The third line tells Apache to let PHP handle all requests for files ending in .php
By the way, I usually use a simple phpinfo file to test PHP:
I call it info.php and use http://localhost/info.php to access it. I get all kinds of data on my PHP setup if everything is correctly configured..
posted 7 years ago
Thanks for replies. But none of the suggestion is working.
Now I have put phpTest1.php file in root dir (www) instead of putting in dir where phpTest.html is placed. Then I changed phpTest.html as follows
Now when I type in fields and click on submit phpTest.html, I am getting response from phpTest1.php
But I don't think this is right way to do things. Please let me know whats wrong I am doing and suggest correct approach.
Secondly, I am using following code with phpTest1.php script When I use this code, message is not getting sent to firstname.lastname@example.org and I get following message.
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\phpTest1.php on line 12
Why is that ? I dont unerstand this message.How can I use mail() in the script ?
Please don't side-track your main question with an email question. Setting up email under PHP is a whole different topic. If you want to discuss that, please delete the email question from this post and crate a new discussion thread with that question.
Please read: ItDoesntWorkIsUseless I pointed out some configuration settings you should have. If they are not working for you, then you need to post the settings that you have; there must be something wrong with them but without seing what you have I can't help you. Please post your httpd.conf file.
The "action" value in the <form> is not what you want. This limits your app to running only on your PC. You really want to have it the way it originally was.
Also, please give full directory paths. I have no idea where "www" is located (I would know on Linux, but you're running Windows). Give the full paths for both the HTML and PHP file.
posted 7 years ago
following is path for httpd.conf and below that is httpd.conf file
following is path for www root dir
Following is path for firstTest.html parent dir
"C:\Users\Nirjari\Desktop\all text files\HTML Files"
I have placed one copy of phpTest1.php in this location and in www root dir.
Both mail() is part of first script and thats why I asked question about it in here.
Please let me know why is this script not working.