dsaba Posted April 20, 2007 Share Posted April 20, 2007 very odd situation that's happening where the constants do NOT echo out after I define them sampleconstants.php: <?php define('Submit_a_video_file', 'Submit a Video File', true); define('Game_Information', 'Game Information', true); define('Divx_Movies', 'Divx Movies', true); define('English_', 'English', true); define('Hello_', 'Hello this should display', true); echo "the page was successfully included"; ?> testecho.php: <?php include 'http://remoteaddress/sampleconstants.php'; echo '<b>'.Submit_a_Video_file.'</b><br>'; echo Game_Information.'<br>'; echo '<b>'.Divx_Movies.'</b><br>'; echo English_.':<br><br>'; echo Hello_.'<br>'; ?> quite simply the output is "Hello_" instead of "Hello more text..." but it does echo "page was successfully included" however when I do this and define the constants in the same page instead of including it works perfectly: <?php //include 'http://p2mcity.freehostia.com/sampleconstants.php'; define('Submit_a_video_file', 'Submit a Video File', true); define('Game_Information', 'Game Information', true); define('Divx_Movies', 'Divx Movies', true); define('English_', 'English', true); define('Hello_', 'Hello this should display', true); echo '<b>'.Submit_a_Video_file.'</b><br>'; echo Game_Information.'<br>'; echo '<b>'.Divx_Movies.'</b><br>'; echo English_.':<br><br>'; echo Hello_.'<br>'; ?> so whats stumps me is that it is the SAME code in the include page that I use all in one page, yet it doesn't work then??? whats going on? -thanks Link to comment https://forums.phpfreaks.com/topic/47827-solved-why-don-t-the-constants-echo/ Share on other sites More sharing options...
Glyde Posted April 20, 2007 Share Posted April 20, 2007 You can NOT include files over a remote connection. All that will do is include the output of the PHP file, not the PHP source itself. You'll need to get the file stored locally on the server, then you can include it and use it without a problem. Link to comment https://forums.phpfreaks.com/topic/47827-solved-why-don-t-the-constants-echo/#findComment-233680 Share on other sites More sharing options...
dsaba Posted April 20, 2007 Author Share Posted April 20, 2007 one cookie for glyde! woo hoo thanks Link to comment https://forums.phpfreaks.com/topic/47827-solved-why-don-t-the-constants-echo/#findComment-233687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.