Jump to content

[SOLVED] form action Problem


BenHD

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.