GIDForums

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Aug-2002, 02:12
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Parsing PHP code that's stored in a database.


I am stuck with trying to parse PHP codes that are stored together with text in a database. For example, 1 column in my db stores text like this:

Code:
This is just text. <?php echo " This WAS PHP. "; ?>This is text again.

Anybody know how I can get the PHP above to work when i retrieve the data?
  #2  
Old 18-Aug-2002, 15:53
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
One link:

www.php.net

The eval() function.

Tadaa!

Garth Farley
  #3  
Old 12-May-2004, 12:57
HaigEK HaigEK is offline
New Member
 
Join Date: May 2004
Location: Virginia, USA
Posts: 1
HaigEK is on a distinguished road

If stored string has been encoded with htmlentities()...


One more link:

us3.php.net

If the stored string has been encoded with htmlentities() it should first be decoded with html_entity_decode() before being passed to eval().
  #4  
Old 13-May-2004, 09:15
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Hello HaigEK,

Thank you for the suggestion but the original example string in the question was:

Code:
This is just text. <?php echo "This WAS PHP."; ?>This is text again.

When we upgraded the forum script from phpBB to vbulletin, the export script did mess up a few posts and while I fixed most of them, I seem to have missed the one on this thread, also I am sure there are others...

But thanks just the same
 

Recent GIDBlogNew Corolla Altis, 10th Generation - Part I by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 07:48
PHP in HTML jrobbio Web Design Forum 4 24-Jul-2003 06:05
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14
[Tutorial] MySQL Basics nniehoff MySQL / PHP Forum 15 23-Mar-2003 19:42
PHP code snippet library - Anyone have any use for this? jrobbio MySQL / PHP Forum 1 02-Mar-2003 15:18

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:00.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.