Jump to content

Recommended Posts

I had someone put together a form for me and I got it up on the web site hosted on a .php enabled web host server.

 

It is just a Contact Us form. You can find it at:

 

http://www.silicagelpackets.com/Contact%20Us/Contact1.php

 

But when I click submit it seems like it does something, but nothing actually happens. The form is suppose to send an e-mail to me when someone clicks submit, but it is not happening.

 

Can anyone help to see what the problem is?

 

CODE:

 

 

          <?

if($_GET[act]=="a"){ $msg="Details Submitted Successfully!!";}

if($_POST[btnSubmit]=="Send")

{

//echo $_POST[reason]."hai";exit;

$c=0;

if($_POST[reason]==""){ $err=1;$c++;}

if($_POST==""){ $err=1;$c++;}

if($_POST[Comments]==""){ $err=1;$c++;}

if($c==0)

{

echo "hai";exit;

 

// here type your email id

 

$headers = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: <".$_POST.">\r\n";

$mailto = $_POST[reason];

$subject= "Request From ".ucfirst($_POST[firstname])."";

$message="<table width='100%' border='0'>

<tr>

    <td height='30' width='28%' >Contact Us Form From $_POST[firstname] </td>

    <td height='30' width='72%'> </td>

  </tr>

  <tr>

    <td width='21%' height='30' align='right'><span class='style11 style2'> First Name: </span></td>

    <td width='79%' height='30'><span class='style2'>$_POST[firstname]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Last Name: </span></td>

    <td height='30'><span class='style2'>$_POST[lastname]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Address:</span></td>

    <td height='30'><span class='style2'>$_POST[address]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>City:</span></td>

    <td height='30'><span class='style2'>$_POST[city]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>State:</span></td>

    <td height='30'><span class='style2'>$_POST[state]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Zip:</span></td>

    <td height='30'><span class='style2'>$_POST[zip]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Country:</span></td>

    <td height='30'><span class='style2'>$_POST[country]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style11 style2'> Email : </span></td>

    <td height='30'><span class='style2'>$_POST</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style11 style2'>Phone Number : </span></td>

    <td height='30'><span class='style2'>$_POST[phone]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Order Number:</span></td>

    <td height='30'><span class='style2'>$_POST[ordernumber]</span></td>

  </tr>

  <tr>

    <td height='30' align='right'><span class='style2'>Comments/Inquiry:</span></td>

    <td height='30'><span class='style2'>$_POST[comments]</span></td>

  </tr>

</table>";

mail($mailto,$subject,$message,$headers); 

 

echo "<script>window.location.href='Contact_us.php?act=a'</script>";

}

 

}

if($_POST[btnSubmit]=="Cancel")

{

echo "<script>window.location.href='http://www.silicagelpackets.com'</script>";

}

?>

 

<!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>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Contact Us Form Document</title>

<style type="text/css">

<!--

.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}

.style11 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }

.style12 {

color: #FF0000;

font-weight: bold;

}

 

.style2 {font-size: 12px}

 

</style>

</style>

<script type="text/javascript">

<!--

 

function validate_form ( )

{

    valid = true;

 

    if ( document.form1.email.value == "" )

    {

        alert ( "Please fill in the 'Email' box." );

        valid = false;

    }

if ( document.form1.comments.value == "" )

    {

        alert ( "Please fill in the 'Comments' box." );

        valid = false;

    }

 

    return valid;

}

 

//-->

</script>

</head>

 

<body><form id="form1" name="form1" method="post" action="" onsubmit="return validate_form ( );">

<table width="100%" border="0">

  <tr>

    <td align="center"><table width="46%" border="0">

      <tr>

        <td colspan="2"><h3 class="style1">Contact Form :   <span class="style12"><? if($err==1){ "Required fields must be field out!";}?><?=$msg?> </span></h3>          </td>

        </tr>

      <tr>

        <td align="right">Reason For Inquiry*:</td>

        <td>

          <select name="reason">

  <option selected="selected">Select</option>

  <option value="sales@silicagelpackets.com"<? if($_POST[reason]=="nandhamkm@gmail.com") echo "selected";?>>Sales Quote</option>

  <option value="customerservice@silicagelpackets.com"<? if($_POST[reason]=="customerservice@silicagelpackets.com") echo "selected";?>>Order Inquiry</option>

  <option value="customerservice@silicagelpackets.com"<? if($_POST[reason]=="customerservice@silicagelpackets.com") echo "selected";?>>Order Inquiry</option>

  <option value="customerservice@silicagelpackets.com"<? if($_POST[reason]=="customerservice@silicagelpackets.com") echo "selected";?>>Order Inquiry</option>

  <option value="eric@silicagelpackets.com"<? if($_POST[reason]=="eric@silicagelpackets.com") echo "selected";?>>Feedback </option>

  <option value="webmaster@silicagelpackets.com"<? if($_POST[reason]=="webmaster@silicagelpackets.com") echo "selected";?>>Bug Report</option>

  <option value="customerservice@silicagelpackets.com"<? if($_POST[reason]=="customerservice@silicagelpackets.com") echo "selected";?>>Help</option>

          </select>

        </td>

      </tr>

      <tr>

        <td width="50%" align="right"><span class="style11"> First Name: </span></td>

        <td width="50%">

    <input name="firstname" type="text" value="<?=$_POST[firstname]?>" />        </td>

      </tr>

      <tr>

        <td align="right">Last Name: </td>

        <td><input name="lastname" type="text" value="<?=$_POST[lastname]?>" /></td>

      </tr>

      <tr>

        <td align="right">Address:</td>

        <td><input name="address" type="text" value="<?=$_POST[address]?>" /></td>

      </tr>

      <tr>

        <td align="right">City:</td>

        <td><input name="city" type="text" value="<?=$_POST[city]?>" /></td>

      </tr>

      <tr>

        <td align="right">State:</td>

        <td><input name="state" type="text" value="<?=$_POST[state]?>" /></td>

      </tr>

      <tr>

        <td align="right">Zip:</td>

        <td><input name="zip" type="text" value="<?=$_POST[zip]?>" /></td>

      </tr>

      <tr>

        <td align="right">Country:</td>

        <td><input name="country" type="text" value="<?=$_POST[country]?>" /></td>

      </tr>

      <tr>

        <td align="right"><span class="style11"> Email* : </span></td>

        <td><input name="email" type="text" value="<?=$_POST?>" /></td>

      </tr>

      <tr>

        <td align="right"><span class="style11">Phone Number : </span></td>

        <td><input name="phone" type="text" value="<?=$_POST[phone]?>" /></td>

      </tr>

      <tr>

        <td align="right">Order Number (if applicable):</td>

        <td><input name="ordernumber" type="text" value="<?=$_POST[ordernumber]?>" /></td>

      </tr>

      <tr>

        <td align="right">Comments/Inquiry*:</td>

        <td><textarea name="comments"><?=$_POST[comments]?></textarea></td>

      </tr>

      <tr>

        <td align="right"><input type="submit" name="btnSubmit" value="Send" /></td>

<td align="left"><input type="submit" name="btnSubmit" value="Cancel" /></td>

        </tr>

    </table></td>

  </tr>

</table></form>

</body>

</html>

 

 

Just an FYI, no, you can't see code using view source.  Wouldn't be very secure if you could now would it?

 

Can you not see the code via Page Source? Maybe not, and if so do I just copy/paste the entire source code for that web page?

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.