Passing variables through text links without using java?

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
bos45430
Forum Newbie
Posts: 12
Joined: Sun Jul 08, 2007 11:11 am

Passing variables through text links without using java?

Post by bos45430 »

i want to pass some data by clicking a link but with PHP 5 my old techniques no longer work. I dont want to use java because im not familiar with it at all. Is there some other alternative?

Thanks

John
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Can you be more specific? What link? General HTML link?
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

Hmm?

Code: Select all

<a href="page.php?varName=value">link</a>
page.php:

Code: Select all

<?php
// Echoes "value" for when called by the link above
echo $_GET['varName'];
?>
bos45430
Forum Newbie
Posts: 12
Joined: Sun Jul 08, 2007 11:11 am

Post by bos45430 »

ok thats what i need. so its that simple huh. wow. i looked on google for a while. now i feel like a jackass. every site i went to said that if you wanted to send variables through a link said to use java.
carsky
Forum Commoner
Posts: 30
Joined: Sun Jul 08, 2007 3:26 am

Post by carsky »

vigge89, do you think its just advisable if you dont want to use java or wether you like java or not it is really advisable to use java in passing data?if yes would it be secured?just want to know.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

carsky wrote:vigge89, do you think its just advisable if you dont want to use java or wether you like java or not it is really advisable to use java in passing data?if yes would it be secured?just want to know.
There's nothing Java-specific about HTTP requests. ?foo=bar&zip=button is standard query string notation. Are you talking about JavaScript where you want to pass variables from JavaScript code to the server?

FYI, Java and JavaScript are two very different languages.
carsky
Forum Commoner
Posts: 30
Joined: Sun Jul 08, 2007 3:26 am

Post by carsky »

yeah i know that java is different from javascript..sorry i wasnt too specific..yes thats what i mean.
Post Reply