This is a discussion on PLS HELP: Script to mail within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I have a flash site (http://www.myscreenenclosure.com/) that sends email using a php script. The contact page worked ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have a flash site (http://www.myscreenenclosure.com/) that sends email
using a php script. The contact page worked great until my webhost moved me to another server. Anyone know why this mail script now fails? Here it is... Sorry, but I'm not a php guru like you all.... Thanks.... <? $adminaddress = "feedback@mysite.com"; $siteaddress ="http://www.MyScreenEnclosure.com"; $sitename = "Atlantic Aluminum And Screen"; //No need to change anything below ... // Gets the date and time from your server $date = date("m/d/Y H:i:s"); // Gets the IP Address if ($REMOTE_ADDR == "") $ip = "no ip"; else $ip = getHostByAddr($REMOTE_ADDR); // ORIGINAL // else $ip = getHostByAddr($REMOTE_ADDR); // Gets the POST Headers - the Flash variables $action = $HTTP_POST_VARS['action'] ; $name = $HTTP_POST_VARS['name'] ; $email = $HTTP_POST_VARS['email'] ; $phone = $HTTP_POST_VARS['phone'] ; $comments = $HTTP_POST_VARS['comments'] ; //Process the form data! // and send the information collected in the Flash form to Your nominated email address if ($action == "send") { // mail ("$adminaddress","Info Request", "A visitor at $sitename has left the following information\n Name: $name Email: $email Phone: $phone The visitor commented: ------------------------------ $comments ------------------------------ Date/Time: $date","FROM:$adminaddress" ) ; //This sends a confirmation to your visitor mail ("$email","Thank You for visiting $sitename", "Hi $name,\n Thank you for your interest in $sitename!\n We will get back with you shortly.\n Thank you, $sitename $siteaddress","FROM:$adminaddress") ; //Confirmation is sent back to the Flash form that the process is complete $sendresult = "Thank you. You will receive a confirmation email shortly."; $send_answer = "answer="; $send_answer .= rawurlencode($sendresult); echo $send_answer; } // ?> |
|
|||
|
It's most likely because the new server is setup with the
register_globals setting off. This means that instead of using $REMOTE_ADDR you'll now use $_SERVER['REMOTE_ADDR'] register_long_arrays is probably set to off also so $HTTP_POST_VARS['action'] should be changed to $_POST['action'] |
|
|||
|
|
|
|||
|
Thanks! I showed my webhoster this and they fixed it! Thanks again!
"samudasu" <samudasu@hotmail.com> wrote in message news:1139454965.201929.88720@g43g2000cwa.googlegro ups.com... > http://de.php.net/manual/en/language...predefined.php > |