For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2005 > Re: [PHP-DB] Random Number generating and adding it to he database..









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Random Number generating and adding it to he database..
Samar

2005-01-23, 8:56 am

On Sun, 23 Jan 2005 10:43:03 +0400, Radwan Aladdin
<raladin@emirates.net.ae> wrote:

> I wanted to know the best Random Function for PHP.. But please I don't want >duplications to happen at the same second.. because I receive many customers..


For that purpose, mt_rand ( [int min, int max]) function is your best
friend, I guess.
See http://in2.php.net/manual/en/function.mt-rand.php for more details.

> And also how can I add abc@localhost.com, whic "abc" is a variable... and >"localhost.com" is a static text??
> So I only request from the user to enter the "abc" only and it will automatically >be : usertexthere@localhost.com


//Do you mean --
$user = "someuser";
echo $user;
//And you wish to make someuser@localhost.com ?
//Then,
$email_address = $user . "@localhost.com";
echo $email_address;
//Will output someuser@localhost.com

The dot (.) is the cocatenation (string-joining) operator.

Regards,
Samar M.

= Warning: Dates in Calendar are closer than they appear.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com