Jump to content

[SOLVED] why don' t the constants echo?


dsaba

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.