Jump to content

onclick Code Help


CaTaLinU

Recommended Posts

it is posible to make something like this?

<a href="" onclick="refresh('index.php?info=1');"/>Index 1</a>

<a href="" onclick="refresh('index.php?info=2');"/>Index 1</a>

<a href="" onclick="refresh('index.php?info=3');"/>Index 3</a>

 

and what code do i need to autorealod the index.php?info=(1,2,3) in my Index.php (simple php file with index.php?info=(1,2,3) include) ?

Link to comment
https://forums.phpfreaks.com/topic/258462-onclick-code-help/
Share on other sites

This what do what you want

<?php $info=$_GET['info'];
// do some processing here
?>
<a href="index.php?info=1" />Index 1</a>
<a href="index.php?info=2" />Index 1</a>
<a href="index.php?info=3" />Index 3</a>

 

The variable $info would be available each time the link is clicked and would be the relnumbe 1, 2, or 3

Link to comment
https://forums.phpfreaks.com/topic/258462-onclick-code-help/#findComment-1324842
Share on other sites

i have

 

continut.php?info=(1,2,3)

<?php
$info = $_GET['info'];

if($info == "1")
{
?>
Text 1
<?
}
if($info == "2")
{
?>
Text 2
<?
}
?>

 

 

and in index.php i want to add an include or something onmouseover or onclick that in don't wnat to refresh the whole page,

i want to be refreshed just continut.php?info to the value 1,2 or 3 what i have choosed on onmouseover...

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/258462-onclick-code-help/#findComment-1324843
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.