471,336 Members | 1,293 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Why won't this PHP/Javascript form POST to my MYSQL database?

Good morning ladies & gentlemen,

I'm trying to create a web form to insert info into my database using session variables. I'm at my wits end at this point. The reset button does its job but when you click submit it doesn't do anything. I'm using the template from the lynda.com essential php web form tutorials. Any help would be appreciated

Here is the client-side code I'm working with,

http://www.postmorebills.ca/user_registration.php

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.     header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
  4.       header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
  5.     header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
  6.     header ("Pragma: no-cache");                          // HTTP/1.0
  7.     session_start();
  8.  
  9.     if (!isset($_SESSION['SESSION'])) require ( "./include/session_init.php");
  10.  
  11.     $arVal = array();
  12.     require_once("./include/session_funcs1.php");
  13.  
  14.     // make sure the seesion vars are initialized...
  15.     reset ($arVal);
  16.     while (list ($key, $val) = each ($arVal)) {
  17.         if (!isset($_SESSION[$key])) $_SESSION[$key] = "";
  18.     }
  19.  
  20.     if ($_SESSION["eventgenre_sel"] == "") $_SESSION["eventgenre_sel"] = 0; 
  21.  
  22.     // if the bFlg is true then some validation problems in the data.
  23.     // namely a blank field or a submission without the feedback page.
  24.     // just present a general error...
  25.  
  26.     $flg = "";
  27.     $error = "";
  28.     if (isset($HTTP_GET_VARS["flg"])) $flg = $HTTP_GET_VARS["flg"];
  29.  
  30.     switch ($flg) {
  31.         case "red":
  32.             $error = "<br><font class=\"txt12_red\">Please fill out all the required fields.<br>Please Try Again.<BR></font>";
  33.             break;
  34.         case "blue":
  35.             $error = "<br><font class=\"txt12_red\">Your Session has Expired.<br>Please Try Again.</font><BR>";
  36.             break;
  37.         case "pink":
  38.             $error = "<br><font class=\"txt12_red\"><BR>The Special Code you entered is not valid.<br>Please Try Again or Leave that field blank.</font><BR>";
  39.             break;
  40.         case "white":
  41.             $error = "<br><font class=\"txt12_red\"><BR>The fields are too long for our Database.<br>Please correct your data via this form.</font><BR>";
  42.             break;
  43.         default:
  44.             $error = "";
  45.     }
  46.  
  47. ?>
  48.  
  49. <?php  echo $_SERVER['SCRIPT_NAME']."<BR>"; ?>
  50. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  51. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  52. <head>
  53. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  54.  
  55.  
  56. <link rel="stylesheet" type="text/css" href="detect800.css"/>
  57. <link rel="stylesheet" type="text/css" href="detect1024.css"/>
  58. <script type="text/javascript" src="jquery.js"></script>
  59. <script type="text/javascript" src="detect.js"></script>
  60. <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/ui.all.css" rel="stylesheet" type="text/css" />
  61. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
  62. <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js" type="text/javascript"></script>
  63. <script src="jquery.ui.datetimepicker.js" type="text/javascript"></script>
  64. <script type="text/javascript">
  65.      $(function() {
  66.         $('#eventdate').datetimepicker();
  67.      });
  68. </script> 
  69. <script src="imageflow.js" type="text/javascript"></script>
  70. <script src="highslide-full.js" type="text/javascript"></script>
  71. <script src="autosuggest.js" type="text/javascript"></script>
  72. <script type="text/javascript">
  73. hs.graphicsDir = 'graphics/';
  74. </script>
  75.  
  76. <script language="javascript">
  77.     function SubmitForm() {
  78.         var form = document.forms[0];
  79.         var bRequired = true;
  80.         if((form.eventname.value.length < 1) ||
  81.         (form.eventvenue.value.length < 1) ||
  82.         (form.eventdate.value.length < 1) ||
  83.         (form.eventgenre.value.length < 1) ||
  84.         (form.eventprice.value.length < 1) ||
  85.         (form.eventpromoter.value.length < 1) ||
  86.         (form.eventflyer.value.length < 1)) {
  87.             alert("Please fill out all the required fields.");
  88.             bRequired = false;
  89.         }
  90.  
  91.         if (!bRequired) return false;
  92.  
  93.         form.eventgenre_sel.value = form.state.selectedIndex;
  94.  
  95.         form.submit();
  96.     }
  97.  
  98.     function ResetForm() {
  99.         var form = document.forms[0];
  100.         form.eventname.value = "";
  101.         form.eventvenue.value = "";
  102.         form.eventdate.value = "";
  103.         form.eventgenre.value = "";
  104.         form.eventprice.value = "";
  105.         form.eventpromoter.value = "";
  106.         form.eventflyer.value = "";
  107.  
  108.         form.eventgenre_sel.value = "";
  109.     }
  110.  
  111. </script>
  112.  
  113. <title>Post More Bills ::: Where Calgary Shows Up</title>
  114. </head>
  115. <body>
  116.  
  117. <div id="shadow"><!-- shadow START -->
  118. <div id="header"><!-- header START -->
  119. <div id="splat">graffiti</div>
  120. <div id="splat2">graffiti</div>
  121. <h1><a href="/" title="Post More Bills | Where Calgary Shows Up">PostMoreBills.ca</a></h1>
  122. <blockquote>
  123. <p>Where Calgary Shows Up</p>
  124. </blockquote>
  125. </div><!-- header END -->
  126. <div id="navigation_bg"><!-- navigation START -->
  127. <ul id="navigation">
  128. <li><a class="home" href="index.php" title="Home"></a></li>
  129. <li><a class="post" href="post.php#container" title="Post A Bill"></a></li>
  130. <li><a class="blog" href="blog.php#container" title="Blog"></a></li>
  131. <li><a class="calendar" href="calendar.php#container" title="Calendar"></a></li>
  132. <li><a class="contact" href="contact.php#container" title="Contact"></a></li>
  133. </ul>
  134. </div><!-- navigation END -->
  135.  
  136.  
  137. <div id="Highslide" class="imageflow"> <!-- coverFlow START -->
  138.  
  139. <?php
  140. $dirname = "flyers/";
  141. $dir = opendir($dirname);
  142. $names = array();
  143. while(false != ($file = readdir($dir)))
  144. {
  145. if(($file != ".") and ($file != "..") and strpos($file, 'thumb_')===0 )
  146. {
  147. $val['thumb'] = $file;
  148. $val['img'] = substr($file, 6, strlen($file));
  149. $names[] = $val;
  150. }
  151. }
  152.  
  153. asort($names);
  154. foreach($names as $name) {
  155. echo "<img src=\"flyers/".$name['thumb']."\" longdesc=\"flyers/".$name['img']."\" alt=\"\" />\n";
  156. }
  157. ?>
  158. </div> <!-- coverFlow END -->
  159.  
  160. <form action="scripts/register.php" method="post" name="userevent" id="userevent">
  161.      <input name="eventgenre_sel" type="hidden" id="eventgenre_sel" value="<?php echo $_SESSION['eventgenre_sel'] ?>" />
  162.  
  163. <?php echo $error; ?>
  164.  
  165. <fieldset>
  166. <label for="eventname" accesskey="n" ><span>Event Name</span>
  167. <input type="text" name="eventname" id="eventname" value="<?php echo $_SESSION['eventname_sel']  ?>" size="32" maxlength="30" /></label>
  168.  
  169. <div id="autosuggest"><ul><li></li></ul></div>
  170. <label for="eventvenue" accesskey="v" ><span>Event Venue</span>
  171. <input type="text" name="eventvenue" id="eventvenue" size="32" value="<?php echo $_SESSION['eventvenue']  ?>" maxlength="30" /></label>
  172.  
  173. <script type="text/javascript">
  174. var venues = new Array("Republik", "HiFi Club", "Bamboo Tiki Room", "Tantra", "Jubilee Auditorium", "Ironwood Stage &amp; Grill", "Broken City", "Soda", "Amsterdam Rhino", "Olympic Plaza", "Stampede Casino", "Habitat Living Sound", "Cantos Music Foundation", "Flames Central", "Prince's Island Park", "Beat Niq Jazz &amp; Social Club", "Giuseppe's Italian Market", "BLVD", "Fourth on 4th", "Opus on 8th", "Local 510", "Local 522", "Raw Bar", "Jupiter Restaurant &amp; Bar", "Vern's", "Lord Nelson's", "Kings Head Pub", "Blind Beggar Pub", "Viscous Circle", "Milk Tiger Lounge", "Pengrowth Saddledome", "Tubby Dog", "Marquee Room", "Distillery Public House", "Cafe Koi", "Mikey's Juke Joint &amp; Eatery", "Palomino", "Atlantic Trap &amp; Gill", "Drake Inn", "Radiopark Music Room", "Rusty Cage South", "Big Al's Good Times Bar", "Rose &amp; Crown", "Tudor Rose Pub", "Elbow River Casino &amp; Lounge", "Rusty Cage Central", "Rusty Cage South", "Rusty Cage North", "Olive Grove", "Shamrock Hotel", "Woody's Taphouse Southland", "Woody's Taphouse Country Hills", "Murrieta's West Coast Bar &amp; Grill", "Stageline Saloon", "Pig &amp; Pint", "Ranchman's", "Red Pepper Pub", "Stavro's Steak House &amp; Lounge Ranchlands", "Stageline Saloon", "Whiskey");
  175. new AutoSuggest(document.getElementById("eventvenue"),venues);
  176. </script>
  177.  
  178. <label for="eventdate" accesskey="d" ><span>Event Date</span>
  179. <input type="text" name="eventdate" id="eventdate" value="<?php echo $_SESSION['eventdate']  ?>" size="32" maxlength="30" /></label>
  180.  
  181. <label for="eventgenre" accesskey="g" ><span>Event Genre</span>
  182. <select name="eventgenre" id="eventgenre">
  183. <option value="none">--select one--</option>
  184. <option value="HipHop">Hip-Hop</option>
  185. <option value="Funk">Funk</option>
  186. <option value="Soul">Soul</option>
  187. <option value="Metal">Metal</option>
  188. <option value="Punk">Punk</option>
  189. <option value="Blues">Blues</option>
  190. <option value="Jazz">Jazz</option>
  191. <option value="Trance">Trance</option>
  192. <option value="Breaks">Breaks</option>
  193. <option value="Electro">Electro</option>
  194. <option value="House">House</option>
  195. <option value="DNB">Drum'N'Bass</option>
  196. <option value="Dubstep">Dubstep</option>
  197. <option value="Lounge">Lounge</option>
  198. <option value="Top40">Top 40</option>
  199. </select>
  200. </label>
  201.  
  202. <label for="eventprice" accesskey="p" ><span id="eventprice">Event Price</span>
  203. <input type="text" name="eventprice" id="eventprice" value="<?php echo $_SESSION['eventprice']  ?>" size="6" maxlength="4"/></label>
  204.  
  205. <label for="eventpromoter" accesskey="c" ><span id="eventpromoter">Event Promoter</span>
  206. <input type="text" name="eventpromoter" id="eventpromoter" value="<?php echo $_SESSION['eventpromoter']  ?>" size="25" maxlength="23"/></label>
  207.  
  208. <label for="eventflyer" accesskey="f" ><span id="eventflyer">Event Flyer (jpg or png MAX 300kb)</span>
  209. <input type="file" name="eventflyer" id="eventflyer" value="<?php echo $_SESSION['eventflyer']  ?>" size="25" maxlength="23"/></label>
  210.  
  211.  
  212.  
  213. <input type="button" name="Reset" value="Reset" onclick="ResetForm();">                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  214. <input type="button" name="Submit" value="Submit" onsubmit="return validateForm(this);" onclick="SubmitForm();  return false; " >
  215.  
  216. </fieldset>
  217. </form>
  218. <script language="javascript">
  219.     // set the selection box values...
  220.  
  221.     var form = document.forms[0];
  222.         form.eventgenre.selectedIndex = parseInt("<?php echo $_SESSION['eventgenre_sel'] ?>");
  223.  
  224. </script>
  225. </body>
  226. </html>
  227.  




