Darkwoods Posted October 24, 2010 Share Posted October 24, 2010 Hey i keep getting undefined index error when i submit the editing page I cant figure out what the problem is I have checked if i have miss spelled anything from the mysql table and i haven't please help everything exist in mysql but still im getting this error and not letting me update it Notice: Undefined index: uruklink in D:\wamp\www\admin\edit.php on line 8 Notice: Undefined index: ketabsetlink in D:\wamp\www\admin\edit.php on line 9 <?php include "../configdb.php"; $id = $_GET['id']; if(isset($_POST['submit'])) { //global variables $uruklink = $_POST['uruklink']; $ketabsetlink = $_POST['ketabsetlink']; //run the query which adds the data gathered from the form into the database $result = mysql_query("UPDATE softlinks SET uruklink='$uruklink', ketabsetlink='$ketabsetlink' WHERE id='$id' ",$connect); echo "<b>Your Page have been edited successfully"; // echo "<meta http-equiv=Refresh content=2;url=index.php>"; } elseif($id) { $result = mysql_query("SELECT * FROM softlinks WHERE id='$id' ",$connect); while($row = mysql_fetch_assoc($result)) { $uruklink = $row['uruklink']; $ketabsetlink = $row['ketabsetlink']; ?> <h3>::Edit Page</h3> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>?id=<?php echo $row['id']?>"> <input type="hidden" name="id" value="<?php echo $row['id']?>"> <input name="name" size="40" maxlength="255" value="<?php echo $uruklink; ?>"> <input name="footer" size="40" maxlength="255" value="<?php echo $ketabsetlink; ?>"> <input type="submit" name="submit" value="Submit"> <?php } } ?> Link to comment https://forums.phpfreaks.com/topic/216679-undefined-index-error-in-mysql-update/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2010 Share Posted October 24, 2010 The name="..." attributes of your form fields are not $_POST['uruklink'] and $_POST['ketabsetlink'] Link to comment https://forums.phpfreaks.com/topic/216679-undefined-index-error-in-mysql-update/#findComment-1125774 Share on other sites More sharing options...
Darkwoods Posted October 24, 2010 Author Share Posted October 24, 2010 loool thanks I missed it lol and i have been on it for hours but thanks Link to comment https://forums.phpfreaks.com/topic/216679-undefined-index-error-in-mysql-update/#findComment-1125776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.