Jump to content

[SOLVED] form giving false return ...


stuntdawg

Recommended Posts

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 <[email protected]>';

$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?

Link to comment
https://forums.phpfreaks.com/topic/161887-solved-form-giving-false-return/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.