searls03 Posted April 30, 2011 Share Posted April 30, 2011 Ok, so I have a field in database called shutoff( a date when registrations will no longer be accepted for an event). How can I make it so that on the specified date, the register button will change to "no longer accepting Registrations". here is the form: <?php // when displaying an article show a link // to see the article list if(isset($_GET['eventid'])) { ?> <div id="info " > <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> <center> <table width="577" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="565" bgcolor="#C5C0B7" class="hjkh" scope="col"><?php echo $event; ?><font color='#C5C0B7'>...........................</font> <font size='-1'> <?php if ($accounttype =='Admin'){ echo "<a href='cofirmation.php'>Confirm Registrations </a><font color='#C5C0B7'>...</font><a href='quickregister.php?eventid=".$_GET['eventid']."'>Quick Registration</a><font color='#C5C0B7'>...</font><a href='viewregistered.php?eventid=".$_GET['eventid']."'>View Registrations</a>"; } ?></font></td> </tr> <tr> <td bgcolor="#999999" class="hjkh" scope="col"><table width="576" border="1" cellspacing="0" cellpadding="1"> <tr> <td width="91" 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($title1)) { echo "<br/><strong>$title1</strong><br />$date1<br />$ $price1<br /><br />"; } if (!empty($title2)) { echo "<br/><strong>$title2</strong><br />$date2<br />$ $price2<br /><br />"; } if (!empty($title3)) { echo "<br/><strong>$title3</strong><br />$date3<br />$ $price3<br /><br />"; } if (!empty($title4)) { echo "<br/><strong>$title4</strong><br />$date4<br />$ $price4<br /><br />"; } if (!empty($title5)) { echo "<br/><strong>$title5</strong><br />$date5<br />$ $price5<br /><br />"; } if (!empty($title6)) { echo "<br/><strong>$title6</strong><br />$date6<br />$ $price6<br /><br />"; } if (!empty($title7)) { echo "<br/><strong>$title7</strong><br />$date7<br />$ $price7<br /><br />"; } if (!empty($title8)) { echo "<br/><strong>$title8</strong><br />$date8<br />$ $price8"; } } //etc etc ?></td> <td width="475" bgcolor="#FFFFFF" scope="col"><?php echo $description; ?></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 = "SELECT eventid FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"; $result = mysqli_query($dbcon, $sql) or die('error getting data'); echo "<table>"; $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></center> <p> </p> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <th scope="col"> </th> </tr> </table> <p><?php } ?> and here is where data is pulled: $query = "SELECT event, description, startdate, enddate, location, subevent1, subevent2, subevent3, subevent4, subevent5, subevent6, subevent7, subevent8, price1, price2, price3, price4, price5, price6, price7, price8, shutoff 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']; $shutoff = $row['shutoff']; does this make sense? it is in yyyy-mm-dd format(I believe that is correct...... Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/ Share on other sites More sharing options...
silkfire Posted April 30, 2011 Share Posted April 30, 2011 There, where you have your button text, check whether the date is less than or equal to today: if (strtotime($row['shutoff']) <= time()) echo 'No longer accepting registrations'. Also make sure your PHP code checks for the shut off date when people are registering to events in case they bypass the disabled button. Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208699 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 what is wrong with this snippet: <?php if (isset($_GET['eventid'])) { include('connect1.php'); $sql = "SELECT eventid FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"; $result = mysqli_query($dbcon, $sql) or die('error getting data'); echo "<table>"; $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']}'>"; //* right here if (strtotime($row['shutoff']) <= time()){ echo 'No longer accepting registrations.'} else {echo "<INPUT TYPE='submit' name='submit' VALUE='Register'>"}; echo "</form>\n"; echo "</td></tr>"; echo "</table>"; } ?> and is that the way I would want to do it? Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208703 Share on other sites More sharing options...
wildteen88 Posted April 30, 2011 Share Posted April 30, 2011 Your query is only returning the eventid column. You need to amend the query so it returns the shutoff column aswell. $sql = "SELECT shutoff, eventid FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"; Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208727 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 there is also an error where I put the comment...... Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208728 Share on other sites More sharing options...
wildteen88 Posted April 30, 2011 Share Posted April 30, 2011 there is also an error where I put the comment...... It'll be helpful if you posted the actual error message. Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208730 Share on other sites More sharing options...
searls03 Posted April 30, 2011 Author Share Posted April 30, 2011 Parse error: syntax error, unexpected '}', expecting ',' or ';' in /home/a6254834/public_html/viewevent.php on line 313 Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208731 Share on other sites More sharing options...
wildteen88 Posted April 30, 2011 Share Posted April 30, 2011 You should format your code so it becomes easier to read. The issue is your're not ending your echo statements with a ; if (strtotime($row['shutoff']) <= time()) { echo 'No longer accepting registrations.'; } else { echo "<INPUT TYPE='submit' name='submit' VALUE='Register'>"; } Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208740 Share on other sites More sharing options...
searls03 Posted May 1, 2011 Author Share Posted May 1, 2011 where could I put this on a page so that it checks it before the page even loads......here is a 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 $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['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> <style type="text/css"> #apDiv1 { position:absolute; left:338px; top:278px; width:311px; height:129px; z-index:1; } #apDiv2 { position:absolute; left:50px; top:207px; width:181px; height:149px; z-index:2; } #apDiv2 { text-align: center; } </style> </head> <body><div id="apDiv1"> <table width="408" border="1" cellspacing="2" cellpadding="2"> <tr> <th width="90" scope="col">Event(s):</th> <th width="298" scope="col"> $sql = mysql_query("SELECT * FROM Registration WHERE eventid=".$_GET["eventid"]." 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 ############################# if (!empty($title1)) { echo "<br/>$title1:"; } if (!empty($title2)) { echo "<br/>$title2:" ; } if (!empty($title3)) { echo "<br/>$title3:"; } if (!empty($title4)) { echo "<br/>$title4:"; } if (!empty($title5)) { echo "<br/>$title5:"; } if (!empty($title6)) { echo "<br/>$title6:"; } if (!empty($title7)) { echo "<br/>$title7:"; } if (!empty($title8)) { echo "<br/>$title8:"; } } //etc etc </th> </tr> <tr> <th>Price:</th> <th> $total = $price1 + $price2 + $price3 = $price4 + $price5 + $price6 + $price7 + $price8 ; echo $total; </th> </tr> <tr> <th>Registrant:</th> <th><?php echo $name; ?></th> </tr> </table> </div> <div id="apDiv2"><?php echo $name; ?> <p> </p> <p> </p> <p><a href="index.php" target="_new"><strong>Troop 78 Home</strong></a></p> <p> </p> <p> </p> <p><strong><a href="http://www.cornhuskercouncil.org">Cornhusker Council</a></strong></p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> <img name="boyscout" src="button/boyscout.jpg" width="1180" height="700" border="0" id="boyscout" alt="" /> </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."; $to = "searls03@gmail.com"; // Change this to your site admin email $from = "events@final.net46.net"; $subject = "New Registration for $event"; //Begin HTML Email Message where you need to change the activation URL inside $message = '<html> <body> Hello, Aaron $name has registered for $event. they will owe $total = $price1 + $price2 + $price3 = $price4 + $price5 + $price6 + $price7 + $price8 ; echo $total; </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['eventid'])) { $self = $_SERVER['PHP_SELF']; $query = "SELECT eventid, event FROM Registration ORDER BY eventid"; $result = mysql_query($query) or die('Error : ' . mysql_error()); // get the article info from database $query = "SELECT event, description, startdate, enddate, location FROM Registration WHERE eventid=".$_GET['eventid']; $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>Register--Boy Scout Troop 78</title> <!-- InstanceEndEditable --> <style type="text/css"> body { background-image: url(button/boyscout1.png); background-repeat: no-repeat; position: relative; } #menu { position:relative; left:160px; top:0px; width:931px; height:59px; z-index:19; } #menu #MenuBar1 li a { color: #000; border-top-style: outset; border-right-style: outset; border-bottom-style: outset; border-left-style: outset; width: 100px; } #status { position:relative; left:16px; top:180px; width:124px; height:44px; z-index:14; } </style> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <script type="text/javascript"> 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];}} } </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; } #editregion p strong { font-size: 36px; } </style> <style type="text/css"> a:link { color: #FFF; } a:visited { color: #FFF; } </style> <!-- InstanceEndEditable --> <!-- InstanceParam name="id" type="text" value="apDiv6" --> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <style type="text/css"> #logout { position:relative; left:0px; top:0pxpx; width:134px; height:38px; z-index:20; font-weight: bold; font-size: 24px; } #logout a { color: #000; } #status { text-align: center; } #logout1 { position:absolute; left:1071px; top:191px; width:224px; height:61px; z-index:2; } #menu2 { position:absolute; left:-1px; top:172px; width:497px; height:92px; z-index:20; } * { padding: 0; } html, body { height: 100%; } .wrapper { min-height: 100%; height: auto !important; height: 100%; padding: 0 auto -4em; } .footer, .push { height: 4em; clear: both; } </style> </head> <body> <div id="menu2"><div id="menu"> <ul id="MenuBar1" class="MenuBarHorizontal"> <li><a href="myprofile.php">My Profile</a> </li> <li><a href="register.php">Register</a></li> <li><a href="dashboard.php">Dashboard</a> </li> <li><a href="news.php">News</a></li> <?php if ($accounttype == "Admin") { ?> <li><a href="membermanager.php">Scout Manager</a></li> <li><a href="eventmanager.php">Event Manager</a></li> <li><a href="newsmanager.php">News Manager</a></li> </ul><?php } ?> </div></div> <div id="logout1"><div id="logout"><a href="logout.php">Logout</a></div></div> <div id="status"><?php echo "$accounttype"; ?> <br /><?php echo "$name"; ?> <p> </p> </div><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /> <br /> <!-- InstanceBeginEditable name="EditRegion3" --> <p> <?php $sql = mysql_query("SELECT * FROM members WHERE userid='$userid' 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"]; } ?> <strong>Events</strong> <?php //Search 'events' table for the username //I don't know where you're storing username, but I've assumed It's defined as $username $sql = mysql_query("SELECT * FROM Events WHERE eventid=".$_GET['eventid']." && userid='$userid' LIMIT 1"); while($row = mysql_fetch_array($sql)){ $title11 = $row['title1']; $title21 = $row['title2']; $title31 = $row['title3']; $title41 = $row['title4']; $title51 = $row['title5']; $title61 = $row['title6']; $title71 = $row['title7']; $title81 = $row['title8']; } ?> <?php $sql = mysql_query("SELECT * FROM Registration WHERE eventid=".$_GET['eventid']." LIMIT 1"); while($row = mysql_fetch_array($sql)){ $eventid = $row["eventid"]; $event = $row["event"]; $startdate = $row["startdate"]; $enddate = $row["enddate"]; $description = $row["description"]; $location = $row["location"]; $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 ############################# echo "<form action ='eventreg.php' method='post'>"; echo "<center><table border='1' width='600'>"; // Example of testing title1 for the userid (already registered) ... if (!empty($title11)){ echo "<tr><td width='300'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' name='title1' value='$title1'><input type='hidden' name='price1' value='$price1'></td><td width='500'><strong>$title1 </strong><br /> $date1 <br />$ $price1 </tr></td> "; } else{ if (!empty($title1)) { echo "<tr><td width='300'> <input type='checkbox' name='title1' value='$title1'/></td><td width='500'><strong>$title1 </strong><br /> $date1 <br />$ $price1<input type='hidden' name='price1' value='$price1'> </tr></td> "; } } if (!empty($title21)){ echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title2' name='title2'><input type='hidden' name='price2' value='$price2'></td><td width='500'><strong>$title2 </strong><br /> $date2 <br />$ $price2 </tr></td> ";} else if (!empty($title2)) { echo "<br/><tr><td> <input type='checkbox' name='title2' value='$title2' /></td><td><strong>$title2 </strong><br /> $date2 <br />$ $price2<input type='hidden' name='price2' value='$price2'> </tr></td>" ; } if (!empty($title31)){echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title3' name='title3'><input type='hidden' name='price3' value='$price3'></td><td width='500'><strong>$title3 </strong><br /> $date3 <br />$ $price3 </tr></td> ";} else if (!empty($title3)) { echo "<br/><tr><td><input type='checkbox' name='title3' value='$title3' /></td><td><strong>$title3</strong> <br /> $date3 <br />$ $price3<input type='hidden' name='price3' value='$price3'></tr></td>"; } if (!empty($title41)){ echo "<tr><td width='100'><strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title4' name='title4'><input type='hidden' name='price4' value='$price4'></td><td width='500'><strong>$title4 </strong><br /> $date4 <br />$ $price4 </tr></td> ";} else if (!empty($title4)) { echo "<br/><tr><td><input type='checkbox' name='title4' value='$title4' /></td><td><strong>$title4</strong> <br /> $date4 <br />$ $price4<input type='hidden' name='price4' value='$price4'></tr></td>"; } if (!empty($title51)){ echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title5' name='title5'><input type='hidden' name='price5' value='$price5'></td><td width='500'><strong>$title5 </strong><br /> $date5 <br />$ $price5 </tr></td> ";} else if (!empty($title5)) { echo "<br/><tr><td><input type='checkbox' name='title5' value='$title5' /></td><td><strong>$title5</strong> <br /> $date5 <br />$ $price5<input type='hidden' name='price5' value='$price5'></tr>"; } if (!empty($title61)){ echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title6' name='title6'><input type='hidden' name='price6' value='$price6'></td><td width='500'><strong>$title6 </strong><br /> $date6 <br />$ $price6 </tr></td> ";} else if (!empty($title6)) { echo "<br/><tr><td> <input type='checkbox' name='title6' value='$title6' /></td><td><strong>$title6 </strong><br /> $date6 <br />$ $price6<input type='hidden' name='price6' value='$price6'></tr></td>"; } if (!empty($title71)){echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title7' name='title7'><input type='hidden' name='price7' value='$price7'></td><td width='500'><strong>$title7 </strong><br /> $date7 <br />$ $price7 </tr></td> ";} else if (!empty($title7)) { echo "<br/><tr><td> <input type='checkbox' name='title7' value='$title7' /></td><td><strong>$title7</strong> <br /> $date7 <br />$ $price7<input type='hidden' name='price7' value='$price7'></tr></td>"; } if (!empty($title81)){ echo "<tr><td width='100'> <strong><font color='red'> You have already registered for this event</font></strong><input type='hidden' value='$title8' name='title8'><input type='hidden' name='price8' value='$price8'> </td><td width='500'><strong>$title8 </strong><br /> $date8 <br />$ $price8 </tr></td> ";} else if (!empty($title8)) { echo "<br/><tr><td> <input type='checkbox' name='title8' value='$title8' /></td><td><strong>$title8</strong> <br /> $date8 <br />$ $price8<input type='hidden' name='price8' value='$price8'></tr></td>"; } echo "</table>"; echo "<input name='userid' type=\"hidden\" value=\"$userid\" />"; echo "<input name='eventid' type=\"hidden\" value=\"$eventid\" />"; echo "<input name='email' type=\"text\" value=\"$email\" />"; echo "<input name='event' type=\"hidden\" value=\"$event\" />"; echo "<input name='name' type=\"hidden\" value=\"$name\" />"; echo "<input name=\"save\" type=\"submit\" value=\"Register Now!\" />"; echo "<input name='id' type=\"hidden\" value=\"$userid, $eventid \" />"; function genRandomString($length = { $characters = '0123456789'; $string =''; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; } $bar = genRandomString(); echo "<input name='barcode' type=\"hidden\" value=\"$bar\" />"; echo "</center></form>"; } //etc etc //If it finds a match, output an error message ?> <br /> <!-- InstanceEndEditable --> <div class="push"></div></div> <div class="footer"><?php if($accounttype == "Admin"){include_once "footer-ad.php";}else if($accounttype == "Scout Master"){ include_once "footer-ad.php";} else if($accounttype == "Scout") { include_once "footer-sc.php"; } ?> </div> <script type="text/javascript"> var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"}); </script> </body> <!-- InstanceEnd --></html> Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208857 Share on other sites More sharing options...
wildteen88 Posted May 1, 2011 Share Posted May 1, 2011 I haven't got a clue your code is a complete mess. Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1208963 Share on other sites More sharing options...
searls03 Posted May 1, 2011 Author Share Posted May 1, 2011 Ya sorry my code does get kinda messy. Where would be the regular place you could put it( head, body, etc.). Quote Link to comment https://forums.phpfreaks.com/topic/235204-disable-a-register-button/#findComment-1209003 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.