darkfreaks Posted February 6, 2008 Share Posted February 6, 2008 ok so i have a compaint form and iti snot showing up any ideas ??? Code: <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); { echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; }; $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/ Share on other sites More sharing options...
teng84 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); {///////<-----------------------------------------------------------------------------------what is that echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; };//----------------------------------------------------------------what is this? $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> see the comments Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459339 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once 'includes/header2.php'; $qls->Security->check_auth_page('complaints.php'); echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; include 'config.php'; $total_a = mysql_query("SELECT Count(*) AS Count FROM `vc_comments` WHERE `username` = 'admin'"); $total_b = mysql_result($total_a, 0, 0); if(!empty($total_b)) { $a = mysql_query("SELECT * FROM `vc_comments` WHERE `username` = 'admin' ORDER BY `id` DESC LIMIT 0,9"); while($b = mysql_fetch_assoc($a)) { echo '<table border="0" width="100%" cellpadding="0" cellspacing="0" class="table"> <tr> <td width="20"><input type="checkbox" id="'.$b['id'].'" value="'.$b['id'].'" name="id[]"></td> <td width="30%" align="center"> <a href="../profile/'.$b['fname'].'">'.$b['fname'].'</a><br>'.$b['date'].'<br> <a href="/commentsadd.php?u='.$b['fname'].'">[ Reply ]</a> </td> <td width="70%">'.$b['message'].'</td> </tr> </table>'; } } echo '<input type="submit" name="delete" id="delete" value="Delete Comments"></form>'; include 'includes/footer.php'; ?> thats how id do it.. Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459340 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 the form does not show butthedelete button does ??? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459345 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 Are you sure $num isn't an empty value? If it is, none of the form fields would display. Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459348 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 just ..in case someone reads what i wrote lol .. i got the <?php if(!empty($total_b)) ?> screwed up, it should be <?php if($total_b != 0) ?> or <?php if(!$total_b) ?> whatever is better ..dunno lol Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459349 Share on other sites More sharing options...
teng84 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); if(mysql_num_rows($result)>0){ echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr>"; while($row = mysql_fetch_array($result)){ $id =$row["id"]; $from = $row["fname"]; $date = $row["date"]; $message = $row["message"]; echo "<td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr>"; echo "</table>"; } } echo "<p><input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"></form>"; include ('includes/footer.php'); ?> try Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459351 Share on other sites More sharing options...
kankaro Posted February 6, 2008 Share Posted February 6, 2008 when you code arrange it properly Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459352 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 nope Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459355 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 'Nope' what? Who are you saying that to? Whats it in reference to? Did you check if $num is receiving anything from the database? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459365 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 its not empty no it queries ??? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459367 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 So what is it equal to when you output it? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459368 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 num is equal to 6 Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459369 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> that is NOT workin? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459374 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 nope Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459376 Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 lol ok ..just checkin.. ^^ Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459377 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 I think your problem may be here: echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; you are missing backslashes before mosto f your quotes. It should read: echo '<h2>Complaints/Reports</h2><form name=\"action\" id=\"action\" method=\"post\" action=\"/commentsdelete.php\">'; Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459426 Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 Actually the double quotes don't need to be escaped if echo is using single quotes. This is fine echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459429 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 Thats true. I don't use single quotes, so I wasn't thinking about that. Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459451 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 wrong wrong and wrong it is still not working Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459492 Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 Tell us what's not working. What's expected? Give us some details. wrong wrong and wrong it is still not working What are we supposed to do with that? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459494 Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 it didnt echo anything at ALL. regardless if i used single or double quotes Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459496 Share on other sites More sharing options...
hamza Posted February 6, 2008 Share Posted February 6, 2008 Dear , Some times mysql_num_rows getting error remove the mysql num and give some values to it and try to show your button. or go to php.net for the further help Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459537 Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 I just realized there is an extra set of curly braces ({}) around the echo statement. I think it is being skipped as a result. Remove those curly braces and your script should (may?) work. Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-459541 Share on other sites More sharing options...
darkfreaks Posted February 8, 2008 Author Share Posted February 8, 2008 those curly braces are needed because it is an else statement any oter ideas ??? ??? Link to comment https://forums.phpfreaks.com/topic/89652-solved-form-does-not-show/#findComment-461899 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.