Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
87
rated 0 times [  94] [ 7]  / answers: 1 / hits: 25149  / 15 Years ago, wed, july 29, 2009, 12:00:00

I'm new to forms and post data ... so I don't know how solve this problem!



I've a php page (page1) with a simple form:



<form method=post action=/page2.php>
<input type=search value=E-Mail Address size=30 name=email />
<input type=submit value=Find E-Mail />
</form>


How you can notice ... this form post the 'email' value to the page2. In the page2 there is a small script that lookup in a database to check if the email address exist.



$email = $_POST['email'];

$resut = mysql_query(SELECT * FROM table WHERE email = $email);
.
.
.
/* do something */
.
.
.

if($result){
//post back yes
}
else{
//post back no
}


I don't know how make the post back in php! And how can I do to the post back data are read from a javascript method that shows an alert reporting the result of the search?



This is only an example of what I'm trying to do, because my page2 make some other actions before the post back.



When I click on the submit button, I'm trying to animate a spinning indicator ... this is the reason that I need to post back to a javascript method! Because the javascript function should stop the animation and pop up the alert with the result of the search!



Very thanks in advance!


More From » php

 Answers
8

I suggest you read up on AJAX.



Here's a PHP example on W3Schools that details an AJAX hit.


[#99039] Thursday, July 23, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josiah

Total Points: 208
Total Questions: 105
Total Answers: 107

Location: Seychelles
Member since Mon, Jun 28, 2021
3 Years ago
;