Forum Moderators: coopster
(Note: I realize the paragraph is stupid... I dunno how I wrote that with that many errors)
hrere's the code:
------------
<?
include('SITE SITE/top.php');
$title = "MM ¦¦ About";
$top = "$main";
$content = '
<p><snip> While being online, try to stay to "safe sites... <snip> keeping your
personal information (like bank information, credit numbers, etc) safe.</p>
<br>
<br>
(Note: This section will be built upon as more issues come to my eyes).';
include('SITE SITE/temp.php');
?>
------------------
Oddly it brings up a variable can't be called (it's call in top.php). It's so odd that this just pops up. I have tried ' and " and even php require but NOTHING seems to want to do this. How can this be fixed?
Thank you.
[edited by: ergophobe at 2:43 pm (utc) on Sep. 5, 2004]
[edit reason] snipped excess text for readability [/edit]
I call up /v5/top.php.
In that file is a variable called $main. this variable has this info:
$main = '<div align="left"><img src="/images/top.gif" alt="Top Image"></div>';
Then the content page tells it this:
$top = '$main';
Then the template calls up this:
<?
echo $top;
?>
Now I dunno if that's the right thing. So far it's outputting $main, then displays the rest of the page.
It used to show the banner that it is supposed to. Now after i get the directory behind it... it doesn't want to. So what can possibly be the problem?
Oh ya I also had it call up an old page of mine and it displayed that fine (But it had no variable and it complained about that, but it's showing it).
And i dunno what ur code meant birdman.. u gotta reallly simplify it to almost exactly how i gotta put it lol.
Anyway now I have this:
<?
include("/v5/top.php");
$title = "My Title";
$top = "$guardian";
Easy, simple and also not the complete thing (content missing from my example). The error on the page reads (i hope this is ok):
Warning: main(/v5/top.php): failed to open stream: No such file or directory in C:\Inetpub\accounts\mm.intellstat\v5\index.php on line 2
Warning: main(): Failed opening '/v5/top.php' for inclusion (include_path='.;c:\php4\pear') in C:\Inetpub\accounts\mm.intellstat\v5\index.php on line 2
Notice: Undefined variable: guardian in C:\Inetpub\accounts\mm.intellstat\v5\index.php on line 6
So it can't find the file when it's /v5/top.php
and if that file isn't included it can't find the variable. I dunno what to do to fix this anymore... ideas?
$top = $main;But when you are using a variable in a quoted context, it won't get parsed within single quotation marks. Have a read of the Strings [php.net] page of the PHP manual for more information.
Going back to your bigger problem here...try setting the path back to the path that you believe is working for the include. Then, at the top of the included file, do a simple statement, such as
exit('You made it here!');If your script stops and the message is displayed, we've confirmed that your include is working and we'll move on to variable scope [php.net] to try and figure out what's happening to your variable.