Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/222445-place-input-data-inside-sent-url/
Share on other sites

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>
");

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.

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>";

 

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.