Page 1 of 1

php code error

Posted: Fri Sep 02, 2005 10:41 am
by phish007
Hey guys im new to the forums..hoping maybe you can help me though..I developed a flash basec contest form. you can see it at http://www.zeroxposur.com/test then click on contest.. Anyways after you fillit out it sends me the email..however the only info that comes though is " From Undefined" heres my php code..did I do something wrong?

Code: Select all

<?php

$name = $_POST["name"];
$email = $_POST["email"];
$address = $_POST["address"];
$state = $_POST["state"];
$zipcode = $_POST["zipcode"];
$sex = $_POST["sex"];
$city = $_POST["city"];
$about = $_POST["about"];
$color = $_POST["color"];
$athlete = $_POST["athlete"];
$game = $_POST["game"];
$music = $_POST["music"];
$create = $_POST["create"];

$to = "webmaster@zeroxposur.com";
$subject = "Contest Form Info";
$body = "{$name} email is {$email} their address is {$address} and the state they reside in is {$state} who's zipcode is {$zipcode} {$name} is a {$sex} who wrote this as a description of themselves{$about} Their favorite athlete is {$athlete} their favorite game is {$game} Their favorite music is {$music} and if they could create a jacket they would do the following {$create}";

$result = @mail($to, $subject, "From: {$email}\r\n");

if($result) {
  echo "result=email sent";
} else {
  echo "result=email failed to send";
}

?>

feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Sep 02, 2005 10:54 am
by feyd
your code appears okay, is it possible your form is incorrect?

Side note: the form is too tall for some displays, and since it doesn't scroll.. kinda a problem. :)

Posted: Fri Sep 02, 2005 11:12 am
by phish007
ok so if the php is good to go..maybe my form actionscript is off then...Are u familiar with flash actionscript at all? thanks for the tip with the display! Ill have to fix that aswell

Posted: Fri Sep 02, 2005 11:26 am
by feyd
sadly, no. I'm not familiar with ActionScript at all right now.

Posted: Fri Sep 02, 2005 4:33 pm
by raghavan20

Code: Select all

@mail($to, $subject, "From: {$email}\r\n");
taking off the '@' symbol might give some warnings or errors which can be a clue to the problem.

Posted: Fri Sep 02, 2005 4:49 pm
by feyd
:oops: just noticed, you forgot to place $body in the mail() call, as well.

Posted: Fri Sep 02, 2005 5:11 pm
by josh
If you still did not get it working, let me know.. I'm okay at flash actionscript.