london77 Posted December 2, 2010 Share Posted December 2, 2010 Hi, I am wondering if "echo" can contain <?php ?> in it. such as echo ''<?php include ("inc/menu.html"); ?>"; if it cannot contain, then how can make it contain "include ()" ? thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/ Share on other sites More sharing options...
Pikachu2000 Posted December 2, 2010 Share Posted December 2, 2010 If you use single quotes, it will echo the string as a literal. The question is why would you want to do that? What are you trying to accomplish? Quote Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142304 Share on other sites More sharing options...
london77 Posted December 2, 2010 Author Share Posted December 2, 2010 ok, thnks for the quick reply, i was trying to put some restriction to a page, and if user is not registered he wont be able to see it, even the admin menu which lays right side. Quote Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142306 Share on other sites More sharing options...
Pikachu2000 Posted December 2, 2010 Share Posted December 2, 2010 This logic should make more sense. Pseudo-code . . . if( $_SESSION['is_logged_in'] === TRUE ) include('logged_in_users_menu.html'); } else { include('generic_users_menu.html'); } Quote Link to comment https://forums.phpfreaks.com/topic/220485-can-echo-contain/#findComment-1142309 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.