Jump to content

Recommended Posts

Hi all

I have a simple script which produces a code for me on the homepage, the php I use is

[code]srand(time());
$rand1 = (rand()%99999);
$rand2 = chr(rand(ord("a"), ord("z")));
$date = date("dmY");
$code = "$rand1$rand2$date";[/code]

I then print the code using

[code]<?php print "$code"; ?>[/code]

How can I retain this code and print it on any page that the user goes to? Even if they return to the homepage, how can I keep the code without it being replaced with a new one?

How could I also create a page to delete the code so the user can get a new code when they return to the homepage.

Any help would be great

Thanks in advance everyone

Ed
Link to comment
https://forums.phpfreaks.com/topic/3971-carry-data-to-another-page/
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.