Well, using the little php I know I have come up with this:
<?php
function changelink($change)
{
$find = "htmlspecialchars($row["source"])";
$replace = "<a href="http://www.amazon.co.uk/dp/($row["source"])?tag=speciainvita-21&camp=1406&creative=6394&linkCode=as1&creativeASIN=($row["source"])" />";
$change = preg_replace($find, $replace, $change);
return $change;
}
<?php echo $change; ?>
Which obviously doesn't work!
What I am trying to do is insert "source" into various places in the bottom line. I am guessing there is another way of doing this apart from the find and replace method as I am guessing trying to find a string will not work. I just wanna know how to do this! I welcome anyone who can show me how to do this and explain how it works as I am really trying to learn php and not just copy and paste!
This is the line originally:
Code:
<?php echo htmlspecialchars($row["source"]); ?>
and "source" is gathered using:
Code:
<input name="source" type="text" value="<?php echo htmlspecialchars(stripslashes($source)); ?>" maxlength="255" size="50"/>
Thanks