In my first attempt i made a form that looks like this
Code: Select all
<form id="Upload" action="changeImage.php" enctype="multipart/form-data" method="post">
<h1>
Upload form
</h1>
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size ?>">
</p>
<p>
<label for="file1">Apply Add:</label>
<select name="newImage" type="file">
<option value="C:\xampp\webalizer\TEST\RateList\Images\B2Blogo.jpg"> B2bLogo</option>
<option value="C:\xampp\webalizer\TEST\RateList\Images\piecesOnly.jpg" > PiecesOnly </option>
<option value="C:\xampp\webalizer\TEST\RateList\Images\packageingStyrofoam.jpg" > Packageing Styrofoam </option>
</select>
<p>
<label for="submit">Press to...</label>
<input id="submit" type="submit" name="submit" value="Change Image">
</p>
</form>
One way of working this out was to have this form submit and populate another form with an input field that is hidden and forwards the image request
Code: Select all
// Form 2
$newImage = $_POST['newImage'];
<form id="Upload" action="echo $uploadHandler" enctype="multipart/form-data" method="post">
<h1>
Upload form
</h1>
<p>
<input type="hidden" name="MAX_FILE_SIZE" value="$max_file_size">
</p>
<p>
<label for="file1">File to upload:</label>
<input id="file1" type="file" name="file[]" value="<?php echo $newAdd ?>" style='visability:hidden;' >
</p>THEN SUMBIT THIS TO AN PHP PROCESS UPLOAD PAGE THAT TAKES THE REQUEST AND UPLOADS THE FILE.
can some on help me on this
I am really stuck here.
THANKS IN ADVANCE