Christy Marie
07-11-2003, 04:30 AM
I am making my site using php includes and when I view my site I get this error..."Warning: main(): stream does not support seeking in /home2/xxxxx/public_html/sean/test.php on line 7"
Here is my HTML code just in case you need it.
<html>
<head>
<title></title>
<LINK REL="StyleSheet" HREF="sb.css" TYPE="text/css">
</head>
<body bgcolor="#006EA3" text="#ffffff" link="#c88b08" vlink="#f8c456" alink="#ffffff">
<? include("/sean/topimages.php") ?>
<? include("sean/nav.php") ?>
<td style="position: absolute; left: 220; top:350" width="320" height="150" bgcolor="#006EA3">
<font size="1" face="tahoma,verdana">
Welcome all!
</font>
</td>
<? include("/sean/nav2.php") ?>
</body>
</html>
Anyone have any idea why it's saying that? The whole site actually seems to show up fine, but that error pops up before the layout and you can still see the error written underneath. I don't think I'm making much sense
First off, even though you are using <? and ?> to block out the php code, you still need semi-colons (';') at the end of the lines.
<? include("/sean/topimages.php"); ?>
Also, try putting <?php instead of <?.
<?php include("/sean/topimages.php"); ?>
Next you have /sean/topimages.php and then sean/nav.php and then /sean/nav2.php, check those. I don't have my test server up and running or I'd check myself, and I can't remember if the '/'s break it.
Let me know how all that goes, I've never seen that message before, but it's best to fix the main file, then you can work on the included file on line 7.
any path on php through *nix that starts with a / is processed from root - ie your
include('/sean/topimages.php');
call will not be processed relative to the calling document and will start from root (it would first look for a dir called sean in the same root dir as home2)
if your settings allow seeking of streamed files the parser might have found it - they don't though (as the warning mentions) so you'll need to adjust your paths.
php path symbols
./ same directory
../ up one directory
../../ up two (etc etc)
/ root
as test.php in folder sean is doing the calling, you could use
include('./topimages.php');
include('topimages.php');
include('../sean/topimages.php');
include('/home2/xxxxx/public_html/sean/topimages.php');
all should work fine - the top three are relative, the last is absolute from root.
Dude128
07-11-2003, 02:50 PM
Originally posted by Trep
First off, even though you are using <? and ?> to block out the php code, you still need semi-colons (';') at the end of the lines.
incorrect- the ?> is the same as ending a statement with a semicolon.
from the php.net documentation:
The closing tag (?>) also implies the end of the statement, so the following are equivalent:
<?php
echo "This is a test";
?>
<?php echo "This is a test" ?>
however, you should probably use the semicolons anyway, just to get in the habit of doing so, or in case you added more statements or combined the two you have, you wouldn't have to worry about adding the semicolons then.
christiandude03
07-11-2003, 10:41 PM
<?php echo "This is a test" ?>
Can be written as:
<?="this is a test"?>
This is very useful when you want to echo a variable in your html...just do <?=$varname?>
toosweet4u
07-12-2003, 04:46 AM
Originally posted by christiandude03
<?php echo "This is a test" ?>
Can be written as:
<?="this is a test"?>
This is very useful when you want to echo a variable in your html...just do <?=$varname?>
But if the server has short tags turned off, your code will break. It's best use the <?php ?> way. That way you'll be 99.99% sure that your script will work properly. ;)
Christy Marie
07-13-2003, 02:56 AM
Thanks everyone for your help! I got it now :)