Jump to content

[SOLVED] Changing Links


herghost

Recommended Posts

Hi all, I am slowly picking up php and am getting there! Thanks to all those who have helped me so far! I have a quick question, I shall try and explain it as best as I can!

 

I am setting up a store where the customer can put a link to the amazon page of the item, I have a affiliates account so I basically want the link changed to my amazon affialtes link automatically, for example the amazon link for an 80gb ipod is:

 

http://www.amazon.co.uk/Apple-iPod-classic-80GB-black/dp/B000UVS20Y/ref=pd_bbs_sr_1?ie=UTF8&s=gateway&qid=1201475249&sr=8-1

 

while the affiliate link is

 

http://www.amazon.co.uk/dp/B000UVS20Y?tag=speciainvita-21&camp=1406&creative=6394&linkCode=as1&creativeASIN=B000UVS20Y&adid=17MV5PBY277D9CQBV8WA&

 

is there a way in php to do this? Currently the link is stored as $source and when displayed I am currently just using the echo command.

 

Thanks for any help you can give, like I say, I am getting there but I do not understand everything at the moment!

Link to comment
Share on other sites

Thought this may explain how its saved better:

 

when the item is entered this code is used:

 

<input name="source" type="text" value="<?php echo htmlspecialchars(stripslashes($source)); ?>" maxlength="255" size="50"/>

 

and when viewed on  another page this is how I have done it:

 

<?php echo htmlspecialchars($row["source"]); ?>

Link to comment
Share on other sites

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.