Jump to content

Text after space character cut off in input text field when editing form back


Lisa23

Recommended Posts

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'];?>"/>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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??

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.