loganbest Posted March 8, 2007 Share Posted March 8, 2007 When I submit a form all it does is go to a blank white page. Here is my form page: <?php include ('functions.php'); session_start(); if (isset($_GET['register'])){ register($redirect); } ?> <HTML> <HEAD> <TITLE>SCGC Program Registration</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251"> <link rel="stylesheet" href="main.css" type="text/css"> <style type="text/css"> #popitmenu{ position: absolute; background-color: white; border:1px solid black; font: normal 12px Verdana; line-height: 18px; z-index: 100; visibility: hidden; } a.popitmenu{ color:gray; } </style> <script type="text/javascript"> var defaultMenuWidth="150px" //set default menu width. var linkset=new Array() //SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT linkset[0]='Enter your groups name here. <br>Example:<br>Mount Juliet High School Winter Drumline.' linkset[1]='Enter your groups Show Name and Music here.' linkset[2]='Enter the Name(s) of your groups directors<br>Example:<br>Tony Cox.' linkset[3]='Enter the Names of your groups members here.' linkset[4]='<img src="http://mjhsband.org/images/drumline.jpg">' linkset[5]='Enter the email address you want to be contacted with.' linkset[6]='Enter the phone number you want to be contacted with.' ////No need to edit beyond here var ie5=document.all && !window.opera var ns6=document.getElementById if (ie5||ns6) document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>') function iecompattest(){ return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body } function showmenu(e, which, optWidth){ if (!document.all&&!document.getElementById) return clearhidemenu() menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu") menuobj.innerHTML=which menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth menuobj.contentwidth=menuobj.offsetWidth menuobj.contentheight=menuobj.offsetHeight eventX=ie5? event.clientX : e.clientX eventY=ie5? event.clientY : e.clientY //Find out how close the mouse is to the corner of the window var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<menuobj.contentwidth) //move the horizontal position of the menu to the left by it's width menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px" else //position the horizontal position of the menu where the mouse was clicked menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px" //same concept with the vertical position if (bottomedge<menuobj.contentheight) menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px" else menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px" menuobj.style.visibility="visible" return false } function contains_ns6(a, b) { //Determines if 1 element in contained in another- by Brainjar.com while (b.parentNode) if ((b = b.parentNode) == a) return true; return false; } function hidemenu(){ if (window.menuobj) menuobj.style.visibility="hidden" } function dynamichide(e){ if (ie5&&!menuobj.contains(e.toElement)) hidemenu() else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) hidemenu() } function delayhidemenu(){ delayhide=setTimeout("hidemenu()",500) } function clearhidemenu(){ if (window.delayhide) clearTimeout(delayhide) } if (ie5||ns6) document.onclick=hidemenu </script> </HEAD> <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 background="images/bgb.gif"> <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="336"><img src="images/index_01.jpg" width=336 height=95 alt=""></td> <td width="444" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td background="images/index_02.gif" height="30"> </td> </tr> <tr> <td background="images/spacer.gif" width="415" height="47"><font face="tahoma" color="gray" size="5"><b>SCGC Program Registration</b></font> <!--<img src="images/spacer.gif" width=415 height=47 alt="" border="0">--></td> </tr> </table> </td> </tr> </table> <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="778" height="153"> <param name="movie" value="1.swf"> <param name="quality" value="high"> <embed src="1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="778" height="153"></embed></object></td> </tr> </table> <table width="780" border="0" cellspacing="0" cellpadding="0" background="images/index_14.gif"> <tr> <td width="161"><img src="images/index_13.gif" width=161 height=35 alt=""></td> <td width="538"> </td> <td width="81"><a href="#"><img src="images/index_16.gif" width=22 height=35 alt="" border="0"></a><a href="#"><img src="images/index_17.gif" width=27 height=35 alt="" border="0"></a><a href="#"><img src="images/index_18.gif" width=23 height=35 alt="" border="0"></a></td> </tr> </table> <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="161" background="images/index_20.gif"> <table width="161" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="161" class="v11g"> <form action="admin.php" method="post"> <input type="text" name="username" size="12"> <br> username <br> <input type="password" name="password" size="12"> <INPUT TYPE="image" SRC="images/index_31.gif" HEIGHT="23" name="submit" id="submit" value="submit" WIDTH="27" BORDER="0"> <br> password </form> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="20"><img src="images/index_37.gif" width=161 height=6 alt=""></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right"><img src="images/index_40.gif" width=58 height=26 alt="" border="0"> </td> </tr> </table> </td> <td background="images/index_28.gif"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td background="images/index_25.gif"><img src="images/index_24.gif" width=335 height=47 alt=""></td> </tr> </table> <table width="619" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="309"> <script language="JavaScript"> <!-- function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("group_name", "group_contact_email", "group_type", "group_contact_phone"); // Enter field description to appear in the dialog box var fieldDescription = Array("Group Name", "Contact Email", "Group Type", "Contact Phone Number"); // dialog message var alertMsg = "Please complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i function checkmail(e){ var returnval=emailfilter.test(e.value) if (returnval==false){ alert("Please enter a valid email address.") e.select() } return returnval } // --> </script> <center><?php if (isset($redirect)) { print $redirect; } else {?> </center> <form action="register.php" method="post" onsubmit="return formCheck(this);"> <table width="100%" border="0" cellspacing="0" cellpadding="1"> <tr> <td> <span class="v11r">? Group Name</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">example</a>)</font><br> <input type="text" name="group_name"><br> <span class="v11r">? Group Type</span><br> Guard<input type="radio" name="group_type" value="guard"> Percussion<input type="radio" name="group_type" value="percussion"><br> <span class="v11r">? Group City, State</span><br> <input type="text" name="city"> <select name="state"> <option selected value=""></option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="DC">District Of Columbia</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> <br> <span class="v11r">? Group Staff</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[2])" onMouseout="delayhidemenu()">example</a>)</font><br> <input type="text" name="group_director"><br> <span class="v11r">? Group Contact Email</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[5])" onMouseout="delayhidemenu()">example</a>)</font><br> <input type="text" name="group_contact_email"><br> <span class="v11r">? Group Contact Phone #</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[6])" onMouseout="delayhidemenu()">example</a>)</font><br> <input type="text" name="group_contact_phone"><br> <span class="v11r">? Group Show Name/Music</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[1])" onMouseout="delayhidemenu()">example</a>)</font><br> <textarea name="group_info" cols="73" rows="25"></textarea><br> <span class="v11r">? Group Picture</span> <font color="gray">(<a href="#" class="popitmenu" onMouseover="showmenu(event,linkset[4])" onMouseout="delayhidemenu()">example</a>)</font><br> <input type="hidden" name="MAX_FILE_SIZE" value="99999999999" /> <input width="100%" type="file" name="group_image"><br><br><br><br><br> <input name="cancel" type="reset" value="Cancel"> <input name="preview" type="button" value="Preview" onclick="window.open('/scgc/preview.php')"> <input name="submit" type="submit" value="Submit" onClick="return checkmail(this.form.group_contact_email)"><br>Please be patient for image upload if clicking on Preview or Submit. </td> </tr> </table> </form> <?php } ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <table width="780" border="0" cellspacing="0" cellpadding="0" height="34" background="images/index_48.gif"> <tr> <td> </td> </tr> </table> <table width="780" border="0" cellspacing="0" cellpadding="0" height="65" background="images/index_51.gif"> <tr> <td width="390" align="center" class="bottom"> <b><font color="#FAA6A6"><span class="v11r">Designed by Logan Best.</span></font></b></td> <td width="390" align="center" class="v11r">©2007 Mjhsband.org. All rights reserved</td> </tr> </table> </BODY> </HTML> Here is my functions.php section that is of concern: /********************* * Register * *********************/ /* The register function is for the groups to enter their info for the Program */ function register(& $Ref_redirect) { $name = $_POST['group_name']; $type = $_POST['group_type']; $city = $_POST['city']; $state = $_POST['state']; $staff = $_POST['group_staff']; $email = $_POST['group_contact_email']; $phone = $_POST['group_contact_phone']; $info = $_POST['group_info']; $_SESSION['group_name'] = $_POST['group_name']; $_SESSION['group_type'] = $_POST['group_type']; $_SESSION['city'] = $_POST['state']; $_SESSION['group_director'] = $_POST['group_director']; $_SESSION['group_contact_email'] = $_POST['group_contact_email']; $_SESSION['group_contact_phone'] = $_POST['group_contact_phone']; $_SESSION['group_info'] = $_POST['group_info']; $_SESSION['group_image'] = $_POST['group_image']; $images_dir="images/groups/"; $images_name=$_FILES['group_image']['name']; $images_tmp=$_FILES['group_image']['tmp_name']; $image_size = $_FILES['group_image']['size']; $image_type = $_FILES['group_image']['type']; $upload_file = $images_dir. basename($images_name); move_uploaded_file($images_tmp, $upload_file); dbconnect(); $insert_group = "INSERT INTO groups VALUES ('','$name','$type','$city','$state','$staff','$email','$phone', '$info', '$images_name')"; $SQL=mysql_query($insert_group); mysql_close(); $redirect=' <br /> <link href="main.css" rel="stylesheet" type="text/css"> <center> <table width="500" height="40" border="0"> <tr> <td><div align="center">Your group\'s information has been sent. Thank you. Redirecting.</div></td> </tr> </table></center>'; header("Refresh: 2; url=thankyou.php"); } Quote Link to comment Share on other sites More sharing options...
skali Posted March 8, 2007 Share Posted March 8, 2007 Try using: ini_set('error_reporting', E_ALL); Quote Link to comment Share on other sites More sharing options...
loganbest Posted March 8, 2007 Author Share Posted March 8, 2007 I get nothing still. Quote Link to comment Share on other sites More sharing options...
loganbest Posted March 10, 2007 Author Share Posted March 10, 2007 ok so I went through every single letter of code and found out that I had just simply forgot to put an underscore in db_connect() when I called the function in the register function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.