Jump to content

searls03

Members
  • Posts

    907
  • Joined

  • Last visited

Everything posted by searls03

  1. Ok, so I want to basically be able to update multiple member statuses at once......basically I want to display a list of members that will have a textbox by them to enter data..........then I can type in each of the data that I need and it will update each and every profile with the correct data for that member.....can anyone help me figure a way to do this.....
  2. Why has this code stopped working, i had it working, but now it is not...........It is an update profile page but when i click save, it is trying to post my username to the database instead of the persons I am updating......help!!!!!!!! <?php } //action: edit user ----------------------------------------------------------------------------- if (isset($_GET['edit']) && isset($_GET['id'])) { $userid = (int) $_GET['id']; if ($userid == 0) { die("Invalid ID provided."); } //execution when completed the edit user form and pressed submit button --------------------- if (isset($_POST['editUser'])) { //validate data ------------------------------------------------------------------------ //check email validation, the function is available at config.php //check both passwords are the same when password fields are not empty //end validate data --------------------------------------------------------------------- //save to database when no errors are detected ------------------------------------------ if (count($error) == 0) { $query = "UPDATE members SET username='".$username."', email='".$email."',name='".$name."', phone='".$phone."',address='".$address."', city='".$city."',state='".$state."', zip='".$zip."',cell='".$cell."', accounttype='".$accounttype."',badges='".$badges."', rank='".$rank."' WHERE userid='".$userid."' "; //update username session if you edit yourself if ($userid == $_SESSION['auth_admin_userid']) { $_SESSION['auth_admin_username'] = $username; } if (mysql_query($query)) { echo "<p><strong>User has been edited and saved to the database.</strong></p>"; } else { echo "<strong>User has NOT been edited and saved into the database. ".mysql_error()."</strong>"; } } } //get user from the database and put data into $_POST variables. $rs = mysql_query("SELECT name, username, phone, address, city, state, zip, cell, email, badges, rank, accounttype FROM members WHERE userid = ".$userid.""); if (mysql_num_rows($rs) == 0) { die("User does not exists!"); } $row = mysql_fetch_assoc($rs); $_POST['name'] = $row['name']; $_POST['username'] = $row['username']; $_POST['phone'] = $row['phone']; $_POST['address'] = $row['address']; $_POST['city'] = $row['city']; $_POST['state'] = $row['state']; $_POST['zip'] = $row['zip']; $_POST['cell'] = $row['cell']; $_POST['email'] = $row['email']; $_POST['badges'] = $row['badges']; $_POST['rank'] = $row['rank']; $_POST['accounttype'] = $row['accounttype']; //if is admin, then $_POST['admin'] exists ?> <div id="TabbedPanels1" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">My Info</li> <li class="TabbedPanelsTab" tabindex="0">Merit Badges</li> <li class="TabbedPanelsTab" tabindex="0">Scout Rank</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"> <form action="admin.php?edit&id=<?php echo $userid;?>" method="post"> <table align="center" cellpadding="8" cellspacing="8"> <tr> <td><div align="right">Name:</div></td> <td> <p><input type="text" name="name" value='<?php echo $_POST['name'];?>' /> <?php echo(isset($error['name']))?$error['name']:"";?></p></td> </tr> <tr> <td>Phone Number:</td> <td><input type="text" name="phone" value='<?php echo $_POST['phone'];?>' /> <?php echo(isset($error['phone']))?$error['phone']:"";?></td> </tr> <tr> <td><div align="right">Address:</div></td> <td><input type="text" name="address" value='<?php echo $_POST['address'];?>' /> <?php echo(isset($error['address']))?$error['address']:"";?></td> </tr> <tr> <td><div align="right">City:</div></td> <td><input type="text" name="city" value='<?php echo $_POST['city'];?>' /> <?php echo(isset($error['city']))?$error['city']:"";?></td> </tr> <tr> <td><div align="right">State:</div></td> <td><input type="text" name="state" value='<?php echo $_POST['state'];?>' /> <?php echo(isset($error['state']))?$error['state']:"";?></td> </tr> <tr> <td><div align="right">Zip Code:</div></td> <td><input type="text" name="zip" value='<?php echo $_POST['zip'];?>' /> <?php echo(isset($error['zip']))?$error['zip']:"";?></td> </tr> <tr> <td><div align="right">Email:</div></td> <td> <p> <input type="text" name="email" value='<?php echo $_POST['email'];?>' /> <?php echo(isset($error['email']))?$error['email']:"";?></p></td> </tr> <tr> <td><div align="right">Cell Phone:</div></td> <td><input type="text" name="cell" value='<?php echo $_POST['cell'];?>' /> <?php echo(isset($error['cell']))?$error['cell']:"";?></td> </tr> <tr> <td class="aaaaaaa" align="right">Username:</td> <td><label for="username"></label> <input type="text" name="username" value='<?php echo $_POST['username'];?>' /> <?php echo(isset($error['username']))?$error['username']:"";?></p> </td> </tr> </table> <p> </p> <input name="editUser" type="submit" value="Save" /> <input type="hidden" name="userid" value="<?php echo $userid; ?>" /> </form> </div> <div class="TabbedPanelsContent"> <label for="badges"></label> <input name="badges" type="text" id="badges" value="<?php echo "$badges"; ?>" /> </div> <div class="TabbedPanelsContent"> <input name="rank" type="text" id="rank" value="<?php echo $rank; ?>" /> </div> </div> </div> <script type="text/javascript"> var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); </script> <?php } ?>
  3. with what they had given me, they had to actually have the decrypted one put in first and then it had to encrypt it, then you could go back and decrypt it..........I am looking for a way just to pull it from database and decrypt it that way.......
  4. I am pretty sure I have seen a way.......oh well.......thanks for the info......
  5. what is a code to decrypt md5 password for viewing by member?
  6. something even better I would like to try is to make every other result row a different color.........
  7. how can I basically put a horizontal rule between each entry on this code.......? <?php if (isset($_POST['submitted'])) { include('connect1.php'); $category = $_POST['category']; $criteria = $_POST['criteria'] ; $query = "SELECT * FROM members WHERE $category LIKE '%".$criteria."%'"; $result = mysqli_query($dbcon, $query) or die('error getting data'); $num_rows = mysqli_num_rows($result); echo "$num_rows results found"; echo "<table width=\"896\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; echo "<tr bgcolor=\"#F7E496\"><td bgcolor=\"#F7E496\"><strong>User ID</strong></td> <td bgcolor=\"#F7E496\"><strong>Name</strong></td> <td bgcolor=\"#F7E496\"><strong>email</strong></td> <td bgcolor=\"#F7E496\"><strong>City</strong></td><td bgclor=\"#F7E496\"></td></tr>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo $row['userid']; echo "</td><td>"; echo $row['name']; echo "</td><td>"; echo $row['email']; echo "</td><td>"; echo $row['city']; echo "</td><td>"; echo "<form action='admin.php' method='get'><input type='hidden' name='edit'><input type='hidden' name='id' value='{$row['userid']}'><INPUT TYPE='submit' name='submit' VALUE='Edit'></form>\n"; echo "</td><td>"; echo "<form action='delete_account.php' method='get'><input type='hidden' name='userid' value='{$row['userid']}'><INPUT TYPE='submit' name='submit' VALUE='Delete'></form>\n"; echo "</td></tr>"; } echo "</table>"; } ?> basically each time the code is shown is an entry......
  8. I will post whole code so you can see it: <?php session_start(); // Must start session first thing /* Created By Adam Khoury @ www.flashbuilding.com -----------------------June 20, 2008----------------------- */ // Here we run a login check if (!isset($_SESSION['id'])) { echo 'Please <a href="login.php">log in</a> to access your account'; exit(); } //Connect to the database through our include include_once "connect_to_mysql.php"; // Place Session variable 'id' into local variable $userid = $_SESSION['id']; // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM members WHERE userid='$userid' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $name = $row["name"]; $phone = $row["phone"]; $username = $row["username"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $zip = $row["zip"]; $cell = $row["cell"]; $email = $row["email"]; $accounttype = $row["accounttype"]; $rank = $row["rank"]; $badges = $row["badges"]; } // Set error message as blank upon arrival to page $errorMsg = ""; // First we check to see if the form has been submitted if (isset($_POST['name'])){ $name = ereg_replace("[^A-Z a-z0-9]", "", $_POST['name']); // filter everything but numbers and letters $phone = ereg_replace("[^A-Z a-z0-9]", "", $_POST['phone']); // filter everything but spaces, numbers, and letters $username = ereg_replace("[^A-Z a-z0-9]", "", $_POST['username']); // filter everything but spaces, numbers, and letters $address = ereg_replace("[^A-Z a-z0-9]", "", $_POST['address']); // filter everything but spaces, numbers, and letters $city = ereg_replace("[^A-Za-z0-9]", "", $_POST['city']); // filter everything but lowercase letters $state = ereg_replace("[^A-Za-z0-9]", "", $_POST['state']); // filter everything but lowercase letters $zip = ereg_replace("[^A-Za-z0-9]", "", $_POST['zip']); // filter everything but lowercase letters $cell = ereg_replace("[^A-Za-z0-9]", "", $_POST['cell']); // filter everything but lowercase letters $accounttype = ereg_replace("[^A-Z a-z0-9]", "", $_POST['accounttype']); // filter everything but lowercase letters $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); $password = ereg_replace("[^A-Za-z0-9]", "", $_POST['password']); // filter everything but numbers and letters // Check to see if the user filled all fields with // the "Required"(*) symbol next to them in the join form // and print out to them what they have forgotten to put in if((!$name) || (!$username) || (!$password)){ $errorMsg = "You did not submit the following required information!<br /><br />"; if(!$name){ $errorMsg .= "--- Name"; } else if(!$username){ $errorMsg .= "--- Username"; } else if(!$Password){ $errorMsg .= "--- Password"; } } else { // Database duplicate Fields Check $sql_username_check = mysql_query("SELECT userid FROM members WHERE username='$username' LIMIT 1"); $username_check = mysql_num_rows($sql_username_check); if ($username_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your User Name is already in use inside our system. Please try another."; } else { // Add MD5 Hash to the password variable $hashedPass = md5($password); // Add user info into the database table, claim your fields then values $sql = "INSERT INTO members (name, phone, username, address, city, state, zip, cell, email, accounttype, password ) VALUES('$name','$phone','$username','$address','$city','$state','$zip','$cell','$email','$accounttype','$hashedPass')"; $rs = mysql_query($sql) or die ("Problem with the query: $sql<br>" . mysql_error()); echo mysql_error(); echo '<meta HTTP-EQUIV="REFRESH" content="0; url=http://final.net46.net/success.php">'; exit(); // Exit so the form and page does not display, just this success message } // Close else after database duplicate field value checks } // Close else after missing vars check //Close if $_POST } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template2.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <style type="text/css"> #apDiv1 { position:absolute; left:33px; top:320px; width:252px; height:48px; z-index:1; } #apDiv2 { position:absolute; left:33px; top:361px; width:254px; height:46px; z-index:2; } #apDiv3 { position:absolute; left:33px; top:525px; width:256px; height:43px; z-index:3; } #apDiv4 { position:absolute; left:33px; top:402px; width:250px; height:48px; z-index:4; } #apDiv5 { position:absolute; left:106px; top:616px; width:263px; height:255px; z-index:5; } #apDiv6 { position:absolute; left:323px; top:200px; width:898px; height:530px; z-index:1; } #apDiv7 { position:absolute; left:33px; top:443px; width:266px; height:42px; z-index:6; } #apDiv8 { position:absolute; left:111px; top:500px; width:125px; height:37px; z-index:7; } #apDiv8 strong { font-size: 24px; } #apDiv9 { position:absolute; left:33px; top:408px; width:267px; height:49px; z-index:8; } #apDiv10 { position:absolute; left:33px; top:449px; width:242px; height:23px; z-index:9; } #apDiv8 a { color: #000; } #apDiv11 { position:absolute; left:101px; top:490px; width:168px; height:42px; z-index:10; font-size: 24px; font-weight: bold; } #apDiv11 a { color: #000; } #apDiv12 { position:absolute; left:33px; top:210px; width:205px; height:135px; z-index:11; } #apDiv12 { text-align: center; } #apDiv13 { position:absolute; left:33px; top:320px; width:258px; height:47px; z-index:12; } #apDiv { position:absolute; left:33px; top:484px; width:225px; height:35px; z-index:11; } #apDiv14 { position:absolute; left:33px; top:566px; width:298px; height:51px; z-index:12; } #apDiv15 { position:absolute; left:101px; top:611px; width:168px; height:42px; z-index:10; font-size: 24px; font-weight: bold; } #apDiv5 a { font-size: 24px; color: #000; font-weight: bold; } </style> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <!-- InstanceBeginEditable name="head" --> <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" /> <!-- InstanceEndEditable --> <!-- InstanceParam name="id" type="text" value="apDiv6" --> </head> <body onload="MM_preloadImages('button/myprofile2.png','button/pictures2.png','button/projects1.png','button/news2.png','button/eventmanager2.png','button/membermanager2.png','button/newsmanager2.png')"> <div id="apDiv2"><a href="register.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','button/register2.png',1)"><img src="button/register1.png" name="Image3" width="235" height="50" border="0" id="Image3" /></a></div> <div id="apDiv4"><a href="projects.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','button/projects2.png',1)"><img src="button/projects1.png" name="Image4" width="235" height="50" border="0" id="Image4" /></a></div> <div id="apDiv11"><?php if ($accounttype == "Scout") { echo '<a href="../logout.php">Logout</a>';} ?></div> <div id="apDiv12"><?php echo "$accounttype"; ?> <p><?php echo "$name"; ?></p> <p>Troop 78</p> </div> <div id="apDiv13"><a href="myprofile.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','button/myprofile2.png',1)"><img src="button/myprofile1.png" name="Image5" width="235" height="50" border="0" id="Image5" /></a></div> <div id="apDiv5"><?php if ($accounttype == "Admin") { echo "<a href=\"../logout.php\">Logout</a>"; } ?></div> </a> </div> <div id="apDiv6"><!-- InstanceBeginEditable name="EditRegion3" --> <div id="TabbedPanels1" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">My Info</li> <li class="TabbedPanelsTab" tabindex="0">Scout Info</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"><table width="600" align="center" cellpadding="4"> <tr> <td width="7%">Register new members here</td> </tr> </table> <table width="600" align="center" cellpadding="5"> <form action="join_form.php" method="post" enctype="multipart/form-data" > <tr> <td colspan="2"><font color="#FF0000"><?php echo "$errorMsg"; ?></font></td> </tr> <tr> <td width="163"><div align="right">Name:</div></td> <td width="409"><input name="name" type="text" /></td> </tr> <tr> <td width="163"><div align="right">Phone:</div></td> <td width="409"><input name="phone" type="text" /></td> </tr> <tr> <td><div align="right">User Name: </div></td> <td><input name="username" type="text" /></td> </tr> <tr> <td><div align="right">Address: </div></td> <td> <input name="address" type="text" /> </td> </tr> <tr> <td><div align="right">City: </div></td> <td> <input name="city" type="text" /> </td> </tr> <tr> <td><div align="right">State: </div></td> <td><input name="state" type="text" /></td> </tr> <tr> <td><div align="right">Zip Code: </div></td> <td><input name="zip" type="text" /></td> </tr> <tr> <td><div align="right">Cell Phone: </div></td> <td><input name="cell" type="text" /></td> </tr> <tr> <td><div align="right">Access Level: </div></td> <td><select name="accounttype" id="accounttype"> <option value="Scout" selected="selected">Scout</option> <option value="Scout Master">Scout Master</option> <option value="Admin">Admin</option> </select></td> </tr> </tr> <tr> <td><div align="right">Email Address: </div></td> <td><input name="email" type="text" /></td> </tr> <tr> <td><div align="right"> Password: </div></td> <td><input name="password" type="password" /> <font size="-2" color="#006600">(letters or numbers only, no spaces no symbols)</font></td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="Submit" value="Submit Form" /></td> </tr> </form> </table></div> <div class="TabbedPanelsContent"> Please create member profile for Scout Info. </div> </div> </div> <script type="text/javascript"> var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); </script> <!-- InstanceEndEditable --></div> <div id="apDiv7"><a href="news.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','button/news2.png',1)"><img src="button/news1.png" name="Image6" width="235" height="50" border="0" id="Image6" /></a></div> <div id="apDiv"> <?php if ($accounttype == "Admin") { echo "<a href=\"../membermanager.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image7','','../button/membermanager2.png',1)\"><img src=\"../button/membermanager1.png\" name=\"Image7\" width=\"235\" height=\"50\" border=\"0\" id=\"Image7\" /></a>"; } ?></div> <div id="apDiv3"><?php if ($accounttype == "Admin") { echo "<a href=\"../addevent.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image8','','../button/eventmanager2.png',1)\"><img src=\"../button/eventmanager1.png\" name=\"Image8\" width=\"235\" height=\"50\" border=\"0\" id=\"Image8\" /></a>"; } ?> </div> <div id="apDiv14"><?php if ($accounttype == "Admin") { echo "<a href=\"../addart.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image9','','../button/newsmanager2.png',1)\"><img src=\"../button/newsmanager1.png\" name=\"Image9\" width=\"234\" height=\"50\" border=\"0\" id=\"Image9\" /></a>"; } ?> </div> <img name="boyscout" src="button/boyscout.jpg" width="1180" height="700" border="0" id="boyscout" alt="" /> </body> <!-- InstanceEnd --></html>
  9. the one ken gave me solved it......thanks
  10. which problem was this for, the first issue has been solved.....
  11. So I have a display box that looks like attatchment.....except a name goes under troop 78.........so everytime I forget to type in a required field either there will be nothing under that or it will be the name that I typed in if i typed a name in but nothing else...... [attachment deleted by admin]
  12. also with this same code, there seems to be a problem that when there is a blank field, it switches users, does anyone see why?
  13. Here is code I have, I can't seem to figure this error out, I bet it is obvious, but I clearly am not seeing it..... Here is error: Problem with the query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 (not really that good of an error, but maybe help getting started?) <?php session_start(); // Must start session first thing /* Created By Adam Khoury @ www.flashbuilding.com -----------------------June 20, 2008----------------------- */ // Here we run a login check if (!isset($_SESSION['id'])) { echo 'Please <a href="login.php">log in</a> to access your account'; exit(); } //Connect to the database through our include include_once "connect_to_mysql.php"; // Place Session variable 'id' into local variable $userid = $_SESSION['id']; // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM members WHERE userid='$userid' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $name = $row["name"]; $phone = $row["phone"]; $username = $row["username"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $zip = $row["zip"]; $cell = $row["cell"]; $email = $row["email"]; $accounttype = $row["accounttype"]; $rank = $row["rank"]; $badges = $row["badges"]; } // Set error message as blank upon arrival to page $errorMsg = ""; // First we check to see if the form has been submitted if (isset($_POST['name'])){ $name = ereg_replace("[^A-Z a-z0-9]", "", $_POST['name']); // filter everything but numbers and letters $phone = ereg_replace("[^A-Z a-z0-9]", "", $_POST['phone']); // filter everything but spaces, numbers, and letters $username = ereg_replace("[^A-Z a-z0-9]", "", $_POST['username']); // filter everything but spaces, numbers, and letters $address = ereg_replace("[^A-Z a-z0-9]", "", $_POST['address']); // filter everything but spaces, numbers, and letters $city = ereg_replace("[^A-Za-z0-9]", "", $_POST['city']); // filter everything but lowercase letters $state = ereg_replace("[^A-Za-z0-9]", "", $_POST['state']); // filter everything but lowercase letters $zip = ereg_replace("[^A-Za-z0-9]", "", $_POST['zip']); // filter everything but lowercase letters $cell = ereg_replace("[^A-Za-z0-9]", "", $_POST['cell']); // filter everything but lowercase letters $accounttype = ereg_replace("[^A-Z a-z0-9]", "", $_POST['accounttype']); // filter everything but lowercase letters $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); $password = ereg_replace("[^A-Za-z0-9]", "", $_POST['password']); // filter everything but numbers and letters // Check to see if the user filled all fields with // the "Required"(*) symbol next to them in the join form // and print out to them what they have forgotten to put in if((!$name) || (!$username) || (!$password)){ $errorMsg = "You did not submit the following required information!<br /><br />"; if(!$name){ $errorMsg .= "--- Name"; } else if(!$username){ $errorMsg .= "--- Username"; } else if(!$Password){ $errorMsg .= "--- Password"; } } else { // Database duplicate Fields Check $sql_username_check = mysql_query("SELECT userid FROM members WHERE username='$username' LIMIT 1"); $username_check = mysql_num_rows($sql_username_check); if ($username_check > 0){ $errorMsg = "<u>ERROR:</u><br />Your User Name is already in use inside our system. Please try another."; } else { // Add MD5 Hash to the password variable $hashedPass = md5($password); // Add user info into the database table, claim your fields then values $sql = mysql_query("INSERT INTO members (name, phone, username, address, city, state, zip, cell, email, accounttype, password ) VALUES('$name','$phone','$username','$address','$city','$state','$zip','$cell','$email','$accounttype','$hashedPass'") or die ("Problem with the query: $sql<br>" . mysql_error()); printf("Records updated: %d\n", mysql_affected_rows()); echo mysql_error(); echo '<meta HTTP-EQUIV="REFRESH" content="3; url=http://final.net46.net/success.php">'; exit(); // Exit so the form and page does not display, just this success message } // Close else after database duplicate field value checks } // Close else after missing vars check //Close if $_POST } ?>
  14. I am looking for something similar to rollover images, but that wont take as much space or as long to load......does anyone have any suggestions?
  15. so this is a little example of what I want it to do........and the event that is on those dates is displayed every month between as long as the date is valid...... [attachment deleted by admin]
  16. ok, so I sorta have it working now, but It is behind all other text fields...........can you help me fix this. <div id="apDiv23"> <form action="addevent.php" method="post"> <table width="830" border="0" cellpadding="2" cellspacing="1" align="center"> <tr> <td width="100">Event Name </td> <td><input name="event" type="text"></td> </tr> <tr><script> $(function() { $( "#datepicker" ).datepicker(); }); </script> <td width="100">Start Date</td> <td><input name="startdate" type="text" id="datepicker"></td> <script type="text/javascript"> // BeginOAWidget_Instance_2137022: #datepicker_2 $(function() { $("#datepicker").datepicker({ showOtherMonths: false }); }); // EndOAWidget_Instance_2137022 </script> </tr> <tr> <td>End Date</td> <td><label for="enddate"></label> <input type="text" name="enddate" id="enddate" /></td> </tr> <tr> <td width="100" height="92">Description</td> <td><script type="text/javascript"> // BeginOAWidget_Instance_2204022: #postContent tinyMCE.init({ // General options mode : "exact", elements : "description", theme : "advanced", skin : "default", plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave", // Theme options theme_advanced_buttons1 : "save,newdocument,print,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect,", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,image,media,|,forecolor,backcolor,|,insertdate,inserttime,", theme_advanced_buttons3 : "hr,cite,abbr,acronym,del,ins,sub,sup,visualchars,nonbreaking,charmap,emotions,ltr,rtl,|,code,preview,fullscreen,help,cleanup,removeformat,|,styleprops,attribs,", theme_advanced_buttons4 : "tablecontrols,visualaid,|,insertlayer,moveforward,movebackward,absolute,visualaid,|,template,pagebreak,restoredraft,", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "/css/editor_styles.css", // Drop lists for link/image/media/template dialogs, You shouldn't need to touch this template_external_list_url : "/lists/template_list.js", external_link_list_url : "/lists/link_list.js", external_image_list_url : "/lists/image_list.js", media_external_list_url : "/lists/media_list.js", // Style formats: You must add here all the inline styles and css classes exposed to the end user in the styles menus style_formats : [ {title : 'Bold text', inline : 'b'}, {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}}, {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}}, {title : 'Example 1', inline : 'span', classes : 'example1'}, {title : 'Example 2', inline : 'span', classes : 'example2'}, {title : 'Table styles'}, {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} ] }); // EndOAWidget_Instance_2204022 </script> <!-- Textarea gets replaced with TinyMCE, remember HTML in a textarea should be encoded --> <textarea id="description" name="description" rows="15" style="width:80%"></textarea></td> </tr> <tr> <td width="100">Price</td> <td><input name="price" type="text"></td> </tr> <tr> <td width="100">Location</td> <td><label for="location"></label> <input type="text" name="location" id="location" /></td> </tr> <tr> <td colspan="2" align="left"><input name="save" type="submit" value="Save Article"></td> </tr> </table> </form>
  17. here is what I have for now...... <script> $(function() { $( "#datepicker" ).datepicker(); }); </script> <div class="demo"> <td width="100">Start Date</td> <td><input name="startdate" type="text" id="datepicker"></td> </div><!-- End demo -->
  18. ok, so I need to basically make a registration page that will display events that happen in that particular month........so basically, lets say it is march, I want to display all events that have a month of 3, if it is march and the event registration is open from march 1 to april 31, I want this to display in both march and april section of registration, it displays 3 months at a time.........can anyone help me with this?
  19. I have, and I can't seem to get it to work when you click in the box, it just shows up on page load
  20. Can you help me set up a way for a calendar to show up when a textfield is clicked on........ <td width="100">Start Date</td> <td><input name="startdate" type="text"></td> </tr> <tr> <td>End Date</td> <td><label for="enddate"></label> <input type="text" name="enddate" id="enddate" />
  21. alright, I have looked and looked and tried different codes, but I have not been able to find any that are working for this......could you help me.......the highlighted are what is trying to be set equal........(not in code brackets) <?php session_start(); // Must start session first thing /* Created By Adam Khoury @ www.flashbuilding.com -----------------------June 20, 2008----------------------- */ // Here we run a login check if (!isset($_SESSION['id'])) { echo 'Please <a href="login.php">log in</a> to access your account'; exit(); } //Connect to the database through our include include_once "connect_to_mysql.php"; // Place Session variable 'id' into local variable $userid = $_SESSION['id']; // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM members WHERE userid='$userid' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $name = $row["name"]; $phone = $row["phone"]; $username = $row["username"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $zip = $row["zip"]; $cell = $row["cell"]; $email = $row["email"]; $accounttype = $row["accounttype"]; $rank = $row["rank"]; $badges = $row["badges"]; } $query = "SELECT event, description, startdate, enddate, location, subevent1, subevent2, subevent3, subevent4, subevent5, subevent6, subevent7, subevent8, price1, price2, price3, price4, price5, price6, price7, price8 FROM Registration WHERE eventid=".$_GET['eventid']; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $startdate = $row['startdate']; $enddate = $row['enddate']; $location = $row['location']; $description = $row['description']; $event= $row["event"]; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; $title1 = $row['title1']; $title2 = $row['title2']; $title3 = $row['title3']; $title4 = $row['title4']; $title5 = $row['title5']; $title6 = $row['title6']; $title7 = $row['title7']; $title8 = $row['title8']; $price1 = $row['price1']; $price2 = $row['price2']; $price3 = $row['price3']; $price4 = $row['price4']; $price5 = $row['price5']; $price6 = $row['price6']; $price7 = $row['price7']; $price8 = $row['price8']; $date1 = $row['date1']; $date2 = $row['date2']; $date3 = $row['date3']; $date4 = $row['date4']; $date5 = $row['date5']; $date6 = $row['date6']; $date7 = $row['date7']; $date8 = $row['date8']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template2.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <style type="text/css"> #apDiv1 { position:absolute; left:33px; top:320px; width:252px; height:48px; z-index:1; } #apDiv2 { position:absolute; left:33px; top:361px; width:254px; height:46px; z-index:2; } #apDiv3 { position:absolute; left:33px; top:525px; width:256px; height:43px; z-index:3; } #apDiv4 { position:absolute; left:33px; top:402px; width:250px; height:48px; z-index:4; } #apDiv5 { position:absolute; left:106px; top:616px; width:263px; height:255px; z-index:5; } #apDiv6 { position:absolute; left:323px; top:200px; width:898px; height:530px; z-index:1; } #apDiv7 { position:absolute; left:33px; top:443px; width:266px; height:42px; z-index:6; } #apDiv8 { position:absolute; left:111px; top:500px; width:125px; height:37px; z-index:7; } #apDiv8 strong { font-size: 24px; } #apDiv9 { position:absolute; left:33px; top:408px; width:267px; height:49px; z-index:8; } #apDiv10 { position:absolute; left:33px; top:449px; width:242px; height:23px; z-index:9; } #apDiv8 a { color: #000; } #apDiv11 { position:absolute; left:101px; top:490px; width:168px; height:42px; z-index:10; font-size: 24px; font-weight: bold; } #apDiv11 a { color: #000; } #apDiv12 { position:absolute; left:33px; top:210px; width:205px; height:135px; z-index:11; } #apDiv12 { text-align: center; } #apDiv13 { position:absolute; left:33px; top:320px; width:258px; height:47px; z-index:12; } #apDiv { position:absolute; left:33px; top:484px; width:225px; height:35px; z-index:11; } #apDiv14 { position:absolute; left:33px; top:566px; width:298px; height:51px; z-index:12; } #apDiv15 { position:absolute; left:101px; top:611px; width:168px; height:42px; z-index:10; font-size: 24px; font-weight: bold; } #apDiv5 a { font-size: 24px; color: #000; font-weight: bold; } </style> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script> <!-- InstanceBeginEditable name="head" --> <style type="text/css"> #apDiv16 { position:absolute; left:504px; top:59px; width:170px; height:49px; z-index:13; } #apDiv17 { position:absolute; left:-315px; top:508px; width:274px; height:599px; z-index:13; } #apDiv18 { position:absolute; left:-312px; top:3px; width:282px; height:412px; z-index:13; background-color: #FF0200; } </style> <!-- InstanceEndEditable --> <!-- InstanceParam name="id" type="text" value="apDiv6" --> </head> <body onload="MM_preloadImages('button/myprofile2.png','button/pictures2.png','button/projects1.png','button/news2.png','button/eventmanager2.png','button/membermanager2.png','button/newsmanager2.png')"> <div id="apDiv2"><a href="register.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','button/register2.png',1)"><img src="button/register1.png" name="Image3" width="235" height="50" border="0" id="Image3" /></a></div> <div id="apDiv4"><a href="projects.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','button/projects2.png',1)"><img src="button/projects1.png" name="Image4" width="235" height="50" border="0" id="Image4" /></a></div> <div id="apDiv11"><?php if ($accounttype == "Scout") { echo '<a href="../logout.php">Logout</a>';} ?></div> <div id="apDiv12"><?php echo "$accounttype"; ?> <p><?php echo "$name"; ?></p> <p>Troop 78</p> </div> <div id="apDiv13"><a href="myprofile.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','button/myprofile2.png',1)"><img src="button/myprofile1.png" name="Image5" width="235" height="50" border="0" id="Image5" /></a></div> <div id="apDiv5"><?php if ($accounttype == "Admin") { echo "<a href=\"../logout.php\">Logout</a>"; } ?></div> </a> </div> <div id="apDiv6"><!-- InstanceBeginEditable name="EditRegion3" --> <div id="apDiv18"></div> <div id="apDiv16"><a href="register.php">Back to Event Calendar</a></div> <?php // when displaying an article show a link // to see the article list if(isset($_GET['eventid'])) { ?> <div id="apDiv26 " > <p>Date(s): <?php echo $startdate; ?><span class="klgjsa"> -</span> <?php echo $enddate; ?><br /> <span class="fgsdfg">Location:</span> <?php echo $location; ?><br /> <span class="adfasdf">Description</span><span class="adfdas">:</span><?php echo $description; ?> </p> <p> </p> <table width="577" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="565" bgcolor="#999999" class="hjkh" scope="col">EVENTS</td> </tr> <tr> <td bgcolor="#999999" class="hjkh" scope="col"><table width="572" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="90" bgcolor="#FFFFFF" scope="col"><?php $sql = mysql_query("SELECT * FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"); while($row = mysql_fetch_array($sql)){ $event= $row["event"]; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; $title1 = $row['title1']; $title2 = $row['title2']; $title3 = $row['title3']; $title4 = $row['title4']; $title5 = $row['title5']; $title6 = $row['title6']; $title7 = $row['title7']; $title8 = $row['title8']; $price1 = $row['price1']; $price2 = $row['price2']; $price3 = $row['price3']; $price4 = $row['price4']; $price5 = $row['price5']; $price6 = $row['price6']; $price7 = $row['price7']; $price8 = $row['price8']; $date1 = $row['date1']; $date2 = $row['date2']; $date3 = $row['date3']; $date4 = $row['date4']; $date5 = $row['date5']; $date6 = $row['date6']; $date7 = $row['date7']; $date8 = $row['date8']; //this will echo the contents of each db row as they are iterated in the loop ############################# if (!empty($subevent1)) { echo "<br/><strong>$title1</strong><br />$date1<br />$ $price1<br /><br />"; } if (!empty($subevent2)) { echo "<br/><strong>$title2</strong><br />$date2<br />$ $price2<br /><br />"; } if (!empty($subevent3)) { echo "<br/><strong>$title3</strong><br />$date3<br />$ $price3<br /><br />"; } if (!empty($subevent4)) { echo "<br/><strong>$title4</strong><br />$date4<br />$ $price4<br /><br />"; } if (!empty($subevent5)) { echo "<br/><strong>$title5</strong><br />$date5<br />$ $price5<br /><br />"; } if (!empty($subevent6)) { echo "<br/><strong>$title6</strong><br />$date6<br />$ $price6<br /><br />"; } if (!empty($subevent7)) { echo "<br/><strong>$title7</strong><br />$date7<br />$ $price7<br /><br />"; } if (!empty($subevent8)) { echo "<br/><strong>$title8</strong><br />$date8<br />$ $price8"; } } //etc etc ?></td> <td width="462" bgcolor="#FFFFFF" scope="col"> </td> </tr> </table></td> </tr> </table> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="31" scope="col"><?php if (isset($_GET['eventid'])) { include('connect1.php'); $sql = mysql_query("SELECT * FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"); $result = mysqli_query($dbcon, $query) or die('error getting data'); echo "<table>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo "<form action='registration.php' method='get'><input type='hidden' name='eventid' value='{$row['eventid']}'><INPUT TYPE='submit' name='submit' VALUE='Register'></form>\n"; echo "</td></tr>"; } echo "</table>"; } ?></td> </tr> </table> <p> </p> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="col"> </th> </tr> </table> </div> </div> <?php } ?> <!-- InstanceEndEditable --></div> <div id="apDiv7"><a href="news.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','button/news2.png',1)"><img src="button/news1.png" name="Image6" width="235" height="50" border="0" id="Image6" /></a></div> <div id="apDiv"> <?php if ($accounttype == "Admin") { echo "<a href=\"../search1.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image7','','../button/membermanager2.png',1)\"><img src=\"../button/membermanager1.png\" name=\"Image7\" width=\"235\" height=\"50\" border=\"0\" id=\"Image7\" /></a>"; } ?></div> <div id="apDiv3"><?php if ($accounttype == "Admin") { echo "<a href=\"../addevent.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image8','','../button/eventmanager2.png',1)\"><img src=\"../button/eventmanager1.png\" name=\"Image8\" width=\"235\" height=\"50\" border=\"0\" id=\"Image8\" /></a>"; } ?> </div> <div id="apDiv14"><?php if ($accounttype == "Admin") { echo "<a href=\"../addart.php\" onmouseout=\"MM_swapImgRestore()\" onmouseover=\"MM_swapImage('Image9','','../button/newsmanager2.png',1)\"><img src=\"../button/newsmanager1.png\" name=\"Image9\" width=\"234\" height=\"50\" border=\"0\" id=\"Image9\" /></a>"; } ?> </div> <img name="boyscout" src="button/boyscout1.png" width="1180" height="700" border="0" id="boyscout" alt="" /> </body> <!-- InstanceEnd --></html> so Please help me if you can...........
  22. still not working..... <?php if (isset($_GET['eventid'])) { include('connect1.php'); $sql = mysql_query("SELECT * FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"); $result = mysqli_query($dbcon, $query) or die('error getting data'); echo "<table>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo "<form action='registration.php' method='get'><input type='hidden' name='eventid' value='{$row['eventid']}'><INPUT TYPE='submit' name='submit' VALUE='Register'></form>\n"; echo "</td></tr>"; } echo "</table>"; } ?>
  23. I believe it is here, but I could be wrong...... <?php if (isset($_GET['eventid'])) { include('connect1.php'); $sql = mysql_query("SELECT * FROM Registration WHERE eventid='$eventid' LIMIT 1"); $result = mysqli_query($dbcon, $query) or die('error getting data'); echo "<table>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo "<form action='registration.php' method='get'><input type='hidden' name='eventid' value='{$row['eventid']}'><INPUT TYPE='submit' name='submit' VALUE='Register'></form>\n"; echo "</td></tr>"; } echo "</table>"; } ?>
×
×
  • 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.