Mykei Posted August 5, 2008 Share Posted August 5, 2008 So I don't know any PHP but would really like a quick answer to what I'm trying to do So my link is as follows : /ach.php?map=MAPNAMEHERE&pid=YOURPID I would like to create two text boxes, one for 'MAPNAMEHERE' and one for 'YOURPID' So once the user has filled in his or hers 'MAPNAME' and 'PID' in the text boxes and submits it, It will then replace the 'MAPNAMEHERE' and 'PID' with the map name and PID they typed in. Would really appreciate a answer, thanks. : Also sorry If It has been asked before but I'm not sure what terms to search for it. Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/ Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 You want them in the URL? Just use GET on the form with properly named inputs. Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/#findComment-608688 Share on other sites More sharing options...
Mykei Posted August 5, 2008 Author Share Posted August 5, 2008 Yeah I'd like it to change the URL Could you maybe give me a quick example please? Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/#findComment-608692 Share on other sites More sharing options...
lemmin Posted August 5, 2008 Share Posted August 5, 2008 This should do it: <form action="ach.php"> Map: <input type="text" name="map"> ID: <input type="text" name="pid"> <input type="submit"> </form> Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/#findComment-608696 Share on other sites More sharing options...
Mykei Posted August 5, 2008 Author Share Posted August 5, 2008 Thank you so much lemmin and DarkWater, It now works perfectly and I understand what the code snippit is doing, It's all so simple now Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/#findComment-608701 Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 Also, so it's valid, you may just want to change the form tag to: <form action="ach.php" method="get"> Link to comment https://forums.phpfreaks.com/topic/118284-using-text-box-to-replace-parts-of-a-link/#findComment-608703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.