Jump to content

[SOLVED] Fields


EagleAmerican

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.