Zepo. Posted June 27, 2007 Share Posted June 27, 2007 I have a list of news with an edit icon next to them. I made the url of each one /news.php?act=edit&id=5 where the id changes, so when in act=edit, it knows which one to edit. But when i use this link, it comes up with a blnk page. I'm lost. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 27, 2007 Share Posted June 27, 2007 its hard to help you without some code Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 27, 2007 Share Posted June 27, 2007 Did you tell your code to do something when the URL was like that? <?php if ($_GET['act'] == 'edit' && !empty($_GET['id'])){ //Put the edit form here } ?> Quote Link to comment Share on other sites More sharing options...
Zepo. Posted June 27, 2007 Author Share Posted June 27, 2007 Still says page cannot be found. Heres the code <?php /*Start the sesion*/ session_start(); /*Lets pull the data from the database*/ $result = mysql_query("SELECT * FROM news"); $news = mysql_fetch_array($result); /*Check the sessions permissions*/ if (isset($_SESSION['name'])) { if ($_SESSION['rights'] == 100){ if ($act == "editnews") { echo "<div class='pagetitle'>News Manager</div> <div style='margin:10px'> <br /> <table cellpadding='4' cellspacing='0' border='0' align='center' width='95%' class='tborder' id='optionsform' > <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' align='center' colspan='2'> <b>Edit News</b> </td> </tr>"; while($news = mysql_fetch_array($result)) { echo " <tr valign='top'> <td class='optiontitle' colspan='2'><div>$news[title]</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' >$news[news]</div><div align='right' style='float:right'> <a href='./news.php?act=edit&id=$news[id]'><img src='./images/edit.gif' alt='Edit' border='0'></a> | <a href='./news.php?act=delete&id=$news[id]'><img src='./images/delete.gif' alt='Delete' border='0'></a></div></td> </tr>"; } echo " </tbody> </table>"; } if ($_GET['act'] == 'edit' && !empty($_GET['id'])){ echo "TEST"; } if ($_GET['act'] == 'delete' && !empty($_GET['id'])){ echo "DELETE"; } } } ?> Webpage cannot be found..... I think i solved it , sorry guys. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 27, 2007 Share Posted June 27, 2007 first do some condensing if (isset($_SESSION['name'])) { if ($_SESSION['rights'] == 100){ if ($act == "editnews") { can be replaced with if (isset($_SESSION['name']) && $_SESSION['rights'] == 100 && $act == "editnews") { Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 27, 2007 Share Posted June 27, 2007 and you saying page can't even load? Quote Link to comment Share on other sites More sharing options...
per1os Posted June 27, 2007 Share Posted June 27, 2007 Are you sure that $_SESSION['rights'] is equal to 100 and session name are both set? If they are not it will never enter the if's. Quote Link to comment 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.