I wonder whether someone could help me please.
I've been looking through this, and many other sites and tutorials to find out how to add a button to a form which opens a PHP file, in this case, a pop up form that allows a user to upload a file to a mySQL database.
In addition to the opening of the file, I'd like to carry over the 'id' field value from the main form to the pop 'File Upload' form.
From the research I've carried out there seems to be a number of ways to do this, but from a beginners perspective I'm not sure what is the best way to do this.
Could someone perhaps please advise on what is the best way to go about this.
Many thanks and kind regards
To pass values between pages:
Main form:
<form action="myuploadform.php" method="get">
ID: <input type="text" name="id">
<input type="submit" value="Open Form">
</form>
The value of the ID text box will be accessible as $_GET['id']
in myuploadform.php
.
Using GET
parameters is the simplest way of passing values. Another way to pass in this GET
value would be in the URL:
.../myuploadform.php?id=35
where the ID then becomes 35.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With