Jump to content

[SOLVED] making a link like this /[email protected]


Jnerocorp

Recommended Posts

Hello,

 

How do u make pages that use links like this.

 

"/[email protected]"

 

I am working on a payment processing where after the person pays it returns to that link with their email i already know how to get it to the page I just dont know how to set up the page that takes the email from the url and then proccesses it to run the script that i write it do

 

Thanks,

JOhn

on a page with '[email protected]' in the URL, adding the following to the page will give you the value of 'email' (which in this case would be: [email protected]):

 

echo $_GET['email'];

 

continue with other variable, ie., [email protected]&name=john

 

echo $_GET['name']; //would produce: john

 

it's using the $_GET superglobal;

 

of course, using this method creates large security gaps, but perhaps you should just get used to working this method, then focus on security.

 

for an example, having

echo $_GET['email'];

will echo whatever the value is for 'email' .. so, you can maybe see how that could used in a malicious manner.  user switches out his email address for some malicious code, and it is then displayed right there on your page.  so, also look into sanitizing and xss attacks.

Also Do you know how to make it so after information is put into a database it is set to delete itself from the database after 10 minutes?

 

If it's a *nix server, then create a php file that runs the delete query you need, and then set up a cron job on the server to ping that file every 10 minutes. Your hosting package will have the details for creating cron jobs in its FAQ somewhere, probably.

Also Do you know how to make it so after information is put into a database it is set to delete itself from the database after 10 minutes?

 

If it's a *nix server, then create a php file that runs the delete query you need, and then set up a cron job on the server to ping that file every 10 minutes. Your hosting package will have the details for creating cron jobs in its FAQ somewhere, probably.

 

You can write a trigger in the DB. Refer to the DB documentation. Thats the best way. The DB itself takes care of itself.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.