Hi Guys,

Me again, ok im trying to figure something out but can not get it working. In my MySQL Database i have one of the values as the following:

http://www.example.com?affid=$affid&pid=$pid

Now in my PHP code i have it so $affid and $pid both equal a number, but when i run my script its outputting the following:

http://www.example.com?affid=$affid&pid=$pid

As you can see the variable $affid and $pid are still in there and haven't been replaced with the values of the variables.

Can someone help me please.

Thank you.

    don't store php in the db, if your going to do something like that you will need to use str_replace() to 'convert'

      This probably isn't a good idea at all, but here is an example.

      $pid = '1';
      $subid = '2';
      
      $string = '<a href="http://example.co.uk/track/click.php?p=$pid&affid=$affid&subid=$subid"><img src="http://media.go2speed.org/brand/files/adwarm/7/thumbnails_100/Tesco-Mobile.png"></a>';
      $string = addslashes($string);
      eval('echo "'.$string.'";');
      
        Write a Reply...