Jump to content

how to post the values from one page to otherpage using anchor tag in PHP?


krishna.p

Recommended Posts

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. DETAILS link is written as follows.

    <a href="details.php">DETAILS</a>

Now my requirement is, 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

 

Link to comment
Share on other sites

sure..let me explain you the simple example...

current page i have controls like country,state and city drop downs and

buttons like UPDATE,SUBMIT and links like DETAILS etc..

now if i click on DETAILS link, details.php should get opened and there i will use posted values from previous page like country,state and city and those 3 values are displayed in details.php.

 

i dont mind using javascript,form tags in my code if im going to accomplish my target..would appreciate if you could please tell me how can i post values from the current page to destination page using this DETAILS link..

 

Thanks,

krishna.p

Link to comment
Share on other sites

No problem... will be waiting for your reply...

 

you are correct.. i want to post the data which may contain around 30 plus values...

 

i think here first thing i need to do is to submit the page and and put those posted values into a session and pass that session values to the destination page...

 

thanks,

krishna.p

 

 

 

Link to comment
Share on other sites

Okay.  I presume that you have form tags around these dropdowns, correct?  Add a name attribute to the form:

<form name="destination" action="details.php" method="post">

Something: <input type="text" /><br />

<a href="javascript:submitForm()">Details</a>

</form>

 

Then the Javascript:

<script type="text/javascript">

function submitForm() {

  document.destination.submit();

}

</script>

Link to comment
Share on other sites

Check this out...

 

 

<script language="Javascript">

 

function submitForm()

{

document.FORMNAME.action = 'details.php';

document.FORMNAME.method = 'post';

document.FORMNAME.submit();

}

</script>

 

on the HTML body

 

<a href="Javascript: submitForm()">Details</a>

Link to comment
Share on other sites

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.