Lisa23 Posted September 29, 2010 Share Posted September 29, 2010 Hi i have this edit form that allows user to mofy data but the problems on the text box is that it deletes the rest of the data after the space from the first word i tried to increase the size of the varChars on mysql but did no work why it happens how can i stop from happening?? this the form input <input type="text" name="name" id="name" class='text_box' value="<?php echo $_GET['name'];?>"/> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 29, 2010 Share Posted September 29, 2010 i suspect the problem is that the content is not properly escaped for HTML output in a form field. maybe try making the string html safe: <input type="text" name="name" id="name" class='text_box' value="<?php echo htmlspecialchars($_GET['name']);?>" /> If the data is displayed after a form GET or POST, you may need to stripslashes() before you htmlspecialchars(). another possibility off the top of my head is the style (CSS) setting for the field. perhaps it is set to a short max size? hope this helps Quote Link to comment Share on other sites More sharing options...
Lisa23 Posted September 29, 2010 Author Share Posted September 29, 2010 Hi i never really done any of the stripslashes or htmlspecialchars(). i tried to reserach about but none seem to be wrking with my script if i set a lengh of text in the input will that affect the txt in it i mean i set size 40 and i only add 2 words on the text like joana travolt and still cut off travold can u can you or sum1 give me an example?? Quote Link to comment Share on other sites More sharing options...
Lisa23 Posted September 29, 2010 Author Share Posted September 29, 2010 I tried like this but gt error <input type="text" name="name" size="40" class='text_box' value<?php echo stripslashes(htmlspecialchars($_GET('name'))) ?>> Fatal error: Function name must be a string in C:\xampp\htdocs\rocksamples\modifydriversform.php on line 89 Quote Link to comment Share on other sites More sharing options...
the182guy Posted September 29, 2010 Share Posted September 29, 2010 You need to use the square brackets [ ] to access arrays like the $_GET, such as $_GET['name'] Quote Link to comment Share on other sites More sharing options...
Lisa23 Posted September 29, 2010 Author Share Posted September 29, 2010 like this value=<?php print (stripslashes(htmlspecialchars($row['name'])))? still no sucess that strange cz i on the edit form i can type as much as i want then when submit it sends every word fine but then when i edit back alwasy cut the rest of the word y Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted September 29, 2010 Share Posted September 29, 2010 You MUST put the value in quotes, or you will see the the problem you're seeing. value="<?php print (htmlspecialchars(stripslashes($row['name']))) ?>" Ken Quote Link to comment Share on other sites More sharing options...
Lisa23 Posted September 29, 2010 Author Share Posted September 29, 2010 THANK YOU VERY much "kenrbnsn" and for evryone that also tried to help me 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.