ecabrera Posted January 2, 2012 Share Posted January 2, 2012 why is it that i remove the / from the var slide and but it cuts of the sentence where the ' was at for example i wrote : It's very sunny out! and it just showed It what mistake did i do wrong <?php if($_POST['submitbtn']){ require "scripts/connect.php"; $slide = mysql_real_escape_string($_POST ['slide']); $news = mysql_real_escape_string($_POST ['news']); if($news){ $query = mysql_query("UPDATE home SET `slide`='$slide',`news`='$news'"); echo "You have add successfully"; }else $msg = "News section must be filled!"; mysql_close(); } ?> <?php require "scripts/connect.php"; $query = mysql_query("SELECT * FROM home"); $rows = mysql_fetch_assoc($query); $slide = stripslashes($rows['slide']); $news = stripslashes($rows['news']); mysql_close(); ?> <form action='edithp' method='post'> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>Slider</td> <td><input type="text" name='slide' style="width:380px" value=<?php echo $slide;?> /></td> </tr> <tr> <td>News</td> <td><textarea cols='45' rows='20' name='news'><?php echo $news;?></textarea></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' value='SUBMIT'</td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/254212-are-killing-me/ Share on other sites More sharing options...
Pikachu2000 Posted January 2, 2012 Share Posted January 2, 2012 The value= attributes in form fields should be quoted. Link to comment https://forums.phpfreaks.com/topic/254212-are-killing-me/#findComment-1303370 Share on other sites More sharing options...
ecabrera Posted January 2, 2012 Author Share Posted January 2, 2012 Thanks Link to comment https://forums.phpfreaks.com/topic/254212-are-killing-me/#findComment-1303371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.