473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP form some data from mySQL how to send total back to mySQL?

Enter id and seven fields populate from mySQL - works
Two drop down lists from mySQL - works
Number of checkboxes for user input - works
To be entered into mySQL and emailed to three addresses from filled fields - maybe works
Currently have two submit buttons, different names, but I would appreciate help to enable fields from mySQL to continue to work, but for the "total" form to be inserted into mySQL.
No mySQL probs. just getting the final submit to work, code below is current attempt (have been 100s so far)

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(isset($_REQUEST['lookup'])) {
  3. //first button was used
  4. }
  5. else if(isset($_REQUEST['total'])) {
  6. //second button was used
  7. }
  8. ?>
Help with fixing and understanding solution would be much appreciated.
Thanks
Sep 11 '10 #1
2 1755
johny10151981
1,059 1GB
where is your code?
Sep 11 '10 #2
Thanks for looking at this Johny


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. function sanitize($value, $type)
  4. {
  5.   $value = (!get_magic_quotes_gpc()) ? addslashes($value) : $value;
  6.  
  7.   switch ($type) {
  8.     case "text":
  9.       $value = ($value != "") ? "'" . $value . "'" : "NULL";
  10.       break;
  11.     case "long":
  12.     case "int":
  13.       $value = ($value != "") ? intval($value) : "NULL";
  14.       break;
  15.     case "double":
  16.       $value = ($value != "") ? "'" . doubleval($value) . "'" : "NULL";
  17.       break;
  18.     case "date":
  19.       $value = ($value != "") ? "'" . $value . "'" : "NULL";
  20.       break;
  21.   }
  22.  
  23.   return $value;
  24. }
  25. //This function highlights a required field that has not been filled in
  26. function missingField($var) {
  27.     if(($_GET['m'] == 'empty') && empty($_SESSION["$var"])) {
  28.         echo "class='missing'";
  29.     } else {
  30.     }
  31. }
  32. // end function
  33. //This function highlights an invalid email address
  34. function badEmail() {
  35.     if(($_GET['m'] == 'email')) {
  36.         echo "class='missing'";
  37.     } else {
  38.     }
  39. }
  40. // end function
  41. //Checkbox session function
  42. function checkBox($var) {
  43.     if(!empty($_SESSION["$var"])) {
  44.         echo "checked='checked'";
  45.     } else {
  46.     }
  47. }
  48. // end function
  49. // this displays a message if an error or a missing field is detected
  50. if($_GET['m'] == 'error') {
  51.     $msg = "<p class='error'>Sorry an error has occoured, please contact the site administrator</p>";
  52. } elseif($_GET['m'] == 'empty') {
  53.     $msg = "<p class='error'>Sorry a required field has been left blank, please enter all fields marked with (*)</p>";
  54. }
  55. elseif($_GET['m'] == 'email')
  56. {
  57. $msg = "<p class='error'>Sorry the email address you have supplied seems to be invalid, please recheck the address supplied.</p>";
  58. }
  59.  
  60. /////////////////////////////////////////////////////////////
  61. // do all validation here
  62. /////////////////////////////////////////////////////////////
  63. $valid = 1;
  64. if ($_POST['baust'] = "" &&
  65.     $_POST['gbask'] = "" &&
  66.     $_POST['bbask'] = "" &&
  67.     $_POST['gcrik'] = "" &&
  68.     $_POST['bcrik'] = "" &&
  69.     $_POST['gfoot'] = "" &&
  70.     $_POST['bfoot'] = "" &&
  71.     $_POST['gnetb'] = "" &&
  72.     $_POST['bhock'] = "" &&
  73.     $_POST['ghock'] = "" &&
  74.     $_POST['bleag'] = "" &&
  75.     $_POST['gsoft'] = "" &&
  76.     $_POST['bunio'] = "" &&
  77.     $_POST['gtouc'] = "" &&
  78.     $_POST['bsoft'] = "" &&
  79.     $_POST['mixed'] = "" &&    
  80.     $_POST['btouc'] = "" ) {
  81.     $valid = 0;
  82.     $msg = "You must select at lease one Sport to enter.";
  83. }
  84. if ($_POST['location'] = "") {
  85.     $valid = 0;
  86.     $msg = "You must select a location.";
  87. }
  88. /////////////////////////////////////////////////////////////
  89. // once validation is successful, then insert to db and send email.
  90. /////////////////////////////////////////////////////////////
  91. if ($valid == 1) {
  92.     //include the connection file
  93.     require_once('connection.php');
  94.     //save the data on the DB and send the email
  95.     if(isset($_POST['action']) && $_POST['action'] == 'submitform')
  96.         //receive the variables
  97.         $schoolid = $_POST['schoolid'];
  98.         $name = $_POST['name'];
  99.         $street = $_POST['street'];
  100.         $town = $_POST['town'];
  101.         $phone = $_POST['phone'];
  102.         $fax = $_POST['fax'];
  103.         $email = $_POST['email'];
  104.         $category = $_POST['category'];
  105.         $subcategory = $_POST['subcategory'];
  106.         $location = $_POST['location'];
  107.         $baust = $_POST['baust'];
  108.         $gback = $_POST['gbask'];
  109.         $bbask = $_POST['bbask'];
  110.         $gcrik = $_POST['gcrik'];
  111.         $bcrik = $_POST['bcrik'];
  112.         $gfoot = $_POST['gfoot'];
  113.         $bfoot = $_POST['bfoot'];
  114.         $gnetb = $_POST['gnetb'];
  115.         $bhock = $_POST['bhock'];
  116.         $ghock = $_POST['ghock'];
  117.         $bleag = $_POST['bleag'];
  118.         $gsoft = $_POST['gsoft'];
  119.         $bunio = $_POST['bunio'];
  120.         $gtouc = $_POST['gtouc'];
  121.         $bsoft = $_POST['bsoft'];
  122.         $mixed = $_POST['mixed'];
  123.         $btouc = $_POST['btouc'];
  124.         $money = $_POST['money'];
  125.         $organiser = $_POST['organiser'];
  126.         $pemail = $_POST['oemail'];
  127.         $principal = $_POST['principal'];
  128.         $pemail = $_POST['pemail'];
  129.         $ip = gethostbyname($_SERVER['REMOTE_ADDR']);
  130.         //save the data on the DB
  131.         mysql_select_db($database_connection, $connection);
  132.         $insert_query = sprintf("INSERT INTO knockouts (schoolid, name, street, town, phone, fax, email, category, subcategory, in, out, baust, gbask, bbask, gcrik, bcrik, gfoot, bfoot, gnetb, bhock, ghock, bleag, gsoft, bunio, gtouc, bsoft, mixed, btouch, money, organiser, oemail, principal, pemail, ip) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,  %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, NOW(), %s)",
  133.                             sanitize($schoolid, "text"),
  134.                             sanitize($name, "text"),
  135.                             sanitize($street, "text"),
  136.                             sanitize($town, "text"),
  137.                             sanitize($phone, "text"),
  138.                             sanitize($fax, "text"),
  139.                             sanitize($seg, "text"),
  140.                             sanitize($email, "text"),
  141.                             sanitize($category, "text"),
  142.                             sanitize($subcategory, "text"),
  143.                             sanitize($in, "text"),
  144.                             sanitize($out, "text"),
  145.                             sanitize($baust, "text"),
  146.                             sanitize($gbask, "text"),
  147.                             sanitize($bbask, "text"),
  148.                             sanitize($gcrik, "text"),
  149.                             sanitize($bcrik, "text"),
  150.                             sanitize($gfoot, "text"),
  151.                             sanitize($bfoot, "text"),
  152.                             sanitize($gnetb, "text"),
  153.                             sanitize($bhock, "text"),
  154.                             sanitize($ghock, "text"),
  155.                             sanitize($bleag, "text"),
  156.                             sanitize($gsoft, "text"),
  157.                             sanitize($bunio, "text"),
  158.                             sanitize($gtouc, "text"),
  159.                             sanitize($bsoft, "text"),
  160.                             sanitize($mixed, "text"),
  161.                             sanitize($btouc, "text"),
  162.                             sanitize($money, "text"),
  163.                             sanitize($organiser, "text"),
  164.                             sanitize($oemail, "text"),
  165.                             sanitize($principal, "text"),
  166.                             sanitize($pemail, "text"),
  167.                             sanitize($ip, "text"));
  168.  
  169. //        $result = mysql_query($insert_query, $connection) or die(mysql_error());
  170.  
  171.         if($result) {
  172.             //send the email
  173.  
  174.             $to = "omariners@ozlists.com";
  175.             $subject = "New contact from the website";
  176.             //headers and subject
  177.             $headers  = "MIME-Version: 1.0\r\n";
  178.             $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  179.             $headers .= "From: ".$name." <".$email.">\r\n";
  180.             $body = "New Application<br />";
  181.             $body .= "Schoolid: ".$schoolid."<br />";
  182.             $body .= "School: ".$name."<br />";
  183.             $body .= "Address: ".$street."<br />";
  184.             $body .= "Suburb/Town: ".$town."<br />";
  185.             $body .= "Phone: ".$phone."<br />";
  186.             $body .= "Fax: ".$fax."<br />";
  187.             $body .= "in Zone: ".$in."<br />";
  188.             $body .= "out Zone: ".$out."<br />";
  189.             $body .= "Boys Australian Football: ".$baust."<br />";
  190.             $body .= "Girls Basketball: ".$gback."<br />";
  191.             $body .= "Boys Basketball: ".$bbask."<br />";
  192.             $body .= "Email: ".$email."<br />";
  193.             $body .= "IP: ".$ip."<br />";
  194.  
  195.             mail($to, $subject, $body, $headers);
  196.             //ok message
  197.             echo "Your message has been sent";
  198.     }
  199. }
  200. ?>
  201. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  202. <html xmlns="http://www.w3.org/1999/xhtml">
  203. <head>
  204. <meta content="en-ie" http-equiv="Content-Language" />
  205. <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  206. <title>Knockout Sports Competitions</title>
  207. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
  208. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  209. <meta name="Keywords" content="sports, pssa" />
  210. <meta http-equiv="pragma" content="no-cache" />
  211. <meta http-equiv="cache-control" content="no-cache" />
  212. <link rel="stylesheet" type="text/css" href="style.css" />
  213. <script type="text/javascript">
  214. function showUser(str)
  215. {
  216. if (str=="")
  217.   {
  218.   document.getElementById("txtHint").innerHTML="";
  219.   return;
  220.   }
  221. if (window.XMLHttpRequest)
  222.   {// code for IE7+, Firefox, Chrome, Opera, Safari
  223.   xmlhttp=new XMLHttpRequest();
  224.   }
  225. else
  226.   {// code for IE6, IE5
  227.   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  228.   }
  229. xmlhttp.onreadystatechange=function()
  230.   {
  231.   if (xmlhttp.readyState==4 && xmlhttp.status==200)
  232.     {
  233.     document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  234.     }
  235.   }
  236. xmlhttp.open("GET","getuser.php?q="+str,true);
  237. xmlhttp.send();
  238. }
  239. </script>
  240. <!--[if ie]>
  241. <style type="text/css">
  242. html { scrollbar-face-color: #ccccc2; scrollbar-shadow-color: #ccccc2; scrollbar-highlight-color: #ccccc2; scrollbar-3dlight-color: #ccccc2; scrollbar-darkshadow-color: #ccccc2; scrollbar-track-color: #e9e9e2; scrollbar-arrow-color: #e9e9e2; }
  243. </style>
  244. <![endif]-->
  245. <script language="JavaScript">
  246.     <!-- hide javascript from non-JavaScript browsers.
  247.         // This function calculates the total for items in the form which are selected
  248.     function calculateTotal(inputItem) {
  249.         with (inputItem.form) {
  250.             // process each of the different input types in the form.
  251.             if (inputItem.type == "radio") { // process radio buttons
  252.                 // subtract the previously selected radio button value from the total
  253.                 calculatedTotal.value = eval(calculatedTotal.value) - eval(previouslySelectedRadioButton.value);
  254.                 // save the current radio selection value
  255.                 previouslySelectedRadioButton.value = eval(inputItem.value);
  256.                 // add the current radio button selection value to the total
  257.                 calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value);
  258.             } else { // process check boxes
  259.                 if (inputItem.checked == false) { // item was uncheck. subtract item value from total
  260.                     calculatedTotal.value = eval(calculatedTotal.value) - eval(inputItem.value);
  261.                 } else { // item was checked. add the item value to the total
  262.                     calculatedTotal.value = eval(calculatedTotal.value) + eval(inputItem.value);
  263.                 }
  264.             }
  265.  
  266.             // total value should never be less than 0
  267.             if (calculatedTotal.value < 0) {
  268.                 InitForm();
  269.             }
  270.  
  271.             // return total value
  272.             return(formatCurrency(calculatedTotal.value));
  273.         }
  274.     }
  275.  
  276.     // format a value as currency.
  277.     function formatCurrency(num) {
  278.         num = num.toString().replace(/\$|\,/g,'');
  279.  
  280.         if(isNaN(num))
  281.            num = "0";
  282.  
  283.         sign = (num == (num = Math.abs(num)));
  284.         num = Math.floor(num*100+0.50000000001);
  285.         cents = num%100;
  286.         num = Math.floor(num/100).toString();
  287.  
  288.         if(cents<10)
  289.             cents = "0" + cents;
  290.  
  291.         for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  292.             num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3));
  293.  
  294.           return (((sign)?'':'-') + '$' + num + '.' + cents);
  295.     }
  296.  
  297.     // This function initialzes all the form elements to default values
  298.     function InitForm() {
  299.         //Reset values on form
  300.         document.selectionForm.total.value='$0';
  301.         document.selectionForm.calculatedTotal.value=0;
  302.         document.selectionForm.previouslySelectedRadioButton.value=0;
  303.  
  304.         //Set all checkboxes and radio buttons on form to unchecked:
  305.         for (i=0; i < document.selectionForm.elements.length; i++) {
  306.             if (document.selectionForm.elements[i].type == 'checkbox' | document.selectionForm.elements[i].type == 'radio') {
  307.                 document.selectionForm.elements[i].checked = false;
  308.             }
  309.         }
  310.  
  311.     }
  312.  
  313.     // end commenting javascript -->
  314.     </SCRIPT>
  315.  
  316. </head>
  317. <body onload="InitForm();" onreset="InitForm();">
  318. <div id="page">
  319. <div id="header">
  320. <h2 class="headertitle">Knockout Competition Nomination Form</h2>
  321. </div>
  322.  
  323.  
  324. <div id="entry">
  325. <div class="set1">
  326. <fieldset>
  327. <legend><strong>Details:</strong></legend>
  328. <?php
  329.     require_once('connection.php');
  330.     mysql_select_db("ozlists_pssa")or die( "<p><span style=\"color: red;\">Unable to select database</span></p>");
  331.         $search=$_POST['schoolid'];
  332.         $data = 'SELECT * FROM `schools` WHERE `schoolid` = "'.$search.'"';
  333.         $query = mysql_query($data) or die("Couldn't execute query. ". mysql_error());
  334.         $data2 = mysql_fetch_array($query);
  335. print_r($_POST);        
  336. ?>
  337. <?php
  338. if(isset($_REQUEST['lookup'])) {
  339. //first button was used
  340. }
  341. else if(isset($_REQUEST['total'])) {
  342. //second button was used
  343. }
  344. ?>
  345. <form name="total" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>">
  346. <ol>
  347. <li class="column1"><label for="schoolid"> ID:</label><input type="text" name="schoolid" value="<?php echo $data2[schoolid]?>"/><input class="details" type="submit" name="lookup" value="Lookup"></li></li>
  348. <li class="column1"><label for="name">Name:</label><input id="name" name="name" class="text" type="text" value="<?php echo $data2[name]?>"/></li>
  349. <li class="column1"><label for="street">Address:</label><input id="street" name="street"  class="text" type="text" value="<?php echo $data2[street]?>"/></li>
  350. <li class="column1"><label for="town">Town / Suburb:</label><input id="town" name="town"  class="text" type="text" value="<?php echo $data2[town]?>"/></li>
  351. <li class="column1"><label for="phone">Phone:</label><input id="phone" name="phone"  class="text" type="text" value="<?php echo $data2[phone]?>"/></li>
  352. <li class="column1"><label for="fax">Fax:</label><input id="fax" name="fax"  class="text" type="text" value="<?php echo $data2[fax]?>"/></li>
  353. <li class="column1"><label for="email">Email:</label><input id="email" name="email"  class="text" type="text" value="<?php echo $data2[email]?>"/></li>
  354. <li class="column2 reset"><img src="http://bytes.com/images/logo.png"/></li>
  355. </ol>
  356. </fieldset>
  357. </div>
  358. <!--end of set1-->
  359.  
  360. <div class="set2">
  361. <fieldset>
  362. <legend><strong>Sports Region and Zone:</strong></legend>
  363. <div id="both">
  364. <div id="cat">
  365. <?php
  366.     require_once('connection.php');
  367.     mysql_select_db("ozlists_pssa")or die( "<p><span style=\"color: red;\">Unable to select database</span></p>");
  368.  
  369. $cat=$_GET['cat']; // Use this line or below line if register_global is off
  370. if(strlen($cat) > 0 and !is_numeric($cat)){ // to check if $cat is numeric data or not.
  371. echo "Data Error";
  372. exit;
  373. }
  374. // Getting the data from Mysql table for first list box //
  375. $quer2=mysql_query("SELECT DISTINCT category,cat_id FROM category order by category");
  376. // End of query for first list box//
  377.  
  378. /////// for second drop down list we will check if category is selected else we will display all the subcategory/////
  379. if(isset($cat) and strlen($cat) > 0){
  380. $quer=mysql_query("SELECT DISTINCT subcategory FROM subcategory where cat_id=$cat order by subcategory");
  381. }else{$quer=mysql_query("SELECT DISTINCT subcategory FROM subcategory order by subcategory"); }
  382. ////////// end of query for second subcategory drop down list box ///////////////////////////
  383.  
  384. echo "<form method=post name=f1 action='send.php'>";
  385. /// Add your form processing page address to action in above line. Example  action=dd-check.php////
  386. //////////        Starting of first drop downlist /////////
  387. echo "<select name='cat' onchange=\"reload(f1)\"><option value=''>Select one</option>";
  388. while($noticia2 = mysql_fetch_array($quer2)) {
  389. if($noticia2['cat_id']==@$cat){echo "<option selected value='$noticia2[cat_id]'>$noticia2[category]</option>"."<BR>";}
  390. else{echo  "<option value='$noticia2[cat_id]'>$noticia2[category]</option>";}
  391. }
  392. echo "</select>";
  393. //////////////////  This will end the first drop down list ///////////
  394.  
  395.  
  396. //////////        Starting of second drop downlist /////////
  397. echo "<select name='subcat'><option value=''>Select one</option>";
  398. while($noticia = mysql_fetch_array($quer)) {
  399. echo  "<option value='$noticia[subcategory]'>$noticia[subcategory]</option>";
  400. }
  401. echo "</select>";
  402. //////////////////  This will end the second drop down list ///////////
  403. ?>
  404. </div>
  405. </div>
  406. <div id="right">
  407. <p>Please indicate <stong>where</strong> you would like to play your early round matches:</p>
  408. <p><input type="checkbox" name="location" value="in" />    in Zone&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  409. <input type="checkbox" name="location" value="out" />   out Zone</label></p>
  410. </div>
  411. </fieldset>
  412. </div>   <!--end of set2--  -- is no set 3 -->
  413. <div class="set4">
  414. <fieldset>
  415. <legend><strong>We wish to enter the following Sports:</strong></legend><br />
  416. <table align="center" cellpadding="5">
  417. <thead>
  418. <tr><th colspan="2">BOYS</th><th colspan="2">GIRLS</th></tr>
  419. </thead>
  420. <tbody>
  421. <tr>
  422. <td><h4>Australian Football</h4><p>Entries Close: 04.02.2011</p></td>
  423. <td><div class="checkbox"><input id="baust" type="checkbox" name="Australian Football"   value=10.00  onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  424. </div>  &nbsp;</td>
  425. <td><h4>Basketball</h4><p>Entries Close: 04.02.2011</p></td>
  426. <td><div class="checkbox">  <input id="gbask" type="checkbox" name="Basketball" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  427. </div>  &nbsp;</td>
  428. </tr>
  429. <tr>
  430. <td><h4>Basketball</h4><p>Entries Close: 04.02.2011</p></td>
  431. <td><div class="checkbox">  <input id="gbask" type="checkbox" name="Basketball" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  432. </div>  &nbsp;</td>
  433. <td><h4>Cricket</h4><p>Entries Close: 26.11.2010</p></td>
  434. <td><div class="checkbox">  <input id="gcric" type="checkbox" name="Cricket" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  435. </div>  &nbsp;</td>
  436. </tr>
  437. <tr>
  438. <td><h4>Cricket</h4><p>Entries Close: 26.11.2010</p></td>
  439. <td><div class="checkbox">
  440.   <input id="bcric" type="checkbox" name="Cricket" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  441. </div>  &nbsp;</td>
  442. <td><h4>Football</h4><p>Entries Close: 04.02.2011</p></td>
  443. <td><div class="checkbox">  <input type="checkbox" name="Football" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  444. </div>  &nbsp;</td>
  445. </tr>
  446. <tr>
  447. <td><h4>Football</h4><p>Entries Close: 04.02.2011</p></td>
  448. <td><div class="checkbox">
  449. <input id="bfoot" type="checkbox" name="Football" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  450. </div>  &nbsp;</td>
  451. <td><h4>Netball</h4><p>Entries Close: 04.02.2011</p></td>
  452. <td><div class="checkbox">  <input id="gnett" type="checkbox" name="Netball" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  453. </div></td>
  454. </tr>
  455. <tr>
  456. <td><h4>Hockey</h4><p>Entries Close: 04.02.2011</p></td>
  457. <td><div class="checkbox">
  458. <input id="bfoot" type="checkbox" name="Hockey" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  459. </div>  &nbsp;</td>
  460. <td><h4>Hockey</h4><p>Entries Close: 04.02.2011</p></td>
  461. <td><div class="checkbox">  <input id="ghock" type="checkbox" name="Hockey" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  462. </div></td>
  463. </tr>
  464. <tr>
  465. <td><h4>Rugby League</h4><p>Entries Close: 04.02.2011</p></td>
  466. <td><div class="checkbox">
  467.   <input id="brugb" type="checkbox" name="Rugby League" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  468. </div>  &nbsp;</td>
  469. <td><h4>Softball</h4><p>Entries Close: 17.12.2010</p></td>
  470. <td><div class="checkbox">  <input id="gsoft" type="checkbox" name="Softball" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  471. </div>  &nbsp;</td>
  472. </tr>
  473. <tr>
  474. <td><h4>Rugby Union</h4><p>Entries Close: 04.02.2011</p></td>
  475. <td><div class="checkbox">
  476.   <input id="brugb" type="checkbox" name="Rugby Union" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  477. </div><td><h4>Touch</h4><p>Entries Close: 04.02.2011</p></td>
  478. <td><div class="checkbox">  <input type="checkbox" name="Touch" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  479. </div></td>
  480. </tr>
  481. <tr>
  482. <td valign="top"><h4>Softball</h4><p>Entries Close: 04.02.2011</p></td>
  483. <td><div class="checkbox">
  484.   <input id="bsoft" type="checkbox" name="Softball" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  485. </div>  &nbsp;</td>
  486. <td><h4>Tennis Mixed<br />2 boys and 2 girls<br /></h3><p>Entries Close: 26.11.2010</p></td>
  487. <td><div class="checkbox"><input id="mixed" type="checkbox" name="mixed" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  488. </div></td></tr>
  489. <tr>
  490. <td><h4>Touch</h4><p>Entries Close: 04.02.2011</p></td>
  491. <td><div class="checkbox"><input type="checkbox" name="Touch" value=10.00 onclick="this.form.total.value=calculateTotal(this);">    Yes<br />
  492. </div></td>
  493. <td colspan="2"><h4>Total cost for number of teams entered:</h4>
  494.   <input type="hidden" name="calculatedTotal" value=0>
  495.   <input type="hidden" name="previouslySelectedcheckboxButton" value=0>
  496. <p>$10.00 per Entry:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="total" readonly onFocus="this.blur();"></p>
  497. </td>
  498. </tr>
  499. </tbody>
  500. </table>
  501. </fieldset>
  502. </div>
  503. <!--end of set4-->
  504. </div>
  505. <div class="set5">
  506. <fieldset>
  507. <legend><strong>Administration details:</strong></legend>
  508. <p>Please retain a copy of this form .</p>
  509. <p></p>
  510. <p>If this entry is incorrect or there are any related issues you should contact the NSWPSSA office immediately on 02&nbsp;9707&nbsp;6920.</p>
  511. <h4>Sports Organiser:&nbsp;&nbsp;&nbsp;
  512. <input type="text" name="organiser" class="s_org_name" value="Entry required" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Organisers's email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="pemail" value="Entry required" /></h4>
  513. <h4>Principal's name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="principal" value="Entry required" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Principal's email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="pemail" value="Entry required" /></h4>
  514. <input id="submit" class="submit" type="submit" name="submit" value="Submit">
  515. </fieldset>
  516. <!--end of set5-->
  517. </div>
  518. </form>
  519. <div id="footer" align="center"><img src="http://bytes.com/images/det_footer.png"></div>
  520. </div>
  521. </div>
  522. </body>
  523. </html>
