Jump to content

davewit13

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

davewit13's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. wow! thats great thanks. your code works perfectly
  2. I Have renamed the form <form action="contact.php" name ="choices" method="get" onsubmit="return checkform()"/>
  3. Hi Guys, I am having issues calling a javascript function when my html form is being submitted before it is being passed into a php file. the code for the function looks like this: <script language="JavaScript" type="text/javascript"> function checkform() { var cname, cemail, cphone, caddress, cquery; with(window.document.choices) { cname=Name; cemail=Email; cphone=Phone; caddress=Address; cquery=Query; } if(cname.value=="") { alert('Please enter your name'); cname.focus(); return false; } else if(cemail.value=="") { alert('Please enter your email'); cemail.focus(); return false; } else if(cphone.value=="") { alert('Please enter your phone number'); cphone.focus(); return false; } else if(caddress.value=="") { alert('Please enter your address'); caddress.focus(); return false; } else if(cquery.value =="") { alert('Please enter a query'); Email.focus(); return false; } else { return true; } } </script> The form code is as follows: <form action="contact.php" method="get" onsubmit="return checkform()"/> <tr> <td align="left" class="bodyText style12" width="100"> Name :</td> <td align="right" width="350"><p> <input type="text" name="Name" size="28" maxlength =100 /> </p></td> </tr> <tr> <td align="left" class="bodyText style12" width="100">Address :</td> <td align="right" width="350"><p> <input type="text" name="Address" size="28" maxlength =100 /> </p></td> </tr> <tr> <td align="left" class="bodyText style12" width="100">Phone:</td> <td align="right" width="350"><p> <input type="text" name="Phone" size="28" maxlength =100 /> </p></td> </tr> <tr> <td align="left" class="bodyText style12" width="100">Email:</td> <td align="right" width="350"><p> <input type="text" name="Email" size="28" maxlength =100 /> </p></td> </tr> <tr> <td align="left" class="bodyText style12" width="100">Your Query :</td> <td align="right" width="350"></p> <textarea name="Query" cols="30" rows="2"></textarea> </td></p></tr> <tr> <td align="right" colspan="2"><p><input type="submit" name ="Submit" value="Email"/> <input type="reset" name ="reset" value="Reset" /></p></td></tr> </form> Please help! It doesnt seem to check anything, just passes it straight to the php file.
  4. hmmm mabe it something i should enquire bout with my hosting company. Thanks alot for your help!
  5. Domestic.php <?php $FullPallet=$_GET["FullPallet"]; $QuarterPallet=$_GET["QuarterPallet"]; $DeliveryType=$_GET["DeliveryType"]; $DeliveryFrom=$_GET["DeliveryFrom"]; $DeliveryTo=$_GET["DeliveryTo"]; ?> <html> <head> <title>Domestic Quote Result</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="mm_health_nutr.css" type="text/css" /> <script language="JavaScript" type="text/javascript"> var d=new Date(); var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear(); var FullPallet= frm.FullPallet.value var QuarterPallet=frm.QuarterPallet.value var DeliveryType= frm.Delivery.value var DeliveryFrom=frm.DeliveryFrom.value var DeliveryTo=frm.DeliveryTo.value </script> <style type="text/css"> <!-- .style2 {color: #FFFFFF} .style7 {color: #000000; font-weight: bold; font-size: 36px; } .style10 {color: #993300; font-weight: bold; font-size: 10px; } </style> </head> <body bgcolor="#999999"> <span class="style2"></span> <table width="70%" height="100" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="3" rowspan="2"><img src="PalletsOnRacks.jpg" alt="Header image" width="283" height="110" border="0" /></td> <td height="88" colspan="3" id="logo" valign="bottom" align="center" nowrap="nowrap"><span class="style7">Pallets </span></td> <td width="2"></td> </tr> <tr bgcolor="#FFFFFF"> <td height="31" colspan="3" id="tagline" valign="top" align="center"><span class="style10">"Your #1 Courier for Domestic and International Freight"</span> </td> <td width="2"></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7" id="dateformat" height="14"> <script language="JavaScript" type="text/javascript"> document.write(Today); </script> </td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td> </tr> <tr> <td width="290" valign="top" bgcolor="#FFFFFF"> <table width="282" height="340" border="0" cellpadding="0" cellspacing="0" id="navigation"> <tr> <td width="282" height="80"><a href="Index.html" class="navText">Home</a></td> </tr> <tr> <td height="80"><a href="quoteDomestic.html" class="navText">Get a Quote (Domestic) </a></td> </tr> <tr> <td height="80"><a href="quoteUK.html" class="navText">Get A Quote (UK) </a></td> </tr> <tr> <td height="80"><a href="contact.html" class="navText">Online Order </a></td> </tr> <tr> </table> <td width="10"></td> <td colspan="2" valign="top"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /><br /> <table width="100%" height="400" border="0" align ="left"cellpadding="0" cellspacing="0" background="Globe.jpg"> "Hello, You have queried an order of <?php echo "Hello, You have queried an order of $FullPallet full pallets and $QuarterPallet quarter pallets. The delivery is from $DeliveryFrom and is going to $DeliveryTo. This is a ".$HTTP_GET_VARS['DeliveryType']."delivery."?> </table> <tr> <td width="290"></td> <td width="10"></td> <td width="1"></td> <td width="554"></td> <td width="4"></td> <td width="3"></td> <td width="2"></td> </tr> </table> <img src="mm_spacer.gif" alt="" width="305" height="1" border="0" /> </body> </html> Domestic.html <html> <head> <title>Quote Ireland</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="mm_health_nutr.css" type="text/css" /> <script> var d=new Date(); var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear(); </script> <style type="text/css"> <!-- .style2 {color: #FFFFFF} .style3 { color: #000000; font-weight: bold; } .style7 {color: #000000; font-weight: bold; font-size: 36px; } .style10 {color: #993300; font-weight: bold; font-size: 10px; } .style11 {font-size: 16px} .style12 { color: #666666; font-weight: bold; } </style> </head> <body bgcolor="#999999"> <span class="style2"></span> <table width="70%" height="100" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="3" rowspan="2"><img src="PalletsOnRacks.jpg" alt="Header image" width="283" height="110" border="0" /></td> <td height="88" colspan="3" id="logo" valign="bottom" align="center" nowrap="nowrap"><span class="style7">Pallets </span></td> <td width="2"></td> </tr> <tr bgcolor="#FFFFFF"> <td height="31" colspan="3" id="tagline" valign="top" align="center"><span class="style10">"Your #1 Courier for Domestic and International Freight"</span> </td> <td width="2"></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td> </tr> <tr bgcolor="#FFFFFF"> <td colspan="7" id="dateformat" height="14"> <script language="JavaScript" type="text/javascript"> document.write(TODAY); </script> </td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF" background="mm_dashed_line.gif"><img src="mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td> </tr> <tr> <td colspan="7" bgcolor="#FFFFFF"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td> </tr> <tr> <td width="290" valign="top" bgcolor="#FFFFFF"> <table width="282" height="340" border="0" cellpadding="0" cellspacing="0" id="navigation"> <tr> <td width="282" height="80"><a href="Index.html" class="navText">Home</a></td> </tr> <tr> <td height="80"><a href="quoteDomestic.html" class="navText">Get a Quote (Domestic) </a></td> </tr> <tr> <td height="80"><a href="quoteUK.html" class="navText">Get A Quote (UK) </a></td> </tr> <tr> <td height="80"><a href="contact.html" class="navText">Online Order </a></td> </tr> <tr> </table> <td width="10"></td> <td colspan="2" valign="top"><img src="mm_spacer.gif" alt="" width="305" height="1" border="0" /> <img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /><br /> <table width="100%" height="400" border="0" align="left" cellpadding="0" cellspacing="0" background="Globe.jpg"> <tr> <td width="553" height="40" class="pageName style3"><h1 class="style11"><u>Get a Quote</u></h1></td> </tr> <form name="myform" method="get" action="domestic.php"> <tr> <td height="15%" class="bodyText style12">Delivery Service:</td> <td align="right"><select name="Delivery"> <option value='24 Hour' >24 Hour</option> <option value='Am Delivery' >AM Delivery</option> <option value='Timed Delivery'>Timed Delivery</option> <option value='Saturday Delivery'>Saturday Delivery</option> </select></td> </tr> <tr> <td height="15%" class="bodyText style12" align="left">Full Pallet:<br /></td> <td align="right"><select name="FullPallet"> <option value="0" selected> 0 </option> <option value="1"> 1 </option> <option value="2"> 2 </option> <option value="3"> 3 </option> <option value="4"> 4 </option> <option value="5"> 5 </option> <option value="6"> 6 </option> <option value="7"> 7 </option> <option value="8"> 8 </option> <option value="9"> 9 </option> <option value="10"> 10 </option> </select> </td> </tr> <tr> <td height="15%" class="bodyText style12" align="left">Carton:<br /></td> <td align="right"><select name="QuarterPallet"> <option value="0" selected> 0 </option> <option value="1 to 3"> 1 - 3 </option> <option value="4 to 6"> 4 - 6 </option> </select></td> </tr> <tr> <td height="15%" class="bodyText style12">Delivery From</td> <td align="right"><select name="DeliveryFrom" size="1"> <option value='Dublin' >Dublin</option> <option value='2' >Wicklow</option> <option value='3' >Wexford</option> <option value='4' >Carlow</option> <option value='5' >Kildare</option> <option value='6' >Meath</option> <option value='7' >Louth</option> <option value='8' >Monaghan</option> <option value='9' >Cavan</option> <option value='10' >Longford</option> <option value='11' >Westmeath</option> <option value='12' >Offaly</option> <option value='13' >Laois</option> <option value='14' >Kilkenny</option> <option value='15' >Waterford</option> <option value='16' >Cork</option> <option value='17' >Kerry</option> <option value='18' >Limerick</option> <option value='19' >Tipperary</option> <option value='20' >Clare</option> <option value='21' >Galway</option> <option value='22' >Mayo</option> <option value='23' >Roscommon</option> <option value='24' >Sligo</option> <option value='25' >Leitrim</option> <option value='26' >Donegal</option> <option value='27'>Armagh</option> <option value='28'>Derry</option> <option value='29'>Down</option> <option value='30'>Fermanagh</option> <option value='31'>Tyrone</option> <option value='32'>Antrim</option> </select> </td> </tr> <tr> <td height="15%" class="bodyText style12">Delivery To</td> <td align="right"><select name="DeliveryTo" size="1"> <option value='Dublin' >Dublin</option> <option value='2' >Wicklow</option> <option value='3' >Wexford</option> <option value='4' >Carlow</option> <option value='5' >Kildare</option> <option value='6' >Meath</option> <option value='7' >Louth</option> <option value='8' >Monaghan</option> <option value='9' >Cavan</option> <option value='10' >Longford</option> <option value='11' >Westmeath</option> <option value='12' >Offaly</option> <option value='13' >Laois</option> <option value='14' >Kilkenny</option> <option value='15' >Waterford</option> <option value='16' >Cork</option> <option value='17' >Kerry</option> <option value='18' >Limerick</option> <option value='19' >Tipperary</option> <option value='20' >Clare</option> <option value='21' >Galway</option> <option value='22' >Mayo</option> <option value='23' >Roscommon</option> <option value='24' >Sligo</option> <option value='25' >Leitrim</option> <option value='26' >Donegal</option> <option value='27'>Armagh</option> <option value='28'>Derry</option> <option value='29'>Down</option> <option value='30'>Fermanagh</option> <option value='31'>Tyrone</option> <option value='32'>Antrim</option> </select> </td> </tr> <tr> <td align="right" colspan="2"><input name="Submit" type="submit" value="Submit"/> <input type="reset" name ="reset" value="Reset" /> <p></p></td> </tr> </form> </table> <tr> <td width="290"></td> <td width="10"></td> <td width="1"></td> <td width="554"></td> <td width="4"></td> <td width="3"></td> <td width="2"></td> </tr> </table> </body> </html>
  6. I have put the semi colon in, however it doesnt seem to display anything back to the screen from my php code. This is in the domestic.php part. <table width="100%" height="400" border="0" align ="left"cellpadding="0" cellspacing="0" background="Globe.jpg"> "Hello, You have queried an order of <?php echo "Hello, You have queried an order of $FullPallet full pallets and $QuarterPallet quarter pallets. The delivery is from $DeliveryFrom and is going to $DeliveryTo. This is a ".$HTTP_GET_VARS['DeliveryType']."delivery."?> hi test <?php echo php test "quote test" ?> </table> However the page does not display anything. only the "hello you have queries an order of, and te hi test part also. It seems to ignore anything in the <?php... ?>
  7. Hi guys, First time using this site. And quiet new to php/server side scripts, so might be a easy one i dunno. Basically i have a html form with drop downs etc. and im sending this to a php file. At the moment i just want to store the values in variable and display them to the screen before manipulating them (which should be the easy bit, i think!). While i do see the information set in the html form on the address bar on the next screen, i cant seem to do At the moment heres how it looks: <html> ........ <form name="myform" method="get" action="domestic.php"> ....... <td align="right" colspan="2"><input name="Submit" type="submit" value="Submit"/> <input type="reset" name ="reset" value="Reset" /></td> </form> ....</html> domestic.php looks like: <?php $FullPallet=$_GET["FullPallet"] $QuarterPallet=$_GET["QuarterPallet"] $DeliveryType=$_GET["DeliveryType"] $DeliveryFrom=$_GET["DeliveryFrom"] $DeliveryTo=$_GET["DeliveryTo"] ?> <html> ...... Hello, You have queried an order of <?php echo $FullPallet ?> full pallets and <?php echo $QuarterPallet; ?> quarter pallets. The delivery is from <?php $DeliveryFrom ?> and is going to <?php $DeliveryTo ?>. This is a <?php $HTTP_GET_VARS['DeliveryType'] ?> delivery. ..... </html> As you can see to display it to the screen i have tried quiet a few different things, not sure if thats the problem or how i set the variables etc. Please Help!!
×
×
  • 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.