我做了这个博客,我需要一点帮助,这是打印帖子的index.php,与他们的图片相同......
<?php
if (!isset($_SESSION['name'])) {
}else{
echo "<a href=\"edit.php?id=".$image."\"><strong>EDIT</strong>";
}
?>
这里是edit.php
<?php
$_GET['id']
$sql = mysql_query("SELECT * FROM BlogData id");
$row = mysql_fetch_array($sql){
$title = $row['title'];
$content = $row['content'];
$category = $row['category'];
$image = $row['id'];
$extension= $row['ext'];
?>
<center>
<form action='edit.php' method='post' enctype="multipart/form-data">
Title: <input type='text' name='title' placeholder="$title" /><br>
Date: <input type='text' name='category' placeholder="$category" /><br>
<textarea rows="10" cols="50" name='content'>$content</textarea><br>
<?php
echo "<img width='228' height='60' src='uploads/".$image.".".$extension."'>";
?>
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<br><br><br>
<input type="submit" value="edit!" name="submit">
</form>
<img src="images/tutorialpost2.jpg">
</center>
?>
所以我有了这个EDIT按钮,我希望它可以工作。它应该能够编辑我的所有MySQL表 使用当前ID。我该怎么做?
答案 0 :(得分:0)
if (isset($_SESSION['name'])) {
<button>
}