Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 2nd, 2003, 02:09 PM
Authorized User
 
Join Date: Jun 2003
Location: San Jose, CA, USA.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing MySQL data from a PHP form

Ok, here's a strange one. I have some HTML code in a database. A lot of which is things like > or <. They are code samples for scripts I use. Here's the issue:

When I am using PHPMyADMIN and I edit the data, I get the &gt;'s and the &lt; just fine. However, if I create my own PHP form to edit the data, my page converts all of the &gt;'s and &lt;'s into their respective < or >.

How can I make sure that I am getting the &gt; or &lt; from the database in my form? Any ideas?

----------
~cmiller
__________________
----------
~cmiller
Reply With Quote
  #2 (permalink)  
Old September 2nd, 2003, 02:21 PM
Authorized User
 
Join Date: Jun 2003
Location: San Jose, CA, USA.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

UPDATE***

Ok, here's what I figured out is happening in PHPMyADMIN. It is converting &lt; into &amp;lt; I guess I should just run a convert on & into &amp; huh? Does this sound right?


----------
~cmiller
Reply With Quote
  #3 (permalink)  
Old September 2nd, 2003, 05:11 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah -- htmlentities() and/or htmlspecialchars() should do it for you.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Php transfering data to mysql Gaurava PHP How-To 2 January 5th, 2008 07:33 AM
Problem with editing my cell data in PHP. changusee2k Pro PHP 0 March 15th, 2006 03:57 AM
form php mysql masgas PHP Databases 3 February 12th, 2006 07:34 PM
Storing form array data to MySQL using PHP osemollie Beginning PHP 0 February 2nd, 2006 07:32 AM
How to script search form in PHP/MYSQL javabeans PHP How-To 0 January 12th, 2004 03:53 AM



All times are GMT -4. The time now is 12:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.