+ 1

how to make a user input variable in php?

I'm new to coding overall, how do I make a html form that can fill in a variable in php? I already have part of the variable, I got this: $url = "https://gateway.apiportal.ns.nl/reisinformatie-api/api/v2/arrivals?station=RTA"; But I need to be able to change the "RTA" at the end. can anyone please help me with this?

23rd Jun 2020, 10:14 AM
newbiecoder
3 Answers
+ 1
Try this.. <Form action="#" method="post"> <Input type="text" value="" name="user"/> </Form> <?php $user=$_POST['user']; ?>
23rd Jun 2020, 12:35 PM
Vic Okeke
0
In addition to my former post... PHP uses the name attribute to select html inputs
23rd Jun 2020, 12:36 PM
Vic Okeke
0
thanks for your help! i figured it out thanks to this.
23rd Jun 2020, 5:41 PM
newbiecoder