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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/ 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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/#findComment-1121672 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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/#findComment-1121673 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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/#findComment-1121674 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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/#findComment-1121678 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 Link to comment https://forums.phpfreaks.com/topic/215750-dynamically-setting-title-with-php/#findComment-1121738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.