By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Parsing PHP sourced from blob

P: n/a
When a php statement is "part" of a markup snippet in a mysql database
table field, what must be done to have the php parse in the document.
The php tags are being displayed

A simple demo demonstrating my problem is at
http://www.boclair.com/test/blobvars.php

Louise
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
boclair wrote:
When a php statement is "part" of a markup snippet in a mysql database
table field, what must be done to have the php parse in the document.
The php tags are being displayed

A simple demo demonstrating my problem is at
http://www.boclair.com/test/blobvars.php

Louise


Try looking here: <http://uk.php.net/eval>

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #2

P: n/a
Try http://www.php.net/eval, the eval() function should do the job!

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic{TOPIC_ID}.htm
Jul 17 '05 #3

P: n/a
Philip Ronan wrote:
boclair wrote:

When a php statement is "part" of a markup snippet in a mysql database
table field, what must be done to have the php parse in the document.
The php tags are being displayed

A simple demo demonstrating my problem is at
http://www.boclair.com/test/blobvars.php

Louise

Try looking here: <http://uk.php.net/eval>


Thanks but I need more help

I applied eval as

if (ISSET($myrow['detail'])){$detail=$myrow['detail'];}
$detail=addslashes($detail);
eval("\$detail = \"$detail\";");

where detail is the blob field.

The result is at http://www.boclair.com/test/blobvars2.php
The image src is line (bolded) still wrong. The value of the page
variable is being contained in the PHP tags.

By removing the PHP tags on the src statement, the document renders
correctly as shown at http://www.boclair.com/test/blobvars3.php

By also removing the php tags in the style attributes, these are also
rendered correctly as shown at http://www.boclair.com/test/blobvars4.php

Does this mean that PHP tagging should not be used in blob values?

Louise
Jul 17 '05 #4

P: n/a
boclair wrote:
Does this mean that PHP tagging should not be used in blob values?


I guess so. Perhaps you could use a regular expression to split the
fragments apart so that the content of the php tags is sent to the eval()
function and everything else is sent out as literal text.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.