Jump to content

Recommended Posts

im trying to create a text template where the name of a city is replaced according to the url parameter $_GET from the city list tbl

 

i have uploaded text in binary code to mysql as BLOB

 

i get the text but not the city name that should be echoed, it is blank

 

for example

great things to see in  <?php echo $RsCity['CityName']; ?>

Link to comment
https://forums.phpfreaks.com/topic/157809-using-blob-in-dynamic-content/
Share on other sites

personally I would use [CITYNAME] in the text and preg_replace it.  Much cleaner than eval.

 

edit:

 

I guess str_replace would be better than preg since its exact string search.

 

ok i have tried both BLOB and TEXT fields structures

with the following code

<?php
$str="[CITYNAME] is a nice place to visit";

$cn="Paris";
$text=str_replace("[CITYNAME]", $cn, $str);
echo $text."<br>";
?>

 

i echo the variable like this

<?php echo $row_RsEvent_Types['textcontent']; ?>

 

i get

<td>";
?>

</td>

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.