/    Sign up×
Community /Pin to ProfileBookmark

Mask URL with PHP????

I set up a form which sends out an email when they input fields and so on (classic php), and now I need to put a special link in the email which is sent when they finish registration. I would like to ‘mask’ the link somehow, so that they can’t easily see the link and send it to their friends. Is there a way to easily do this with PHP? The goal is to make a url link in an email that is sent via php mail function to, to somehow ‘mask’ the actual url so they can’t re-send it.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@ryanlundJun 11.2009 — You could have it so that there is a unique id in it that can only be used once maybe.
Copy linkTweet thisAlerts:
@Dark_Light2Jun 25.2009 — Well i dont know the exacts because I am stil a junior developer myself, but from what i can gather a solution might be found by adding the link in as a string, for example.

[code=php]
IF (variable? such as amount of times page has loaded)
$URL =="your uniqueurl.php";
elseif (another variable)
$URL =="your uniqueurl.php";

mail( "[email protected]", "Subject",
$formdetails. " " . $URL, "From: $email" );[/code]


You would have to get a pro to clarify the exact code but i am sure it can be done, however it may make the code very large depending on how many unique URLs you want to give out.
Copy linkTweet thisAlerts:
@NogDogJun 25.2009 — This sort of thing is usually done by generating a unique value that is sent with the link as part of the URL query string. That value is also saved in the database (typically associated with a user ID). When the link is clicked, the receiving script checks the received value against the database, and if it checks out, then it marks that particular DB record in some way to indicate the transaction has been completed, disallowing use of that user ID and unique identifier in any further transactions.
Copy linkTweet thisAlerts:
@ryanlundJun 25.2009 — This sort of thing is usually done by generating a unique value that is sent with the link as part of the URL query string. That value is also saved in the database (typically associated with a user ID). When the link is clicked, the receiving script checks the received value against the database, and if it checks out, then it marks that particular DB record in some way to indicate the transaction has been completed, disallowing use of that user ID and unique identifier in any further transactions.[/QUOTE]

Thankyou for explaining what i was getting at. To be fair i can never be arsed to explain it, its pretty common sence.
Copy linkTweet thisAlerts:
@Dark_Light2Jun 25.2009 — Oh now i see what you mean sorry didn't quite get it, yeh thats not too difficult to do using MySQL and a bit of string manipulation, although I can't myself tell you how to do it.
×

Success!

Help @1234567890 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...