Jump to content

Spot the problem


Zoofu

Recommended Posts

$amount_check = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."'"; 
		$amount_check_res = mysql_query($amount_check) or die(mysql_error()); 
		$amount_count = mysql_num_rows($amount_check_res); 
		$pages = ceil($amount_count/$limit); 

		$previous = ($page-1 <= 0) ? "« Prev" : "<a href=\"./index.php?act=topic&id=".$id."&page=".($page-1)."\">« Prev</a>"; 
		$nextpage = ($page+1 > $pages) ? "Next »" : "<a href=\"./index.php?act=topic&id=".$id."&page=".($page+1)."\">Next »</a>"; 
		echo "<tr><td align=\"right\" colspan=\"2\">\n";
		echo "Pages: ";
		echo $previous; 
		for($i=1;$i<=$pages;$i++){ 
		    $href = ($page == $i) ? " ".$i." " : " <a href=\"./index.php?act=topic&id=".$id."&page=".$i."\">".$i."</a> "; 
     
		    echo $href; 
		} 
		echo $nextpage; 
		echo "</td></tr>\n";
		$select_sql = "SELECT * FROM `forum_replies` WHERE `tid`='".$id."' ORDER BY id ASC LIMIT ".$end.",".$start.""; 
		$select_res = mysql_query($select_sql) or die(mysql_error()); 

		while($rowr = mysql_fetch_assoc($select_res)){
			echo "<tr><td colspan=\"2\" align=\"left\" class=\"forum_header\">Posted On: <em>".$rowr['date']."</em></td></tr>\n";
			echo "<tr><td align=\"left\" width=\"15%\" valign=\"top\" class=\"forum_header\">".uid($rowr['uid'], true)."<br>Total Posts: ".post($rowr['uid'])."<br>".$a."</td>\n";
			echo "<td align=\"left\" valign=\"top\" class=\"forum_header\">\n";
			echo topic($rowr['message']);
			echo "</td>\n";
			echo "</tr>\n";
		}
		echo "<form method=\"post\" action=\"./index.php?act=reply&id=".$row['id']."\">\n";
		echo "<tr><td colspan=\"2\" align=\"center\"><textarea style=\"width:90%\" name=\"reply\"></textarea><br><input type=\"submit\" name=\"submit\" value=\"Add Reply\" style=\"width:90%\"></td></tr>\n";
		echo "</table>\n";

 

in my next script I use:   

 

if(!$_POST['submit']){

 

but it doesn't run the rest of the script because apparently $_POST['submit'] doesn't actually exist.

 

[Above is only part of my script]

Link to comment
https://forums.phpfreaks.com/topic/171031-spot-the-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.