Ich mache soziale Projektformular und ich versuche, Antwort hinzuzufügen .. Die Antwortschaltfläche ist ein Link, der Benutzer zu reply.php Seite mit Post-ID in href ... auf der reply.php meine Formularaktion ist die gleiche Seite, aber wenn ich auf die Schaltfläche klicken, um Formular zu senden es nicht die ID und aktualisiert Seite mit Post und Anzeige Fehler undefined ID brauche Hilfe ..ID auf href übergeben und Formular auf derselben Seite senden
hier ist meine reply.php
<?php
require('session.php');
$id=$_GET['id'];
//echo $id;
[email protected]$_POST['submit'];
[email protected]$_POST['reply'];
if(isset($submit)){
[email protected]$_GET['id'];
$sql=mysqli_query($con,"INSERT INTO REPLY (reply,Username,post_id) VALUES '$reply','$user_check','$id'");
$sql2=mysqli_query($con,"SELECT * FROM REPLY WHERE post_id= '$id'");
while($row=mysqli_fetch_array($sql2)){
echo $row['Username']."<br/>".$row['reply']."<br/>";
}
}
else "error in submission";
?>
<!DOCTYPE html>
<html>
<title>Studhelp</title>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="w3.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<?php
$sql=mysqli_query($con,"select * from posts where post_id='$id'");
while($row=mysqli_fetch_array($sql)){?>
<!-- Middle Column -->
<div class="w3-col m7">
<div class="w3-row-padding">
<div class="w3-col m12">
<div class="w3-card-2 w3-round w3-white">
<div class="w3-container w3-padding">
<h3 class="w3-opacity"><?php echo $row['Username'] ;?></h3>
<?php
echo $row['Posts']."<br/>".$row['date']."<br/>";
}
?>
</p>
</div>
</div>
</div>
</div>
<form action="reply.php" method="post">
<input type="text" name="reply" >
<input type="submit" name="submit" value="reply">
</form>
dies ist der Anker-Tag senden ID
<a href="reply.php?id=<?php echo $row['post_id']; ?>" class="reply-comment"> Reply </a>
reply.php
Dank sein für help..the Problem Aktion Aktion muss ich nur noch in Form