Jump to content

html wont show


studentofstone

Recommended Posts

everything seems to be working fine except the form wont show up.

the site is here http://davisgutierrez.com/testing_area/form.php

<?php
if($_POST['formSubmit'] == "Submit") 
    {
if(empty($_POST['formName'])) 
        {
		$errorMessage .= "<li>You forgot to enter your Name.</li>";
	}

if(empty($_POST['address'])) 
        {
		$errorMessage .= "<li>You forgot to enter your address.</li>";
        }
        	
if(empty($_POST['city'])) 
        {
		$errorMessage .= "<li>You forgot to enter your city.</li>";
	}
        	
if(empty($_POST['state'])) 
        {
		$errorMessage .= "<li>You forgot to enter your state.</li>";
	}

if(empty($_POST['zip'])) 
	{
		$errorMessage .= "<li>You forgot to enter your zip code.</li>";
	}

if(empty($_POST['phone'])) 
        {
		$errorMessage .= "<li>You forgot to enter your phone number.</li>";
	}

    if(empty($_POST['email'])) 
        {
		$errorMessage .= "<li>You forgot to enter your email.</li>";
	}
        	
        }


$varformName = $_POST['formName'];
$varaddress = $_POST['address'];
$varcity = $_POST['city'];
$varstate = $_POST['state'];
$varzip = $_POST['zip'];
$varphone = $_POST['phone'];
$varemail = $_POST['email'];




        
        
//generated by fatcow	


$link = mysql_connect(''); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
   }  
echo 'Connected successfully'; 
$db_selected = mysql_select_db("learnphp"); 

   if (!$db_selected) {
    die(' blast!' . mysql_error()); 
   }
       if(!empty($errorMessage))	 {
   echo("<p>There was an error with your form:</p>\n");
   echo("<ul>" . $errorMessage . "</ul>\n");
 }
     


		  $fs = fopen("memberdata.csv","a");

						fwrite($fs,$varformName . ", " .
						$varAddress . ", " .
						$varCity . "," .
						$varState . "," .
						$varZip . "," .
						$varPhone . "," .
						$varEmail . "," .
						"/n");
						fclose($fs);


		//header("Location: thankyou.html");
		exit;



?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">

<head>
    <title>membership test</title>
</head>

<body>
<?php
	    if(!empty($errorMessage)) 
	    {
		    echo("<p>There was an error with your form:</p>\n");
		    echo("<ul>" . $errorMessage . "</ul>\n");
            }
        ?>
       
<form  action="form.php" method="post" name="ohta_membership_application" >
Name: <input type="text" name="formName" maxlenghth="45" value="<?=$varformName;?>" />
Address: <input type="text" name="address" maxlenghth="4" value="<?=$varAddress;?>" />
City: <input type="text" name="city" maxlenghth="4" value="<?=$varCity;?>" />
State: <input type="state" name="state" maxkength="2" value="<?=$varState;?>">
Zip: <input type="text" name="zip" maxlenghth="4" value="<?=$varZip;?>" />
Phone: <input type="text" name="phone" maxlenghth="4" value="<?=$varPhone;?>" />
Email: <input type="text" name="email" maxlenghth="4" value="<?=$varEmail;?>" />
<input type="submit" name="formSubmit"  value="Submit" />
<input type="reset" name="reset" value="Reset" >

</form>

</body>
</html>

Link to comment
Share on other sites

ok, now it gives me mail sent but the email isn't getting there. I am using eclipse and have error reporting on at the server. there are no error messages. that means I am either telling the program to do something wrong, or not telling it to do something i need it to do.

mail("$email", "$subject", "$message", "$headers", "From: $from");
$mail_sent = @mail("$email", "$subject", "$message", "$headers", "From: $from");
echo $mail_sent ? "Mail sent" : "Mail failed";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.