random text statements

I want to make 1 of 3 random text statements to appear on a Freeway page using php.

(I know how to work with php in the page etc, but never used php rand)

Any pointers how to do this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Make an array of the strings:

$strings = array('thing one','thing two','thing three');

Now to select a random number between zero and the number of elements
in your array -1 (since we started at 0) simply do this:

$len = count($strings) -1;
$rnd = rand(0,$len);

Finally, use the $rnd result to indicate which index of the array you
wish to display:

echo $strings[$rnd];

Walter

On Apr 4, 2008, at 8:39 AM, WebWorker wrote:

I want to make 1 of 3 random text statements to appear on a Freeway
page using php.

(I know how to work with php in the page etc, but never used php rand)

Any pointers how to do this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks walter - i’ll have go with that.

Just note, on the web forum, my original message has disappeared, but you’ve post two duplicate messages. (For me at least)


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 4 Apr. 2008, 1:03 pm, WebWorker wrote:

Thanks walter - i’ll have go with that.

Just note, on the web forum, my original message has disappeared, but you’ve post two duplicate messages. (For me at least)

Did you make your initial post on the Web or from mail?

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No I use the web


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’m using the web site for posting messages


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I can’t figure this out, it all looks fine, and in the proper order,
in my Mail in-box. Would you please try posting another new thread,
and see if it comes up as the actual beginning of the thread on the Web?

Walter

On Apr 4, 2008, at 9:38 AM, WebWorker wrote:

I’m using the web site for posting messages


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ve done a new thread.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I only use the web site for posting and reading and I FREQUENTLY see the answers only without the original question. I also see double posts from you Walt… alot.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Can you see if you can find me some links to these? I alternate
between using the Web and Mail for Freewaytalk, but I spend the bulk
of my time in Mail.

Walter

On Apr 4, 2008, at 11:41 AM, chuckamuck wrote:

I only use the web site for posting and reading and I FREQUENTLY
see the answers only without the original question. I also see
double posts from you Walt… alot.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 4 Apr. 2008, 3:44 pm, waltd wrote:

Can you see if you can find me some links to these? I alternate
between using the Web and Mail for Freewaytalk, but I spend the bulk
of my time in Mail.

Walter

On Apr 4, 2008, at 11:41 AM, chuckamuck wrote:

I only use the web site for posting and reading and I FREQUENTLY
see the answers only without the original question. I also see
double posts from you Walt… alot.

Next time it happens i’ll point it out, but i’ll poke around a bit and see what I can find.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 4 Apr. 2008, 3:51 pm, chuckamuck wrote:

On 4 Apr. 2008, 3:44 pm, waltd wrote:

Can you see if you can find me some links to these? I alternate
between using the Web and Mail for Freewaytalk, but I spend the bulk
of my time in Mail.

Walter

On Apr 4, 2008, at 11:41 AM, chuckamuck wrote:

I only use the web site for posting and reading and I FREQUENTLY
see the answers only without the original question. I also see
double posts from you Walt… alot.

Next time it happens i’ll point it out, but i’ll poke around a bit and see what I can find.

This isn’t from you Walt, but it is an example of seeing the answer before the question. http://freewaytalk.net/thread/view/29071


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options