Forums

PHP

This topic is locked

Random Text Value

Posted 15 Dec 2001 01:59:02
1
has voted
15 Dec 2001 01:59:02 Stephen Bateman posted:
Hi Everyone,

I have to sales reps and a sales enquiry form that is send by e-mail. What I need to do is randomly send the form to one a reps. for example:

$rep1 = " "
$rep2 = " "

$sendto = ????????

Thanks

Replies

Replied 16 Dec 2001 01:23:42
16 Dec 2001 01:23:42 Tim Green replied:
Try this:-

$rep1 = " ";
$rep2 = " ";

$randVal = "rep".rand(1,2);
$sendto = $$randVal;

(note the double $ sign is very important in the last line).

Hope this helps.

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>

Reply to this topic