fellixombc Posted July 5, 2008 Share Posted July 5, 2008 basically i want it to echo, what i put, in a php or html document. like would this work? <?php $left_side.php echo "$left_side.php"; </php> i think that code won't work because $ means variable and it thinks left_side.php ( a document ) is a variable i want it to echo text from another document Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 What? O_O I didn't quite understand what you're saying at all. Sorry. Please rephrase it. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted July 5, 2008 Share Posted July 5, 2008 If you want to echo the literal string "$left_side.php", you need to use single quotes, not double quotes: <?php echo '$left_side.php'; ?> Ken Quote Link to comment Share on other sites More sharing options...
fellixombc Posted July 5, 2008 Author Share Posted July 5, 2008 i think ken answered my question i wanted a php document to echo text on an other document. like this: news.php (contains news) index.php (<body>"NEWS HERE"</body>) the news here is the text from news.php Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 5, 2008 Share Posted July 5, 2008 Well in that case, he didn't answer your question. Read up on include in the php manual. Quote Link to comment Share on other sites More sharing options...
fellixombc Posted July 5, 2008 Author Share Posted July 5, 2008 Well in that case, he didn't answer your question. Read up on include in the php manual. yeah i noticed when it didn't work. do you have any idea? Quote Link to comment Share on other sites More sharing options...
bothwell Posted July 5, 2008 Share Posted July 5, 2008 Well in that case, he didn't answer your question. Read up on include in the php manual. yeah i noticed when it didn't work. do you have any idea? Just what he said You need to use the include function. include('left_side.php'); There's more in the PHP manual about other things you might find useful. Quote Link to comment Share on other sites More sharing options...
fellixombc Posted July 5, 2008 Author Share Posted July 5, 2008 Well in that case, he didn't answer your question. Read up on include in the php manual. yeah i noticed when it didn't work. do you have any idea? Just what he said You need to use the include function. include('left_side.php'); There's more in the PHP manual about other things you might find useful. thank you so much!!! solved btw Quote Link to comment Share on other sites More sharing options...
piyushsharmajec Posted July 5, 2008 Share Posted July 5, 2008 Dear, For any file like this $file.php echo '$file.php '; can't echo as $file.php is vaiable but it cant assign any value For this better to use functiones like include("filename"); or require("filename");in any page. But how could it echo the stuff that is in that file, so for this we have echo in the file itself as whatever we include. Like in filename.php we echo anything as by echo"stuff"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.