how to post the values using anchor tag in PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
krishna.p
Forum Newbie
Posts: 19
Joined: Fri May 23, 2008 8:12 am

how to post the values using anchor tag in PHP?

Post 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
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

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

Post 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.
krishna.p
Forum Newbie
Posts: 19
Joined: Fri May 23, 2008 8:12 am

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

Post 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
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

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

Post 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.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

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

Post 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 ;)
Post Reply