stuntdawg Posted June 11, 2009 Share Posted June 11, 2009 I'm a total noob ... i know just enough to be dangerous ... i have a form submit form that uses three files (config.php, index.php and maile.php) i have this three part form installed on several sites hosted on lunarpages and ipower ... and they work just fine ... that is until i install it on godaddy ... i'm starting to hate godaddy ... there support guys are idiots. here's the problem and the code (from maile1): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="http://cheerfcc.org/css/main.css" media="all" /> <link rel="icon" href="http://cheerfcc.org/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="http://cheerfcc.org/favicon.ico" type="image/x-icon" /> </head> <body> <center> <br /> <?php if (!$HTTP_POST_VARS["school"] || !$HTTP_POST_VARS["coach"] || !$HTTP_POST_VARS["emaile"] || !$HTTP_POST_VARS["division"] || !$HTTP_POST_VARS["time1"] || !$HTTP_POST_VARS["time2"] || !$HTTP_POST_VARS["time3"]) { echo "Please fill in all fields."; echo '<a href="javascript:history.go(-1)">Go Back</a>'; exit; } ?> <?php include('config.php'); $time = date ("h:i A"); $date = date ("l, F jS, Y"); $urlh = getenv(HTTP_HOST); $url = "http://$urlh"; $IP = $_SERVER['REMOTE_ADDR']; $school = $_POST['school']; $coach = $_POST['coach']; $emaile = $_POST['emaile']; $division = $_POST['division']; $time1 = $_POST['time1']; $time2 = $_POST['time2']; $time3 = $_POST['time3']; $headers = 'From: System Admin <nationaloffice@cheerfcc.org>'; $email; $subject = "National's Practice Time (Private Schools)"; $body = $_POST['body']; $bodys = "\nSchool Name: $school\n\nCoach's Name: $coach\n\nDivision: $division\n\nFirst Choice: $time1\n\nFirst Choice: $time2\n\nFirst Choice: $time3\n\nThis form was submitted on\n $date at\n $time.\n From IP Address.$IP \n From E Address: $emaile\n Name: $coach \nUrl: $url "; $IP = $_SERVER['REMOTE_ADDR']; $body = $body . $bodys; mail($email, $subject, $body, "From: $emaile"); ?> To place a request for another team, <a href="javascript:history.go(-1)">Go Back</a><br /> <br /> Otherwise, <a href="javascript:window.close()">Close</a> </center> </body> </html> this issue is line 12-24 which ckecks for empty fields from index1.php. if i remove those lines, the file works okay and the form is submitted and received. BUT, if i remove those lines, then it doesn't check for empty values/fields. Again, there is nothing wrong with this on my other servers, just godaddy. if you fill out the form, even if all the fields are completed, it comes back and says, please return and fill out all fields. you can see what i mean by going to this site. http://www.cheerfcc.org/php/index2.php this is a site where the exact same code works http://www.xenoplexus.com/php-fcc/index2.php what the heck is the problem? it has to be there servers, right? Quote Link to comment https://forums.phpfreaks.com/topic/161887-solved-form-giving-false-return/ Share on other sites More sharing options...
J.Daniels Posted June 11, 2009 Share Posted June 11, 2009 It is probably becase GoDaddy has register_long_arrays set to off. $HTTP_POST_VARS is depreciated. Change all occurrences of $HTTP_POST_VARS to $_POST Quote Link to comment https://forums.phpfreaks.com/topic/161887-solved-form-giving-false-return/#findComment-854131 Share on other sites More sharing options...
stuntdawg Posted June 12, 2009 Author Share Posted June 12, 2009 DUDE! you rock! i know so little of php that i never would have caught that! i'm assuming it would be best to change that code on my other scripts running on the others sites since its depreciated ... thank you for your help and timely response! Quote Link to comment https://forums.phpfreaks.com/topic/161887-solved-form-giving-false-return/#findComment-854455 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.