Questions about a user comment in PHP

Source: Internet
Author: User
Question of a user comment in PHP
I wrote a program, the user can comment on the submitted article, the code is as follows,


<title></title>




Session_Start ();
Check whether to log in, and then turn to the login screen if not logged in
if (!isset ($_session[' userid ')) {
Header ("Location:login.html");
Exit ();
}
Include ("menu.php");
echo "Back to homepage";
Include ("config.php");
$sql = "SELECT * from text where id={$_get[' id '}";
$result =mysql_query ($sql, $conn);
echo "
";
if ($row =mysql_fetch_assoc ($result)) {
echo $row [' title '];
echo "
";
echo "Author:". $row [' author '];
echo "Date of publication:". Date ("Y-m-d h:m:s", $row [' time ']);
echo "


";
echo $row [' article '];
echo "


";
}else{
echo "The article does not exist";
}
?>







Want to know how to put the PHP code in the $row["id" to the docomment.php, so that he can be called in the docomment.php, ask the great God teach you
------Solution--------------------
action= "Docomment.php?id="
docomment.php page using $_get[' ID ').
Or put a hidden text in the form input value is $row["id"]
------Solution--------------------
Reference:
action= "docomment.php?id="
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.