Carlton Posted December 23, 2010 Share Posted December 23, 2010 This has been bothering me for a while, how do I do this? echo (" <form method = 'get' action = 'member.php?action=Search&option=faction&name=NAME'> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form> "); name='member' is supposed to be sent with here: member.php?action=Search&option=faction&name=NAME. Obviously replacing NAME with the input. Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/ Share on other sites More sharing options...
quelle Posted December 23, 2010 Share Posted December 23, 2010 Here, and gl echo (" <form method = 'get' action = 'member.php?action=Search&option=faction&name=' . $_GET['member'] . '> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form> "); Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150589 Share on other sites More sharing options...
Carlton Posted December 23, 2010 Author Share Posted December 23, 2010 Here, and gl echo (" <form method = 'get' action = 'member.php?action=Search&option=faction&name=' . $_GET['member'] . '> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form> "); I tried that before I posted this. No luck. Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150595 Share on other sites More sharing options...
Carlton Posted December 23, 2010 Author Share Posted December 23, 2010 Bump Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150868 Share on other sites More sharing options...
BlueSkyIS Posted December 23, 2010 Share Posted December 23, 2010 where do you set the value that you are trying to insert into the string? Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150871 Share on other sites More sharing options...
Carlton Posted December 23, 2010 Author Share Posted December 23, 2010 where do you set the value that you are trying to insert into the string? What do you mean? Your question is simple to many others, but to me I don't understand it in this case. Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150874 Share on other sites More sharing options...
BlueSkyIS Posted December 23, 2010 Share Posted December 23, 2010 where does the value for NAME come from? where does the value come from that you want to put into the echo statement? // Where do we get the value for $somevalue, in the echo below? echo "<form method = 'get' action = 'member.php?action=Search&option=faction&name=$somevalue'> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form>"; Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150881 Share on other sites More sharing options...
Carlton Posted December 23, 2010 Author Share Posted December 23, 2010 where does the value for NAME come from? where does the value come from that you want to put into the echo statement? // Where do we get the value for $somevalue, in the echo below? echo "<form method = 'get' action = 'member.php?action=Search&option=faction&name=$somevalue'> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form>"; There's no value, this: <input type='text' name='member' /> is supposed to be in the member.php?action=Search&option=faction&name=THEINPUTSENT Sorry if i'm misunderstanding you Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150888 Share on other sites More sharing options...
BlueSkyIS Posted December 23, 2010 Share Posted December 23, 2010 there is no input when you first open the script, so the value will be name= (nothing). When you post the form there will be 2 different names: one POST'ed and the other one GET'ed. if you want to put the POST'ed value into that string, you'll need to use something like this: $posted_name = urlencode(stripslashes($_POST['name'])); // Remove stripslashes if magic quotes is not on. echo "<form method = 'get' action = 'member.php?action=Search&option=faction&name=$posted_name'> Faction's Name: <input type='text' name='member' /><br /><br /> <input type='submit' value='Search' /> </form>"; i don't understand the purpose for this, but that should work. Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150894 Share on other sites More sharing options...
Carlton Posted December 23, 2010 Author Share Posted December 23, 2010 It deletes my current wanted url and replaces it with: member.php?member=INPUT Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150931 Share on other sites More sharing options...
BlueSkyIS Posted December 23, 2010 Share Posted December 23, 2010 need to see more code to understand what's going on. Quote Link to comment https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/#findComment-1150935 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.