Passing form data from asp file to php
The data passed to your PHP script will come from an HTML form. The fact that the form was created with an ASP script will have nothing to do with as long as the output of your ASP script is a normal HTML form.
When you submit your form, a page reload suggests that the HTML for the form is not appropriate for your needs.
You are dealing with a moderately complex scenario and in order to determine the cause of the problem, you need to break things down into simpler components and test them yourself.
Let be:
- [A] = ASP script
- [B] = HTML Form
- [C] = PHP script
As I understand the scenario:
- [A] generates [B]
- [B] sends data to [C]
This indicates the following general problems:
- [A] generates incorrectly [B] (your ASP is rendering incorrect HTML)
- [C] does not correctly process the incoming form data (boolean error in your PHP script)
Work backwards from your end goal (this is correct data handling with your PHP script). Check every step along the way and make sure it really is the way you want it.
- Go through your PHP code. Make sure it looks right at the moment. Pay attention to the PHP script url.
- Create your HTML form manually. Set the attribute
action
to the PHP script url. The form will now submit data to your PHP script. Check that the PHP script does what it needs to do. Until you get this job, you cannot proceed. - Make your ASP script output the same HTML that you manually generated.
As long as you can get an HTML form submitting data to your PHP script, and as long as your PHP script correctly processes the incoming data, you can proceed and then create an ASP generated form.
source to share
This should definitely work. Are you sure the form button is <input type = "submit">?
Are you sure phptest.php is in the correct directory?
What happens if you go directly to the url for phptest.php?
Can you update your question with at least HTML for the form <form> tag and <input> tags?
source to share
can you post the code here?
I would recommend JSON pass as "standar" ( http://ar.php.net/json_decode )
source to share