Sep 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: James | last post by:
How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is a drop down list FROM: this is a drop down...
4
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
6
by: theouimets | last post by:
After submitting a form from a PHP script and using the back button I get a page cannot be displayed error. Everything works find except when the back button is used. Using IE with SP2 on Windows...
4
by: Andrea De Santi | last post by:
How can I redirect to another page with form data? In asp Classic I write: <form ... action="filename">...</form> and in then target page I write <%=request.form("fieldname")%> ..... but in...
25
by: Wim Cossement | last post by:
Hello, I was wondering if there are a few good pages and/or examples on how to process form data correctly for putting it in a MySQL DB. Since I'm not used to using PHP a lot, I already found...
4
by: Cerebral Believer | last post by:
Hi I need help! Forgive me I am a PHP newbie. I have a small script that enables me to send a form from an HTML page. I want to use the HTML formatted form because the design of my website is...
10
by: James | last post by:
Hello, as this falls under both VB and PHP I have posted this into two newsgroups (this is the first time I've done this so if it is mucked up then I'm sorry). Anyway I want to make some simple...
1
by: cooltoad | last post by:
I've tried to find a decent guide online as to how to do this, but all I run into is software. Basically I have a form that once submitted, produces calculations on the output page based on...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
3
by: 532054 | last post by:
when i fill this form i need to display data on my webpage how can i do this form page = http://rightmotion.com/reservation.php where i need to display data =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.