Jump to content

[SOLVED] plz help with script...


m_tyhurst2002

Recommended Posts

I have made this form and I uploaded to server and when I go to the page I get a blank page. My eyes are tired of looking for something that I have wrong. I can't seem to find anything. Can I put a line of code that will tell me the error in the browser or something? I am quite new to this... Heres the code

<?php
$Checked = false;  
  if (isset($_POST['submit'])) {
    $fullname = $_POST['fullname'];
    $company = $_POST['company'];
    $email = $_POST['email'];
    $dateneeded = $_POST['dateneeded'];
    $phone = $_POST['phone'];
    $address = $_POST['address'];
    $citystate = $_POST['citystate'];
    $service = $_POST['service'];
    $maintenaceplan = $_POST['maintenaceplan'];
    $logowork = $_POST['logowork'];
    $brochure = $_POST['brochure'];
    $desireddomain = $_POST['desireddomain'];
    $compurl = $_POST['compurl'];
    $compurl2 = $_POST['compurl2'];
    $purposeofsite = $_POST['purposeofsite'];
    $descriptionofsite = $_POST['descriptionofsite'];
    $budget = $_POST['budget'];
    $connection = $_POST['connection'];
    $approxpages = $_POST['approxpages'];
    if ( !empty($fullname) && 
         !empty($company) &&
         !empty($email) &&
         !empty($dateneeded) &&
         !empty($phone) &&
         !empty($address) &&
         !empty($citystate) &&
         !empty($service) &&
         !empty($maintenaceplan) &&
         !empty($logowork) &&
         !empty($brochure) &&
         !empty($desireddomain) &&
         !empty($compurl) &&
         !empty($compurl2) &&
         !empty($purposeofsite) &&
         !empty($descriptionofsite) &&
         !empty($budget) &&
         !empty($connection) &&
         !empty($approxpages)) {

    if(isset($_POST['submit'])) {
         $to = "[email protected]";
         $subject = "Request Quote from www.invent-designs.com";
         $fullname_field = $_POST['fullname'];
         $company_field = $_POST['company'];
         $email_field = $_POST['email'];
         $dateneeded_field = $_POST['dateneeded'];
         $service_field = $_POST['service'];
         $maintenaceplan_field = $_POST['maintenaceplan'];
         $logowork_field = $_POST['logowork'];
         $brochure_field = $_POST['brochure'];
         $desireddomain_field = $_POST['desireddomain'];
         $compurl_field = $_POST['compurl'];
         $compurl2_field = $_POST['compurl2'];
         $purposeofsite_field = $_POST['purposeofsite'];
         $descriptionofsite_field = $_POST['descriptionofsite'];
         $budget_field = $_POST['budget'];
         $connection_field = $_POST['connection'];
         $approxpages_field = $_POST['approxpages'];
         $phone_field = $_POST['phone'];
         $address_field = $_POST['address'];
         $citystate_field = $_POST['citystate'];

         $body = "From:\n Name: $fullname_field\n Company: $company_field\n E-Mail: $email_field\n Phone: $phone_field\n Address: $address_field\n City State Zip: $citystate_field\n Date Needed By: $dateneeded_field\n Service Required: $service_field"\n Budget: $budget_field\n Approximate Pages: $approxpages_field\n Connection Type: $connection_field\n Additional Options 1: $maintenanceplan_field\n Additional Options 2: $logowork_field\n Additional Options 3: $brochure_field\n Desired Domain Name: $desireddomain_field\n Competitor's Site 1: $compurl_field\n Competitor's Site 2: $compurl2_field\n Purpose of Site: $purposeofsite_field\n Description of Site: $descriptionofsite_field";
$Checked = true;//Checked
        mail($to, $subject, $body, "From:$email_field");
         } else {
        echo "blarg!";
  }
  }
    else { $error = true; }
  }
