PDA

View Full Version : arrays() help!


m@l@y@
09-05-2006, 08:16 AM
hi, i'm new to arrays => anyone who can help with this.

<?php
$var = array('one', 'two', 'three');


foreach($var as $key => $value){
if($_GET['click']){
print 'value:'.$value;
}
}
?>

# i need to print each 'value' on every click of a link.
e.g onfirst click => prints 'one'
onsecond click => prints 'two'
onthird click => prints 'three'

Thanx in advance, i'm learning from the best!

Fumigator
09-05-2006, 08:38 AM
Clicking on a link is a browser operation. How are you keeping track of how many times a link has been clicked on?

m@l@y@
09-05-2006, 08:52 AM
all i know is that you can assign a value to a link.
e.g <a href='?test=clicked'>click</a>

then you can listen to everyclick each time your 'browser form' submits.
e.g
if($_GET['test']){
print 'i'm clicked';
}
# so, each time i click on a link, i should be able to retrieve values in an array one click @ a time.