Click to See Complete Forum and Search --> : If in perl?
Mobic
Apr 27th, 2001, 01:31 PM
$number = (int(rand($total));
$nbr
I want the program to choose the [int[rand....) if the $nbr not is 200 or more, and it should choose $nbr if $nbr is over 200.
How would i be doing this?
spandex44
Apr 27th, 2001, 07:56 PM
Hmm, please calrify. I don't seem to understand what you want to do.
Neronis2000
Apr 27th, 2001, 09:20 PM
I think i know what you mean... So you want the $nbr part to happen when $nbr is greater than or equal to 200 and the int part to happen when it is less than $nbr... well either way the code would look like
if ($nbr => 200) {
$nbr;
} else {
$number = (int(rand($total));
}
This says that when nbr is not greater than or equal to 200 it uses the int code, but when it is it does the $nbr bit.
Mobic
Apr 28th, 2001, 07:06 AM
Thanx!
:p
One more think.
If a http://something.com?memberid is created, is it possible to track the visitor by cookies or something, and give the memberid credits when a new user signs up? Kinda referal program...
Neronis2000
Apr 28th, 2001, 07:13 AM
yeah it is a little more advanced but i can write a script for yo uif you want and i will show you what i did so you can back engineer it... but basicly it would involve a userdatabase in this layout
username|points
simple... it would scan down the list to see if the member is on the list... if he is it would then add points... then stick it back into the databse...
Mobic
Apr 28th, 2001, 07:36 AM
Hmm..
If you would do that it would be great.
I've been trying for a couple of days now, and just cant get it to work.. but i guess thats what you learn by.. testing and failing..
Neronis2000
Apr 28th, 2001, 08:39 PM
No Probz, just email some small details (the location of perl on your server, perl version, blah blah blah). I will have finished writing the script in 10 min of replying to this thread... so email me when you want it!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.