TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-02-2009, 03:48 AM   #1 (permalink)
The Acquainted
 
KingOfTheSouth's Avatar
 
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
KingOfTheSouth is on a distinguished road
Default Random links

I am having a problem, I am trying to setup a random id generator with php and mysql. I want it so that when people purchase the product it gives them a download link but I do not want them to have the link for ever. I want the link to last like 30 minutes. So what I want to do is make it do is when the product is purchased it last 30 minutes but then it cancels out and it gives the file a new ID. Can anyone help me? I am lost so far. Here is what I got so far.

PHP Code:
<?php

  $id 
$_GET['id'];

  
$links = array(

    
"download" => "http://www.domains.com/path/to/file.zip"

    
);

 

  
header("Location:".$links[$id]);

  exit;

?>
KingOfTheSouth is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unique random number? code_junkie Advanced PHP Programming 4 12-21-2008 12:01 AM
Showing random links with an array paulOr Advanced PHP Programming 6 10-24-2008 09:28 AM
Eyes Random String Generator EyeDentify Script Giveaway 10 06-11-2008 05:11 PM
Random Items without a Database WinSrev Tips & Tricks 11 12-05-2007 02:50 AM
How Rdoanm is Rondam? Wildhoney General 3 09-19-2007 01:32 PM


All times are GMT. The time now is 07:51 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design