[ 9 posts ]

shashank sharma

  • Username: shanky89
  • Joined: Tue Oct 27, 2009 2:43 am
  • Posts: 5
  • Offline
  • Profile

Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 2:53 am
+0-
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.

richardbenson

  • Joined: Wed Feb 11, 2009 6:17 am
  • Posts: 31
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 3:12 am
+0-
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"

shashank sharma

  • Username: shanky89
  • Joined: Tue Oct 27, 2009 2:43 am
  • Posts: 5
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 3:18 am
+1-
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

richardbenson

  • Joined: Wed Feb 11, 2009 6:17 am
  • Posts: 31
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 3:44 am
+0-
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.

shashank sharma

  • Username: shanky89
  • Joined: Tue Oct 27, 2009 2:43 am
  • Posts: 5
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 4:41 am
+0-
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

richardbenson

  • Joined: Wed Feb 11, 2009 6:17 am
  • Posts: 31
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 5:26 am
+0-
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?

shashank sharma

  • Username: shanky89
  • Joined: Tue Oct 27, 2009 2:43 am
  • Posts: 5
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 5:44 am
+0-
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

richardbenson

  • Joined: Wed Feb 11, 2009 6:17 am
  • Posts: 31
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 6:08 am
+0-
Your not sending any fields called "data" only "email" and "text".

shashank sharma

  • Username: shanky89
  • Joined: Tue Oct 27, 2009 2:43 am
  • Posts: 5
  • Offline
  • Profile

Re: Regarding sending mail using yahoo.connect.util

Post Posted: Tue Oct 27, 2009 6:31 am
+0-
thanx man ... got it ...... i was posting the wrong variable . dumb me :mrgreen: .... nyway i will ask more if get any problem somewhere
  [ 9 posts ]
Display posts from previous:  Sort by  
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