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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.