$_GET doesn't read by the 2nd page of my php file, but when i try to echo its working

huuphuoc

New Member
\[code\]<?phpif (isset($_GET['id'])) {$c = $_GET['id'];}mysql_connect("localhost","root","");mysql_select_db("blog");?><html><head><body background="u.jpg"><center><a href="http://stackoverflow.com/questions/12661322/register.php"><img src="http://stackoverflow.com/questions/12661322/1.jpg" width="100" height="50"/></a><a href="http://stackoverflow.com/questions/12661322/login.php"><img src="http://stackoverflow.com/questions/12661322/2.jpg" width="100" height="50"/></a><a href="http://stackoverflow.com/questions/12661322/index.php"><img src="http://stackoverflow.com/questions/12661322/3.jpg" width="100" height="50"/></a></center><center><title>Pinoy Blog</title></head><?phpif(isset($_POST['submit'])){$content = $_POST['content'];mysql_query("INSERT INTO comment (comment,p_id) VALUE('$content','$c')");echo '<a href="http://stackoverflow.com/questions/12661322/index.php">span style="font-size:26px;"><strong><span style="font-family: verdana, geneva, sans-serif; ">Success! Tignan ang post.&nbsp;</span></strong></span>.</a> || <a href="http://stackoverflow.com/questions/12661322/post.php">Magpost ulit? Click mo to.</a>';}else{?><form action='post.php' method='post'><span style="font-size:26px;"><strong><span style="font-family: verdana, geneva, sans-serif; ">Comment:&nbsp;</span></strong></span><textarea name='content' ></textarea><br /><input type='submit' name='submit' value='http://stackoverflow.com/questions/12661322/POST!'/></form><?php}?><center></body></html>\[/code\]I got problem with $_GET, when i click the submit button it doesn't read the "id" wich came from my first page of php. this is the link where the value of id came from \[code\]<?php echo $content."<p><a href='http://stackoverflow.com/questions/12661322/post.php?id=$pid'>Comment.</a>"?></p>\[/code\] but when i try to to run this \[code\]echo $_GET['id'];\[/code\] its working at it shows that it has value.
 
Top