Page 1 of 1

Passing variables through text links without using java?

Posted: Mon Jul 09, 2007 12:29 am
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

Posted: Mon Jul 09, 2007 3:06 am
by Gente
Can you be more specific? What link? General HTML link?

Posted: Mon Jul 09, 2007 6:44 am
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'];
?>

Posted: Mon Jul 09, 2007 10:35 am
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.

Posted: Mon Jul 09, 2007 11:57 am
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.

Posted: Mon Jul 09, 2007 12:26 pm
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.

Posted: Mon Jul 09, 2007 8:35 pm
by carsky
yeah i know that java is different from javascript..sorry i wasnt too specific..yes thats what i mean.