Submit button is downloading the php instead of running it

社会主义新天地 提交于 2019-12-02 13:02:24

If the actual php soure code is being downloaded, you have some configuration issues on your webserver, but I won't go into that here.

I do suggest you remove the @ infront of the mail command though, since that surpresses errors you might be having.

One of the errors ie. you are surpressing is the fact that yo u dont' have a $Message variable, considering the fact that your code says: $email_from = $_POST['Message']; // required.

Aside from that: I suggest you read up about naming conventions concerning upper/lower case characters. It makes debugging code quite a bit easier. Try http://framework.zend.com/manual/1.12/en/coding-standard.naming-conventions.html for starters.

PS. You do actually have a $Message variable, but its empty.

rahulxyz

I faced the same problem. I was attempting this on WAMP server. It worked fine when I type the URL: localhost/login.html and registered. The problem came when I opened it via an Editor. The new URL was localhost:66342/login.html.

So all I had to do was type in the original URL instead of this new one and it worked.

All you need is a web server.
For those using LAMP server, moving the files to var/www/html folder works.
If you don't want to move your files, then simply start a web server in the directory where your files are. (Assuming your file is named index.html / index.php. Specify the filename in the below command, otherwise.)

php -S localohost:8080 <filename>

Now visit http://localhost:8080/ and you are good to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!