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 Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/ 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. Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582495 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 Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582496 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 Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582499 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. Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582500 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? Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582502 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. Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582507 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 Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582508 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"; Link to comment https://forums.phpfreaks.com/topic/113378-solved-some-php-echoing-help/#findComment-582511 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.