通过位于其他目录中的html表单运行php脚本

I installed wamp in a directory

E:\folder_name\wamp

it has all the stuff www and PHP files example testmysql.php in it and it works fine when I run it on the browser directly via

http://localhost:80/testmysql.php

I am working on a project and created a file in directory E:\folder_name\index.html and this index.html has a form

<form method="post" action="../wamp/www/testmysql.php">

/*
 *  form inputs etc here and submitt button also 
*
*

</form>

when I run it in the browser it downloads the PHP file instead of executing it. for PHP script I m using phpstorm Plz help me

You must change address in action to:

http://localhost/testmysql.php

The folder in your index.html is relative to what your webserver serves so it should be

<form method="post" action="testmysql.php">

if the folder structure is like this

  • E:\folder_name\wamp\www\index.html
  • E:\folder_name\wamp\www\testmysql.php