alenteria / noswfupload

Automatically exported from code.google.com/p/noswfupload
0 stars 0 forks source link

Problem on adding other input type inside the form. I can't get the value of added input type, when using filereceiver.php #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Problem on adding other input type inside the form. I can't get the value of 
added input type, when using filereceiver.php

What is the expected output? What do you see instead?

Original Form: index.php

            <form method="post" action="filereceiver.php" enctype="multipart/form-data">
                <div>
                    <input type="file" name="test" />
                    <input class="submit" type="submit" value="Upload File" />
                </div>
            </form>

Revised Form:

            <form method="post" action="filereceiver.php" enctype="multipart/form-data">
                <div>
                    <input type="hidden" name="sample" value='album'/>
                    <input type="file" name="test" />
                    <input class="submit" type="submit" value="Upload File" />
                </div>

            </form>

Note: I'm trying to get the value of <input type="hidden" name="sample" 
value='album'/>, using filereceiver.php.. But I can't the submit button after 
adding the  <input type="hidden" name="sample" value='album'/>.

Your help is much appreciated. Thank you! :)

Original issue reported on code.google.com by ryanwe...@gmail.com on 24 Nov 2011 at 8:20

GoogleCodeExporter commented 9 years ago
Did you ever find a fix for this? I can get the extra fields to stick, but 
can't get their values to be seen by either the noswfupload.php or 
filereceiver.php scripts. I've been banging my head for a few days, now. Thanks!

Original comment by Jeff.Koo...@gocetech.com on 13 Jan 2012 at 11:05

GoogleCodeExporter commented 9 years ago
@Jeff

This was my revised post before.

Revised Form Start:
            <form method="post" action="filereceiver.php" enctype="multipart/form-data">
                <div>
                    <input type="hidden" name="sample" value='album'/>
                    <input type="file" name="test" />
                    <input class="submit" type="submit" value="Upload File" />
                </div>
            </form>

Revised Form End:

The problem was, how can I get the value from <input type="hidden" 
name="sample" value='album'/>,
because adding a new input box to the form, will not allow you to pass values 
with the use of submit.

-> I just did a sample <input type="hidden" name="sample" value='album'/> to 
make it easy on this trend, but the real code was.  

-> I'll just sort out the important codes.. 

   <?php
    {

      $get_album_name = $_GET['album_name']; /* Let's say From album_categories.php?album_name=graphics */

       echo "<form method='POST' action='filereceiver.php' enctype='multipart/form-data'>";
       echo "<div>";
       echo "<input type='hidden' name='album_name' value='$get_album_name' />";
       echo "</div>";
       echo "</form>";

    }
    ?>   

/* Solution */ == thanks to my friend (Mr. Bard) who has extensive experienced 
in web development.
                  He's the one who observed the behavior of the form, where you can actually use the 

-> <form method="post" action="filereceiver.php" enctype="multipart/form-data"> 

-> with this one

   echo "<form method='POST' action='filereceiver.php?album_name=$get_album_name' enctype='multipart/form-data'>";

-> Eliminate the input box but use the form action instead. God bless! :)

Original comment by ryanwe...@gmail.com on 16 Jan 2012 at 8:06