Jump to content

[SOLVED] Retrieving POST Variables


Bendude14

Recommended Posts

Ok, i am using ajax to send some data via POST the problem is retrieving using php.

 

Here is the javascript

 

	    function validate() {     
		var content = document.getElementById("email").value;//value's to be send using send
            http.open("POST", url, true);
            http.onreadystatechange = handleHttpResponse;


		//Send the proper header information along with the request
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", content.length);
	http.setRequestHeader("Connection", "close");

            http.send(content);
		//alert(content);
        }

 

Here is the form where the info is been taken from

 

<input type="text" name="email" id="email" onblur="validate(this);" />Email<br />

 

 

And then i am trying to retrieve the info like this in php

 

$email = $_POST['email'];

 

But i do not recieve a value like this.

 

I think its the php because using firebug it shows that the value of email was actually sent via POST and i have also tried alerting the content var with javascript it outputs the value typed into the email text box

 

Thanks in advance for any help

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.