?>
<html>
<head>
<title>iNVENT DESIGNS - Web site creation, logo design, flash design, print designs, brochure, business cards</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
background-image: none;
background-repeat: repeat-y;
background-position: center center;
background-attachment: fixed;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
.style11 {font-size: 12px; font-family: Geneva, Arial, Helvetica, sans-serif; }
.style14 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
}
.style15 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
}
.style16 {
color: #C16417;
font-size: 12px;
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.style18 {
font-size: 10px;
color: #FF0000;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('images/portfolio_over.jpg','images/aboutus_over.jpg','images/contact_over.jpg')">
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table width="638" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/main_background.gif">
  <tr>
    <th width="638" scope="col"><table width="641" border="0" cellspacing="0" cellpadding="0">
      <tr align="left" valign="top">
        <td height="189" scope="col"><img src="images/left_spacer.gif" width="30" height="4"></td>
        <td scope="col"><div align="left"><img src="images/contact_image.jpg" width="191" height="189"></div></td>
        <td scope="col"><div align="left"><img src="images/portfolio_image.jpg" width="196" height="189"></div></td>
        <td scope="col"><img src="images/aboutus_image.jpg" width="194" height="189"></td>
        <td scope="col"><img src="images/right_spacer.gif" width="27" height="5"></td>
      </tr>
      <tr align="left" valign="top">
        <td height="45" scope="row"><img src="images/left_spacer.gif" width="30" height="4"></td>
        <td scope="col"><div align="left"><a href="contact.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Contact','','images/contact_over.jpg',1)"><img src="images/contact_off.jpg" name="Contact" width="191" height="45" border="0"></a></div></td>
        <td scope="col"><div align="left"><a href="portfolio.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Portfolio','','images/portfolio_over.jpg',1)"><img src="images/portfolio_off.jpg" name="Portfolio" width="196" height="45" border="0"></a></div></td>
        <td scope="col"><div align="left"><a href="aboutus.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('About Us','','images/aboutus_over.jpg',1)"><img src="images/aboutus_off.jpg" name="About Us" width="194" height="45" border="0"></a></div></td>
        <td scope="col"><img src="images/right_spacer.gif" width="27" height="5"></td>
      </tr>
      <tr valign="top">
        <th colspan="5" scope="row"><div align="left"><br>
            <a href="index.php"><img src="images/logo.gif" width="387" height="77" border="0"></a><br>
        </div></th>
      </tr>
      <tr valign="top">
        <th width="3190" colspan="5" scope="row"><div align="center"><img src="images/contact_header.jpg" width="638" height="58"></div></th>
      </tr>
      <tr valign="top">
        <th colspan="5" scope="row"><table width="596" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr valign="top" bgcolor="#FFFFFF">
            <th colspan="3" scope="col"><span class="style15">              We would love to discuss your next web design or print project! Please email us with<br> 
              the form below and we can begin the process of your project. </span><br>
              <br>              <table width="560" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <th width="560" scope="col"><div align="left"><span class="style11">Mailing Address</span><span class="style15">:</span><span class="style11"> iNVENT DESIGNS, 
                            5504 Underwood Cv., 
                            Arlington, TN 38002</span><br>
                            <span class="style11">Email Address: [email protected] </span><br>
                            <span class="style11">Phone: 901.674.1754 <br>
  <br>
                            </span> </div></th>
                </tr>
              </table></th>
          </tr>
          <tr valign="top" bgcolor="#FFFFFF">
            <th colspan="3" scope="col"><div align="left">
<table width="596" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr align="left" valign="top">
      <th colspan="2" scope="row"><table border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th scope="col"><table width="596"  border="0" align="center" cellpadding="3" cellspacing="3">
            <tr valign="top">
              <td colspan="4"><p align="center" class="style15"><b><u>FREE REQUEST FORM </u><font color="#CC0000"><br>
                <br>
              </font></b></p>                </td>
            </tr>
            <tr valign="top">
              <td colspan="4"><span class="style15">Please fill out the form below to get an accurate quote for your project. The quote form is also a great way for us to understand your business and better serve you.<br>
                  <span class="style18">(*Required) </span>                </span></td>
            </tr>
            <tr valign="top">
              <td width="3%" class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td width="30%" class="style11"><b></b>Full Name:</td>
              <td colspan="2"><input name="fullname" type="text"  class="style16" id="fullname" value="<?php echo $fullname; ?>"  size="50"/>
                <br><?php
  if ( $error==true && empty($fullname) ) {
    echo 'Error! Please enter your first and last name.<br>';
  }
?></td>
            </tr>
            <tr valign="top">
              <td class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td class="style11"><b></b>Company Name:</td>
              <td colspan="2"><input name="company" id="company" type="text" class="style16" value="<?php echo $company; ?>" size="50"/>
                <br>
                <span class="style6 style10 style11">
                <?php
  if ( $error==true && empty($company) ) {
    echo 'Error! Please enter your company name.<br>';
  }
?>
                </span></td>
            </tr>
            <tr valign="top">
              <td class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td class="style11"><b></b>Current Email<b></b>:</td>
              <td colspan="2"><input name="email" id="email" type="text" class="style16"  size="50" value=<?php echo $email; ?>>
                <br>
                <span class="style6 style10 style11">
                <?php
  if ( $error==true && empty($email) ) {
    echo 'Error! Please enter current email.<br>';
  }
?>
                </span></td>
            </tr>
            <tr valign="top">
              <td class="style11"> </td>
              <td class="style11">Address:</td>
              <td colspan="2"><input name="address" type="text" class="style16" id="address" size="50"></td>
            </tr>
            <tr valign="top">
              <td class="style11"> </td>
              <td class="style11">City / State / Zip:</td>
              <td colspan="2">                   <input name="citystate" type="text" class="style16" id="citystate" size="50"></td></tr>
            <tr valign="top">
              <td class="style11"> </td>
              <td class="style11">Phone number:</td>
              <td colspan="2"><input name="phone" type="text" class="style16" id="phone" size="50"></td>
            </tr>
            <tr valign="top">
              <td class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td class="style11"><b></b>Project Deadline :</td>
              <td colspan="2"><input name="dateneeded" id="dateneeded" type="text" class="style16"  size="50" value="<?php echo $dateneeded; ?>"/>
                <span class="style11">              (mm/dd/yyyy) <br>
                <span class="style6 style10 style11">
                <?php
  if ( $error==true && empty($dateneeded) ) {
    echo 'Error! Please enter deadline date.<br>';
  }
?></span>                </span></td>
            </tr>
            <tr valign="top">
              <td class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td rowspan="2" class="style11"><p>Estimated Budget:</p>                </td>
              <td width="21%"><select name="budget" class="style16">
                <option value="0" <?php 
  if (empty($budget)) echo "selected";
?>>- Select -</option>
			<option value="Under $1,000">Under $1,000</option>
		   <option value="$1,000-$4,999">$1,000-$4,999</option>
		   <option value="$5,000 - $9,999">$5,000 - $9,999</option>
		   <option value="$10,000 or more">$10,000 or more</option>
		   </select>
                <span class="style6 style10 style11">                </span></td>
              <td width="46%" valign="top" class="style11"><p>Approximate Number of Pages:
                    <input name="approxpages" class="style16" id="approxpages" size="10"> 
                  </p></td>
            </tr>
            <tr valign="top">
              <td class="style11"> </td>
              <td colspan="2"><span class="style6 style10 style11">
                <?php
  if ( $error==true && empty($budget) ) {
    echo 'Error! Please select estimated budget.<br>';
  }
?>
              </span></td>
              </tr>
            <tr valign="top">
              <td class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
              <td rowspan="2" class="style11">Current Internet Connection:                </td>
              <td><select name="connection" class="style16">
               <option value="0" <?php 
  if (empty($connection)) echo "selected";
?>>- Select -</option>
                <option value="Not Available Yet">Not Available Yet</option>
                <option value="Dial Up">Dial Up</option>
                <option value="Cable/DSL">Cable/DSL</option>
              </select>
                <span class="style6 style10 style11">                </span></td>
              <td width="46%" class="style11"> </td>
            </tr>
            <tr valign="top">
              <td class="style11"> </td>
              <td colspan="2"><span class="style6 style10 style11">
                <?php
  if ( $error==true && empty($connection) ) {
    echo 'Error! Please select connection speed.<br>';
  }
?>
              </span></td>
              </tr>
  </table>
<table width="596"  border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td valign="top" bgcolor="#FDF3E7"><span class="style15"><b><font color="#000000"><b><font color="#CC0000" size="+1">*</font></b>Type of Service Required</font></b>:</span><br>      
      <br>      
      <input name="service" id="service" type="radio" value="New Site" />
      <span class="style11">New Website Creation
      <input name="service" id="service" type="radio" value="Site Redesign" /> 
      Existing Website Redesign 
      <input name="service" id="service" type="radio" value="Site Maintenance" />
      Existing Website Maintenance 
      <input name="service" id="service" type="radio" value="other" /> 
      Other<br>
      <span class="style6 style10 style11">
      <?php
  if ( $error==true && empty($service) ) {
    echo 'Error! Please select type of service.<br>';
  }
?>
      </span></span></td>
  </tr>
  <tr>
    <td height="76" align="left" valign="top" bgcolor="#FDF3E7"><span class="style15"><b>Additional Options:</b><i> (optional - check all that apply)</i><i></i></span><i><br>
      </i><span class="style11"><br>
      <input name="maintenaceplan" type="checkbox" id="maintenaceplan" value="1">
      Maintenance Plan Enrollment       
      <input name="logowork" type="checkbox" id="logowork" value="1">
      Custom Digital Logo Work
       <input name="brochure" type="checkbox" id="brochure" value="1"> 
      Brochure/ Business Card Design </span> </td>
  </tr>
</table>
<table width="596"  border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td width="2%" class="style11"> </td>
    <td width="37%" class="style11">Desired Domain Name: </td>
    <td width="61%"><input name="desireddomain" class="style16" id="desireddomain" value="www." size="50">      </td>
  </tr>
  <tr>
    <td class="style11"> </td>
    <td class="style11">Competitor's Site/Site You Like: </td>
    <td><input name="compurl" type="text" class="style16" id="compurl" value="www." size="50">      </td>
  </tr>
    <tr>
      <td class="style11"> </td>
    <td class="style11">Competitor's Site/Site You Like: </td>
    <td><input name="compurl2" type="text" class="style16" id="compurl2" value="www." size="50">      </td>
  </tr>
  <tr>
    <td valign="top" class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
    <td valign="top" class="style11"><b></b>Main Purpose of the Site:</td>
    <td><select name="purposeofsite" class="style16">
               <option value="0" <?php 
  if (empty($purposeofsite)) echo "selected";
?>>- Select -</option>
			<option value="Advertise">Advertise Products and Services</option>
		   <option value="Sell Products">Sell Products Online</option>
		   <option value="Showcase Work">Showcase my Work</option>
		   <option value="Data Projects">Process Data Related Projects</option>
		   <option value="Other">Other</option>
		   </select>
      <br>
      <span class="style6 style10 style11">
      <?php
  if ( $error==true && empty($purposeofsite) ) {
    echo 'Error! Please select purpose of site.<br>';
  }
?>
      </span></td>
  </tr>
  <tr>
    <td align="left" valign="top" class="style11"><b><font color="#CC0000" size="+1">*</font></b></td>
    <td align="left" valign="top" class="style11"><b></b>Description of Desired Site:</td>
    <td><textarea name="descriptionofsite" cols="65" rows="10" class="style16" id="descriptionofsite"><?php echo $descriptionofsite; ?></textarea>
      <span class="style6 style10 style11">
      <?php
  if ( $error==true && empty($descriptionofsite) ) {
    echo 'Error! Please enter description of desired site.<br>';
  }
?>
      </span></td>
  </tr>
  <tr>
    <td> </td>
    <td><input type="submit" name="submit" value="Submit"></td>
    <td align="right" valign="top"> </td>
  </tr>
  <tr>
    <td colspan="3"><div align="center"> <span class="style15"><?php
if($Checked)
{
         echo '<div align="center"><br>Thanks for your interest in our services ';
         echo $_POST['fullname']."! We will reply within 24-48 hours.<br> ";
}
?></span></div></td>
    </tr>
</table></th>
        </tr>
      </table></th>
      </tr>
    </table>
                                   </div>              </th>
            </tr>
        </table></th>
      </tr>
      <tr valign="top">
        <th colspan="5" scope="row"><div align="center"><img src="images/contact_footer.jpg" width="638" height="47"></div></th>
      </tr>
      <tr valign="top">
        <th colspan="5" scope="row"><p> </p>
          </th>
      </tr>
    </table></th>
  </tr>
</table>
</form>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/69636-solved-plz-help-with-script/
Share on other sites

        $body = "From:\n Name: $fullname_field\n Company: $company_field\n E-Mail: $email_field\n Phone: $phone_field\n Address: $address_field\n City State Zip: $citystate_field\n Date Needed By: $dateneeded_field\n Service Required: $service_field"n Budget: $budget_fieldn Approximate Pages: $approxpages_fieldn Connection Type: $connection_fieldn Additional Options 1: $maintenanceplan_fieldn Additional Options 2: $logowork_fieldn Additional Options 3: $brochure_fieldn Desired Domain Name: $desireddomain_fieldn Competitor's Site 1: $compurl_field\n Competitor's Site 2: $compurl2_fieldn Purpose of Site: $purposeofsite_fieldn Description of Site: $descriptionofsite_field";

$Checked = true;//Checked

        mail($to, $subject, $body, "From:$email_field");

        } else {

        echo "blarg!";

  }

  }

    else { $error = true; }

  }

?>

 

should be

 

        $body = "From:\n Name: $fullname_field\n Company: $company_field\n E-Mail: $email_field\n Phone: $phone_field\n Address: $address_field\n City State Zip: $citystate_field\n Date Needed By: $dateneeded_field\n Service Required: $service_field\n Budget: $budget_fieldn Approximate Pages: $approxpages_fieldn Connection Type: $connection_fieldn Additional Options 1: $maintenanceplan_fieldn Additional Options 2: $logowork_fieldn Additional Options 3: $brochure_fieldn Desired Domain Name: $desireddomain_fieldn Competitor's Site 1: $compurl_field\n Competitor's Site 2: $compurl2_fieldn Purpose of Site: $purposeofsite_fieldn Description of Site: $descriptionofsite_field";

$Checked = true;//Checked

        mail($to, $subject, $body, "From:$email_field");

        } else {

        echo "blarg!";

  }

  }

    else { $error = true; }

  }

?>

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.