teng84 Posted August 6, 2007 Share Posted August 6, 2007 <a href=" ?x=1" onclick="javascript: var x = confirm ('are you sure you want to delete'); if(x==false){ return false;}">confirm</a> i have test that it works HMMm you keep on fallowing q LOL is that a trick Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316392 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 or <html> <head> <script type="text/javascript"> function disp_confirm() { var r=confirm("Press a button") if (r==false) return false; } </script> </head> <body> <a href=" ?x=1" onclick="disp_confirm()">confirm</a> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316393 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 How can I do it in mine? Right now it just deletes without a notification, so obviously the code I added didn't work. Here is the part we need to work on: echo "<tr> <td><a href=view.php?id=$id>$name</a></td> <td>$from</td> <td>$genre</td> <td><a href='index.php?delete=$id' onclick='return confirm('Are you sure you want to delete?')'>Delete</a></td> <td><a href='index.php?edit=$id'>Edit</a></td></tr>"; } // end while echo "</table>"; Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316397 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 echo "<tr> <td><a href=view.php?id=$id>$name</a></td> <td>$from</td> <td>$genre</td> <td><a href='index.php?delete=$id' onclick='javascript: var x = confirm (\"are you sure you want to delete\"); if(x==false){ return false;}'>confirm</a>'; </td> <td><a href='index.php?edit=$id'>Edit</a></td></tr>"; Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316398 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Thank you so much for all of your help! It all works great.. I appreciate this so much. Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316406 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 glad its all done you owe me alot lol Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316407 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Yeah, if you ever have a computer or malware problem, let me know. I'm in training for malware removal right now. Thanks so much, Adam Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316410 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 thats was a joke im not expecting anything im at the office and no task so i do this to spend my time beside im from ASIA so can you lol Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316414 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Sorry, unsolved. :( I found a huge bug. When in edit.. we use HTML in the description and removal instructions. It seems that the HTML interferes with the text box in edit. It shows the last part of the HTML in text next to the text box in some of the entries. If you want a screenshot.. let me know. Thanks and sorry, Adam Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316425 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 post every thing you think can help me help you Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316427 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Screenshot attached and here is the current code because I changed it a bit. Thanks. <html> <head> <title>ParasiteDB - Research and Remove Parasites!</title> <META content="parasite, virus, malware, removal, computer, pc, database, pdb, db" name=keywords> <META content="You can research and find ways to remove hundreds of different parasites here. Come take a look!" name=description> <style TYPE="text/css"> A{text-decoration:none} A:hover{color:#FFFFFF;text-decoration:underline} } BODY { SCROLLBAR-FACE-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #0099CC; SCROLLBAR-3DLIGHT-COLOR: #0099CC; SCROLLBAR-ARROW-COLOR: #0099CC; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #0000000; } </style> </head> <BODY BGCOLOR="#000000" TEXT="#FFFFFF" VLINK="#0099CC" ALINK="#0099CC" LINK="#0099CC" topmargin="0"> <table border="0" cellspacing="1" width="100%"> <tr> <td width="100%" background="logo.jpg"> <table border="0" cellpadding="0" cellspacing="0" width="100%" bordercolor="#FFFFFF"> <tr> <td width="100%" background="images/logo.jpg" height="80"> <p align="center"><font color="#FFFFFF" size="4" face="Arial"><b>ParasiteDB - Research and Remove Parasites!</b></font></td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="1" cellpadding="5" cellspacing="5" width="100%" bordercolor="#FFFFFF"> <tr> <td width="20%" valign="top"> <font face="Arial" size="2"><b> Navigation</b></font><br> <font face="Arial" size="2"> - <a href="http://parasitedb.freehostia.com/index.php">Home</a><br> - <a href="mailto:Webmaster@parasitedb.freehostia.com?subject=Contact Us">Contact Us</a><br> - <a href="mailto:Webmaster@parasitedb.freehostia.com?subject=Advertise">Advertise</a><br> - <a href="http://parasitedb.freehostia.com/search.php">Search</a><br> - <a href="index.php">Staff Login</a><br> - <a href="view_online.php">View Users Online</a></font> <font face="Arial" size="1"> <p> </font><font face="Arial" size="2"> <font face="Arial" size="2">Google Ads Coming Soon!</font></a><font face="Arial" size="1"> <p> <font face="Arial" size="2"><b> Sponsors</b></font><br> </font><font face="Arial" size="2">- <a href="http://malwareremoval.com/">Malware Removal</a><br> - <a href="http://pchelpforum.com/">PC Help Forum</a><br> </font></td> <td width="80%" valign="top"><b><font face="Arial"><font size="2" color="#FFFFFF"><center><br> <?php if (isset($_GET['addparasite'])): // User wants to add a joke ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label>Name:<br /> <textarea name="parasitename" rows="1" cols="50"> </textarea></label><br /> <label>From:<br /> <textarea name="parasitefrom" rows="1" cols="50"> </textarea></label><br /> <label>Genre:<br /> <textarea name="parasitegenre" rows="1" cols="50"> </textarea></label><br / <label>Description:<br /> <textarea name="parasitedescription" rows="5" cols="50"> </textarea></label><br /> <label>Removal Info:<br /> <textarea name="parasiteremoval" rows="5" cols="50"> </textarea></label><br /> <input type="submit" value="Add" name="parasiteadd" /> </form> <?php else: // Default page display $dbcnx = @mysql_connect('', 'adaarm_db', ''); if (!$dbcnx) { exit('<p>Unable to connect to the ' . 'database server at this time.</p>'); } if (!@mysql_select_db('adaarm_db')) { exit('<p>Unable to locate the ' . 'database at this time.</p>'); } if (isset($_GET['edit'])) { $edit_id = $_GET['edit']; unset($_GET['edit']); $query = "SELECT * FROM parasite WHERE id='$edit_id'"; $result = mysql_query($query)or die(mysql_error()); $data = mysql_fetch_assoc($result); ?> <fieldset><legend>Parasite Edit</legend> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="id" value="<?php echo $data['id']; ?>"> Parasitename:<input type="text" name="parasitename" value="<?php echo $data['parasitename']; ?>"><br /> Parasitefrom:<input type="text" name="parasitefrom" value="<?php echo $data['parasitefrom']; ?>"><br /> Parasitegenre:<input type="text" name="parasitegenre" value="<?php echo $data['parasitegenre']; ?>"><br /> Parasitedescription:<input type="text" name="parasitedescription" cols="3" value="<?php echo $data['parasitedescription']; ?>"><br /> Parasiteremoval:<input type="text" name="parasiteremoval" cols="3" value="<?php echo $data['parasiteremoval']; ?>"><br /> <input type="submit" value="Submit" name="parasiteedit"> </form> </fieldset> <?php } if (isset($_REQUEST['parasiteedit'])) { $n = $_REQUEST['parasitename']; $f = $_REQUEST['parasitefrom']; $g = $_REQUEST['parasitegenre']; $d = $_REQUEST['parasitedescription']; $r = $_REQUEST['parasiteremoval']; $id= $_REQUEST['id']; $edit_sql = "UPDATE parasite SET parasitename='$n', parasitefrom='$f', parasitegenre='$g', parasitedescription='$d', parasiteremoval='$r' WHERE id='$id'"; $result = mysql_query($edit_sql)or die(mysql_error()); if ($result) { echo "The parasite named $edit_name has been changed.<br /> New values: <br /> Parasitename: $parasitename <br /> Parasitefrom: $parasitefrom <br /> Parasitegenre: $parasitegenre <br /> Parasitedescription: $parasitedescription <br /> Parasiteremoval: $parasiteremoval"; }else{ echo "The edit request could not be carried out."; } } if (isset($_GET['delete'])) { $delete_id = $_GET['delete']; unset($_GET['delete']); $delete_sql = "DELETE FROM parasite WHERE id='$delete_id'"; $result = mysql_query($delete_sql)or die(mysql_error()); if ($result) { echo "The parasite has been deleted."; } else { echo "The delete could not be carried out."; } } if (isset($_POST['parasiteadd'])) { $parasitename = $_POST['parasitename']; $parasitefrom = $_POST['parasitefrom']; $parasitegenre = $_POST['parasitegenre']; $parasitedescription = $_POST['parasitedescription']; $parasitetechremoval = $_POST['parasiteremoval']; $sql = "INSERT INTO parasite SET parasitename='$parasitename', parasitefrom='$parasitefrom', parasitegenre='$parasitegenre', parasitedescription='$parasitedescription', parasiteremoval='$parasiteremoval'"; if (@mysql_query($sql)) { echo "<p>The parasite '$parasitename' has been added.</p>"; } else { echo '<p>Error adding submitted parasite: ' . mysql_error() . '</p>'; } } include'notes.php'; echo '<br><p><a href="' . $_SERVER['PHP_SELF'] . '?addparasite=1">Add a Parasite</a></p>'; $sql = mysql_query("SELECT parasitename,parasitefrom,parasitegenre,parasitedescription,parasiteremoval,id FROM parasite ORDER BY parasitename ASC") or die(mysql_error()); echo "<h3>Parasites in Database:</h3><br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center>Name</td> <td align=center>From</td> <td align=center>Genre</td> <td align=center>Delete</td> <td align=center>Edit</td> </tr>"; while ($r = mysql_fetch_array($sql)) { // Begin while $id = $r["id"]; $name = $r["parasitename"]; $from = $r["parasitefrom"]; $genre = $r["parasitegenre"]; $description = $r["parasitegenre"]; $removal = $r["parasiteremoval"]; /* create a $_GET variable called delete using the objects id. Edit the this page link to the name of this page.*/ echo "<tr> <td><a href=view.php?id=$id>$name</a></td> <td>$from</td> <td>$genre</td> <td><a href='index.php?delete=$id' onclick='javascript: var x = confirm (\"Are you sure you want to delete?\"); if(x==false){ return false;}'>Delete</a></td> <td><a href='index.php?edit=$id'>Edit</a></td></tr>"; } // end while echo "</table>"; endif; ?> </table> </center> </div> <p> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <p align="center"><font size="2"><font face="Arial">All Site Content © 2007 - ParasiteDB<br>All Rights Reserved</font></td> </tr> </table> </BODY> </html> [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316428 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 what is the error and what do you want with that i think its fine or maybe i just dont see the prob Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316431 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Look in my screenshot where parasiteremoval is in the edit. Next to the text box it says SmitfraudFix tool by noahd... The removal instructions are cut off there and put outside the textbox. Also could we make the textboxes a little bigger for description and removal? Thanks, Adam Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316436 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 first put the textboxes in table as layout and we cant make test boxes bigger but using css yes or you can adjust the size of the text box. maybe theres an overflow so try using the layour or can you send me the url address ill look at it Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316441 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Sorry but the staff area is protected by .htaccess (username and password). My webhost isn't allowing me to create anymore right now.. I can't even get into the control panel. :S But FTP is still working so I can edit the files. And how would I put them in a table layout? Like with <table><td> etc.? Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316442 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 <fieldset><legend>Parasite Edit</legend> <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <br /> <br /> <br /> <table width="200" border="1"> <tr> <td><input type="hidden" name="id" value="<?php echo $data['id']; ?>" /> Parasitename:</td> <td><input type="text" name="parasitename2" value="<?php echo $data['parasitename']; ?>" /></td> </tr> <tr> <td>Parasitefrom:</td> <td><input type="text" name="parasitefrom2" value="<?php echo $data['parasitefrom']; ?>" /></td> </tr> <tr> <td>Parasitegenre:</td> <td><input type="text" name="parasitegenre2" value="<?php echo $data['parasitegenre']; ?>" /></td> </tr> <tr> <td>Parasitedescription:</td> <td><input type="text" name="parasitedescription2" cols="3" value="<?php echo $data['parasitedescription']; ?>" /></td> </tr> <tr> <td>Parasiteremoval:</td> <td><input type="text" name="parasiteremoval2" cols="3" value="<?php echo $data['parasiteremoval']; ?>" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit" name="parasiteedit" /></td> </tr> </table> <br /> <br /> </form> </fieldset> Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316444 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 New screenshot uploaded. Still not working right, [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316445 Share on other sites More sharing options...
teng84 Posted August 6, 2007 Share Posted August 6, 2007 now im not getting you u use this if (isset($_GET['edit'])) { so basically it will show everything if true as well as the query inside Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316449 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 Now I am getting confused too. That line below parasiteremoval is not supposed to be there. It comes from the parasiteremoval part and should be in the edit box. Let's start by making the textbox bigger. How? Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316456 Share on other sites More sharing options...
EagleAmerican Posted August 6, 2007 Author Share Posted August 6, 2007 *Bump* Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-316794 Share on other sites More sharing options...
EagleAmerican Posted August 7, 2007 Author Share Posted August 7, 2007 *Bump* Quote Link to comment https://forums.phpfreaks.com/topic/62711-solved-edit-and-delete-function/page/2/#findComment-317285 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.