Jump to content

searls03

Members
  • Posts

    907
  • Joined

  • Last visited

Everything posted by searls03

  1. I do know how the basic username and password work, I have done this before. I just haven't ever tried this admin edit all profiles before.
  2. Oh...ok, i see what is happening, it is taking the session id, which is the user id.....this is my userid. how can I fix this?
  3. like this? $q = "UPDATE Registration SET event='$event', startdate='$startdate', enddate='$enddate', description='$description', location= '$location' where id='$id'"; $sql = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); echo $q; printf("Records updated: %d\n", mysql_affected_rows()); if that is it, this is what I get: UPDATE Registration SET event='hjjg', startdate='fdgfd', enddate='dfgdfg', description='type in content herefgdfgd', location= 'fdgfdgfh' where id='7'Records updated: 0
  4. I never took it it out................Correct? the onlythings I took out were some fields.....
  5. ok, so I can get the stuff to display when it is not for a specific event. if it is for a specific event, it does not display. here is entire code: <?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 $id = $_SESSION['id']; // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM members WHERE id='$id' 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['username'])){ $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 $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); if((!$email)){ $errorMsg = "You did not submit the following required information!<br /><br />"; if(!$email){ $errorMsg .= "--- Email Address"; } } else { $sql = mysql_query("INSERT INTO events (name, phone, username, address, city, state, zip, cell, email) VALUES('$name','$phone','$username','$address','$city','$state','$zip','$cell','$email") or die (mysql_error()); $to = "$email"; // Change this to your site admin email $from = "events@final.net46.net"; $subject = "Complete your registration"; //Begin HTML Email Message where you need to change the activation URL inside $message = '<html> <body bgcolor="#FFFFFF"> Hi ' . $username . ', <br /><br /> You must complete this step to activate your account with us. <br /><br /> Please click here to activate now >> <a href="http://www.somewebsite.com/activation.php?id=' . $id . '"> ACTIVATE NOW</a> <br /><br /> Your Login Data is as follows: <br /><br /> E-mail Address: ' . $email . ' <br /> Password: ' . $password . ' <br /><br /> Thanks! </body> </html>'; // end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; $to = "$to"; // Finally send the activation email to the member mail($to, $subject, $message, $headers); // Then print a message to the browser for the joiner print "<br /><br /><br /><h4>OK $firstname, one last step to verify your email identity:</h4><br /> We just sent an Activation link to: $email<br /><br /> <strong><font color=\"#990000\">Please check your email inbox in a moment</font></strong> to click on the Activation <br /> Link inside the message. After email activation you can log in."; 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 ?> <?php // if no id is specified, list the available articles if(!isset($_GET['id'])) { $self = $_SERVER['PHP_SELF']; $query = "SELECT id, event FROM Registration ORDER BY id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); // create the article list $description = '<ol>'; while($row = mysql_fetch_array($result, MYSQL_NUM)) { list($id, $event, $date) = $row; $description .= "<li><a href=\"$self?id=$id\">$event</a></li>\r\n"; } $description .= '</ol>'; $Events = 'Events'; } else { // get the article info from database $query = "SELECT event, description, startdate, enddate, location FROM Registration WHERE id=".$_GET['id']; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $event = $row['event']; $description = $row['description']; $startdate = $row['startdate']; $enddate = $row['enddate']; $location = $row['location']; } ?> <!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:5; } #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" --> <style type="text/css"> #apDiv6 #apdiv19 #form1 table tr td { text-align: right; } #apDiv6 #apdiv19 #form1 table tr td #event { text-align: right; } .help { text-align: right; } .help { text-align: right; } </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" --> <p> <?php $sql = mysql_query("SELECT * FROM members WHERE id='$id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $name = $row["name"]; $phone = $row["phone"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $zip = $row["zip"]; $cell = $row["cell"]; $email = $row["email"]; } ?> <?php $sql = mysql_query("SELECT * FROM Registration WHERE id='$id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $event = $row["event"]; $startdate = $row["startdate"]; $enddate = $row["enddate"]; $description = $row["description"]; $location = $row["location"]; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; //this will echo the contents of each db row as they are iterated in the loop print_r($row); ############################# if (!empty($subevent1)) { echo "<br/>$subevent1: <input type='checkbox' name='subevent[]' value='$subevent1' />"; } if (!empty($subevent2)) { echo "<br/>$subevent2: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent3)) { echo "<br/>$subevent3: <input type='checkbox' name='subevent[]' value='$subevent3' />"; } if (!empty($subevent4)) { echo "<br/>$subevent4: <input type='checkbox' name='subevent[]' value='$subevent4' />"; } if (!empty($subevent5)) { echo "<br/>$subevent5: <input type='checkbox' name='subevent[]' value='$subevent5' />"; } if (!empty($subevent6)) { echo "<br/>$subevent6: <input type='checkbox' name='subevent[]' value='$subevent6' />"; } if (!empty($subevent7)) { echo "<br/>$subevent7: <input type='checkbox' name='subevent[]' value='$subevent7' />"; } if (!empty($subevent8)) { echo "<br/>$subevent8: <input type='checkbox' name='subevent[]' value='$subevent8' />"; } } //etc etc ?> </p> <p> </p> <!-- 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="buttons/boyscout.jpg" width="1180" height="700" border="0" id="boyscout" alt="" /> </body> <!-- InstanceEnd --></html>
  6. so would it work if instead of using id I were to make a new row call userid-not session variable. would this work? if so, how?
  7. ok so i put this code in and nothing shows up.......I know what you are thinking....yes there is a value in database... <?php $sql = mysql_query("SELECT * FROM Registration WHERE id='$id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $event = $row["event"]; $startdate = $row["startdate"]; $enddate = $row["enddate"]; $description = $row["description"]; $location = $row["location"]; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; ############################# if (!empty($subevent1)) { echo "<br/>$subevent1: <input type='checkbox' name='subevent[]' value='$subevent1' />"; } if (!empty($subevent2)) { echo "<br/>$subevent2: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent3)) { echo "<br/>$subevent3: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent4)) { echo "<br/>$subevent4: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent5)) { echo "<br/>$subevent5: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent6)) { echo "<br/>$subevent6: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent7)) { echo "<br/>$subevent7: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } if (!empty($subevent8)) { echo "<br/>$subevent8: <input type='checkbox' name='subevent[]' value='$subevent2' />"; } } //etc etc ?> . where would i put the other code you gave me?
  8. alright now I got the error to go away by taking away some things, but now it says 0 records updated. help me: <?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 $id=$_SESSION['id']; // Process the form if it is submitted if ($_POST['event']) { $event = $_POST['event']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $description = $_POST['description']; $subevent1 = $_POST['subevent1']; $location = $_POST['location']; $q = "UPDATE Registration SET event='$event', startdate='$startdate', enddate='$enddate', description='$description', location= '$location' where id='$id'"; $sql = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error()); printf("Records updated: %d\n", mysql_affected_rows()); echo mysql_error(); exit(); } // close if post ?>
  9. I don't know why I didn't see that.... I should have noticed that. Thanks!!!!!!!!!!!!
  10. Ok......so how I make a check box appear with it? I think I have an idea, but I just want to make sure I don't mess the code up.
  11. What do you mean they have no value? If you mean where values come from, there is a form on another page that (should) populates the values
  12. Would this be easier to do if I had two tables? One for members,one for sessions?
  13. now this is what i got: Problem with the query: UPDATE Registration SET event='akajl', startdate='jlkjkl', enddate='jkljakljlk', description='', subevent1='', subevent2='', subevent3='', subevent4=', subevent5='', subevent6='', subevent7='', subevent8='', title1='', title2='', title3='', title4='', title5='', title6='', title7='', title8='', price1='', price2='', price3='', price4='', price5='', price6='', price7='', price8='', id='7' 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 '7'' at line 1
  14. here error: Fatal error: Call to undefined function myslq_error() in /home/a6254834/public_html/eventup.php on line 40
  15. sorry, how do I echo the query, I am a bit new to this stuff.
  16. why am I getting 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 '7'' at line 1: <?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 $id=$_SESSION['id']; // Process the form if it is submitted if ($_POST['startdate']) { $event = $_POST['event']; $startdate = $_POST['startdate']; $enddate = $_POST['enddate']; $description = $_POST['description']; $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']; $sql = mysql_query("UPDATE Registration SET event='$event', startdate='$startdate', enddate='$enddate', description='$description', subevent1='$subevent1', subevent2='$subevent2', subevent3='$subevent3', subevent4=$subevent4', subevent5='$subevent5', subevent6='$subevent6', subevent7='$subevent7', subevent8='$subevent8', title1='$title1', title2='$title2', title3='$title3', title4='$title4', title5='$title5', title6='$title6', title7='$title7', title8='$title8', price1='$price1', price2='$price2', price3='$price3', price4='$price4', price5='$price5', price6='$price6', price7='$price7', price8='$price8', id='$id'") or die (mysql_error()); printf("Records updated: %d\n", mysql_affected_rows()); exit(); } // close if post ?>
  17. so here is a code have that can display the events.......I need to know if it is possible to edit this so that only subevents that have a value will show.: <?php if (isset($_GET['id'])) { include('connect1.php'); $sql = mysql_query("SELECT * FROM Registration WHERE id='$id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $event = $row["event"]; $startdate = $row["startdate"]; $enddate = $row["enddate"]; $description = $row["description"]; $location = $row["location"]; $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']; } $result = mysqli_query($dbcon, $query) or die('error getting data'); echo "<table>"; while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "<tr><td>"; echo $row['event']; echo "</td></tr>"; } echo "</table>"; } ?>
  18. Not sure what kind of a schema that you want......but any ways the subevents hold text unless something else is needed.......
  19. I need to know what line(s) exactly need to be changed to get. I tried changing one line in the search code to get but now it pulls no id. The address it goes to is .../myprofile.php?id= and then no Id. I am pretty sure it has to do with session variable. But if I try to changethe variable no content displays then. I need to know where to put get and if the session variable could cause this. Thanks in advance for any help.
  20. my database will hold up to 8 subevents. called subevent1-8. I need to know how to make a check mark display in a form if there is a subevent present in the database. here is the code for the registration page. All I have for it is for subevents and info able to be displayed. I need to know how to display a checkmark by subevent if present. no content as I need to know what to put for the content: <?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 $id = $_SESSION['id']; // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM members WHERE id='$id' 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['username'])){ $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 $email = stripslashes($_POST['email']); $email = strip_tags($email); $email = mysql_real_escape_string($email); if((!$email)){ $errorMsg = "You did not submit the following required information!<br /><br />"; if(!$email){ $errorMsg .= "--- Email Address"; } } else { $sql = mysql_query("INSERT INTO events (name, phone, username, address, city, state, zip, cell, email) VALUES('$name','$phone','$username','$address','$city','$state','$zip','$cell','$email") or die (mysql_error()); $to = "$email"; // Change this to your site admin email $from = "events@final.net46.net"; $subject = "Complete your registration"; //Begin HTML Email Message where you need to change the activation URL inside $message = '<html> <body bgcolor="#FFFFFF"> Hi ' . $username . ', <br /><br /> You must complete this step to activate your account with us. <br /><br /> Please click here to activate now >> <a href="http://www.somewebsite.com/activation.php?id=' . $id . '"> ACTIVATE NOW</a> <br /><br /> Your Login Data is as follows: <br /><br /> E-mail Address: ' . $email . ' <br /> Password: ' . $password . ' <br /><br /> Thanks! </body> </html>'; // end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; $to = "$to"; // Finally send the activation email to the member mail($to, $subject, $message, $headers); // Then print a message to the browser for the joiner print "<br /><br /><br /><h4>OK $firstname, one last step to verify your email identity:</h4><br /> We just sent an Activation link to: $email<br /><br /> <strong><font color=\"#990000\">Please check your email inbox in a moment</font></strong> to click on the Activation <br /> Link inside the message. After email activation you can log in."; 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 ?> <?php // if no id is specified, list the available articles if(!isset($_GET['id'])) { $self = $_SERVER['PHP_SELF']; $query = "SELECT id, event FROM Registration ORDER BY id"; $result = mysql_query($query) or die('Error : ' . mysql_error()); // create the article list $description = '<ol>'; while($row = mysql_fetch_array($result, MYSQL_NUM)) { list($id, $event, $date) = $row; $description .= "<li><a href=\"$self?id=$id\">$event</a></li>\r\n"; } $description .= '</ol>'; $Events = 'Events'; } else { // get the article info from database $query = "SELECT event, description, date, price, location FROM Registration WHERE id=".$_GET['id']; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $event = $row['event']; $description = $row['description']; $date = $row['date']; $location = $row['location']; } ?> <!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:5; } #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" --> <style type="text/css"> #apDiv6 #apdiv19 #form1 table tr td { text-align: right; } #apDiv6 #apdiv19 #form1 table tr td #event { text-align: right; } .help { text-align: right; } .help { text-align: right; } </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" --> <p> <?php $sql = mysql_query("SELECT * FROM members WHERE id='$id' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $name = $row["name"]; $phone = $row["phone"]; $address = $row["address"]; $city = $row["city"]; $state = $row["state"]; $zip = $row["zip"]; $cell = $row["cell"]; $email = $row["email"]; } $sql = mysql_query("SELECT * FROM Registration WHERE id='$id' 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']; } ?> </p> <p> </p> <!-- 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="buttons/boyscout.jpg" width="1180" height="700" border="0" id="boyscout" alt="" /> </body> <!-- InstanceEnd --></html>
  21. I have a page for event registration and I have subevents that will have a check mark by them. how do i make it so that a check mark only appears if a subevent is present?
  22. Come on, I need some help. so How do i make it not display my info and submit to the right person in database.
  23. Can you give me the exact line and how to do it? I think I know where, and i tried changing it, but now it doesn't pull any id.
  24. What do you mean pass in the user id?
  25. so what session should I set then? here is login form page where all sessions start: <?php /* Created By Adam Khoury @ [url='http://www.flashbuilding.com/']www.flashbuilding.com[/url] -----------------------June 20, 2008----------------------- */ if ($_POST['username']) { //Connect to the database through our include include_once "connect_to_mysql.php"; $username = stripslashes($_POST['username']); $username = strip_tags($username); $username = mysql_real_escape_string($username); $password = ereg_replace("[^A-Za-z0-9]", "", $_POST['password']); // filter everything but numbers and letters $password = md5($password); // Make query and then register all database data that - // cannot be changed by member into SESSION variables. // Data that you want member to be able to change - // should never be set into a SESSION variable. $sql = mysql_query("SELECT * FROM members WHERE username='$username' AND password='$password'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ // Get member ID into a session variable $id = $row["id"]; session_register('id'); $_SESSION['id'] = $id; // Get member username into a session variable $name = $row["name"]; session_register('name'); $_SESSION['username'] = $username; // Get member userlevel into a session variable $userlevel = $row["userlevel"]; session_register('userlevel'); $_SESSION['userlevel'] = $userlevel; // Update last_log_date field for this member now mysql_query("UPDATE members SET lastlogin=now() WHERE id='$id'"); // Print success message here if all went well then exit the script header("location: news.php?"); exit(); } // close while } else { // Print login failure message to the user and link them back to your login page print '<br /><br /><font color="#FF0000">No match in our records, try again </font><br /> <br /><a href="login.php">Click here</a> to go back to the login page.'; exit(); }} ?>
×
×
  • 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.