Lamez Posted February 10, 2008 Share Posted February 10, 2008 Can someone review my code, and see if there are any errors. What it is suppose to do, is see if the user is in the paid table, and if they are show a link, but if the user is not in the paid table show a checkbox. So please just look over my code for errors <?php include ("../../style/include/session.php"); include ("../../style/include/cons/head_2.php"); if($session->isAdmin()){ print '<div class="box"><h2>Select Paid</h2>'; ?> <form action="pay_do.php" method="post"> <table width="63%" border="0"> <tr> <td width="194"><strong>First Name </strong></td> <td width="261"><strong>Last Name </strong></td> <td width="273"><strong>Paid (username) </strong></td> </tr> <? $qr=mysql_query("select * from users order by first"); $pt=mysql_query("select * from paid order by user"); while ($rs=mysql_fetch_assoc($qr)) { $pu=mysql_fetch_assoc($pt); $table = 'paid'; $field = 'user'; $compared = $pu['user']; $result = mysql_query("SELECT $field FROM $table WHERE $field = '$compared'"); ?> <tr> <td><? echo $rs['first'];?></td> <td><? echo $rs['last'];?></td> <td> <? if(mysql_num_rows($result)==0) { //"Not Paid "; ?> <input type="checkbox" name="checkbox[]" value="<? echo $rs['username'] ?>" /> <?php } else { echo '<a href="pay_dele.php?cmd=delete&user='.$rs['username'].'">Not Paid</a> '; } ?> (<? echo $rs['username']; ?>) </td> <? } ?> </tr> </table> <br /> <input name="Submit" type="Submit" value="Mark Paid" /> </form> <?php }else{ header("Location: ../../index.php"); } print '</div>'; include ("../../style/include/cons/foot.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/90373-any-errors/ Share on other sites More sharing options...
budimir Posted February 10, 2008 Share Posted February 10, 2008 If you want us to check if there is any errors in your code, you need to gives your include files!!! Why are you using lon and short php tags? Did you enable short tags? Can't you just start your script and see if you get any errors? What do we need to check? Quote Link to comment https://forums.phpfreaks.com/topic/90373-any-errors/#findComment-463348 Share on other sites More sharing options...
Lamez Posted February 10, 2008 Author Share Posted February 10, 2008 I am very sorry. Those include files are just my heading, and the file to tell if the user is logged in or not(session.php), and my footer. Those are not the problems. I do have shot tags enabled. I did not get any errors, but the scripts does not run properly Quote Link to comment https://forums.phpfreaks.com/topic/90373-any-errors/#findComment-463549 Share on other sites More sharing options...
EchoFool Posted February 10, 2008 Share Posted February 10, 2008 How does it not run properly.. what does it do wrong.. does it if no error comes up on your screen it wont on ours.. but turn error reporting on just to check everything. Quote Link to comment https://forums.phpfreaks.com/topic/90373-any-errors/#findComment-463550 Share on other sites More sharing options...
Lamez Posted February 11, 2008 Author Share Posted February 11, 2008 when I select a user, it is suppose to add the user to the paid databse, well it does, but then it suppose to show a link if they are in the paid table. Well it shows it on the wrong user. Quote Link to comment https://forums.phpfreaks.com/topic/90373-any-errors/#findComment-463572 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.