Far Cry Posted October 13, 2010 Share Posted October 13, 2010 Hi there, so recently I have been trying to dynamically set the title on a page with PHP I have tried <title><?ech"$username";?>'s Profile</title> the result is "'s Profile" note that the username variable is being passed thru a file that is required. Any help is appreciated Quote Link to comment Share on other sites More sharing options...
Far Cry Posted October 13, 2010 Author Share Posted October 13, 2010 Hi there, so recently I have been trying to dynamically set the title on a page with PHP I have tried <title><?echo"$username";?>'s Profile</title> the result is "'s Profile" note that the username variable is being passed thru a file that is required. Any help is appreciated Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 13, 2010 Share Posted October 13, 2010 When you get an output like that it's usually an indication that the PHP is not being evaluated. What is the file name of the file in question? Ken Quote Link to comment Share on other sites More sharing options...
Far Cry Posted October 13, 2010 Author Share Posted October 13, 2010 When you get an output like that it's usually an indication that the PHP is not being evaluated. What is the file name of the file in question? Ken profile.php Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 13, 2010 Share Posted October 13, 2010 It could be that short tags aren't enabled, replace the "<? echo" with "<?php echo" Ken Quote Link to comment Share on other sites More sharing options...
joshd963 Posted October 13, 2010 Share Posted October 13, 2010 your code: <?echo"$username";?> new code: <?php echo "$username"; ?> if that doesnt work... are you passing the title through POST? if so.. you will need to set the variable first.. ie.. $username = $_POST['username']; Josh Quote Link to comment 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.