Jump to content

Recommended Posts

Hi,

 

I have a page layout where I navigate with /index.php?section=<bla>

Now I wanna add a form that calls a site with GET parameters but it always redirects me to index.php with the parameters and forgets the "?section=" stuff.

I added a little testpage:

echo "<form action=\"index.php?section=test\" method=\"get\"><input type=\"text\" name=\"test\" /><input type=\"submit\" /></form>";

to be sure that I didn't messup in the page itself but I still have the same problem.

 

Could somebody please help me and explain where I messed up?

I didn't find anything on the net because I don't know what to search for and I couldn't remember one site that also navigates in the way I do.

 

Thanks Ben

Link to comment
https://forums.phpfreaks.com/topic/125084-solved-form-action-problem/
Share on other sites

not really sure what you're trying to accomplish here, but if you are trying to make a form that submits with the GET method and you have other vars you want to pass via the GET method as well...just pass those other vars with a hidden input field.

@adam291086 :

Thanks but I still have the same result.

Anything else I can try?

 

@Crayon Violent;

Sorry I didn't make myself clearer.

My Problem is that I have a site (index.php?section=test) that should have a form to input some data via a get parameter. When I hit the submit button the data gets transfered to index.php and to to index.php?section=test.

 

Ben

<input type="hidden" name="section" value="test" />

 

 

not really sure what you're trying to accomplish here, but if you are trying to make a form that submits with the GET method and you have other vars you want to pass via the GET method as well...just pass those other vars with a hidden input field.

 

Crayon answered your question a long time ago.

Thank you guys so much .......

 

corbin is right Crayon really did answer the question 40 minutes ago.

 

For the books and ppl like me:

echo "<form action=\"index.php?section=test\" method=\"get\"><input type=\"text\" name=\"test\" /><input type=\"submit\" /><input type=\"hidden\" name=\"section\" value=\"test\"></form>";

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.