brem13 Posted March 29, 2009 Share Posted March 29, 2009 hey, i have a variable that pulls GET data, but when i try to have it show in a text field, it only shows one word, ive had this problem before but cant figure out how to actually fix it, ive tried, but i keep getting errors the code below will only display 1 word out of 5 echo "value=RE: ".$sub; Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/ Share on other sites More sharing options...
genericnumber1 Posted March 29, 2009 Share Posted March 29, 2009 & is a "forbidden" character in your query string. Use urlencode on strings you will be putting in a query. It may be processed by the browser before being sent, but you shouldn't rely on that. Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796340 Share on other sites More sharing options...
brem13 Posted March 29, 2009 Author Share Posted March 29, 2009 that puts the space in there and it shows the first word ONLY out of the get variable, but in my link i can see all the words Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796343 Share on other sites More sharing options...
genericnumber1 Posted March 29, 2009 Share Posted March 29, 2009 Can you show us the rest of your code? That would hopefully answer questions such as "Why are you echoing the query string instead of using it? What is $sub?" etc. Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796348 Share on other sites More sharing options...
brem13 Posted March 29, 2009 Author Share Posted March 29, 2009 <form action="index.php" method="POST"> <font face="Tahoma" size="2">Reply</font><br> <input type="text" name="sub" width="150px" style="font-size:10px; font-family:Tahoma; height:17px;" <? $username = $_COOKIE['loggedin']; $sub = $_GET['sub']; $user = $_GET['user']; echo "value=RE: ".$sub; ?> > Subject<br> <textarea name="mess" style="font-size:11px; font-family:Tahoma; width: 225px; height: 60px" rows="1" cols="20"></textarea><br /> <input type="submit" name="message" value="Send"><input type="reset" name="reset" value="Clear"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796360 Share on other sites More sharing options...
wildteen88 Posted March 29, 2009 Share Posted March 29, 2009 Always wrap HTML attribute values within quotes. <?php $username = $_COOKIE['loggedin']; $sub = $_GET['sub']; $user = $_GET['user']; ?> <form action="index.php" method="POST"> <font face="Tahoma" size="2">Reply</font><br> <input type="text" name="sub" width="150px" style="font-size:10px; font-family:Tahoma; height:17px;" value="RE: <?php echo $sub; ?>"> Subject<br> <textarea name="mess" style="font-size:11px; font-family:Tahoma; width: 225px; height: 60px" rows="1" cols="20"></textarea><br /> <input type="submit" name="message" value="Send"><input type="reset" name="reset" value="Clear"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796362 Share on other sites More sharing options...
brem13 Posted March 29, 2009 Author Share Posted March 29, 2009 sweeeeet, thank you Quote Link to comment https://forums.phpfreaks.com/topic/151633-solved-one-word-called-from-_get/#findComment-796363 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.