Jump to content

Problems with php form bringing in complete form


Goingpostal

Recommended Posts

Hello all

 

I have created an online quoting system for my printing company.  Everything seems to be ok the quote prices are correct, however some of the fields are not showing correctly.  For example the customer will fill out what colour package, stock, coating etc and quantity for the business cards as well as their name, company, phone and email.  when they submit the form the results are emailed to me and they are taken to another page showing the quote price and everything they have filled in.  The email that is sent to me shows all the correct information, however when the new page is up the Colour,stock and coating fields only show the first 4 letters.  I have no idea what is causing this.

 

If anyone has ideas please let me know!!!!!

 

The link to the site is:

http://www.boagrafix.com/phpproblem

 

the code for the php file used is:

<HTML>
<HEAD>
<TITLE>Business Cards Instant Quote</TITLE>
<script>
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("One or more of the required elements are not completed. Please complete them, then submit again!")
return false
}
else
return true
}
</script>
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
-->
</style>
</HEAD>

<!-- BEGIN PHP SCRIPTING -->

<?php

  foreach ($_POST as $key => $value) {
    $$key = $value;
  }

$email   ='lxxxx.xxxxx.com'.',';
$email  .=$requiredEmail;

// Business Cards Colour

switch ($Colour)    {
  case "FC":
    $Colour_package = "Full Colour Single Sided";
    $Cpackage = 1.00;
    break;
  case "FC DS":
    $Colour_package = "Full Colour Double Sided";
    $Cpackage = 1.35;
    break;
}

// Business Cards Stock

switch ($Stock)    {
  case "340":
    $Stock_package = "340 GSM Ivory Board";
    $Spackage = 1.00;
    break;
  case "300 Gloss":
    $Stock_package = "300 GSM Gloss Artboard";
    $Spackage = 1.35;
    break;
  case "300 Matt":
    $Stock_package = "300 GSM Matt Artboard";
    $Spackage = 1.35;
    break;
}

// Business Cards Coating

switch ($Coating)    {
  case "0":
    $Coating_package = "None";
    $Coating = 0;
    break;
  case "MDS":
    $Coating_package = "Matt Double Sided";
    $Coating = 1.00;
    break;
  case "MSS":
    $Coating_package = "Matt Single Sided";
    $Coating = .55;
    break;
  case "GDS":
    $Coating_package = "Gloss Double Sided";
    $Coating = 1.00;
    break;
  case "GDS":
    $Coating_package = "Gloss Single Sided";
    $Coating = .55;
    break;
}

// Quantity
switch ($Quantity)    {
  case "250":
    $Quantity_package = "250";
    $Quantity = 250;
    break;
  case "500":
    $Quantity_package = "500";
    $Quantity = 250;
    $Quantity2 = 25;
    break;
  case "1000":
    $Quantity_package = "1000";
    $Quantity = 250;
    $Quantity2 = 50;
    break;
  case "2000":
    $Quantity_package = "2000";
    $Quantity = 250;
    $Quantity2 = 75;
    break;

}

// SET AUOTMATIC, UNIQUE QUOTE GENERATION VARIABLE

$time = time();
$qn = rand(1, 99);
$quote_num = $time . ' ' . $qn;

// SET ESTIMATED TIME OF COMPLETION VARIABLE


// CALCULATION OF QUOTE TOTAL VARIABLES FOLLOW


$total =($Quantity2) + ($Quantity)*($Spackage + $Coating + $Cpackage);
$total = number_format ($total, 2);

// END CALCULATIONS FOR QUOTE TOTAL

// START SCREEN PRINTING OF DATA



// EMAIL QUOTE

