| Page 1 of 1 | [ 9 posts ] |
|
Hey,
I just started working on YUI . I am designing a site which need to send the feedback to mail . I have a form and i am using a YUI animation feature to to make it beautiful . On posting response to mail response is not coming to call back and it is reloading the page again. my javascript function is this function FeedBack_Send() { var callback = { success: function(o) { $("feedback_send").disabled = false; $("feedback_cancel").disabled = false; $("feedback_email").value = ""; $("feedback_txt").value = ""; $("feedback_success").innerHTML = "<h3><font color='green'>Thank you for your feedback!</font></h3>"; $("feedBackContent").style.height = "410px"; setTimeout(FeedBack_Toggle, 2000); }, failure: function(o) { $("feedback_send").disabled = false; $("feedback_cancel").disabled = false; $("feedback_email").value = ""; $("feedback_txt").value = ""; $("feedback_success").innerHTML = "<h3><font color='red'>Server Error!</font></h3>" + o.argument; $("feedBackContent").style.height = "410px"; setTimeout(FeedBack_Toggle, 2000); }, } $("feedback_send").disabled = true; $("feedback_cancel").disabled = true; var data = "email=" + $("feedback_email").value + "&text=" + $("feedback_txt").value; YAHOO.util.Connect.asyncRequest("POST", "C:\Inetpub\wwwroot\feedback\script\mail.php", callback, data); } Please help..i am stuck here . Just people tell me how to write .php file for this. |
|
The first issue I can see is that you are calling a script on the local hard drive of your computer, which is not going to work:
"C:\Inetpub\wwwroot\feedback\script\mail.php" Needs to be a web reference, e.g. "http://www.yourdomain.com/feedback/script/mail.php" |
|
i changed it to http://localhost/feedback/script/try.php as running on my machine .
It is going to failure state. I think it means it is unable to find the file |
|
What happens when you open the script manually in your browser?
Also, try POSTing a normal HTML form to the script to see if it works at all. |
|
yeah.... actually it is not able to post .
I just tried a simple code for PHP i.e. <?php $data = $_POST['data']; // this is not working echo $data; ?> ... ny suggestion people |
|
I'm not a php man, but have you installed and configured PHP correctly on your computer?
Create a script with just this in it: <?php echo("Hello world"); ?> Does it output anything? |
|
yes .PHP is installed
i tried something like this <?php if(isset($_POST['data'])) $data = $_POST['data']; else $data = "post is not working"; echo $data; ?> and used o.responseText ...it prints post is not working |
|
Your not sending any fields called "data" only "email" and "text".
|
|
thanx man ... got it ...... i was posting the wrong variable . dumb me
|
| Page 1 of 1 | [ 9 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group