Jump to content

/ are killing me


ecabrera

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.