Fonction php
Résolu
Utilisateur anonyme
-
Utilisateur anonyme -
Utilisateur anonyme -
Bonjour,
je cherche la fonction php click (que quand l'utlisateur click cela affiche une autre page
je cherche la fonction php click (que quand l'utlisateur click cela affiche une autre page
A voir également:
- Fonction php
- Fonction si et - Guide
- Easy php - Télécharger - Divers Web & Internet
- Fonction miroir - Guide
- Fonction moyenne excel - Guide
- Expert php pinterest - Télécharger - Langages
5 réponses
Tu as l'évènement javascript OnClick ou tu peux faire un
<form method=post action='page.php'> <input type=submit value='ok' /> </form>
Affiche une autre page? Dans une nouvelle fenêtre, un nouveau onglet, ou tout simplement un chemin qui OUVRE une page?
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
ce que je veut c'est quand je clique sur une case de mon calendrier il affiche une page
mon code pour mon calendrier
<?php
if(!isset($_REQUEST["m"]) ) $m = date("n");
else $m=$_REQUEST["m"];
if(!isset($_REQUEST["a"]) ) $a = date("Y");
else $a=$_REQUEST["a"];
$mnom = Array("","Janvier","Février","Mars"
,"Avril","Mai","Juin","Juillet","Août"
,"Septembre","Octobre","Novembre","Décembre");
$dayone = date("w",mktime(1,1,1,$m,1,$a));
if($dayone==0) $dayone=7;
$url = "calendrier.php";
$aplus=$a+10; //modifie le changement de date des 2 premier bouton
$amoins=$a-10;
?>
<html><head><title>Calendrier</title>
<style type="text/css">
<!--
a:link,a:active,a:visited
{
text-decoration:none;
color: #000000;
}
tr.impaire {
background-color:#f9f8f1;
}
tr.paire {
background-color:#f2efe3;
}
body {
font-size:10px;
background-color: #FFFFFF;
}
-->
</style>
<script type="text/javascript">
function surligne(elt){
elt.style.backgroundColor="#66CCCC";
}
function surligneoff(elt){
elt.style.backgroundColor="#FFFFFF";
}
</script>
</head><body > <center>
<?php if($amoins>=1970)
echo"<a href='$url?m=$m&a=$amoins'><<</a> "; // 10 ans avant
for($i=$a-9;$i<=$a;$i++) {
if($i>=1970 && $i<=date("Y")+5)
echo"<a href='$url?m=$m&a=$i'>$i</a>";
}
if($aplus<=date("Y")+100)
echo" <a href='$url?m=$m&a=$aplus'>>></a>";// 100 ans apres
?>
<br><br>
<?php for($i=1;$i<=12;$i++) {
echo"<a href='$url?m=$i&a=$a'>".substr( $mnom[$i],0,1)."</a>";
if($i!=12) echo" - "; } ?>
<br/><br/>
<font size=4>
<?php if(($m==1 && $a<=1970)==false){
echo"<a href='";
if($m==1){
$an=$a-1;
$mois=12;
}
else{
$an=$a;
$mois=$m-1;
}
echo $url."?m=$mois&a=$an'><<</a> ";} // mois avant
?>
<?php echo $mnom[$m]." ".$a;
if($m==12){
$an=$a+1;
$mois=1;
}
else{
$an=$a;
$mois=$m+1;
}
$jours_in_month=cal_days_in_month(CAL_GREGORIAN,$m,$a);
// calcul du nombe de semaine soit nb_jour ds le mois diviser par 7
//et on arrondit au superieur
$nb_semaine=ceil($jours_in_month/7);
$jours_a_afficher=$nb_semaine*7;
echo" <a href='$url?m=$mois&a=$an'>>></a>"; // mois apres
?></font>
<br><br>
<table width=100% cellspacing=0 border>
<tr class="paire">
<th>Lundi</th>
<th>Mardi</th>
<th>Mercredi</th>
<th>Jeudi</th>
<th>Vendredi</th>
<th>Samedi</th>
<th>Dimanche</th>
<?php for($i=1;$i<=$jours_a_afficher;$i++) {
if($i%7 == 1) { ?></tr><tr><?php }
if(($i<($jours_in_month+$dayone ))&&($i>=$dayone)) { ?>
<th onMouseOut="javascript:surligneoff(this);" onMouseOver="javascript:surligne(this);" >
<?php echo '<span style="color:#F08080;">',$i-$dayone+1;'</span>' ?></th>
<?php }
else { ?>
<th bgcolor=silver> </th>
<?php }
} ?>
</table>
</body></html>
mon code pour mon calendrier
<?php
if(!isset($_REQUEST["m"]) ) $m = date("n");
else $m=$_REQUEST["m"];
if(!isset($_REQUEST["a"]) ) $a = date("Y");
else $a=$_REQUEST["a"];
$mnom = Array("","Janvier","Février","Mars"
,"Avril","Mai","Juin","Juillet","Août"
,"Septembre","Octobre","Novembre","Décembre");
$dayone = date("w",mktime(1,1,1,$m,1,$a));
if($dayone==0) $dayone=7;
$url = "calendrier.php";
$aplus=$a+10; //modifie le changement de date des 2 premier bouton
$amoins=$a-10;
?>
<html><head><title>Calendrier</title>
<style type="text/css">
<!--
a:link,a:active,a:visited
{
text-decoration:none;
color: #000000;
}
tr.impaire {
background-color:#f9f8f1;
}
tr.paire {
background-color:#f2efe3;
}
body {
font-size:10px;
background-color: #FFFFFF;
}
-->
</style>
<script type="text/javascript">
function surligne(elt){
elt.style.backgroundColor="#66CCCC";
}
function surligneoff(elt){
elt.style.backgroundColor="#FFFFFF";
}
</script>
</head><body > <center>
<?php if($amoins>=1970)
echo"<a href='$url?m=$m&a=$amoins'><<</a> "; // 10 ans avant
for($i=$a-9;$i<=$a;$i++) {
if($i>=1970 && $i<=date("Y")+5)
echo"<a href='$url?m=$m&a=$i'>$i</a>";
}
if($aplus<=date("Y")+100)
echo" <a href='$url?m=$m&a=$aplus'>>></a>";// 100 ans apres
?>
<br><br>
<?php for($i=1;$i<=12;$i++) {
echo"<a href='$url?m=$i&a=$a'>".substr( $mnom[$i],0,1)."</a>";
if($i!=12) echo" - "; } ?>
<br/><br/>
<font size=4>
<?php if(($m==1 && $a<=1970)==false){
echo"<a href='";
if($m==1){
$an=$a-1;
$mois=12;
}
else{
$an=$a;
$mois=$m-1;
}
echo $url."?m=$mois&a=$an'><<</a> ";} // mois avant
?>
<?php echo $mnom[$m]." ".$a;
if($m==12){
$an=$a+1;
$mois=1;
}
else{
$an=$a;
$mois=$m+1;
}
$jours_in_month=cal_days_in_month(CAL_GREGORIAN,$m,$a);
// calcul du nombe de semaine soit nb_jour ds le mois diviser par 7
//et on arrondit au superieur
$nb_semaine=ceil($jours_in_month/7);
$jours_a_afficher=$nb_semaine*7;
echo" <a href='$url?m=$mois&a=$an'>>></a>"; // mois apres
?></font>
<br><br>
<table width=100% cellspacing=0 border>
<tr class="paire">
<th>Lundi</th>
<th>Mardi</th>
<th>Mercredi</th>
<th>Jeudi</th>
<th>Vendredi</th>
<th>Samedi</th>
<th>Dimanche</th>
<?php for($i=1;$i<=$jours_a_afficher;$i++) {
if($i%7 == 1) { ?></tr><tr><?php }
if(($i<($jours_in_month+$dayone ))&&($i>=$dayone)) { ?>
<th onMouseOut="javascript:surligneoff(this);" onMouseOver="javascript:surligne(this);" >
<?php echo '<span style="color:#F08080;">',$i-$dayone+1;'</span>' ?></th>
<?php }
else { ?>
<th bgcolor=silver> </th>
<?php }
} ?>
</table>
</body></html>