Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Transfer Information Via Links With Php, Please Help!
kbjr
post Mar 17 2008, 04:41 AM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 10
Joined: 4-March 08
Member No.: 58,821



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:

CODE
<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! smile.gif
Go to the top of the page
 
+Quote Post
jlhaslip
post Mar 17 2008, 08:16 AM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 3,882
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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:
CODE
<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.
Go to the top of the page
 
+Quote Post
bf2gamer
post Mar 22 2008, 07:07 AM
Post #3


Newbie
*

Group: Members
Posts: 2
Joined: 22-March 08
Member No.: 59,676



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:
HTML
<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:
CODE
<?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" biggrin.gif

Notice from rvalkass:

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


This post has been edited by rvalkass: Mar 22 2008, 10:51 AM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Affiliate Links?(6)
  2. 3000 Free Templates, Very Very Good(8)
  3. Inspiration! Where Do You Get Yours?(1)
  4. Design Of A Map With Links(5)
  5. Target Links To A Div Layer(22)


 



- Lo-Fi Version Time is now: 26th July 2008 - 09:47 AM