Re: work around to show my news?
| From: | David Robley | Date: | Tue, 05 Sep 2000 01:16:11 +0000 |
| Subject: | Re: work around to show my news? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15197@lists.php.net to get a copy of this message | ||
On 4 Sep, Splitskull wrote:
> i have my news showing up on a page, but it wouldn't show because my php
> file had this:
>
> if(!isset($page)){
> $page = 'main';
> }
>
> /* Retrieve the contents based on whether or not the file actually exists.
> */
> if(file_exists("/usr/home/clans/users/db/$page.html")){
> if((!eregi('\.cgi$', $page.cgi))&&(!eregi('\.pl$', $page.pl))){
> $content = join('', file("/usr/home/clans/users/db/$page.html"));
> }
> }else{
> $content = "<b>PAGE NOT FOUND.</b><br><a
> href=\"javascript:history.back(1)\">Back to last page</a>";
> }
>
> so i wrote a workaround in my news include page (news.html) that goes like
> this:
>
> if(!eregi(news.html)){
> $title = 'News';
> $content = join('', file("/usr/home/clans/users/db/newspro/news.txt"));
> }
>
> but i get an error, while at the same time it shows the page. is there a
> better way to do the workaround so that i dont get an error? it does sort
> of slow my page down
> take it easy, cause i'm a newbie
>
> --
> Cody Merrill
> 38494034
> Splitskull@home.com
I'm not sure exactly what you are trying to do, in either case. The
first example seems to have some regex tests that will always fail, and
the second example probably should throw an error on the first line
shown, as eregi needs two arguments.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA