Pass variable to string in include file - PHP

phillipcadet

New Member
What I am trying to do is to have an include file with generalized language in a string that will be used across multiple pages, but I also need to pass a variable to the string from the current page.Here is an example:Here is a snippet of the index.php page:\[code\]<?PHPrequire_once($_SERVER['DOCUMENT_ROOT'].'/lib/prefix.php');echo $GENERAL_STRINGS['user_not_found'];?>\[/code\]Here is the include page:\[code\]<?PHP$GENERAL_STRINGS['user_not_found'] = 'User account not found<br /><a href="http://stackoverflow.com/register/?email='.$email.'">Register Today for FREE</a>';?>\[/code\]The $email variable is always empty when the link is referenced, I assume this is because it is looking for the $email variable from the include page instead of the index page. Is there a way around this?
 
Back
Top