Here is my code snippet to go to the required page :Code to go to next page .
<a href="text.php?post_id=<?php echo "$postid" + "$one" ; ?> ">NEXT </a><br/>
and the code of processing page that again r开发者_运维百科eturn to the same page :
$postid = mysql_real_escape_string($_GET['post_id']);
$get_next_page = "SELECT post_title from posts where post_id ='$postid' ";
$confirm_next_page = @mysql_query($get_next_page) ;
if(!$confirm_next_page)
{
echo "<a href=\"javascript: history.go(-1)\">Back</a></h2>". mysql_error();
}
while($row =@mysql_fetch_array($confirm_next_page))
{
$redirect_page = "post.php?post_id=$postid&post_title=$post_title";
header("location : $redirect_page ");
}
?>
when I execute this code I get 404 page not found .I have checked the permissons and they are set to read/write for me . If I go to index of / , it shows me a Back button as required and this error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Thankx !
Ok, 404 means that the server is unable to find the file you're looking for. (404 literally means file not found). If you are getting this error, it means that you have probably mis-typed the name of the file. To be sure, however, you may wish to make sure that there are no .htaccess
files or the like in the directory you're working in -- those can cause problems, but my experience is that bad .htaccess
results in a 500 because it involves a redirect resulting in a 404
The reason you're getting that MySQL error is probably because you have entered the url correctly, but you have omitted the post_id
parameter. If this is the case, that means that you have turned your error reporting down below maximum. I highly recommend that you turn them back on high.
精彩评论