Hallo ich übergebe die Variable an eine andere Seite, aber ich bekomme einen Fehler von Undefined index: titles in C:\xampp\htdocs\studentportal\edit2.php on line 6
Kann mir jemand helfen? Ich weiß nicht, warum es einen Fehler bekommt.Modale Bootstrap-Werte können nicht auf eine andere Seite übergeben werden
hier ist die Form, in der modal
<form method="POST" enctype="multipart/form-data" action ="edit2.php">
<div class="form-group">
<label for="title">News Title</label>
<input type="text" name="titles" class="form-control title" id="title" placeholder="News Title" value="<?php echo $row['news_title']; ?>">
</div>
<div class="form-group">
<label for="date">Date</label>
<input type="text" name="dates" class="form-control date" id="date" placeholder="Date" value="<?php echo $row['news_date']; ?>"s>
</div>
<div class="form-group">
<label for="content">News Content</label>
<textarea class="form-control content" name="contents" rows="5" id="content"><?php echo $row['news_content']; ?></textarea>
</div>
<img id="blah" src="<?php echo $row['news_image']; ?>" width="200px" height="140px"/>
<input id="image" name="image" class="fileupload" type="file" accept="image/*"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<a class='btn btn-info left-margin' href="edit2.php?newsid=<?php echo $row['news_id'];?>">Yes</a>
</form>
hier ist die edit2.php
<?php
include_once('connection.php');
$newsid = $_GET['newsid'];
echo $_POST['titles'];
?>
dann, was soll ich Sir tun? –
Ich habe meine Antwort mit einer alternativen Formularaktion und einer Alternative für Ihr a-Tag bearbeitet. – 1sloc
Warum hat es funktioniert? kann man erklären hehe –