как отправить id страницы через форму?
как отправить id страницы вот код :
id страницы помещен в $id
вот файл shot.php
setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO shoutbox ( date_time, name, message, page_id)
VALUES (NOW(), :name, :message, '$idr')";
/*** prepare the statement ***/
$stmt = $dbh->prepare($sql);
/*** bind the params ***/
$stmt->bindParam(':name', $name, PDO::PARAM_STR);
$stmt->bindParam(':message', $message, PDO::PARAM_STR);
/*** run the sql statement ***/
if ($stmt->execute()) {
populate_shoutbox();
}
}
}
catch(PDOException $e) {
echo $e->getMessage();
}
if($_POST['refresh']) {
populate_shoutbox();
}
function populate_shoutbox() {
global $dbh;
$sql = "select * from shoutbox WHERE page_id='$id'";
echo '
- ';
- ';
echo ''.date("d.m.Y H:i", strtotime($row['date_time'])).'';
echo ''.$row['name'].'';
echo ''.$row['message'].'';
echo ' ';
foreach ($dbh->query($sql) as $row) {
echo '
}
echo '
}
?>