Jump to content

psychowolvesbane

Members
  • Posts

    204
  • Joined

  • Last visited

    Never

Everything posted by psychowolvesbane

  1. Okay I've solved the problem, it looks like I was using a JavaScript only function for checking the string length of a variable so it caused some problems, now I've used the isset($PostCode{8}) on the elseif line and it works perfectly.
  2. Ah thanks I'm now getting: Fatal error: Call to undefined function: length() in /usr/home/awccloth/public_html/admin/add_campus_details_form.php on line 158 which is part of this validation: if(empty($PostCode)) { $Errors++; $Err9 = "<span class=\"errmsg\">! </span>"; $MsgPostCode = "<span class=\"errmsg\">Please Enter the Post Code</span><br>"; } elseif((length($PostCode) !== 7) || (length($PostCode) !== 6)) { $Errors++; $Err9 = "<span class='errmsg'>! </span>"; $MsgPostCode = "<span class='errmsg'>Please enter a valid post code </span><br>"; } else { $MsgPostCode=""; $Err9 = ""; }
  3. Okay the page loads fine with the form and everything, then when I press submit and I get past the JavaScript validation check the page reloads and it's just a blank white screen with no error messages, I spent a little while to determine it was the PHP validation section causing the problem but I can't see anything out of place, even compared to my other forms. All my form values are fine and work as they should be. P.S. I have already used error_report(E_ALL); but it didn't turn up anything wrong.
  4. Hey I've had this form that used to work until very recently, I'm pretty sure I've not made any changes to the problem area since it used to work but for some reason it's causing problems. The problem is the PHP form validation from lines 26 to 165 of the code below: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php session_start(); include "connect_details.php"; $Submit = $_POST['SubmitB']; if($_POST['SubmitB'] == "Submit") { $Campus = addslashes($_POST['Campus']); $CampusEmail = $_POST['CampusEmail']; $ConfirmEmail = $_POST['ConfirmEmail']; $TelNo = $_POST['TelNo']; $Add1 = addslashes($_POST['Add1']); $Add2 = addslashes($_POST['Add2']); $Add3 = addslashes($_POST['Add3']); $Town = addslashes($_POST['Town']); $County = addslashes($_POST['County']); $PostCode = addslashes($_POST['PostCode']); $Errors = "0"; // This section is causing errors when it used to work and works fine without it, but I need to keep the PHP validation. if(empty($Campus)) { $Errors++; $Err1 = "<span class='errmsg'>! </span>"; $MsgCampus = "<span class='errmsg'>Please Enter the Campus Name</span><br>"; } else { $MsgCampus=""; $Err1 = ""; } if($CampusEmail !== $ConfirmEmail) { $Errors++; $Err2 = "<span class='errmsg'>! </span>"; $MsgCampusEmail = "<span class='errmsg'>The Email Addresses do not match please re-confirm them</span><br>"; } else { if(empty($CampusEmail)) { $Errors++; $Err2 = "<span class='errmsg'>! </span>"; $MsgCampusEmail = "<span class='errmsg'>Please Enter a Campus Email Address</span><br>"; } elseif(!preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $CampusEmail)) { $Errors++; $Err2 = "<span class='errmsg'>! </span>"; $MsgCampusEmail = "<span class='errmsg'>Please Enter a valid Campus Email Address</span><br>"; } else { $MsgCampusEmail=""; $Err2 = ""; } if(empty($ConfirmEmail)) { $Errors++; $Err3 = "<span class='errmsg'>! </span>"; $MsgConfirmEmail = "<span class='errmsg'>Please Enter a Confirmation Email Address</span><br>"; } elseif(!preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $ConfirmEmail)) { $Errors++; $Err3 = "<span class='errmsg'>! </span>"; $MsgConfirmEmail = "<span class='errmsg'>Please Enter a valid Confirmation Email Address</span><br>"; } else { $MsgConfirmEmail=""; $Err3 = ""; } } if(empty($TelNo)) { $Errors++; $Err4 = "<span class='errmsg'>! </span>"; $MsgTelNo = "<span class='errmsg'>Please Enter the Telephone Number!</span><br>"; } elseif(is_numeric($TelNo) == false) { $Errors++; $Err4 = "<span class='errmsg'>! </span>"; $MsgTelNo = "<span class='errmsg'>That is not a valid Telephone Number!</span><br>"; } else { $MsgTelNo=""; $Err4 = ""; } if(empty($Add1)) { $Errors++; $Err5 = "<span class='errmsg'>! </span>"; $MsgAdd1 = "<span class='errmsg'>Please Enter the Address Line 1</span><br>"; } else { $MsgAdd1=""; $Err5 = ""; } if(empty($Add2)) { $Errors++; $Err6 = "<span class='errmsg'>! </span>"; $MsgAdd2 = "<span class='errmsg'>Please Enter the Address Line 2</span><br>"; } else { $MsgAdd2=""; $Err6 = ""; } if(empty($Town)) { $Errors++; $Err7 = "<span class='errmsg'>! </span>"; $MsgTown = "<span class='errmsg'>Please Enter the Town</span><br>"; } else { $MsgTown=""; $Err7 = ""; } if(empty($County)) { $Errors++; $Err8 = "<span class='errmsg'>! </span>"; $MsgCounty = "<span class='errmsg'>Please Enter the County</span><br>"; } else { $MsgCounty=""; $Err8 = ""; } if(empty($PostCode)) { $Errors++; $Err9 = "<span class=\"errmsg\">! </span>"; $MsgPostCode = "<span class=\"errmsg\">Please Enter the Post Code</span><br>"; } elseif((length($PostCode) !== 7) || (length($PostCode) !== 6)) { $Errors++; $Err9 = "<span class='errmsg'>! </span>"; $MsgPostCode = "<span class='errmsg'>Please enter a valid post code </span><br>"; } else { $MsgPostCode=""; $Err9 = ""; } // End of section if($Errors==0) { $conn = mysql_connect($Host,$Username,$Password) or die(mysql_error()); $db = mysql_select_db($Dbname, $conn); $rs1 = mysql_query("SELECT * FROM Campus",$conn) or die(mysql_error()); $NumberOfRecords = mysql_num_rows($rs1); $CampusID = "Campus".($NumberOfRecords+1); $X = 1; while($OkCampusID == false) { $rs2 = mysql_query("SELECT CampusID FROM Campus WHERE CampusID='$CampusID'",$conn) or die(mysql_error()); if(mysql_num_rows($rs2)==1) { $OkCampusID = false; $CampusID = "Campus".$X; } else { $OkCampusID = true; } $X++; } $rsNew = mysql_query("INSERT INTO Campus (CampusID, Campus, CampusEmail, TelNo, Add1, Add2, Add3, Town, County, PostCode) VALUES('$CampusID','$Campus','$CampusEmail','$TelNo','$Add1','$Add2','$Add3','$Town','$County','$PostCode')",$conn) or die(mysql_error()); if(mysql_affected_rows($conn) == 1) { $_SESSION['NewAction'] = "Added"; } elseif(mysql_affected_rows($conn) == 0) { $_SESSION['NewAction'] = "NotAdded"; } mysql_close($conn); header("Location:display_campus_details.php?Action=Edit"); } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="keywords" content="Abingdon College, Witney College, clothing, Clothing Line, hats, bags, t-shirts, shirts, vests, jackets"> <meta name="description" content="Clothing Line"> <meta name="author" content="Adam Compton"> <title>Clothing Line - New Campus Form</title> <link href="stylesheetCL.css" rel="stylesheet"> <?php require('jscript.inc'); if(($_SESSION['User_Type'] == "Student") || ($_SESSION['User_Type'] == "")) { header("Location:../index.php"); } ?> <script language='JavaScript' type='text/JavaScript'> <!-- function IsNumeric(strString) { var strValidChars = "0123456789-"; var strChar; var Result = true; if (strString.length == 0) return false; for (i = 0; i < strString.length && Result == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { Result = false; } } return Result; } function Validate(f) { return (ValidateValues(f)==0 ? true : false ); } function ValidateValues(f) { var Errors = 0 if((document.AddCampus.Campus.value+'').length<1) { Errors++ document.getElementById('mySpan1a').style.display='block'; document.getElementById('mySpan1a').innerHTML='Please Enter a Campus Name!'; document.getElementById('mySpan1b').style.display='inline'; document.getElementById('mySpan1b').innerHTML='! '; } else { document.getElementById('mySpan1a').style.display='none'; document.getElementById('mySpan1a').innerHTML=''; document.getElementById('mySpan1b').style.display='none'; document.getElementById('mySpan1b').innerHTML=''; } if(document.AddCampus.CampusEmail.value !== document.AddCampus.ConfirmEmail.value) { Errors++ document.getElementById('mySpan2a').style.display='block'; document.getElementById('mySpan2a').innerHTML='The Email Addresses do not match, please re-confirm them!'; document.getElementById('mySpan2b').style.display='inline'; document.getElementById('mySpan2b').innerHTML='! '; document.getElementById('mySpan2d').style.display='inline'; document.getElementById('mySpan2d').innerHTML='! '; } else { if(document.AddCampus.CampusEmail.value =="") { Errors++ document.getElementById('mySpan2a').style.display='block'; document.getElementById('mySpan2a').innerHTML='Please Enter an Email Address!'; document.getElementById('mySpan2b').style.display='inline'; document.getElementById('mySpan2b').innerHTML='! '; } else if(!document.AddCampus.CampusEmail.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { Errors++ document.getElementById('mySpan2a').style.display='block'; document.getElementById('mySpan2a').innerHTML='Please Enter a Valid Email Address!'; document.getElementById('mySpan2b').style.display='inline'; document.getElementById('mySpan2b').innerHTML='! '; } else { document.getElementById('mySpan2a').style.display='none'; document.getElementById('mySpan2a').innerHTML=''; document.getElementById('mySpan2b').style.display='none'; document.getElementById('mySpan2b').innerHTML=''; } if(document.AddCampus.ConfirmEmail.value =="") { Errors++ document.getElementById('mySpan2c').style.display='block'; document.getElementById('mySpan2c').innerHTML='Please Enter an Confirmation Email Address!'; document.getElementById('mySpan2d').style.display='inline'; document.getElementById('mySpan2d').innerHTML='! '; } else if(!document.AddCampus.ConfirmEmail.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { Errors++ document.getElementById('mySpan2c').style.display='block'; document.getElementById('mySpan2c').innerHTML='Please Enter a Valid Confirmation Email Address!'; document.getElementById('mySpan2d').style.display='inline'; document.getElementById('mySpan2d').innerHTML='! '; } else { document.getElementById('mySpan2c').style.display='none'; document.getElementById('mySpan2c').innerHTML=''; document.getElementById('mySpan2d').style.display='none'; document.getElementById('mySpan2d').innerHTML=''; } } if((document.AddCampus.TelNo.value+'').length<0) { Errors++; document.getElementById('mySpan3a').style.display='block'; document.getElementById('mySpan3a').innerHTML='Please Enter the Telephone Number!'; document.getElementById('mySpan3b').style.display='inline'; document.getElementById('mySpan3b').innerHTML='! '; } else if((document.AddCampus.TelNo.value+'').length<11) { Errors++; document.getElementById('mySpan3a').style.display='block'; document.getElementById('mySpan3a').innerHTML='Please Enter a Valid Telephone Number!'; document.getElementById('mySpan3b').style.display='inline'; document.getElementById('mySpan3b').innerHTML='! '; } else if(IsNumeric(document.AddCampus.TelNo.value) == false) { Errors++; document.getElementById('mySpan3a').style.display='block'; document.getElementById('mySpan3a').innerHTML='Please Enter a valid Telephone Number!'; document.getElementById('mySpan3b').style.display='inline'; document.getElementById('mySpan3b').innerHTML='! '; } else { document.getElementById('mySpan3a').style.display='none'; document.getElementById('mySpan3a').innerHTML=''; document.getElementById('mySpan3b').style.display='none'; document.getElementById('mySpan3b').innerHTML=''; } if((document.AddCampus.Add1.value+'').length<1) { Errors++; document.getElementById('mySpan4a').style.display='none'; document.getElementById('mySpan4a').innerHTML='Please Enter Address Line 1!'; document.getElementById('mySpan4b').style.display='inline'; document.getElementById('mySpan4b').innerHTML='! '; } else { document.getElementById('mySpan4a').style.display='none'; document.getElementById('mySpan4a').innerHTML=''; document.getElementById('mySpan4b').style.display='none'; document.getElementById('mySpan4b').innerHTML=''; } if((document.AddCampus.Add2.value+'').length<1) { Errors++; document.getElementById('mySpan5a').style.display='none'; document.getElementById('mySpan5a').innerHTML='Please Enter Address Line 2!'; document.getElementById('mySpan5b').style.display='inline'; document.getElementById('mySpan5b').innerHTML='! '; } else { document.getElementById('mySpan5a').style.display='none'; document.getElementById('mySpan5a').innerHTML=''; document.getElementById('mySpan5b').style.display='none'; document.getElementById('mySpan5b').innerHTML=''; } if((document.AddCampus.Town.value+'').length<1) { Errors++ document.getElementById('mySpan6a').style.display='block'; document.getElementById('mySpan6a').innerHTML='Please Enter the Town!'; document.getElementById('mySpan6b').style.display='inline'; document.getElementById('mySpan6b').innerHTML='! '; } else { document.getElementById('mySpan6a').style.display='none'; document.getElementById('mySpan6a').innerHTML=''; document.getElementById('mySpan6b').style.display='none'; document.getElementById('mySpan6b').innerHTML=''; } if((document.AddCampus.County.value+'').length<1) { Errors++; document.getElementById('mySpan7a').style.display='block'; document.getElementById('mySpan7a').innerHTML='Please Enter the County!'; document.getElementById('mySpan7b').style.display='inline'; document.getElementById('mySpan7b').innerHTML='! '; } else { document.getElementById('mySpan7a').style.display='none'; document.getElementById('mySpan7a').innerHTML=''; document.getElementById('mySpan7b').style.display='none'; document.getElementById('mySpan7b').innerHTML=''; } if((document.AddCampus.PostCode.value+'').length<1) { Errors++; document.getElementById('mySpan8a').style.display='block'; document.getElementById('mySpan8a').innerHTML='Please Enter the Post Code!'; document.getElementById('mySpan8b').style.display='inline'; document.getElementById('mySpan8b').innerHTML='! '; } else { document.getElementById('mySpan8a').style.display='none'; document.getElementById('mySpan8a').innerHTML=''; document.getElementById('mySpan8b').style.display='none'; document.getElementById('mySpan8b').innerHTML=''; } return Errors; } //--> </script> </head> <body> <div class="MainContainer"> <?php require('header.inc'); require('menu.inc') ?> <div class="DivMain"> <span class="head1">New Campus Form</span><br> <span class="errmsg">All fields marked with an * are required</span><br><br> <?php echo $MsgCampus; echo $MsgCampusEmail; echo $MsgConfirmEmail; echo $MsgTelNo; echo $MsgAdd1; echo $MsgAdd2; echo $MsgTown; echo $MsgCounty; echo $MsgPostCode; ?> <span id="mySpan1a" class="mySpan1a"><br></span> <span id="mySpan2a" class="mySpan2a"><br></span> <span id="mySpan2c" class="mySpan2c"><br></span> <span id="mySpan3a" class="mySpan3a"><br></span> <span id="mySpan4a" class="mySpan4a"><br></span> <span id="mySpan5a" class="mySpan5a"><br></span> <span id="mySpan6a" class="mySpan6a"><br></span> <span id="mySpan7a" class="mySpan7a"><br></span> <span id="mySpan8a" class="mySpan8a"><br></span> <br> <form method="POST" action="add_campus_details_form.php" name="AddCampus" onSubmit="return Validate(this);"> <table style="width: auto; position: absolute;"> <tr><td><?php echo $Err1?><span id="mySpan1b" class="mySpan1b"></span><span class="head4">Campus Name:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="33" name="Campus" maxlength="30" value="<?php echo $Campus?>"/></label> </td></tr> <tr><td><?php echo $Err2?><span id="mySpan2b" class="mySpan2b"></span><span class="head4">Campus Email:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="55" maxlength="50" name="CampusEmail" value="<?php echo $CampusEmail?>"/></label> </td></tr> <tr><td><?php echo $Err3?><span id="mySpan2d" class="mySpan2d"></span><span class="head4">Confirm Email:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="55" maxlength="50" name="ConfirmEmail" value="<?php echo $ConfirmEmail?>"/> </label></td></tr><tr></tr> <tr><td><?php echo $Err4?><span id="mySpan3b" class="mySpan3b"></span><span class="head4">Telephone No:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="15" maxlength="15" name="TelNo" value="<?php echo $TelNo?>"/></label><span class="normal"> (No spaces)</span> </td></tr> <tr><td><?php echo $Err5?><span id="mySpan4b" class="mySpan4b"></span><span class="head4">Address 1:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="33" name="Add1" maxlength="30" value="<?php echo $Add1?>"/></label> </td></tr> <tr><td><?php echo $Err6?><span id="mySpan5b" class="mySpan5b"></span><span class="head4">Address 2:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="33" name="Add2" maxlength="30" value="<?php echo $Add2?>"/></label> </td></tr> <tr><td><span class="head4">Address 3:</span><br></td> <td width="300"><label><input type="text" size="33" name="Add3" maxlength="30" value="<?php echo $Add3?>"/></label> </td></tr> <tr><td><?php echo $Err7?><span id="mySpan6b" class="mySpan6b"></span><span class="head4">Town:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="33" name="Town" maxlength="30" value="<?php echo $Town?>"/></label> </td></tr> <tr><td><?php echo $Err8?><span id="mySpan7b" class="mySpan7b"></span><span class="head4">County:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="20" name="County" maxlength="20" value="<?php echo $County?>"/></label> </td></tr> <tr><td><?php echo $Err9?><span id="mySpan8b" class="mySpan8b"></span><span class="head4">Post Code:</span><span class="errmsg"> *</span></td> <td width="300"><label><input type="text" size="7" maxlength="7" name="PostCode" value="<?php echo $PostCode?>"/></label><span class="normal"> (No spaces)</span> </td></tr> <tr><td> <input type="submit" name="SubmitB" class="buttonS" style="overflow:visible; width:auto" value="Submit" onMouseOver="OverMouse(this)"; onMouseOut="OutMouse(this)"/> <input type="reset" name="ResetB" class="buttonS" style="overflow:visible; width:auto" value="Reset" onMouseOver="OverMouse(this)"; onMouseOut="OutMouse(this)"/> </td></tr> <tr></tr> <tr><td><a href="display_campus_details.php?Action=Edit">Back to Edit Campus Details List</a></td></tr> </table> </form> </div> </div> </body> </html> If anyone can tell me why it's happening I'd be greatly appreciated.
  5. Edit: Okay I did a little bit of searching for the SQL Date_Sub() function and came across a solution: $sql = "SELECT * FROM UserAccount WHERE Status='0' AND DateOfReg <= {fn DATE_SUB({fn CURDATE()}, INTERVAL 14 DAY)}"; Thanks anyway for trying!
  6. Hi, I have a user list where I sort between various criteria from the database, one of which is to see which Inactive users haven't activated their account after 14 days, the date of registration is also a field in the table for comparison. I have tried to select only those users who haven't activated after that time period but it just brings up all the inactive users instead of a few who registered more than 2 weeks ago. Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php session_start(); if(isset($_POST['DelYes'])) { } ?> <html> <head> <title>Clothing Line</title> <link href="stylesheetCL.css" rel="stylesheet"> <?php require('jscript.inc'); if(($_SESSION['User_Type'] == "Student") || ($_SESSION['User_Type'] == "")) { header("Location:../index.php"); } else { $Action = $_GET['Action']; $NewAction = $_SESSION['NewAction']; if ($Action == "") { header("Location:admin.php"); } $Sort = $_GET['Sort']; if($Sort =="") { $Sort = "All"; } } ?> </head> <body> <div class="MainContainer"> <?php require('header.inc'); include "connect_details.php"; require('menu.inc'); ?> <div class="DivMain"> <?php $conn = mysql_connect($Host,$Username,$Password) or die(mysql_error()); $db = mysql_select_db($Dbname, $conn); if($Sort == "All") { $Category = "All"; $sql = "SELECT * FROM UserAccount"; } elseif($Sort == "Admins") { $Category = "Admins"; $sql = "SELECT * FROM UserAccount WHERE AccountType='Admin'"; } elseif($Sort == "Students") { $Category = "Students"; $sql = "SELECT * FROM UserAccount WHERE AccountType='Student'"; } elseif($Sort == "Inactive") { $Category = "Inactive"; $sql = "SELECT * FROM UserAccount WHERE Status='0'"; } elseif($Sort == "Unactivated") { $Category = "Unactived"; //THIS IS THE PROBLEM######### $sql = "SELECT * FROM UserAccount WHERE Status='0' AND DATE_SUB(NOW(), INTERVAL 14 DAY) >= DateOfReg "; //THIS IS THE PROBLEM######### } if ($Action == "Edit") { echo"<span class=\"head3\">List of Users - Category: ".$Category."</span><br><br> <a href=\"display_user_details.php?Action=Edit&Sort=All\">All Users</a> | <a href=\"display_user_details.php?Action=Edit&Sort=Admins\">Admins</a> | <a href=\"display_user_details.php?Action=Edit&Sort=Students\">Students</a> | <a href=\"display_user_details.php?Action=Edit&Sort=Inactive\">Inactive Users</a> | <a href=\"display_user_details.php?Action=Edit&Sort=Unactivated\">Overdue Activated Users</a><br><br>"; $rs = mysql_query($sql, $conn); if(mysql_affected_rows($conn) == 0) { echo"<span class='errmsg'>There are no users in this category</span><br><br>"; } else { echo"<span class=\"head4\">Click on one to edit</span><br><br> <table border=\"0\" cellpadding=\"3\"><tr> <th>Surname</th> <th>Email</th> <th>Campus</th> <th>Date Of Reg</th> <th>User Type</th> <th>Status</th> </tr>"; while($row = mysql_fetch_array($rs)) { $UserID = $row['UserID']; $Surname = $row['Surname']; $Email = $row['Email']; $Campus = $row['Campus']; $DateOfReg = $row['DateOfReg']; $UserType = $row['AccountType']; $Status = $row['Status']; $Activity = ""; if($Status == 0) { $Activity = "Inactive"; } else { $Activity = "Active"; } echo "<tr style=\"color:#E61732; line-height:8pt\" onMouseOver=\"this.style.backgroundColor='#FF7777';this.style.color='black'; this.style.cursor='pointer'\"onMouseOut=\"this.style.backgroundColor='white';this.style.color='#E61732'\" onClick=\"location.href='edit_user_details_form.php?UserID=$UserID'\"> <td class=\"tdcenter\">$Surname</td> <td class=\"tdcenter\">$Email</td> <td class=\"tdcenter\">$Campus</td> <td class=\"tdcenter\">$DateOfReg</td> <td class=\"tdcenter\">$UserType</td> <td class=\"tdcenter\">$Activity</td> </tr>"; } mysql_close($conn); echo"</table>"; } } elseif($Action == "Delete") { echo"<span class=\"head3\">List of Users - Category: ".$Category."</span><br><br>"; echo"<a href=\"display_user_details.php?Action=Delete&Sort=All\">All Users</a> | <a href=\"display_user_details.php?Action=Delete&Sort=Students\">Students</a> | <a href=\"display_user_details.php?Action=Delete&Sort=Admins\">Admins</a> | <a href=\"display_user_details.php?Action=Delete&Sort=Inactive\">Inactive Users</a> | <a href=\"display_user_details.php?Action=Delete&Sort=Unactivated\">Overdue Activated Users</a><br><br>"; $rs = mysql_query($sql, $conn); if(mysql_affected_rows($conn) == 0) { echo"<span class=\"errmsg\">There are users in this category</span><br><br>"; } else { echo"<span class=\"head4\">Click on one to delete</span><br><br> <table border=\"0\" cellpadding=\"3\"><tr> <th>Surname</th> <th>Email</th> <th>Campus</th> <th>Date Of Reg</th> <th>User Type</th> <th>Status</th> </tr>"; while($row = mysql_fetch_array($rs)) { $UserID = $row['UserID']; $Surname = $row['Surname']; $Email = $row['Email']; $Campus = $row['Campus']; $DateOfReg = $row['DateOfReg']; $UserType = $row['AccountType']; $Status = $row['Status']; $Activity = ""; if($Status == 0) { $Activity = "Inactive"; } else { $Activity = "Active"; } echo "<tr style=\"color:#E61732; line-height:8pt\" onMouseOver=\"this.style.backgroundColor='#FF7777';this.style.color='black'; this.style.cursor='pointer'\"onMouseOut=\"this.style.backgroundColor='white';this.style.color='#E61732'\" onClick=\"if(confirm('Are you sure you wish to delete this user?'))window.location.href='delete_user.php?UserID=$UserID'\"> <td class=\"tdcenter\">$Surname</td> <td class=\"tdcenter\">$Email</td> <td class=\"tdcenter\">$Campus</td> <td class=\"tdcenter\">$DateOfReg</td> <td class=\"tdcenter\">$UserType</td> <td class=\"tdcenter\">$Activity</td> </tr>"; } mysql_close($conn); echo"</table>"; } } if($Sort == "Unactivated") { echo" <br><span class=\"head4\">All of the above users have not activated their account in the alloted 2 weeks, do you wish to remove them?</span> <form method=\"post\" name=\"DeleteUnactivated\" action=\"display_user_details.php?Action=$Action\"> <input type=\"submit\" name=\"DelYes\" class=\"buttonS\" style=\"overflow:visible; width:auto\" value=\"Yes\" onMouseOver=\"OverMouse(this)\"; onMouseOut=\"OutMouse(this)\"/>"; } if($NewAction == "Added") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User successfully Added!</span></div>"; } elseif($NewAction == "NotAdded") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User could not be Added!</span></div>"; } if($NewAction == "Edited") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User successfully Edited!</span></div>"; } elseif($NewAction == "NotEdited") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User could not be Edited!</span></div>"; } if($NewAction == "Deleted") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User successfully Deleted!</span></div>"; } elseif($NewAction == "NotDeleted") { echo"<br><div style='position:relative; top:100x; left:0px; width:300px'> <span class='head4'>User could not be Deleted!</span></div>"; } echo"<br><br><a href=\"admin.php\">Back to Admin Menu</a>"; unset($_SESSION['NewAction']); ?> </div> </div> </body> </html>
  7. The only thing I can see is: $query = "select * from school_data where school_district = '".$selected_district."'"; should be: $query = "select * from school_data where school_district = '$selected_district'";
  8. I just noticed something when browsing through you're form coding, on each form input you didn't use value=\"\" even when you paused the echo to place the php variable in, so you must have forgotten that. Although it still seems to post the other info fine except for the id, but give it a shot at least, plus this is how you're form inputs should look like anyway so I'd recommend keeping it. <?php echo "<form method=\"post\" action=\"update_user.php\" id=\"user_update\" name=\"user_update\">"; echo "<p>"; echo "<label for=\"id\">ID:</label><input type=\"text\" disabled=\"disabled\" name=\"id\" id=\"id\" value=\"" . $row['id'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"username\">Username:</label><input type=\"text\" disabled=\"disabled\" name=\"username\" id=\"username\" value=\"" . $row['username'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"name\">First Name:</label><input type=\"text\" name=\"name\" id=\"name\" value=\"" . $row['name'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"surname\">Surname:</label><input type=\"text\" name=\"surname\" id=\"surname\" value=\"" . $row['surname'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"email\">E-mail:</label><input type=\"text\" name=\"email\" id=\"email\" value=\"" . $row['email'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"password\">Password:</label><input type=\"password\" name=\"password\" id=\"password\" onKeyUp=\"passwordStrength(this.value)\" value=\"" . $row['password'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"passconf\">Confirm Password:</label><input type=\"password\" name=\"passconf\" id=\"passconf\" value=\"" . $row['password'] . "\">"; echo "</p>"; echo "<p>"; echo "<label for=\"passwordStrength\">Password Strength</label>"; echo "<div id=\"passwordDescription\">Password not entered</div>"; echo "<div id=\"passwordStrength\" class=\"strength0\"></div>"; echo "</p>"; echo "<p>"; echo "<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Update\">\n"; echo "</p>"; echo "</form>"; ?>
  9. So what you can do is place userId into a hidden field within the form to send that information through the POST. P.S. You don't need to use concatenation with this: WHERE `id`='".$id."', WHERE `id`='$id' would be just fine unless you planned to add some non-variable onto the Id.
  10. With the Array you need to use: $name = $array['Name']; (or whatever field name it is) $email = $array['Email']; $location = $array['Location']; BTW with an array it would actually start at 0 instead of 1, so 0,1,2 not 1,2,3.
  11. <?php $text = 'Some content;?> [phpcode]<?php echo $test; ?>[/phpcode] some content [phpcode]<?php echo $test; ?>[/phpcode] <?php $text = preg_replace('/\[phpcode\](.*?)\[\/phpcode\]/ie', 'highlight_string(\'$1\', TRUE)', $text); echo $text; ?>
  12. Use a counter variable in your while loop and increment it for each loop: if($counter%3==0&&$counter!=0) echo"</tr><tr>"; Use this for the incrementing: ++$counter;
  13. Just curious, what's the purpose of checking for a numeric value? mysql_real_escape_string() won't do anything to a number anyway, does it? Perhaps he just uses it on all his inputs just in case.
  14. select subid from pay_code where mincost<'300000' and mode1='rent' order by subid desc limit 1; You have too many 0's, if you want 7 you only need 30K not 300K.
  15. I can see a lot of simple syntax errors from what I know of PHP5, but whether they are the only causes is unknown at this point. Here's my attempt at converting them all: //------------------------Begin Monster-------------------------------------------// function monster(){ $page = $_GET['page']; if(empty($page)){ $page = 1; } $limit = 25; $query_count = "SELECT id, name, lvl, members FROM monsters ORDER BY name ASC"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); $limitvalue = $page * $limit - ($limit); echo "<p><font class=\"adminheader\">Monster Admin</font></p>"; echo "<TABLE border=\"0\" width=\"89%\" class=monster>\n"; echo "<TR><TD class=title><center>Monster Name</center></td><td class=title><center>Edit</center></TD</TR>\n"; /* query for monsters */ $query = "SELECT id, name, lvl, members FROM monsters ORDER BY name ASC LIMIT $limitvalue, $limit"; $result = mysql_query ($query); while ($row = mysql_fetch_assoc ($result)) { /* display monsters in a table */ /* place table row data in * easier to use variables. */ $count = $count + 1; $name = $row['name']; $level = $row['lvl']; /* display the data */ echo "<TR bgcolor=\"".processRow($count)."\"><TD class=\"calc\"><b>".$name."</b></td><td class=\"calc\"><a href=\"".$_SERVER['PHP_SELF'] . "?flibble=m_update&id=".$row['id']."\"><img src=\"images/admin/view.gif\" alt=\"Edit\" border=\"0\"></a> <a href=\"".$_SERVER['PHP_SELF'] . "?flibble=m_delete&id=".$row['id']."\"><img src=\"images/admin/delete.gif\" alt=\"Delete\" border=\"0\"></a></TD></TR>"; if($count == 2){ $count = 0; } } /* finish up table*/ echo "</TABLE><center>\n"; if($page != 1){ $pageprev = $page-1; echo "<a href=\"admin.php?flibble=monster&page=".$pageprev."\">Previous</a> "; }else{ echo "Previous "; } $numofpages = $totalrows / $limit; for($i = 1; $i <= $numofpages; $i++){ if($i == $page){ echo $i." "; }else{ echo " <a href=\"admin.php?flibble=monster&page=".$i."\">".$i."</a> "; } } if(($totalrows % $limit) != 0){ if($i == $page){ echo $i." "; }else{ echo 2 <a href=\"admin.php?flibble=monster&page=".$i."\">".$i."</a> "; } } if(($totalrows - ($limit * $page)) > 0){ $pagenext = $page+1; echo " <a href=\"admin.php?flibble=monster&page=".$pagenext."\">Next</a>"; }else{ echo " Next"; } echo "<p><b><a href=\"http://runehints.com/admin.php?flibble=add_monster\"><img src=\"images/plus.gif\" alt=\"Add\" border=\"0\"> Add monster</a></b></p>"; } function m_update($id) { /* query for item */ $query = "SELECT * FROM monsters WHERE id=$id"; $result = mysql_query ($query); /* if we get no results back, error out */ $numrtn = mysql_num_rows($result); if ($numrtn == 0) { echo "The monster requested cannot be found\n"; return; } $row = mysql_fetch_assoc($result); /* easier to read variables and * striping out tags */ $id = $row['id']; $name = $row['name']; $lvl = $row['lvl']; $hp = $row['hp']; $race = $row['race']; $location = $row['location']; $members = $row['members']; $examine = $row['examine']; $contrib = $row['contributedby']; $drops = $row['drops']; $picture = $row['picture']; $sxp = $row['slayerxp']; if ($members = "Y") { $mem = "Yes"; }else{ $mem = "No"; } $xphp1 = $hp * 1.3333333333333333333; $xpo = $hp * 4; $xp1 = $hp * 5.3333333333333333333; $xphp = sprintf('%.0f', $xphp1); $xp = sprintf('%.0f', $xp1); if (isset($_POST['submit'])){ //handle form require_once ('../mysql_connect.php');//connect to db $name = escape_data($_POST['name']); $picture = escape_data($_POST['picture']); $level = escape_data($_POST['level']); $hp = escape_data($_POST['hp']); $members = escape_data($_POST['members']); $examine = escape_data($_POST['examine']); $location = escape_data($_POST['location']); $loot = escape_data($_POST['drops']); $contrib = escape_data($_POST['contrib']); $race = escape_data($_POST['race']); $sxp = escape_data($_POST['sxp']); if ($name && $picture && $level && $hp && $members && $examine && $location && $loot && $contrib){//if evrything is ok $query = "UPDATE monsters SET name = '$name' , lvl = '$level', hp = '$hp', members = '$members', location = '$location', examine = '$examine', drops = '$loot', contributedby = $contrib', picture = '$picture', slayerxp = '$sxp' WHERE id ='$id'"; $result = @mysql_query ($query); //Run the query. if ($result){ //if it entered correctly echo "<br /><table width=98% bgcolor=#C6F4DF class=pass align=center><tr> <td width=40><img src=images/tick.gif></td> <td align=left> <B>Success</B> <BR> The ".$name."\'s data was successfully updated<br /> </table><br /><br />"; include ('difffooter.inc');//footer exit(); }else{ // didn't work echo "<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr> <td width=40><img src=images/exclamation.gif></td> <td align=left> <B>Update Failed!</B> <BR> The ".$name."\'s data was could not be updated <BR>Please Try again later<br /> </table><br /><br />"; } }else{ echo "<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr> <td width=40><img src=images/exclamation.gif></td> <td align=left> <B>Update Failed!</B> <BR> Data missing. <BR>Please enter all information needed and try again<br /> </table><br /><br />"; } } /* display the items */ echo "<br /><center><font class=\"adminheader\">Update Monster Information</font></center> <br />"; echo "<form action=\"admin.php?flibble=m_update&id=".$id."\" method=\"post\">"; ?> <table width="89%" height="334" border="0" class="monster"> <tr> <td><center><input type="text" class="text" name="name" size="15" maxlength="30" value="<?php echo "$name"; ?>" /></center></td> </tr> <tr> <td><table width="101%" height="297" border="1" class="monster"> <tr> <td height="115" width="17%">Picture:</td> <td><img src="monster/<?php echo $picture; ?>"><br /><br /><input type="text" class="text" name="picture" size="15" maxlength="30" value="<?php echo "$picture"; ?>" /></td> <td width="34%">Level:</td> <td><input type="text" class="text" name="level" size="3" maxlength="3" value="<?php echo "$lvl"; ?>" /></td> </tr> <tr> <td height="23" width="17%">Race:</td> <td><input type="text" class="text" name="race" size="15" maxlength="30" value="<?php echo "$race"; ?>" /></td> <td width="34%">Members?</td> <td><input type="text" class="text" name="members" size="1" maxlength="1" value="<?php echo "$members"; ?>" /></td> </tr> <tr> <td height="23" width="17%">Hitpoints:</td> <td><input type="text" class="text" name="hp" size="3" maxlength="4" value="<?php echo "$hp"; ?>" /></td> <td>Xp gained total:</td> <td><?php echo "$xp"; ?></td> </tr> <tr> <td height="23">Xp gained to hits:</td> <td colspan="1"><?php echo "$xphp"; ?></td> <td>Xp that goes to other combat skill:</td> <td colspan="1"><?php echo "$xpo"; ?></td> <tr> <td height="23" width="17%">Location:</td> <td><input type="text" class="text" name="location" value="<?php echo "$location"; ?>" /></td> <td width="34%">Examine:</td> <td><input type="text" class="text" name="examine" value="<?php echo "$examine"; ?>" /></td> </tr> <tr> <td height="74" width="17%">Contributed by:</td> <td><input type="text" class="text" name="contrib" value="<?php echo $contrib; ?>" /></td> <td width="34%">Loot:</td> <td><textarea name="loot" rows="18" cols="50"><?php echo $drops; ?></textarea></td> </tr> <tr> <td>Slayer XP:</td> <td><input type="text" class="text" name="sxp" size="3" maxlength="4" value="<?php echo "$sxp"; ?>" /></td> </tr> </table></td> </tr> </table> <div align="center"><input type="submit" name="submit" value="Update DB" class="liteoption" /> <input type="reset" name="reset" value="reset" class="liteoption" /></div></form> <?php } function m_delete($id){ $query = "SELECT `name` FROM monsters WHERE id=$id"; $result = mysql_query ($query); /* if we get no results back, error out */ $numrtn = mysql_num_rows($result); if ($numrtn == 0) { echo "The monster requested cannot be found\n"; return; } $row = mysql_fetch_assoc($result); /* easier to read variables and * striping out tags */ $name = $row['name']; if (isset($_POST['yes'])){ //handle form $query = "DELETE FROM `monsters` WHERE `id` = ".$id." LIMIT 1"; $result = mysql_query($query); if ($result) { ob_end_clean(); header("http://runehints.com/admin.php?flibble=monster"); } } echo "<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr> <td width=40><img src=images/exclamation.gif></td> <td align=left> <B>Delete?</B> <BR> Are you sure you want to delete ".$name." from the database? <BR><br /><form action=\"admin.php?flibble=m_delete&id=".$id."\" method=\"post\"><input type=\"submit\" name=\"yes\" value=\"Yes\" class=\"delete\" /> <input name=\"no\" type=button onClick=\"javascript&#38;#058;history.go(-1)\" value=\"No\" class=\"delete\" /></form> </table><br /><br />"; } function add_monster() { if (isset($_POST['submit'])){ //handle form require_once ('../mysql_connect.php');//connect to db $name = escape_data($_POST['name']); $picture = escape_data($_POST['picture']); $level = escape_data($_POST['level']); $hp = escape_data($_POST['hp']); $members = escape_data($_POST['members']); $examine = escape_data($_POST['examine']); $location = escape_data($_POST['location']); $loot = escape_data($_POST['loot']); $contrib = escape_data($_POST['contrib']); $race = escape_data($_POST['race']); $slayer = escape_data($_POST['sxp']); if ($name && $picture && $level && $hp && $members && $examine && $location && $loot && $contrib){//if evrything is ok $uploaddir = 'monster/'; $uploadfile = $uploaddir . $_FILES['image']['name']; $upload = move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile); if( $upload == TRUE ) { echo "<font face=verdana color=green size=1>The picture was uploaded successully</font><br />"; $query = "INSERT INTO monsters (name, lvl, hp, members, location, examine, race, drops, contributedby, picture, slayerxp ) VALUES ('$name', '$level', '$hp', '$members', '$location', '$examine', '$race', '$loot', '$contrib', '$picture', '$slayerxp' )"; $result = @mysql_query ($query); //Run the query. if ($result){ //if it entered correctly echo "<br /><table width=98% bgcolor=#C6F4DF class=pass align=center><tr> <td width=40><img src=images/tick.gif></td> <td align=left> <B>Success</B> <BR> The ".$name."\'s data was successfully added<br /> </table><br /><br />"; include ('difffooter.inc');//footer exit(); }else{ // didn't work echo "<table width=98% bgcolor=#faf5f4 class=logfail align=center><tr> <td width=40><img src=images/exclamation.gif></td> <td align=left> <B>Update Failed!</B> <BR> The ".$name."\'s data was could not be added <BR>Please Try again later<br /> </table><br /><br />"; } } else { echo "Error while uploading file, transfer aborted<br /><pre>"; print_r($_FILES); echo "</pre>"; exit; } } } ?> <br /><font class="adminheader"><center>Add monster</center></font><br /> Here you can add monsters to the database. Be sure to give credit properly where it is due!<br /> <form action="admin.php?flibble=add_monster" method="post" enctype="multipart/form-data"><center> <table class=calc> <tr><td> <table> <tr><td align=right><font class="text2">Monster Name:</font></td><td align=left><input type="text" class="text" name="name" size="15" maxlength="30" value="<?php if (isset($_POST['name'])) echo $_POST['name']; ?>" /></td></tr> <tr><td align=right><font class="text2">Picture:</font></td><td align=left><input name="image" type="file"></td></tr> <tr><td align=right><font class="text2">Picture Name:</font></td><td align=left><input type="text" class="text" name="picture" size="15" maxlength="30" value="<?php if (isset($_POST['picture'])) echo $_POST['picture']; ?>" /><span class="small">Simply put the name of the file you uploaded in here. eg. if in the box above you had "C:\images\image.jpg" what would go in here is "image.jpg"</span><br /></td></tr> <tr><td align=right><font class="text2">Monster's Level:</font></td><td align=left><input type="text" class="text" name="level" size="3" maxlength="3" value="<?php if (isset($_POST['level'])) echo $_POST['level']; ?>" /></td></tr> <tr><td align=right><font class="text2">Monster's HP:</font></td><td align=left><input type="text" class="text" name="hp" size="3" maxlength="4" value="<?php if (isset($_POST['hp'])) echo $_POST['hp']; ?>" /></td></tr> <tr><td align=right><font class="text2">Slayer XP:</font></td><td align=left><input type="text" class="text" name="sxp" size="3" maxlength="4" value="<?php if (isset($_POST['sxp'])) echo $_POST['sxp']; ?>" /></td></tr> <tr><td align=right><font class="text2">Monster's Race:</font></td><td align=left><input type="text" class="text" name="race" size="15" maxlength="30" value="<?php if (isset($_POST['race'])) echo $_POST['race']; ?>" /></td></tr> <tr><td align=right><font class="text2">Members?:</font></td><td align=left><input type="text" class="text" name="members" size="1" maxlength="1" value="<?php if (isset($_POST['members'])) echo $_POST['members']; ?>" /><font class="small2">Use Y or N only</font></td></tr> <tr><td align=right><font class="text2">Monster's Examine Description:</font></td><td align=left><input type="text" class="text" name="examine" size="25" maxlength="255" value="<?php if (isset($_POST['examine'])) echo $_POST['examine']; ?>" /><font class="small2">Please be sure to get it exact.</font></td></tr> <tr><td align=right><font class="text2">Monster's Location:</font></td><td align=left><input type="text" class="text" name="location" size="25" maxlength="255" value="<?php if (isset($_POST['location'])) echo $_POST['location']; ?>" /></td></tr> <tr><td align=right><font class="text2">Monster's Loot:</font></td><td align=left><textarea name="loot" rows="18" cols="50" wrap="physical"><?php if (isset($_POST['loot'])) echo $_POST['loot']; ?></textarea></td></tr> <tr><td align=right><font class="text2">Contributed by:</font></td><td align=left><input type="text" class="text" name="contrib" size="25" maxlength="100" value="<?php if (isset($_POST['contrib'])) echo $_POST['contrib']; ?>" /><font class="small2"> The person who gave you the information not you (unless you are providing your own information)</font></td></tr> </table> </td> </tr> <tr> <td> <div align="center"><input type="submit" name="submit" value="Add Monster" class="liteoption" /> <input type="reset" name="reset" value="reset" class="liteoption" /></div> </td> </tr> </table> </CENTER> </form> <?php } //------------------------End Monster-------------------------------------------// //--monster--// case 'monster': monster(); break; case 'add_monster': add_monster(); break; case 'm_update': m_update($_GET['id']); break; case 'm_delete': m_delete($_GET['id']); break;
  16. The only thing I can suggest since I can't fully understand what values would be entered into your fields would be to use a foreach loop on the arrays, and either concatenate each value into a single string that only needs to be entered once, or you add a new record for each time a checkbox is selected.
  17. If you have a connection script when you come to use the mysql_query() function you need to do this mysql_query($query,$conn);
  18. SQL for first part: $sql = "SELECT Location_id FROM Location WHERE Location='London'"; $rs = mysql_query($sql); //(If you have a connection you need to have ($sql,$conn) After using the mysql_query function you set the mysql_fetch_array function in a While loop. While($row = mysql_fetch_array($rs)) { $LocationID = $row['Location_id']; $sql2 = "SELECT * FROM Listing WHERE Location_id ='$LocationID'"; $rs2 = mysql_query($sql2); $row2 = mysql_fetch_array($rs2); $ListingID = $row2['Listing_id']; $ListingTitle = $row2['Listing_title']; $ListingDesc = $row2['Listing_Description']; }
  19. Try this based off the code you gave me: $find_items_sql1 = mysql_query("SELECT * FROM safety_box WHERE owner = '$userid' AND game = '$game' LIMIT $start,50"); while ($find_items_sql2 = mysql_fetch_array($find_items_sql1)) { $ItemID = $find_items_sql2['item_id']; $find_items_sql3 = mysql_fetch_array(mysql_query("SELECT * FROM items2 WHERE id ='$ItemID' AND game = '$game' ORDER BY item_name DESC")); $Record0 = $find_items_sql3['id']; $Record1 = $find_items_sql3['item_name']; $Record2 = $find_items_sql2['stock']; $Record3 = $find_items_sql3['item_value']; $Record4 = $find_items_sql3['item_desc']; echo "<TR BGCOLOR=\"$maincellColor\"> <TD WIDTH=85><CENTER><IMG SRC=\"images/user_images/opg_$game/items/item_$Record0.gif\"></CENTER></TD> <TD WIDTH=90><CENTER><FONT SIZE=\"-1\"><B>$Record1</B></FONT><BR></CENTER></TD> <TD WIDTH=45><CENTER><FONT SIZE=\"-1\">$Record2</FONT></CENTER></TD> <TD WIDTH=55><CENTER><FONT SIZE=\"-1\">$Record3</FONT></CENTER></TD> <TD><P><FONT SIZE=\"-1\">$Record4</FONT></P></TD> <TD WIDTH=100><CENTER><FONT SIZE=\"-1\">Remove: <INPUT TYPE=text NAME=\"remove[$id]\" VALUE=\"0\" SIZE=7 MAXLENGTH=6><BR> item(s)</FONT></CENTER></TD> </TR>"; }
  20. No problem Don't forget to use the Topic Solved button on the bottom of the page in the thread when the problem is resolved.
  21. PHP doesn't like echoing any of the major tags like <form> or <table> and their equivalent closing tags, it might also not like form <input>, learnt that the hard way like you about 5 months ago.
  22. Try this as well: <?php session_start(); ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Users</title> </head> <body> <TABLE> <th>ID</th> <th>NAME</th> <th>USERNAME</th> <th>EMAIL</th> <?php $user="*******"; $password="********"; $database="*********"; $conn = mysql_connect("*************" ,$user,$password); @mysql_select_db($database, $conn) or die(mysql_error); $result = mysql_query("SELECT * FROM USERS",$conn); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['NAME'] . "</td>"; echo "<td>" . $row['USERNAME'] . "</td>"; echo "<td>" . $row['EMAIL'] . "</td>"; echo "</tr>"; } mysql_close($conn); ?> </TABLE> </body> </html>
  23. Try: $result = mysql_query("SELECT * FROM USERS",$conn);
  24. What error messages or lack thereof are you getting on the page when you load it? Also, I'm not sure if this helps in any way but it might reduce confusion with the $find_items variable being used with little difference between the names. $find_items_sql1 = mysql_query("SELECT * FROM safety_box WHERE owner = '$userid' AND game = '$game' ORDER BY item_id LIMIT $start,50"); while ($find_items = mysql_fetch_array($find_items_sql1)) { $find_item2 = mysql_fetch_array(mysql_query("SELECT * FROM items2 WHERE id ='$find_items['item_id']' AND game = '$game' ORDER BY item_name")); $Record1 = $find_item2['Record1']; ... }
×
×
  • 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.