Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"CALLING" A PAGE

Status
Not open for further replies.

techgrrl

Programmer
Jul 27, 2001
4
US
Hi-
I have to replace the current "page not found message" on a site. The site was developed using PHP, PHP "calls" pages from page.php (which controls the layout, etc of the entire site). This is the orginal script:

if(!file_exists("content/$id.txt"))
{
$nopage =
&quot;<H3><b>Page Not Found on girlsinc.org</H3>
<HR>
<p> The page you are looking for is outdated, inaccurate, or does not exist at <a href=../ic/>}
else
{

$contents = file(&quot;content/$id.txt&quot;);

and then towards bottom of page this script makes refence to it:----

<?php
if(empty($nopage)) eval($data[2]);
else echo $nopage;
?>

I have made this change to the first part of the script:
if(!file_exists(&quot;content/$id.txt&quot;)) $id.=&quot;.1&quot;;

if(!file_exists(&quot;content/$id.txt&quot;)) {
$id=404;
}

I got this from another page.php which controls another part of the site (that calls in a 404.txt page), however I get an error about the second part of the script (listed above). I can't figure out what changes to make to this part of the script for it to function properly.

I appreciate any help!
Thanks!
 
if(!file_exists(&quot;content/$id.txt&quot;)) $id.=&quot;.1&quot;;

if(!file_exists(&quot;content/$id.txt&quot;)) {
$id=404;
}

I'm confused there....it looks like your making the $id variable equal 404 if it doesn't exist. Do you have a link to the files? It's really difficult to tell what your scripts are doing without the complete code & reference links. - PAINKILLER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top