Page 1 of 1

how to post the values using anchor tag in PHP?

Posted: Tue Jul 29, 2008 9:43 am
by krishna.p
Hi experts,
Im new to php. i want to pass the posted values of the current page to destination page using anchor tag.
let me explain you breifly..
my current page is first.php which contains a total of 24 controls in it. it contains buttons named UPDATE,SUBMIT and links such as DETAILS. The DETAILS link is written as follows.
<a href="details.php">DETAILS</a>
Now if i click on DETAILS link all the 24 posted values should get posted to details.php.
would appreciate if you could please help me out..thanks in advance.

Thanks,
krishna.p

Re: how to post the values using anchor tag in PHP?

Posted: Tue Jul 29, 2008 9:49 am
by jaoudestudios
You can not send POSTs through a link unless you are using AJAX. If you are a beginner then I recommend sending them as a GET. If you want clean URLs then you could use SESSIONS.

Re: how to post the values using anchor tag in PHP?

Posted: Tue Jul 29, 2008 9:54 am
by krishna.p
Thanks for the reply..
how can i use SESSIONS..i think to use SESSIONS we need to reload the current page and after that we have to give our Destination page.
would appreciate if you could please tell me how to use SESSIONS to pass the posted data when clicking on a DETAILS link?
Thanks in advance...

Thanks,
krishna.p

Re: how to post the values using anchor tag in PHP?

Posted: Tue Jul 29, 2008 10:58 am
by ghurtado
jaoudestudios wrote:You can not send POSTs through a link unless you are using AJAX
But you can submit a POST form (why the hell do we capitalize that word? ;) ) with a simple onClick event handler from javascript. No need for complicated AJAX.

Re: how to post the values using anchor tag in PHP?

Posted: Tue Jul 29, 2008 4:04 pm
by Eran
Even better, you can style a submit button to look like a link and not use javascript at all. By the way, I like to write 'post' instead of POST ;)