jasonc310771
08-21-2009, 09:36 PM
i have all my variables in a vars.php file and this is included at the top of al my pages.
varsfile.php
<?php
$emailtextstring = "Thank you $namestring for signing up to xxxxx";
// $namestring does not yet have a value
?>
in my other pages i wish to say use this variable $emailtextstring as its full contents would be html and have a lot more in it but this is just an example to show what i have problems with.
i wish to use this to email the user welcoming them.
how do i have a string use a variable later on in a script before it is setup?
edited...
i have just tried this out and seem to get the string name to show but not the content
<?
// yes this line first!
$test = "\$name";
// yes this line second!
$name = "jason";
echo($test);
// output should be...
// jason
// but it outputs....
// $name
?>
varsfile.php
<?php
$emailtextstring = "Thank you $namestring for signing up to xxxxx";
// $namestring does not yet have a value
?>
in my other pages i wish to say use this variable $emailtextstring as its full contents would be html and have a lot more in it but this is just an example to show what i have problems with.
i wish to use this to email the user welcoming them.
how do i have a string use a variable later on in a script before it is setup?
edited...
i have just tried this out and seem to get the string name to show but not the content
<?
// yes this line first!
$test = "\$name";
// yes this line second!
$name = "jason";
echo($test);
// output should be...
// jason
// but it outputs....
// $name
?>