Jump to content

richarro1234

Members
  • Posts

    146
  • Joined

  • Last visited

Everything posted by richarro1234

  1. hmmm, ok thanks. im not really sure how to hide the fuill path of a mysql error like that. the rest should be pretty easy to fix. i cant do anything now as i need to be up and at work in 7 hours. Thanks for that, will get them fixed and re-post link after updated. Thanks Rich
  2. there, its in the welcome message bit: Welcome to Nosepad, the future of social networking! Sign up today and start making friends! It's fast, easy and free! Sign up and get connected with all your friends! The best way to keep in touch, share photos, create groups and events! PHP FREAKS PROFILE Site Statistics People Online: Guests Online: 0 Members Online: 0 Cant miss it. Thanks Rich
  3. top of the header, should show up at the very very top of the page.
  4. Hey, can some nice people test my site for SQL injection please? i say nice people as i dont want my database to be gone when i get back from work lol. i would just like to know what threats there are and what page(s) they are one. Here is the link http://www.futurehost.org/index.php i have added a link back to my php freaks profile, (i think i saw something saying there needed to be a link back to your profile to proove you own the site?) Thanks Rich
  5. nobody know how to fix it? damn it, does anyone have a pre-made code example i could look at to get an idea of how to delete multiple images form a folder and mysql database? thanks rich
  6. <?include("header.php");?> <? if ($_GET['note'] == 'deleted') { $note = "<br><center> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='75%' id='AutoNumber1' bordercolor='red' bgcolor='#000000'> <tr> <td width='100%' class=trnext align='center'><font color='red' size='2'><b>Your images have been deleted successfully!</b></font></td> </tr> </table> </center><br>"; } include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from richspri_social.users WHERE username = '".$_COOKIE["twusername"]."'"); while ($r = @mysql_fetch_array($query)) { $approv = $r['id']; ?> <? if ($_GET['action'] == 'deletemulti') { foreach($_POST['deleted_items'] as $v){ mysql_query("delete from richspri_social.userimg where file_name IN($v)"); } foreach($_POST['deleted_items'] as $deleted){ unlink($deleted); } header ("Location: approveimg.php?note=deleted"); die(); } ?> <?}?> <center> <?=$note?></center> <br> <div align="center"> <center> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#5D6765" width="95%" id="AutoNumber1" bgcolor="#131313"> <tr> <td width="5%" align="center" bgcolor="#000000"><b>Delete</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Picture</b></td> <td width="16%" align="center" bgcolor="#000000"><b>User Edited</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Value Edited</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Original Value</b></td> <td width="15%" align="center" bgcolor="#000000"><b>New Value</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Date</b></td> </tr> <tr> <td width="100%" align="center" colspan="6"> </td> </tr> <form action="approveimg.php?action=deletemulti" name="approv" method="post"> <? $results= mysql_query("SELECT * FROM richspri_social.userimg WHERE approved = 'no'"); $id = "id"; $filename = "file_name"; $filesize = "filesize"; $filetype = "filetype"; $desc = "description"; $ownerid = "ownerid"; $path = "filepath"; echo mysql_error(); if (mysql_Numrows($results)>0) //if there are records in the fields { $numrows=mysql_NumRows($results); //count them $x=0; while ($x<$numrows){ //loop through the records $theid=mysql_result($results,$x,$id); $thename=mysql_result($results,$x,$filename); $thesize=mysql_result($results,$x,$filesize); $theowner=mysql_result($results,$x,$ownerid); $thetype=mysql_result($results,$x,$filetype); $thedesc=mysql_result($results,$x,$desc); $thepath=mysql_result($results,$x,$path); ?> <tr> <td width="5%" align="center"><input type="checkbox" class="normal" value="<?=$theid?>" name="deleted_items[]"> <td width="16%" align="center"><a href="../userimages/<?=$thename;?>"><img src="..//userimages/<?=$thename?>" width="100" height="100"></a> </td> <td width="16%" align="center"><a href="profile.php?id=<?=$memlink['id'];?>"><?=$theusername?></a> </td> <td width="16%" align="center"><?=$theaction?> </td> <td width="16%" align="center"><?=$theorigvalue?> </td> <td width="15%" align="center"><?=$thenewvalue?> </td> <td width="16%" align="center"><?=$logdate?> </td> </tr> <? $x++; } ?> <td width="5%" align="center" bgcolor="#000000"><input type="submit" value="DEL"></td> <td width="95%" align="center" colspan="3" bgcolor="#000000"><font size="2"><b><a href="#" onclick="setCheckboxes('approv', true); return false;">Select All</a> | <a href="#" onclick="setCheckboxes('approv', false); return false;">Unselect All</a></b></font></td> </form </table> </center> </div> <?php } else { ?> </center> <center><b>There Are No New Images to Approve!</b></center> <br> <? } ?> </td> </tr> </table> </center> </div> <br> <?include("footer.php");?> Hey there, i have a folder called userimg where the files upload to, the above file is located in/admin/. i newed the above code to delete MULTIPLE files (which are sleected from the form under the mysql) AND delete the rows from the mysql database. At the moment it deletes the files form userimg, but it doesnt dleete it from the database, can someone help with the code so that it will delete the file and then dleete it form the database. Thanks Rich
  7. Still havent fixed it yet, any one got any more suggestions? Thanks Rich
  8. tried it, i got this: and yes they do exsist before someone says anything.
  9. <? if ($_GET['action'] == 'deletemulti') { $delete = $_POST["file_name"]; $deleted_items = join(', ', $_POST["deleted_items"]); $deleted_items1 = join(', ', $_POST["deleted_items1"]); chdir('../userimages/'); $do = unlink($deleted_items); if($do=="1"){ echo "The file was deleted successfully."; } else { echo "There was an error trying to delete the file."; } $query = mysql_query("DELETE FROM userimg WHERE id = ($deleted_items1)"); header ("Location: approveimg.php?note=delsucmulti"); die(); } ?> There
  10. someone help me please. i still cant get it working.
  11. that wopuld only change the display of it if anything, it wouldnt change the way it handles the php above it (the deletemulti action)
  12. yea i think thats why i cant find it either lol. well thanks for your help, ill leave it open and hope someone else will see what we cant see. Thanks Rich
  13. this is what i got after running the script again:
  14. ill try the print and report back, the form is under the second sql bit. <form action="approveimg.php?action=deletemulti" name="approv" method="post"> <? $results= mysql_query("SELECT * FROM userimg WHERE approved = 'no'"); $id = "id"; $filename = "file_name"; $filesize = "filesize"; $filetype = "filetype"; $desc = "description"; $ownerid = "ownerid"; echo mysql_error(); if (mysql_Numrows($results)>0) //if there are records in the fields { $numrows=mysql_NumRows($results); //count them $x=0; while ($x<$numrows){ //loop through the records $theid=mysql_result($results,$x,$id); $thename=mysql_result($results,$x,$filename); $thesize=mysql_result($results,$x,$filesize); $theowner=mysql_result($results,$x,$ownerid); $thetype=mysql_result($results,$x,$filetype); $thedesc=mysql_result($results,$x,$desc); $thename1 = "<img src='../userimages/$thename' height='100' width='100'>"; ?> <tr> <input type="hidden" class="normal" value="<?=$theid;?>" name="deleted_items1[]"> <td width="5%" align="center"><input type="checkbox" class="normal" value="<?=$thename?>" name="deleted_items[]"> <td width="16%" align="center"><a href="../userimages/<?=$thename;?>"><img src="..//userimages/<?=$thename?>" width="100" height="100"></a> </td> <td width="16%" align="center"><a href="profile.php?id=<?=$memlink['id'];?>"><?=$theusername?></a> </td> <td width="16%" align="center"><?=$theaction?> </td> <td width="16%" align="center"><?=$theorigvalue?> </td> <td width="15%" align="center"><?=$thenewvalue?> </td> <td width="16%" align="center"><?=$logdate?> </td> </tr> <? $x++; } ?> <td width="5%" align="center" bgcolor="#000000"><input type="submit" value="DEL"></td> <td width="95%" align="center" colspan="3" bgcolor="#000000"><font size="2"><b><a href="#" onclick="setCheckboxes('approv', true); return false;">Select All</a> | <a href="#" onclick="setCheckboxes('approv', false); return false;">Unselect All</a></b></font></td> </form>
  15. well that deletes the images still, but it doesnt delete from the database, it just gives me this erro:
  16. yea that deleltes the files form the server, but it wont delete it form the database, thats what the comma seperated was for.
  17. hey all, I have thispeice of code that displays images on a wenpage for approval, it all works fine for single file deletion, but as soon as you select more then one image to be deleted it doesnt work. At the moment it will delete the file from the server and delete the imagefrom the database, but multiples wont seem to work. Can someone help me as to why it wont work. Thanks <?include("header.php");?> <? if ($_GET['note'] == 'delsucmulti') { $note = "<br><center> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='75%' id='AutoNumber1' bordercolor='red' bgcolor='#000000'> <tr> <td width='100%' class=trnext align='center'><font color='red' size='2'><b>Your messages have been deleted successfully!</b></font></td> </tr> </table> </center><br>"; } include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from users WHERE username = '".$_COOKIE["twusername"]."'"); while ($r = @mysql_fetch_array($query)) { $approv = $r['id'];?> <? if ($_GET['action'] == 'deletemulti') { $delete = $_POST["file_name"]; $deleted_items = join(', ', $_POST["deleted_items"]); $deleted_items1 = join(', ', $_POST["deleted_items1"]); chdir('../userimages/'); $do = unlink($deleted_items); if($do=="1"){ echo "The file was deleted successfully."; } else { echo "There was an error trying to delete the file."; } $query = mysql_query("DELETE FROM userimg WHERE id = ($deleted_items1)"); header ("Location: approveimg.php?note=delsucmulti"); die(); } ?> <?}?> <center> <?=$note?></center> <br> <div align="center"> <center> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#5D6765" width="95%" id="AutoNumber1" bgcolor="#131313"> <tr> <td width="5%" align="center" bgcolor="#000000"><b>Delete</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Picture</b></td> <td width="16%" align="center" bgcolor="#000000"><b>User Edited</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Value Edited</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Original Value</b></td> <td width="15%" align="center" bgcolor="#000000"><b>New Value</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Date</b></td> </tr> <tr> <td width="100%" align="center" colspan="6"> </td> </tr> <form action="approveimg.php?action=deletemulti" name="approv" method="post"> <? $results= mysql_query("SELECT * FROM userimg WHERE approved = 'no'"); $id = "id"; $filename = "file_name"; $filesize = "filesize"; $filetype = "filetype"; $desc = "description"; $ownerid = "ownerid"; echo mysql_error(); if (mysql_Numrows($results)>0) //if there are records in the fields { $numrows=mysql_NumRows($results); //count them $x=0; while ($x<$numrows){ //loop through the records $theid=mysql_result($results,$x,$id); $thename=mysql_result($results,$x,$filename); $thesize=mysql_result($results,$x,$filesize); $theowner=mysql_result($results,$x,$ownerid); $thetype=mysql_result($results,$x,$filetype); $thedesc=mysql_result($results,$x,$desc); $thename1 = "<img src='../userimages/$thename' height='100' width='100'>"; ?> <tr> <input type="hidden" class="normal" value="<?=$theid;?>" name="deleted_items1[]"> <td width="5%" align="center"><input type="checkbox" class="normal" value="<?=$thename?>" name="deleted_items[]"> <td width="16%" align="center"><a href="../userimages/<?=$thename;?>"><img src="..//userimages/<?=$thename?>" width="100" height="100"></a> </td> <td width="16%" align="center"><a href="profile.php?id=<?=$memlink['id'];?>"><?=$theusername?></a> </td> <td width="16%" align="center"><?=$theaction?> </td> <td width="16%" align="center"><?=$theorigvalue?> </td> <td width="15%" align="center"><?=$thenewvalue?> </td> <td width="16%" align="center"><?=$logdate?> </td> </tr> <? $x++; } ?> <td width="5%" align="center" bgcolor="#000000"><input type="submit" value="DEL"></td> <td width="95%" align="center" colspan="3" bgcolor="#000000"><font size="2"><b><a href="#" onclick="setCheckboxes('approv', true); return false;">Select All</a> | <a href="#" onclick="setCheckboxes('approv', false); return false;">Unselect All</a></b></font></td> </form </table> </center> </div> <?php } else { ?> </center> <center><b>There Are No New Images to Approve!</b></center> <br> <? } ?> </td> </tr> </table> </center> </div> <br> <?include("footer.php");?>
  18. <?php if(isset($submit)) { $page = $_GET["page"]; $rowmax = 10; //Set this to the number of items you want returned per page if(!isset($page)) { $page = 1; } if($page == 1) { $pagein = 0; } if($page > 1) { $pagein = $page * $rowmax - $rowmax; } include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); //Below is where the total number of rows will be calculated //Below is where you would do the selected query to draw only paginated results. $results= mysql_query("SELECT * FROM adminactionlog Order by date desc LIMIT $pagein, $rowmax"); $id = "id"; $adminname = "adminname"; $username = "username"; $action = "action"; $origvalue = "origvalue"; $newvalue = "newvalue"; $date = "date"; echo mysql_error(); if (mysql_Numrows($results)>0) //if there are records in the fields { $numrows=mysql_NumRows($results); //count them $x=0; while ($x<$numrows){ //loop through the records $theid=mysql_result($results,$x,$id); $theadminname=mysql_result($results,$x,$adminname); $theusername=mysql_result($results,$x,$username); $theaction=mysql_result($results,$x,$action); $theorigvalue=mysql_result($results,$x,$origvalue); $thenewvalue=mysql_result($results,$x,$newvalue); $thedate=mysql_result($results,$x,$date); $logdate = date("m/d/Y h:i a",$thedate); ?> <? $query = mysql_query("SELECT * from users WHERE username = '$theadminname'"); while ($adminlink = mysql_fetch_array($query)) { ?> <? $query = mysql_query("SELECT * from users WHERE username = '$theusername'"); while ($memlink = mysql_fetch_array($query)) { ?> <tr> <td width="17%" align="center"><a href="profile.php?id=<?=$adminlink['id'];?>"><?=$theadminname?></a> </td> <td width="17%" align="center"><a href="profile.php?id=<?=$memlink['id'];?>"><?=$theusername?></a> </td> <td width="17%" align="center"><?=$theaction?> </td> <td width="17%" align="center"><?=$theorigvalue?> </td> <td width="16%" align="center"><?=$thenewvalue?> </td> <td width="16%" align="center"><?=$logdate?> </td> </tr> <? $x++; } ?> <?}?> <?}?> <?} $result1 = mysql_query($query1); while($row = mysql_fetch_array($result1)){ //This is the area where the paginated ruslts will be displayed by row results } //Below will only do calutaions if query was successful if($result1 != null) { $pagecount = ceil($num_rows / $rowmax); $resultinput = $pagein + 1; $resultsoutput = $pagein + $rowmax; if($resultsoutput > $num_rows) {$resultsoutput = $num_rows;}//Change $resultsoutput to $num_rows on last page here //Only displays pagination links if necessary below here if ($pagecount > 1) { echo "Page "; $x = 1; $y = $pagecount; for( $i = $x; $i <= $y; $i++ ) { print "<a href='adminlog1.php?page=$i'><b>[$i]</b></a> "; } } echo "<p align='center'>There were $num_rows results.<br />//Shows the total number of resutls on this line You are viewing results $resultinput through $resultsoutput.</p>";//shows which results you are viewing here } } ?> Thats what i got and all it shows is a blank white page.
  19. yes but because of the way its coded it doesnt seem to work, or atleast i couldnt get it to work, so got rid of the code to post on here.
  20. Hey all, im having some problems with this code. basically i would like to set-up pagination for it as it is often updated and gets big pretty quick, all the sctipts i havelooked at dont seem to work i was wondering if someone could help me with the pagination please Thanks in advance Rich <?include("header.php");?> <? if ($_COOKIE["status"] == "online") { include("data.php"); mysql_connect($server,$username, $password); mysql_select_db($database); $query = mysql_query("SELECT * from users WHERE username = '".$_COOKIE["twusername"]."'"); while ($r = mysql_fetch_array($query)) { ?> <center> <?=$note?></center> <br> <? if ($r['username'] == 'richarro123') { ?> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#5D6765" width="95%" id="AutoNumber1" bgcolor="#131313"> <tr> <td width="17%" align="center" bgcolor="#000000"><b>Admin</b></td> <td width="17%" align="center" bgcolor="#000000"><b>User Edited</b></td> <td width="17%" align="center" bgcolor="#000000"><b>Value Edited</b></td> <td width="17%" align="center" bgcolor="#000000"><b>Original Value</b></td> <td width="16%" align="center" bgcolor="#000000"><b>New Value</b></td> <td width="16%" align="center" bgcolor="#000000"><b>Date</b></td> </tr> <tr> <td width="100%" align="center" colspan="6"> </td> </tr> <?php $results= mysql_query("SELECT * FROM adminactionlog Order by date desc"); $id = "id"; $adminname = "adminname"; $username = "username"; $action = "action"; $origvalue = "origvalue"; $newvalue = "newvalue"; $date = "date"; echo mysql_error(); if (mysql_Numrows($results)>0) //if there are records in the fields { $numrows=mysql_NumRows($results); //count them $x=0; while ($x<$numrows){ //loop through the records $theid=mysql_result($results,$x,$id); $theadminname=mysql_result($results,$x,$adminname); $theusername=mysql_result($results,$x,$username); $theaction=mysql_result($results,$x,$action); $theorigvalue=mysql_result($results,$x,$origvalue); $thenewvalue=mysql_result($results,$x,$newvalue); $thedate=mysql_result($results,$x,$date); $logdate = date("m/d/Y h:i a",$thedate); ?> <? $query = mysql_query("SELECT * from users WHERE username = '$theadminname'"); while ($adminlink = mysql_fetch_array($query)) { ?> <? $query = mysql_query("SELECT * from users WHERE username = '$theusername'"); while ($memlink = mysql_fetch_array($query)) { ?> <tr> <td width="17%" align="center"><a href="profile.php?id=<?=$adminlink['id'];?>"><?=$theadminname?></a> </td> <td width="17%" align="center"><a href="profile.php?id=<?=$memlink['id'];?>"><?=$theusername?></a> </td> <td width="17%" align="center"><?=$theaction?> </td> <td width="17%" align="center"><?=$theorigvalue?> </td> <td width="16%" align="center"><?=$thenewvalue?> </td> <td width="16%" align="center"><?=$logdate?> </td> </tr> <? $x++; } ?> <?}?> <?}?> <?}?> </table> </center> </div> <?} else {?> <center><b>!</b></center> <?}?> <br> <? } } else { require( 'notloggedin.php' ); }?> <?include("footer.php");?>
  21. nope no errors, it runs the script properly as it shows up the msg that it was added successfully, but it just doesnt get the info from the textarea to the database. here is the full code incase the error lies elsewhere: <? include("data.php"); //include("funktioner.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); if ($_GET['action'] == 'update') { if ($_COOKIE["lilyusername"] == 'lily' || $_COOKIE["lilyusername"] == 'richarro123') { $editlist = $_GET['get'] == 'name' || $_GET['get'] == 'ingrediants' || $_GET['get'] == 'method'; } else { $editlist = $_GET['get'] == 'thugs' || $_GET['get'] == 'turns'; } if ($editlist) { $get = ($_GET['get']); $uid = ($_GET['id']); if ($_POST['newinfo'] == '') { header ("Location: editrecipe.php?error=1"); die(); } include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from recipes WHERE id = '$uid'"); while ($ther = mysql_fetch_array($query)) { $there = "yes"; $memuname = $ther['username']; $oldvalue = $ther[$get]; } if ($there == FALSE) { header ("Location: editrecipe.php?error=2"); die(); } include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $txt = str_replace(";", "<br>", $_POST['newinfo']); $query = mysql_query("UPDATE recipes SET $get = $txt WHERE id = $uid"); header ("Location: editrecipe.php?note=1"); die(mysql_error()); } } ?> <?include("header.php");?> <? if ($_COOKIE["lilystatus"] == "online") { include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from users WHERE username = '".$_COOKIE["lilyusername"]."'"); while ($r = mysql_fetch_array($query)) { ?> <? // Error messages if ($_GET['error'] == '1') { $note = "<br><center> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='75%' id='AutoNumber1' bordercolor='red' bgcolor='#000000'> <tr> <td width='100%' align='center'><font color='red' size='2'><b>You have to enter in something!</b></font></td> </tr> </table> </center><br>"; } if ($_GET['error'] == '3') { $note = "<br><center> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='75%' id='AutoNumber1' bordercolor='red' bgcolor='#000000'> <tr> <td width='100%' align='center'><font color='red' size='2'><b>Sorry couldn't edit that Article!</b></font></td> </tr> </table> </center><br>"; } // Note messages if ($_GET['note'] == '1') { $note = "<br><center> <table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' width='75%' id='AutoNumber1' bordercolor='red' bgcolor='#000000'> <tr> <td width='100%' align='center'><font color='red' size='2'><b>The article info was updated successfully!</b></font></td> </tr> </table> </center><br>"; } ?> <center> <?=$note?></center> <br> <? if ($r['rank'] == 'admin' || $r['rank'] == 'headadmin') { ?> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="75%" id="AutoNumber7" bgcolor="#000000"> <tr> <td width="100%" align="center"><font size="2"><b>Here is where you can Alter Any Article you want.</b></font></td> </tr> </table> </center> </div> <br> <? if ($_GET['action'] == '') { ?> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" id="AutoNumber4" bgcolor="#131313"> <tr> <td width="100%" colspan="3" height="14" bgcolor="#000000"> <p align="center"><b>Get Recipe</b></td> </tr> <tr> <td width="100%" colspan="3" height="14"></td> </tr> <tr> <td width="100%" colspan="3" height="13" align="center">Select the recipe by there ID or name.</td> </tr> <tr> <td width="100%" colspan="3" height="14"></td> </tr> <form action="editrecipe.php?action=getinfo" method="post"> <tr> <td width="33%" height="20"> <p align="right"> <select size="1" name="getby"> <option selected>ID</option> <option>name</option> </select> </td> <td width="33%" height="20" align="center"><input type="text" name="info" size="20"></td> <td width="34%" height="20"><input type="submit" value="Submit" name="B1"></td> </tr> </form> </table> </center> </div> <?} elseif ($_GET['action'] == 'getinfo') { include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from recipes WHERE ".$_POST['getby']." = '".$_POST['info']."'"); while ($al = mysql_fetch_array($query)) { $lastlogindate = date("dS of F, Y \@ h:i a",$al['lastlogin']); $registereddate = date("dS of F, Y \@ h:i a",$al['reggad']); ?> <br> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" id="AutoNumber5" bgcolor="#131313"> <tr> <td width="100%" colspan="3" bgcolor="#000000"> <p align="center"><b>Information for <?=$al['name'];?></b></td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> <tr> <td width="33%"> <p align="center"><b>ID:</b></td> <td width="33%" align="center"><?=$al['id'];?></td> <td width="34%"> </td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> <tr> <td width="33%"> <p align="center"><b>name:</b></td> <td width="33%" align="center"><?=$al['name'];?></td> <td width="34%"><a href="editrecipe.php?action=edit&get=name&what=name&id=<?=$al['id'];?>">EDIT</a></td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> <tr> <td width="33%"> <p align="center"><b>Date Posted:</b></td> <td width="33%" align="center"><?=$al['ingrediants'];?></td> <td width="34%"><a href="editrecipe.php?action=edit&get=ingrediants&what=ingrediants&id=<?=$al['id'];?>">EDIT</a></td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> <tr> <td width="33%"> <p align="center"><b>Article:</b></td> <td width="33%" align="center"><?=$al['method'];?></td> <td width="34%"><a href="editrecipe.php?action=edit&get=method&what=method&id=<?=$al['id'];?>">EDIT</a></td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> <tr> <td width="100%" colspan="3"> </td> </tr> </table> </center> </div> <? $there = "yes"; ?> <?}?> <? if ($there == FALSE) {?> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1"> <tr> <td width="100%"> <p align="center"><b>Sorry that user doesn't exist!</b></td> </tr> </table> <?}?> <?} elseif ($_GET['action'] == 'edit') { if ($_COOKIE["lilyusername"] == 'lily' || $_COOKIE["lilyusername"] == 'richarro123') { $editlist = $_GET['get'] == 'name' || $_GET['get'] == 'ingrediants' || $_GET['get'] == 'method'; } else { $editlist = $_GET['get'] == 'thugs' || $_GET['get'] == 'turns'; } if ($editlist){ $uid = ($_GET['id']); $what = ($_GET['what']); $get = ($_GET['get']); include("data.php"); mysql_connect($server,$anvandare, $losen); mysql_select_db($databas); $query = mysql_query("SELECT * from recipes WHERE id = $uid"); while ($edit = mysql_fetch_array($query)) { ?> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="75%" id="AutoNumber6" bgcolor="#131313"> <tr> <td width="100%" colspan="3" align="center" bgcolor="#000000"><b>Edit <?=$edit['name']?>'s <?=$what?></b></td> </tr> <tr> <td width="100%" colspan="3" align="center"> </td> </tr> <form action="editrecipe.php?action=update&id=<?=$uid?>&get=<?=$get?>" method="post"> <tr> <td width="33%"> <p align="center"><?=$edit['name']?>'s Current <?=$what?>: <br> <? $dsign = ""; $editget = $edit[$get]; ?> <?=$dsign?><?=$editget?> </td> <td width="34%"> <p align="center"> <?php if ($get == 'method') {?> <textarea rows="9" name="newinfo" cols="22" class="inquiryform" value="<?=$edit[$get]?>"></textarea> <?} else if ($get == 'ingrediants') {?> <textarea rows="9" name="newinfo" cols="22" class="inquiryform" value="<?=$edit[$get]?>"></textarea> <?} else {?> <input name="newinfo" maxlength="30" size="20" value="<?=$edit[$get]?>"> <?}?> </td> <td width="33%"> <input type="submit" value="Update"> </td> </tr> </form> </table> </center> </div> <?}?> <?}?> <?}?> <?} else {?> </p> <center><b>Only Admins May View This Page!</b></center> <?}?> <br> <? } } else { require( 'notloggedin.php' ); }?> <?include("footer.php");?>
×
×
  • 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.