Jump to content

Recommended Posts

Hi

 

I'm trying to upload HTML into my database.

 

I'm using:

$description=addslashes($_POST['description']);

 

However, when i use HTML inside the content that i'm uploading,

the code gets all messed up, when viewing the code inside the

textarea?

 

I'm trying to build an EDIT section, But the code i want to edit

is not user friendly?

 

Heres the code i'm using to display the content

$desc2 = stripslashes(nl2br($row2['ptxt_body']));
<textarea name="description" cols="40" rows="7" wrap="PHYSICAL" id="description" value="'.$desc2.'" align="left">'.strip_tags($desc2, '<b><br /><i>').'</textarea>

 

Heres the link:

http://www.telegraphlondon.co.uk/text_upload.php

 

I want it to display this inside the text area.

hello world

<a href="index.php" class="bluelink">Email here</a>

 

And, i want it the display this when echoed to the screen.

hello world

 

Email here

 

(Email here becoming a blue Email link)

 

Any idears please

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/52187-inserting-html-into-a-database/
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.