Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating a URL for a Form

Status
Not open for further replies.

LRS46

Technical User
Aug 4, 2005
43
0
0
US
Hello,

I want to have an input field that a token is entered into and then added to the form action URL, but I am not real PHP savvy.

Something like this:

please enter your token: ___________

The user then enters the token

Then the POST url will be "token"

So if I enter token number 123456 then the URL will be:
"123456"

Is this real hard to do? I am not a programmer but I have to edit one page and make this work.



Larry S.
Systems & Network Consultant
 
use an html form. set the action to the index.php page, set the method to get. put a text field called token inside the form and a submit button.
 
Thanks jpadie.

I tried that but it cuts off part of my URL. Instead of
"
I get:
"
where the sid=1& is missing from the URL.

Here is my code:

[tt]<p>Please enter your token number from the letter you received: </p>
<form action=" method="get" name="token" >

<input name="token" type="text" size="15" maxlength="7">
<input type="submit" name="Submit" value="Submit">
</form>[/tt]


Larry S.
Systems & Network Consultant
 
if you are using php sessions and the sid is the php session id normally php adds this in for you automatically. have you enabled trans_sid in the php.ini?

if you want to do this manually there are two options.

1. add the sid=1 to the action of the form. ie action="index.php?sid=1"
2. add a hidden field called sid to the form and preset its value using the html value attribute of its tag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top