Image selected using input type=files
Hy,
I'm creating cms, and I upload my picture to my folder successfully, i want to select picture from files on server using <input type="file"> and that selected value ti put in <input type="text" name="image" value="">.
How can i do that.
This is my form code:
<form action="index.php?content=categories" method="post" name="maint" enctype="multipart/form-data">
<fieldset class="maintform">
<legend>Change</legend>
<ul>
<li>
<label class="required">Category</label><br>
<input type="text" name="cat_name" class="required" value="<?php echo htmlspecialchars( $item->getCat_name()); ?>">
</li>
<li>
<label>Descrioption</label><br>
<textarea rows="5" cols="60" name="cat_description"><?php echo htmlspecialchars($item->getCat_description()); ?></textarea>
</li>
<li>
<label>Image</label><br>
<input type="text" name="cat_image" value="<?php echo htmlspecialchars( $item->getCat_image());?>">
<input type="text" name="image" value="">
</li>
</ul>
|