I am trying to create a query screen for reports. I have created a php code by getting support from here and other sites. But the problem is; when a user input report serial number and submits it, the page only reload. After reload; when the user enters serial again to the field and hits submit, this time the code works but only for the 1st serial entered, no matter the second serial is.
I have tried to change the parts of my code but could not find a solution.
I am trying to create a system like, user will enter a serial to the field and when hits to submit button; a new window pop out and directs user to a link which has been created based on user input.
For example, user entered "234" as the serial number and hit submit button. The new window will go to the; "example.com/reports/report234.pdf"
Here is the code I have problem with;
<?php
if(isset($_POST['submit']))
{
$seri = $_POST['seri'];
$url = "https://www.example.com/wp-content/uploads/Rapor/".$seri.".pdf";
}
?>
<form method="post" action="<?php echo $url; ?>">
<input type="text" name="seri"><br>
<input type="submit" name="submit" value="Sorgula"><br>
</form>