Jump to content

Recommended Posts

For some reason, the edit field gets messed up when editing if there is HTML in the data. How can I fix this and also how can I make the fields for parasitedescription and parasiteremoval bigger to like 3 lines in height?

 

<fieldset><legend>Parasite Edit</legend>
   <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
   <br />
   <br />
   <br />
   <table width="200" border="1">
     <tr>
       <td><input type="hidden" name="id" value="<?php echo $data['id']; ?>" />
         Parasitename:</td>
       <td><input type="text" name="parasitename2" value="<?php echo $data['parasitename']; ?>" /></td>
     </tr>
     <tr>
       <td>Parasitefrom:</td>
       <td><input type="text" name="parasitefrom2" value="<?php echo $data['parasitefrom']; ?>" /></td>
     </tr>
     <tr>
       <td>Parasitegenre:</td>
       <td><input type="text" name="parasitegenre2" value="<?php echo $data['parasitegenre']; ?>" /></td>
     </tr>
     <tr>
       <td>Parasitedescription:</td>
       <td><input type="text" name="parasitedescription2" cols="3" value="<?php echo $data['parasitedescription']; ?>" /></td>
     </tr>
     <tr>
       <td>Parasiteremoval:</td>
       <td><input type="text" name="parasiteremoval2" cols="3" value="<?php echo $data['parasiteremoval']; ?>" /></td>
     </tr>
     <tr>
       <td> </td>
       <td><input type="submit" value="Submit" name="parasiteedit" /></td>
     </tr>
   </table>
   <br />
   <br />
   </form>
</fieldset>

 

Screenshot also attached.

 

Thanks so much,

Adam

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/63762-solved-fields/
Share on other sites

to make input fields bigger you should use textareas rather then input so then you can specify how many rows you want will change the height.

 

example

<textarea name="parasitedescription" cols="30" rows="3"></textarea>

 

to remove harmful html use htmlspecialchars

 

htmlspecialchars — Convert special characters to HTML entities

 

this would turn script into <script> for example

 

$parasitedescription = htmlspecialchars($parasitedescription);

 

Hope this helps.

Link to comment
https://forums.phpfreaks.com/topic/63762-solved-fields/#findComment-317852
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.