And here is the server-side code.

http://postmorebills.ca/include/register.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $debug = FALSE;
  4.  
  5. /************************************************************
  6.    Adjust the headers...
  7. ************************************************************/
  8.     header("Expires: Thu, 17 May 2001 10:17:17 GMT");    // Date in the past
  9.       header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
  10.     header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
  11.     header ("Pragma: no-cache");                          // HTTP/1.0
  12.  
  13. /*****************************************************************************
  14.    Check the session details.
  15.    we will store all the post variables in session variables
  16.    this will make it easier to work with the verification routines
  17. *****************************************************************************/
  18.     session_start();
  19.  
  20.  
  21.     if (!isset($_SESSION['SESSION'])) require_once( "include/session_init.php" );
  22.  
  23.     $arVal = array();
  24.     require_once("include/session_funcs1.php");
  25.  
  26.     reset ($_POST);
  27.     while (list ($key, $val) = each ($_POST)) {
  28.         if ($val == "") $val = "NULL";
  29.         $arVals[$key] = (get_magic_quotes_gpc()) ? $val : addslashes($val); 
  30.         if ($val == "NULL")
  31.             $_SESSION[$key] = NULL;
  32.         else
  33.             $_SESSION[$key] = $val;
  34.  
  35.         if ($debug) echo $key . " : " . $arVals[$key] . "<br>";
  36.     }
  37.  
  38. /**********************************************************************************************
  39.    Make sure session variables have been set and then check for required fields
  40.    otherwise return to the registration form to fix the errors.
  41. **********************************************************************************************/
  42.  
  43.     // check to see if these variables have been set...
  44.     if ((!isset($_SESSION["eventname"])) || (!isset($_SESSION["eventvenue"])) || (!isset($_SESSION["eventdate"])) ||  (!isset($_SESSION["eventgenre"]))
  45.          || (!isset($_SESSION["eventprice"])) || (!isset($_SESSION["eventpromoter"])) || (!isset($_SESSION["eventflyer"]))) {
  46.          resendToForm("?flg=red");
  47.     }
  48.         // form variables must have something in them...
  49.     if ($_SESSION['eventname'] == "" || $_SESSION['eventvenue'] == "" || $_SESSION['eventdate'] == "" || $_SESSION['eventgenre'] == "" || $_SESSION['eventprice'] == "" || $_SESSION['eventpromoter'] == "" || $_SESSION['eventflyer'] == "") {
  50.         resendToForm("?flg=red");
  51.     }
  52.  
  53.     // make sure fields are within the proper range...
  54.     if (strlen($_SESSION['eventname']) > 35 || strlen($_SESSION['eventvenue']) > 35
  55.         || strlen($_SESSION['eventdate']) > 35 || strlen($_SESSION['eventgenre']) > 35 
  56.         || strlen($_SESSION['eventprice']) > 35 || strlen($_SESSION['eventpromoter']) > 35 
  57.         || strlen($_SESSION['eventflyer']) > 35 ) {
  58.         resendToForm("?flg=white");
  59.     }
  60.  
  61. /**********************************************************************************************
  62.   Insert into the database...
  63. **********************************************************************************************/
  64.  
  65.     $query = "INSERT INTO td_events (seventname, seventvenue, seventdate, seventgenre, seventprice, seventpromoter, seventflyer) "
  66.         ."VALUES (".$arVals['eventname'].", ".$arVals['eventvenue'].", ".$arVals['eventdate'].", ".$arVals['eventgenre']
  67.         .", ".$arVals['eventprice'].", ".$arVals['eventpromoter'].", ".$arVals['eventflyer'].")";
  68.  
  69.     //echo $query;
  70.  
  71.     $result = mysql_query($query) or die("Invalid query: " . mysql_error() . "<br><br>". $query);
  72.     $insertid = mysql_insert_id();
  73.  
  74.         /*** This following function will update session variables and resend to the form so the user can fix errors ***/
  75.  
  76.     function resendToForm($flags) {
  77.             reset ($_POST);
  78.             // store variables in session...
  79.             while (list ($key, $val) = each ($_POST)) {
  80.                 $_SESSION[$key] = $val;
  81.             }    
  82.             // go back to the form...
  83.             //echo $flags;
  84.             header("Location: ./user_registration.php".$flags);
  85.             exit;
  86.     }
  87.  
  88. ?>
  89. <p>SUCCESS!<br>
  90.   The event was entered in the database!<br>
  91.   You probably want to redirect to a thank you page or send an email to the user for confirmation.<br>
  92.   <br>
  93.   <br>
  94.   Here are the variables...<br>
  95.  
  96. <?php
  97.     reset ($arVals);
  98.     while (list ($key, $val) = each ($arVals)) {
  99.         echo $key . " : " . $arVals[$key] . "<br>";
  100.     }
  101.  
  102.     echo "<br><br>The SQL Statment was:<br>";
  103.     echo $query."<br><br><br><br>";
  104. ?>
  105. </p>
  106. <p>&nbsp;</p>
  107. <p>&nbsp;</p>
  108. <p>&nbsp;</p>
  109. <p>&nbsp;</p>
  110. <p>&nbsp;</p>
  111. <p>&nbsp;</p>
  112. <p>&nbsp;</p>
  113.  
  114.  
  115. <?php
  116. /**********************************************************************************************
  117.  
  118.    CREATES THUMBNAIL
  119.  
  120. **********************************************************************************************/
  121.  
  122.  //define a maxim size for the uploaded images
  123.  define ("MAX_SIZE","1024"); 
  124.  // define the width and height for the thumbnail
  125.  // note that theese dimmensions are considered the maximum dimmension and are not fixed, 
  126.  // because we have to keep the image ratio intact or it will be deformed
  127.  define ("WIDTH","500"); 
  128.  define ("HEIGHT","650"); 
  129.  
  130.   // this is the function that will create the thumbnail image from the uploaded image
  131.  // the resize will be done considering the width and height defined, but without deforming the image
  132.  function make_thumb($img_name,$filename,$new_w,$new_h)
  133.  {
  134.      //get image extension.
  135.      $ext=getExtension($img_name);
  136.      //creates the new image using the appropriate function from gd library
  137.      if(!strcmp("jpg",$ext) || !strcmp("jpeg",$ext) || !strcmp("JPG",$ext))
  138.          $src_img=imagecreatefromjpeg($img_name);
  139.  
  140.       if(!strcmp("png",$ext) || !strcmp("PNG",$ext))
  141.          $src_img=imagecreatefrompng($img_name);
  142.  
  143.           //gets the dimmensions of the image
  144.      $old_x=imageSX($src_img);
  145.      $old_y=imageSY($src_img);
  146.  
  147.       // next we will calculate the new dimmensions for the thumbnail image
  148.      // the next steps will be taken: 
  149.      //     1. calculate the ratio by dividing the old dimmensions with the new ones
  150.      //    2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable
  151.      //        and the height will be calculated so the image ratio will not change
  152.      //    3. otherwise we will use the height ratio for the image
  153.      // as a result, only one of the dimmensions will be from the fixed ones
  154.      $ratio1=$old_x/$new_w;
  155.      $ratio2=$old_y/$new_h;
  156.      if($ratio1>$ratio2)    {
  157.          $thumb_w=$new_w;
  158.          $thumb_h=$old_y/$ratio1;
  159.      }
  160.      else    {
  161.          $thumb_h=$new_h;
  162.          $thumb_w=$old_x/$ratio2;
  163.      }
  164.  
  165.       // we create a new image with the new dimmensions
  166.      $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
  167.  
  168.      // resize the big image to the new created one
  169.      imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 
  170.  
  171.      // output the created image to the file. Now we will have the thumbnail into the file named by $filename
  172.      if(!strcmp("png",$ext))
  173.          imagepng($dst_img,$filename); 
  174.      else
  175.          imagejpeg($dst_img,$filename); 
  176.  
  177.       //destroys source and destination images. 
  178.      imagedestroy($dst_img); 
  179.      imagedestroy($src_img); 
  180.  }
  181.  
  182.  // This function reads the extension of the file. 
  183.  // It is used to determine if the file is an image by checking the extension. 
  184.  function getExtension($str) {
  185.          $i = strrpos($str,".");
  186.          if (!$i) { return ""; }
  187.          $l = strlen($str) - $i;
  188.          $ext = substr($str,$i+1,$l);
  189.          return $ext;
  190.  }
  191.  // This variable is used as a flag. The value is initialized with 0 (meaning no error found) 
  192.  // and it will be changed to 1 if an error occurs. If the error occurs the file will not be uploaded.
  193.  $errors=0;
  194.  // checks if the form has been submitted
  195.  if(isset($_POST['Submit']))
  196.  {
  197.  //reads the name of the file the user submitted for uploading
  198.      $image=$_FILES['eventflyer']['name'];
  199.      // if it is not empty
  200.      if ($image) 
  201.      {
  202.          // get the original name of the file from the clients machine
  203.          $filename = stripslashes($_FILES['eventflyer']['name']);
  204.  
  205.          // get the extension of the file in a lower case format
  206.           $extension = getExtension($filename);
  207.          $extension = strtolower($extension);
  208.          // if it is not a known extension, we will suppose it is an error, print an error message 
  209.          // and will not upload the file, otherwise we continue
  210.          if (($extension != "jpg")  && ($extension != "jpeg") && ($extension != "JPG") && ($extension != "PNG") && ($extension != "png"))    
  211.          {
  212.              echo '<h1>Unknown extension!</h1>';
  213.              $errors=1;
  214.          }
  215.          else
  216.          {
  217.              // get the size of the image in bytes
  218.              // $_FILES[\'image\'][\'tmp_name\'] is the temporary filename of the file in which 
  219.             // the uploaded file was stored on the server
  220.              $size=getimagesize($_FILES['eventflyer']['tmp_name']);
  221.              $sizekb=filesize($_FILES['eventflyer']['tmp_name']);
  222.  
  223.              //compare the size with the maxim size we defined and print error if bigger
  224.              if ($sizekb > MAX_SIZE*500)
  225.              {
  226.                  echo '<h1>You have exceeded the size limit!</h1>';
  227.                  $errors=1;
  228.              }
  229.  
  230.               //we will give an unique name, for example the time in unix time format
  231.              $image_name=$filename;
  232.              //the new name will be containing the full path where will be stored (images folder)
  233.               $newname="flyers/".$image_name;
  234.              $copied = copy($_FILES['eventflyer']['tmp_name'], $newname);
  235.              //we verify if the image has been uploaded, and print error instead
  236.              if (!$copied) 
  237.              {
  238.                  echo '<h1>Copy unsuccessfull!</h1>';
  239.                  $errors=1;
  240.              }
  241.              else
  242.              {
  243.                  // the new thumbnail image will be placed in images/thumbs/ folder
  244.                  $thumb_name='flyers/thumb_'.$image_name;
  245.                  // call the function that will create the thumbnail. The function will get as parameters 
  246.                  // the image name, the thumbnail name and the width and height desired for the thumbnail
  247.                  $thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT);
  248.              }}    }}
  249.  
  250.   //If no errors registred, print the success message and show the thumbnail image created
  251.  if(isset($_POST['Submit']) && !$errors) 
  252.  {
  253.      echo "<h1>Thumbnail created Successfully!</h1>";
  254.      echo '<img src="'.$thumb_name.'">';
  255.  }
  256. ?>
  257.  


