PJStew
01-22-2007, 08:32 AM
Hi all,
Is it posible to change a variable OnClick using a text link instead of a form?
e.g.
<?php
function trials()
{
$style = "trials";
}
echo "<a onclick=\"trials()\" >Trials</a>";
// instead of
echo "<input type=\"button\" onclick=\"trials()\">";
?>
The reason i want to do this is because on my site i have a view 9 page for view picture of diferant style, e.g. trials, steet, freestyle.... the pages are the same except the style of picture the code selects from the database. e.g.
$sql2 = "SELECT COUNT(*) as `count` FROM uploaded_images WHERE style = 'trials' ORDER BY `date` ASC";
if i change "trials" to the variable "$style" and then make it so $style can be changed to street, freestyle or any of the other style, then i would only need one page instead of 9... ;)
all the 9 pages link to eachother on the left of the page here's a link (http://www.unicyclepics.co.uk/display.trials2.php) to one of the pages as it is now.
I would rather not use Javascript if pos.
thanks in advace. :)
Is it posible to change a variable OnClick using a text link instead of a form?
e.g.
<?php
function trials()
{
$style = "trials";
}
echo "<a onclick=\"trials()\" >Trials</a>";
// instead of
echo "<input type=\"button\" onclick=\"trials()\">";
?>
The reason i want to do this is because on my site i have a view 9 page for view picture of diferant style, e.g. trials, steet, freestyle.... the pages are the same except the style of picture the code selects from the database. e.g.
$sql2 = "SELECT COUNT(*) as `count` FROM uploaded_images WHERE style = 'trials' ORDER BY `date` ASC";
if i change "trials" to the variable "$style" and then make it so $style can be changed to street, freestyle or any of the other style, then i would only need one page instead of 9... ;)
all the 9 pages link to eachother on the left of the page here's a link (http://www.unicyclepics.co.uk/display.trials2.php) to one of the pages as it is now.
I would rather not use Javascript if pos.
thanks in advace. :)