mail ('xxxxxx@XXXXX.com', 'Instant Quote Generated', "Quote Number:  $quote_num - Quote Total:  $total --> 
Name: $requiredname
Company: $requiredConame	Telephone: $requiredPhone
Email: $requiredEmail
Type: $Type
Colour:  $Colour_package
Stock:  $Stock_package
Coating:  $Coating_package 
Quantity:  $Quantity_package

", 'From: ');


?>



<div align="center">
  <table width="600" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
      <td height="58" colspan="4" valign="top"><table width="600" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
      <td width="129" height="19"> </td>
      <td width="45"> </td>
      <td width="140"> </td>
      <td width="196"> </td>
    </tr>
<form action="final.php" method="POST" onSubmit="return checkrequired(this)" language="JavaScript" name="FrontPage_Form1">
   

<tr>
      <td height="22" valign="top"><span lang="en-us">   Quote Number</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredQuote" value=<?php echo $quote_num ?> type="text" id="Quote" tabindex"5" size="55" readonly="true">
                 <span class="style1">*</span></label></td>
                </tr>
    <tr>
      <td height="22" valign="top"><span lang="en-us">   Total</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredPrice" value=<?php echo $total ?> type="text" id="total" tabindex"5" size="55" readonly="true">
                 <span class="style1">*</span></label></td>
                </tr>
<tr>
      <td height="22" valign="top"><span lang="en-us">   Colour</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="Colour" value=<?php echo $Colour_package ?> type="text" id="Quote" tabindex"5" size="55" readonly="true">
                 <span class="style1">*</span></label></td>
                </tr>
    <tr>
      <td height="22" valign="top"><span lang="en-us">   Stock</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="Stock" value=<?php echo $Stock_package ?> type="text" id="total" tabindex"5" size="55" readonly="true">
                 <span class="style1">*</span></label></td>
                </tr>
<tr>
      <td height="22" valign="middle"><span lang="en-us">   Coating</span></td>
      <td colspan="3" align="left" valign="top"><label>
        <input name="Coating" value=<?php echo $Coating_package ?> type="text" id="Fname" tabindex="5" size="55" readonly="true">
        <span class="style1">*</span></label></td>
      </tr>
<tr>
      <td height="22" valign="middle"><span lang="en-us">   Quantity</span></td>
      <td colspan="3" align="left" valign="top"><label>
        <input name="Quantity" value=<?php echo $Quantity_package ?> type="text" id="Fname" tabindex="5" size="55" readonly="true">
        <span class="style1">*</span></label></td>
      </tr>
<tr>
      <td height="22" valign="middle"><span lang="en-us">   Name</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredname" value=<?php echo $requiredname ?> type="text" id="Coname" tabindex="2" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
   
    <tr>
      <td height="22" valign="middle"><span lang="en-us">   Company</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredConame" value=<?php echo $requiredConame ?> type="text" id="Coname" tabindex="2" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
    <tr>
      <td height="22" valign="middle"><span lang="en-us">   Phone</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredPhone" value=<?php echo $requiredPhone ?> type="text" id="Phone" tabindex="3" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
    <tr>
      <td height="22" valign="middle"><span lang="en-us">   Fax</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="Fax" type="text" id="Fax" tabindex="4" size="55">
                 <span class="style1"></span></label></td>
                </tr>
    <tr>
      <td height="22" valign="top"><span lang="en-us">   Email</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredEmail" value=<?php echo $requiredEmail ?> type="text" id="Email" tabindex"5" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
    
<tr>
      <td height="22" valign="top"><span lang="en-us">   Street Address</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredAddress" type="text" id="Address" tabindex"5" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
<tr>
      <td height="22" valign="top"><span lang="en-us">   Suburb</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredSuburb" type="text" id="Suburb" tabindex"5" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
<tr>
      <td height="22" valign="top"><span lang="en-us">   State</span></td>
                 <td colspan="2" align="left" valign="top">
                 
          <select name="requiredState" id="State" tabindex="8">
            <option value="VIC" selected>VIC</option>
            <option value="ACT">ACT</option>
            <option value="NSW">NSW</option>
            <option value="NT">NT</option>
    <option value="QLD">QLD</option>
            <option value="SA">SA</option>
    <option value="TAS">TAS</option>
            <option value="WA">WA</option>
                  </select>
          <span class="style1">*</span>
</tr>
<tr>
      <td height="22" valign="top"><span lang="en-us">   Postcode</span></td>
                 <td colspan="3" align="left" valign="top"><label>
                 <input name="requiredPost" type="text" id="Postcode" tabindex"5" size="55">
                 <span class="style1">*</span></label></td>
                </tr>
    <tr>
      <td height="22" valign="middle"><span lang="en-us">   Special Details</span></td>
      <td colspan="3" align="left" valign="top"><label>
          <textarea name="Details" cols="55" id="Details"></textarea>
        <span class="style1"></span></label></td>
      </tr>

<tr>
      <td height="62" colspan="4" valign="top">              
        <p align="center">
          <input type="submit" value="Get Your Quote" name="Submit_Button" style="font-family: Arial; font-size: 10pt; color: #006600; font-weight: bold" tabindex="32">
          <input type="reset" value="Reset" name="Reset_Button" style="font-size: 8pt; font-family: Arial" tabindex="33">
        </p>
</tr>
<tr>
<td height="24">    
      <td>    
      <td colspan="2" valign="top">    <input name="Type" type="hidden" id="Type" value="Business Cards" />
</tr>

</form>

        
</BODY>
</HTML>

 

Thank you very much

 

(edited by kenrbnsn to put in the


tags)

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.