Help with a php script

This is a discussion on Help with a php script within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've got a cgi script that allows me to add the output of a php script to an html ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-11-2003
\(a\)
 
Posts: n/a
Default Help with a php script

I've got a cgi script that allows me to add the output of a php script to an
html page using the following line of code.

#insert : http://www.url.com/sript.php#

What I'm wondering is if someone could write me a couple of lines of code
for script.php that would randomly select one line of information from a
text file called text.txt.

This way, if I had the following line in my html file, the place where
#insert : http://www.url.com/sript.php# is located, would be replaced by a
random line of text from text.txt.

<a href="http://www.yahoo.com">#insert : http://www.url.com/sript.php#</a>

The contents of text.txt would be something like this:

This is yahoo
yahoo is a search engine
search using yahoo

Thanks for the help.


Reply With Quote
  #2 (permalink)  
Old 09-11-2003
Jon Kraft
 
Posts: n/a
Default Re: Help with a php script

(a) <nospam@spam.com> wrote:

> What I'm wondering is if someone could write me a couple of lines of code
> for script.php that would randomly select one line of information from a
> text file called text.txt.


I usually take £40 per hour.

How about doing it yourself? Look up these functions in the manual:

file()
count()
mt_rand()

http://www.php.net/manual/en/

HTH;
JOn


Reply With Quote
  #3 (permalink)  
Old 09-13-2003
\(a\)
 
Posts: n/a
Default Re: Help with a php script

Thanks for your help. Why waste your time writing a response. That just
took away time you could have been earning money.

Anyways, someone was kind enough to help...and get this FOR FREE.


"Jon Kraft" <jon@jonux.co.uk> wrote in message
news:bjpc9n$li9a3$1@ID-175424.news.uni-berlin.de...
> (a) <nospam@spam.com> wrote:
>
> > What I'm wondering is if someone could write me a couple of lines of

code
> > for script.php that would randomly select one line of information from a
> > text file called text.txt.

>
> I usually take £40 per hour.
>
> How about doing it yourself? Look up these functions in the manual:
>
> file()
> count()
> mt_rand()
>
> http://www.php.net/manual/en/
>
> HTH;
> JOn
>
>



Reply With Quote
  #4 (permalink)  
Old 09-16-2003
Jon Kraft
 
Posts: n/a
Default Re: Help with a php script

(a) <nospam@spam.com> wrote:

> Thanks for your help. Why waste your time writing a response. That just
> took away time you could have been earning money.
>
> Anyways, someone was kind enough to help...and get this FOR FREE.


The only thing wasted here was my sarcasm.


> "Jon Kraft" <jon@jonux.co.uk> wrote in message
> news:bjpc9n$li9a3$1@ID-175424.news.uni-berlin.de...
>> (a) <nospam@spam.com> wrote:
>>
>> > What I'm wondering is if someone could write me a couple of lines of

> code
>> > for script.php that would randomly select one line of information from
>> > a text file called text.txt.

>>
>> I usually take £40 per hour.
>>
>> How about doing it yourself? Look up these functions in the manual:
>>
>> file()
>> count()
>> mt_rand()
>>
>> http://www.php.net/manual/en/
>>
>> HTH;
>> JOn
>>
>>


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0