Jump to content

PHP and html edit


ReVeR

Recommended Posts

[!--quoteo(post=356829:date=Mar 21 2006, 03:22 AM:name=ReVeR)--][div class=\'quotetop\']QUOTE(ReVeR @ Mar 21 2006, 03:22 AM) [snapback]356829[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hello.
I have a textbox, and i was wondering how i could fill it with default data?
What parameter do i need to set?
Thx
[/quote]

Depends on how you plan to set it. I think this code works well serverside assuming your textbox is called 'textbox':

[code]
<?php
$default_content = "Your default content";
if (isset($_POST['textbox']))
    $default_content = trim($_POST['textbox']);
?>
[/code]

for your texbox you only need

[code]
<input type="text" name="textbox" id="textbox" value="<?php echo $default_content;?>" />
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5385-php-and-html-edit/#findComment-19209
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.