bob2588 Posted October 23, 2009 Share Posted October 23, 2009 i know the if statement is missed up but i dont know who to fix it <?php session_start(); if(!session_is_registered(username)){ header('location:login.php'); } ?> <?php $id=$_GET['id']; $code=$_GET['code']; if(?chnage = ){ mysql_query("UPDATE Ads SET Html = '$code' WHERE id = '$id'"); } else { echo"<form id='form1' name='form1' method='post' action='?change=$id'> <label><br /> <textarea name='code' id='code' cols='45' rows='5'></textarea> <br /> </label> <input type='submit' name='Submit' id='Submit' value='Submit' /> </form>"; } ?> Thanks bob Link to comment https://forums.phpfreaks.com/topic/178783-solved-if-statement/ Share on other sites More sharing options...
lemmin Posted October 23, 2009 Share Posted October 23, 2009 The ?chnage is probably supposed to be $chnage, or $change even. I don't see if defined anywhere, though. Link to comment https://forums.phpfreaks.com/topic/178783-solved-if-statement/#findComment-943102 Share on other sites More sharing options...
Alex Posted October 23, 2009 Share Posted October 23, 2009 I think you're looking for isset(), to check if the form was submitted. ex: if(isset($_POST['Submit'])) { // Was submited } else { // Wasn't submitted } Link to comment https://forums.phpfreaks.com/topic/178783-solved-if-statement/#findComment-943103 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.