Add textarea to Simple Upload Script

Place for comments, problems, questions, or any issue related to the JavaScript / PHP scripts from this site.
User avatar
JanMolendijk
Posts: 282
Location: Holland Rotterdam

Add textarea to Simple Upload Script

Hi, i wanna use your script for uploading but i wanna
make an option in it to what map i wanna upload it with an text-area

https://coursesweb.net/php-mysql/simple- ... -script_s2

Admin Posts: 805
Hello
If you want to associate a textarea to the upload, just add a <textarea> element, with a "name", in the form:

Code: Select all

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data"> 
  Upload File: <input type="file" name="fileup" /><br/>
  <textarea name="txtup"></textarea><br/>
  <input type="submit" name='submit' value="Upload" /> 
 </form>
- Then, in php get the value associated to that name:

Code: Select all

if(isset($_FILES['fileup']) && strlen($_FILES['fileup']['name']) > 1){
  $txtup = isset($_POST['txtup']) ? $_POST['txtup'] :'';
  //the rest of the code..
}

JanMolendijk Posts: 282
i wanna associate a textarea for the right uploadmap for my pictures

Admin Posts: 805
I not know what it is that uploadmap you refer, neither what it has to do with textarea.
Maybe you not know how to say what you want. Is a <textarea> element or an <input> text field? What is Upload-map, the folder on server where the file is uploaded?
So, tell clear what you want, or put an example and what you have tried.

Similar Topics