Sending post data? |
[eluser]agartzia[/eluser]
Hi! I was trying to figure out which way is the best to send post data to a controller from a link? For example, when I click in a "Search all post by user XXX" and it takes me to a search results page. I've thought of Javascript, but it's somehow a "tricky" solution. Cheers!
[eluser]xwero[/eluser]
I don't think you want to send post data using a $_GET request I think you want to build a link that gets the data: http://site.com/user/1/posts or http://site.com/posts/user/1. take a look at the forum links for inspiration (my forum posts).
[eluser]agartzia[/eluser]
[quote author="xwero" date="1202931656"]I don't think you want to send post data using a $_GET request I think you want to build a link that gets the data: http://site.com/user/1/posts or http://site.com/posts/user/1. take a look at the forum links for inspiration (my forum posts).[/quote] xwero, as fast as always! Yep, I want to do a search from a link. I've done a function... Code: class Search extends Controller { I could code some Javascript, but as I've said, it's not 'clean' enough. The forum is a good example, as well.
[eluser]xwero[/eluser]
I'm not sure why you want to redirect your search? If you have input fields you want to send along with the link you are better of with a form than you can send whatever you want.
[eluser]agartzia[/eluser]
[quote author="Negligence" date="1202942226"]Save it to the session, then redirect.[/quote] Hey, that's a good idea... I'll have to modify some of the code, but it's ok. Thanks! |
Welcome Guest, Not a member yet? Register Sign In |