PDA

View Full Version : [php] link supplies info on 2nd page...



novatron6
April 4th, 2005, 08:05 PM
Hey All,

I realize this may be on a previous thread, but don't know how to phrase it...

I need to have a link that when clicked will place the name of the link on the page...

EXAMPLE: You click on someones name and then the page the link takes you to has that persons name on it, i.e. a contact form.

like this: http://www.intervarsity.org/contact/

when you click on the persons name they are included on the next page...

any help or redirection would be helpful, thanks!

doug

hl
April 4th, 2005, 08:34 PM
you could use the $_GET variable.

something like

<?php
$name = $_GET['name'];
print $name;
?>


and the url would look something like intervarsity.org/contact/index.php?name=person

spartan018
April 4th, 2005, 08:36 PM
use query strings in the URL, and retrieve them using the $_GET array.
example: admin.php?id=123

$admin_id = $_GET[id];
print $admin_id; //will print '123'
you can use this number to get info from an SQL database or however u want

novatron6
April 4th, 2005, 08:48 PM
I am fairly new to PHP, what would I put on the contact page?

thanks for your help!

hl
April 4th, 2005, 09:21 PM
I am fairly new to PHP, what would I put on the contact page?

thanks for your help!
well as said in both posts, instead of a normal link like http://example.com/contact/person.php

it would be http://www.example.com/contact/index.php?person=person

type thing

novatron6
April 5th, 2005, 04:51 PM
Cool I got it, works great!

Thanks!