Re: "trigger" words

From: Date: Fri, 07 Dec 2001 12:02:19 +0000
Subject: Re: "trigger" words
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-77029@lists.php.net to get a copy of this message
Yes! But since one must learn by trying, I will give you some general rules. Okay, make it work as a function. You need the page url to grab and the word to search. So it's a function with two arguments: function do_it ($page_url , $word) { Then inside the function you fopen() the $page, and ereg($word, $page_contents). If ereg() is succesful, you will 'return the function' to create a link similar to: echo "<a href=\"$page\">$word</a>"; return 1; Or the usual $sql = "INSERT INTO table blah blah blah" using your preferred db query function. -- Julio Nobrega Don't eat the yellow snow. "Deron" <reverend@metalages.com> wrote in message news:20011207022220.45914.qmail@pb1.pair.com... > Is there an easy way with PHP, or something else, to have a document on the > web where a certain word is mentioned within the page somewhere...in my case > a band name.... and it could automatically take that name/word and create it > as a link that's stored in either a flatfile or a database of some sort? > > Deron > www.metalages.com > > >

« previous php.general (#77029) next »