lilman Posted November 30, 2006 Share Posted November 30, 2006 Here is my code:<input name=question type=hidden value=<?php echo $question; ?>>Say $question is "hello world" when I call it on the next page all I get is hello. anyone know what I can do to resolve this problem? Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/ Share on other sites More sharing options...
marcus Posted November 30, 2006 Share Posted November 30, 2006 do this:[code]<?php$question = "hello world";?><input type=hidden name=question value="<?=$question?>">[/code] Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133036 Share on other sites More sharing options...
kenrbnsn Posted November 30, 2006 Share Posted November 30, 2006 Always enclose attribute values within quotes![code]<input name="question" type="hidden" value="<?php echo $question; ?>">[/code]Ken Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133038 Share on other sites More sharing options...
trq Posted November 30, 2006 Share Posted November 30, 2006 Valid html helps.[code]<input name='question' type='hidden' value='<?php echo $question; ?>'>[/code] Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133039 Share on other sites More sharing options...
kenrbnsn Posted November 30, 2006 Share Posted November 30, 2006 To mgallforever:Get out of the habit of using the "<?=" short cut for "<?php echo". This and the short tag "<?" will be going away in PHP version 6.Ken Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133041 Share on other sites More sharing options...
marcus Posted November 30, 2006 Share Posted November 30, 2006 Ah yes, I remember that from a topic reply you posted. Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133042 Share on other sites More sharing options...
Zane Posted November 30, 2006 Share Posted November 30, 2006 Actually kenrbnsnquoting this site herehttp://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html[quote][b]Farewell <%[/b]They will remove support for the ASP style tags, but the PHP short-code tag will remain (<?) - so to those on php general who reckon the short-tag is 'depreceated' - hah! ;-)[/quote]andhttp://www.php.net/~derick/meeting-notes.html#remove-support-for-and-script-language-php-and-add-php-var Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133073 Share on other sites More sharing options...
kenrbnsn Posted December 1, 2006 Share Posted December 1, 2006 I sit corrected. :)Ken Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133234 Share on other sites More sharing options...
projectshifter Posted December 1, 2006 Share Posted December 1, 2006 [quote author=zanus link=topic=116902.msg476631#msg476631 date=1164930857]Actually kenrbnsnquoting this site herehttp://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html[quote][b]Farewell <%[/b]They will remove support for the ASP style tags, but the PHP short-code tag will remain (<?) - so to those on php general who reckon the short-tag is 'depreceated' - hah! ;-)[/quote]andhttp://www.php.net/~derick/meeting-notes.html#remove-support-for-and-script-language-php-and-add-php-var[/quote]Sounds like they wised up :D Can't wait til php6 then lol, sadly many people are still stuck on 4 and are afraid to make the jump :( Link to comment https://forums.phpfreaks.com/topic/29035-only-showing-the-letters-before-the-space-when-passing-a-variable-by-form/#findComment-133242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.