The reference file session_funcs1.php look like this.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.         $arVals = array("eventname"=>"", "eventvenue"=>"", "eventdate"=>"", "eventgenre"=>"", "eventgenre_sel"=>"", "eventprice"=>"", "eventpromoter"=>"", "eventflyer"=>"");
  4.  
  5. ?>
  6.  
The reference file session_init.php look like this.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $_SESSION['APP_MX'] = "http://www.postmorebills.ca";
  3.     $_SESSION['APP_SERVER'] = "http://www.postmorebills.ca";
  4.     $_SESSION['SITE_EMAIL'] = "test@testing.com";
  5.  
  6.     $_SESSION['MYSQL_SERVER1'] = "http://phpmyadmin2.ehost-services.com/index.php";
  7.     $_SESSION['MYSQL_LOGIN1'] = "**********";
  8.     $_SESSION['MYSQL_PASS1'] = "*********";
  9.     $_SESSION['MYSQL_DB1'] = "*******";
  10.  
  11.     $_SESSION['LOGGEDIN'] = "";
  12.     $_SESSION['USERID'] = 0;
  13.  
  14.     $_SESSION['EMAIL'] = "";
  15.     $_SESSION['FNAME'] = "";
  16.     $_SESSION['LNAME'] = "";
  17.  
  18.     $_SESSION['SESSION'] = true;
  19.  
  20. ?>
  21.  
Nov 23 '10 #1
2 3516
JKing
1,206 Expert 1GB
You have a javascript error on your user registration page. The error is "form.state is undefined" Line 93 on the code you posted. form.eventgenre_sel.value = form.state.selectedIndex;
Nov 23 '10 #2
amazing! thank you!!
Nov 23 '10 #3

Post your reply

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

Similar topics

10 posts views Thread by Dan Weeb | last post: by
1 post views Thread by minstrel80232 | last post: by
7 posts views Thread by Thomas Kirk | last post: by
6 posts views Thread by Bob Sanderson | last post: by
1 post views Thread by rh1200la | last post: by
12 posts views Thread by mistral | last post: by
reply views Thread by rosydwin | last post: by

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.