scheols Posted July 27, 2006 Share Posted July 27, 2006 [code]<?phpinclude "database.php";$zid = $_GET['id'];$submit = $_POST['esubmit'];if($submit){$ename = $_POST['ename'];$epost = $_POST['epost'];$result = mysql_query("UPDATE shouts SET post=$epost, name=$ename WHERE zid=$zid ");echo "Thank You Your News Has Been Edited SuccessfullyYou Will Now Be Redirected <meta http-equiv=Refresh content=4;url=shout.php>";}elseif($zid){$result = mysql_query("SELECT * FROM shouts WHERE zid='$zid' ");while($row = mysql_fetch_array($result)){$name = $row['name'];$post = $row['post'];?><h2>::Edit News::</h2><form method="post" action="<?php echo $PHP_SELF ?>"><input type="hidden" name="zid" value="<? echo $row['zid'] ?>">Name: <input type="text" name="ename" maxlength="20" value="<? echo $name; ?>"><br>Post:<textarea name="epost"><? echo $post; ?></textarea><input type="submit" name="esubmit" value="Update Post"></form><?}}?>[/code]anyone have and ideahttp://shout.xizionz.vectoredhost.com/shout.php Quote Link to comment https://forums.phpfreaks.com/topic/15779-wont-update/ Share on other sites More sharing options...
corbin Posted July 27, 2006 Share Posted July 27, 2006 Try:[code]<?phpinclude "database.php";$zid = $_GET['id'];$submit = $_POST['esubmit'];$p_zid = $_POST['zid'];if($submit){$ename = $_POST['ename'];$epost = $_POST['epost'];$result = mysql_query("UPDATE `shouts` SET `post` = '$epost', `name` = '$ename' WHERE `zid` = '$p_zid' ");echo "Thank You Your News Has Been Edited SuccessfullyYou Will Now Be Redirected <meta http-equiv=Refresh content=4;url=shout.php>";}elseif($zid){$result = mysql_query("SELECT * FROM shouts WHERE zid='$zid' ");while($row = mysql_fetch_array($result)){$name = $row['name'];$post = $row['post'];?><h2>::Edit News::</h2><form method="post" action="<?php echo $PHP_SELF ?>"><input type="hidden" name="zid" value="<? echo $zid; ?>">Name: <input type="text" name="ename" maxlength="20" value="<? echo $name; ?>"><br>Post:<textarea name="epost"><? echo $post; ?></textarea><input type="submit" name="esubmit" value="Update Post"></form><?}}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15779-wont-update/#findComment-64504 Share on other sites More sharing options...
vinny_bc Posted July 27, 2006 Share Posted July 27, 2006 change[code=php:0]$submit = $_POST['esubmit'];[/code]to [code=php:0]$submit = isset($_POST['esubmit']);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/15779-wont-update/#findComment-64505 Share on other sites More sharing options...
scheols Posted July 27, 2006 Author Share Posted July 27, 2006 @ seocnd posteryep that did it can u tell me what u changed? opps nvm i know :) Quote Link to comment https://forums.phpfreaks.com/topic/15779-wont-update/#findComment-64507 Share on other sites More sharing options...
corbin Posted July 27, 2006 Share Posted July 27, 2006 Oh... hehe should have seen that. if($_POST['esubmit']) just checks if it has a value... isset checks if it has a value and isnt "" Quote Link to comment https://forums.phpfreaks.com/topic/15779-wont-update/#findComment-64509 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.