Xclone Posted December 1, 2020 Share Posted December 1, 2020 (edited) Not experienced coding PHP and need help doing something which is probably very easy but looks like Mt Everest to me. Want a web page working locally in Windows 10 local PC that has fields where multiple URL parameters can be filled in: FOO = 123456 BAR = abc Then, write URLs with those variables and have them work the same in a browser: http://webpage1.com/?var1=FOO&var2=BAR would send http://webpage1.com/?var1=123456&var2=abc http://webpage2.com/?var1=FOO&var2=BAR would send http://webpage2.com/?var1=123456&var2=abc http://webpage3.com/?var1=FOO&var2=BAR would send http://webpage3.com/?var1=123456&var2=abc If I update the fields in my local webpage and refresh browser, would like the new value(s) to be used instead. Any help with this greatly appreciated. If someone will put a file together think that I can edit and modify from there for my specific application. Thank you. Edited December 1, 2020 by Xclone Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/ Share on other sites More sharing options...
Barand Posted December 1, 2020 Share Posted December 1, 2020 Use a form. https://www.php.net/manual/en/language.variables.external.php Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/#findComment-1582730 Share on other sites More sharing options...
Xclone Posted December 1, 2020 Author Share Posted December 1, 2020 I see where this creates the form for input, but what about setting the variables and using them in URLs on the PC? Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/#findComment-1582731 Share on other sites More sharing options...
requinix Posted December 1, 2020 Share Posted December 1, 2020 That happens automatically. A lot of how webpages work for folks like us is declarative, meaning that you tell the browser what you want and it will deal with the how. Give the browser a standard web form, built correctly using the right information for the different pieces (eg, the form inputs will need the names "var1" and "var2"), and it will turn the form data that a user enters into the correct URL. A skeleton of the form's HTML markup is <form action="/" method="get"> <input type="text" name="var1"> <input type="text" name="var2"> <button type="submit">Submit</button> </form> That contains the absolute bare minimum information to get the behavior you want: entering "FOO" and "BAR" into the two fields and clicking the button will instruct the browser to go to "/?var1=FOO&var2=BAR". Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/#findComment-1582732 Share on other sites More sharing options...
Xclone Posted December 2, 2020 Author Share Posted December 2, 2020 (edited) Thanks. I want to do this within the embedded browser(s) in OBS Studio. Does anyone know if this will/won't work in that environment (or if there is a comparable OBS solution such as a plugin)? Edited December 2, 2020 by Xclone Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/#findComment-1582750 Share on other sites More sharing options...
Barand Posted December 2, 2020 Share Posted December 2, 2020 (edited) 18 minutes ago, Xclone said: Does anyone know if this will/won't work in that environment You will if you try it. Experiment. Planes won't fall out of the sky if get it wrong. Edited December 2, 2020 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/311786-specifiedshared-url-parameters/#findComment-1582752 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.