speida Posted May 16, 2007 Share Posted May 16, 2007 Hi, i got a problem for the flash based contact form on this website (under contact) www.gsxtreme.co.uk The flash side i think works fine, but the php file doesn't wanna work i keep getting errors of any type. The PHP file is here http://www.gsxtreme.co.uk/mailform.php and if you go there you can see it gives you a Parse error. This is the PHP code: <?php $adminaddress = "info@gsxtreme.co.uk"; $siteaddress ="http://www.gsxtreme.co.uk"; $sitename = "GS Xtreme Sales LTD"; //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); // Gets the POST Headers - the Flash variables $action = $_REQUEST['action'] ; $email = $_REQUEST['email'] ; $firstname = $_REQUEST['firstname'] ; $name = $_REQUEST['name'] ; $company = $_REQUEST['company'] ; $city = $_REQUEST['city'] ; $comments = $_REQUEST['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 GS Xtreme Sales LTD website has left the following information\n Firstname: $firstname Email: $email\n The visitor, $firstname, commented: ------------------------------ $comments Logged Info : ------------------------------ Using: $HTTP_USER_AGENT Hostname: $ip IP address: $REMOTE_ADDR Date/Time: $date","FROM:$yourmailadress" ) ; //This sends a confirmation to your visitor mail ("$email","Thank You for visiting GS Xtreme Sales LTD", "Hello $firstname,\n Thank you for your interest in GS Xtreme Sales LTD!\n We will get back to you within 24 hours. Best Regards, GS Xtreme Sales Costumer Support. ) ; } ?> Please help me because i spent 2 hours in front of this code without luck! when i change something i get another error Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/ Share on other sites More sharing options...
john010117 Posted May 16, 2007 Share Posted May 16, 2007 <?php $adminaddress = "info@gsxtreme.co.uk"; $siteaddress ="http://www.gsxtreme.co.uk"; $sitename = "GS Xtreme Sales LTD"; //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); // Gets the POST Headers - the Flash variables $action = $_REQUEST['action'] ; $email = $_REQUEST['email'] ; $firstname = $_REQUEST['firstname'] ; $name = $_REQUEST['name'] ; $company = $_REQUEST['company'] ; $city = $_REQUEST['city'] ; $comments = $_REQUEST['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 GS Xtreme Sales LTD website has left the following information\n Firstname: $firstname Email: $email\n The visitor, $firstname, commented: ------------------------------ $comments Logged Info : ------------------------------ Using: $HTTP_USER_AGENT Hostname: $ip IP address: $REMOTE_ADDR Date/Time: $date","FROM:$yourmailadress" ) ; //This sends a confirmation to your visitor mail ("$email","Thank You for visiting GS Xtreme Sales LTD", "Hello $firstname,\n Thank you for your interest in GS Xtreme Sales LTD!\n We will get back to you within 24 hours. Best Regards, GS Xtreme Sales Costumer Support.") ; } ?> You forgot the ending quotes in mail(). Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254929 Share on other sites More sharing options...
speida Posted May 16, 2007 Author Share Posted May 16, 2007 Uhm? where? could u post the correct code pls? thx a lot! Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254931 Share on other sites More sharing options...
speida Posted May 17, 2007 Author Share Posted May 17, 2007 ok i fixed it like this: <?php $adminaddress = "info@gsxtreme.co.uk"; $siteaddress ="http://www.gsxtreme.co.uk"; $sitename = "GS Xtreme Sales LTD"; //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); // Gets the POST Headers - the Flash variables $action = $REQUEST['action'] ; $email = $REQUEST['email'] ; $firstname = $REQUEST['firstname'] ; $name = $REQUEST['name'] ; $company = $REQUEST['company'] ; $city = $REQUEST['city'] ; $comments = $REQUEST['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 GS Xtreme Sales LTD website has left the following information\n Firstname: $firstname Email: $email\n The visitor, $firstname, commented: ------------------------------ $comments Logged Info : ------------------------------ Using: $HTTP_USER_AGENT Hostname: $ip IP address: $REMOTE_ADDR Date/Time: $date, FROM:$yourmailadress ") ; //This sends a confirmation to your visitor mail ("$email","Thank You for visiting GS Xtreme Sales LTD", "Hello $firstname,\n Thank you for your interest in GS Xtreme Sales LTD!\n We will get back to you within 24 hours. Best Regards, GS Xtreme Sales Costumer Support. ") ; //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; } ?> Now the php file at http://www.gsxtreme.co.uk/mailform.php says: Notice: Undefined variable: REMOTE_ADDR in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 12 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 16 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 17 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 18 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 19 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 20 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 21 Notice: Undefined variable: REQUEST in /home/fhlinux169/g/gsxtreme.co.uk/user/htdocs/mailform.php on line 22 What do i do now? :S Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254951 Share on other sites More sharing options...
speida Posted May 17, 2007 Author Share Posted May 17, 2007 new code: <?php $adminaddress = "info@gsxtreme.co.uk"; $siteaddress ="http://www.gsxtreme.co.uk"; $sitename = "GS Xtreme Sales LTD"; //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); // Gets the POST Headers - the Flash variables $action = $_REQUEST['action'] ; $email = $_REQUEST['email'] ; $firstname = $_REQUEST['firstname'] ; $name = $_REQUEST['name'] ; $company = $_REQUEST['company'] ; $city = $_REQUEST['city'] ; $comments = $_REQUEST['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 GS Xtreme Sales LTD website has left the following information\n Firstname: $firstname Email: $email\n The visitor, $firstname, commented: ------------------------------ $comments Logged Info : ------------------------------ Using: $HTTP_USER_AGENT Hostname: $ip IP address: $REMOTE_ADDR Date/Time: $date, FROM:$yourmailadress ") ; //This sends a confirmation to your visitor mail ("$email","Thank You for visiting GS Xtreme Sales LTD", "Hello $firstname,\n Thank you for your interest in GS Xtreme Sales LTD!\n We will get back to you within 24 hours. Best Regards, GS Xtreme Sales Costumer Support. ") ; //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; } ?> Look at the new result in the link i previously sent... Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254955 Share on other sites More sharing options...
hitman6003 Posted May 17, 2007 Share Posted May 17, 2007 Notices are just that...notices...they aren't an error, just php telling you that, in this case, a variable is being used before it's defined. Put this at the top of your script: ini_set("display_errors", 0); That should hide all errors, which is recommended on a website that is visible to the world. Alternately, you can "turn down" the error reporting level using this: error_reporting(E_ALL ^ E_NOTICE); Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254957 Share on other sites More sharing options...
speida Posted May 17, 2007 Author Share Posted May 17, 2007 ya thats what i thought.. so i tried the form and it works fine.. thanks for the help anyways hehe Quote Link to comment https://forums.phpfreaks.com/topic/51753-solved-php-errors-for-a-flash-based-contact-form/#findComment-254958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.