Jump to content
xisto Community
kbjr

Transfer Information Via Links With Php Please Help

Recommended Posts

I need to send a piece of information from one php page to another (kind of like a form).
The thing is that I need the page to send a different piece of information based on what link is clicked.
Something like this:

<a href="some code">Send Information 1</a><a href="some other code">Send Information 2</a>

I don't know how to do this, so does anyone have any ideas?

Thanks in advance! <_<

Share this post


Link to post
Share on other sites

You will need to study the PHP manual and learn about the "GET" method.

start here

 

The basic are that you add a 'query string' to the URL in the Anchor tag, like so:

<a href="target_page.php?info=this_information">Send Information 1</a>
In the above example Anchor tag, "this_information" is the information being sent, and it is named "info" in the $_GET array.

Then you need to write a php script that handles the information in the receiving file.

The php.net site can be your best friend.

Share this post


Link to post
Share on other sites

As slip said, you will probably have to read tutorials. Look up codes. If you don't know a function google it ex: "php if". That said, i might be able to help too.

It would probably be best to use a form "depending on the situation".

Say the name of the form is "form". You have a text field named "test". What you want to do is Post the information that has been entered into test to post.php. post.php the takes your information and processes it how you feel neccessary.

ex:

<form id="form" name="form" method="post" action="post.php">
   <input type="text" name="Test" id="Test" />
   <input type="submit" name="submit" id="submit" value="Submit" />
</form>


OK. there is the form. what you type in the textfield will get sent to post.php when you click submit.

what you can do with post.php

ex:

<?php$form = $_POST['Test'];echo "$form";?>
this will just echo what you have entered into the textfield onto the page post.php. pretty simple but it can get complicated.

if you need more help just reply and ask. we will be willing to help "i think" :lol:

Notice from rvalkass:

Code tags added around the code sections. Take a look at the list of BBCodes for more info.

Edited by rvalkass (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.