Merhaba arkadaşlar, PHP de radio butonlarla bir uygulama çalışıyorum.
Konuyu aktarayım;
resimde görülen banner kısmı için 3 tane banner.php dosyam var.
banner1.php, banner2.php, banner3.php
kullanıcının 3 farklı radio butonu kullanarak seçtiği hava durumu ne ise onunla ilgili bannerin index.php de ilgili yere include olmasını istiyorum.
include işleminden sonra radio seçim alanının tekrar gelmesini istiyorum. bunu (index.php?yonetici_islem=2 ile yapıyorum)
bi türlü yapamadım yardımcı olabilirseniz çok sevinirim.
Banner.php nin include edileceği yer resimdedir
Admin panelindeki radio buttonlar
index.php kodu
<?php ob_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PHP Test Sitesi</title>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
body {
background-image: url(/phpburada/images/arka.jpg);
background-attachment:fixed;
}
.yazilar {
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
color: #333;
font-weight: bold;
}
body p {
font-family: Verdana, Geneva, sans-serif;
font-size: 11px;
color: #000;
font-weight: bold;
}
br
{
line-height:3px;
}
.eskifiyat {
font-family: Tahoma, Geneva, sans-serif;
font-size: 24px;
font-weight: bolder;
color: #333;
text-decoration: line-through;
}
.yenifiyat {
font-family: Tahoma, Geneva, sans-serif;
font-size: 32px;
font-weight: bolder;
color: #FFF;
text-decoration: blink;
}
.uyari {
font-family: Arial, Helvetica, sans-serif;
font-size: 24px;
font-weight: bolder;
color: #FFF;
text-decoration: blink;
}
.sadece {
font-family: Tahoma, Geneva, sans-serif;
font-size: 16px;
color: #FFF;
background-color: #F00;
}
.modeladi {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #333;
font-style: normal;
font-variant: normal;
}
.hava_durumu_baslik {
font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
font-weight: bold;
}
.satisadedi {
font-family: "Arial Black", Gadget, sans-serif;
font-size: 12px;
color: #03F;
font-weight: bold;
font-variant: normal;
}
</style>
</head>
<body onload=k"MM_preloadImages('/phpburada/images/ing2.jpg','/phpburada/images/turk2.jpg')">
<table width="800" border="0" align="center">
<tr>
<td height="150" colspan="3" bgcolor="#e6e5e1">
<?php
if ($ders==gunesli) include("banner1.php");
else if ($ders==karli) include("banner2.php");
else if ($ders==yagmurlu) include("banner1.php");
else include("banner1.php");
?>
</td>
</tr>
<tr>
<td background="/phpburada/images/Haber_arkaplan.jpg"height="30" colspan="3" bgcolor="#FFFFFF"><p><marquee onmouseover="this.stop();" onmouseout="this.start();" scrolldelay="2" scrollamount="3" >
<?php
error_reporting(E_ALL ^ E_NOTICE);
if ($_GET['dil']==2)include("haberleren.txt");
else if ($_GET['dil']==1) include("haberler.txt");
else include("haberler.txt");
?>
</marquee></p></td>
</tr>
<tr>
<td background="/phpburada/images/150330_sol.jpg""" width="144" height="330" align="center" valign="top" bgcolor="#e6e5e1"><p><a href="index.php?dil=1">
<br />
<img src="/phpburada/images/turk1.jpg" name="trr" width="70" height="26" border="0" id="trr" onmouseover="MM_swapImage('trr','','/phpburada/images/turk2.jpg',1)" onmouseout="MM_swapImgRestore()" /></a> <a href="index.php?dil=2"><img src="/phpburada/images/ing1.jpg" name="enn" width="70" height="26" border="0" id="enn" onmouseover="MM_swapImage('enn','','/phpburada/images/ing2.jpg',1)" onmouseout="MM_swapImgRestore()" /></a> <br />
</p>
<p>
<?php
error_reporting(E_ALL ^ E_NOTICE);
if ($dil==2)include("ingilizce_menu.php");
else if ($dil==1) include("turkce_menu.php");
else include("turkce_menu.php");
?>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<?php
error_reporting(0);
session_start();
if (session_is_registered("kisi"))
{
echo "<a href='oturum_kapat.php'>Güvenli Çýkýþ</a>";
}
else include("yoneticigiris.php");
?>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<?php if ($_GET['dil'] == 2) echo "Visitors: ";
else if ($_GET['dil']== 1) echo "Ziyaretçiler: ";
else echo "Ziyaretçiler:";
include ("sayac.php");
?>
</p>
</td>
<td align="center" valign="top" background="/phpburada/images/iframeback.jpg"width="506" bgcolor="#e6e5e1">
<!-- <iframe frameborder="0" width="500" height="550" align="top" name="orta" src="/phpburada/hakkimizda.php"></iframe>-->
<?php
session_start();
if (session_is_registered("kisi"))
{
switch($yonetici_islem)
{
case 1: include("haberler.php"); break;
case 2: include("havadurumu.php");break;
case 3: break;
case 4: break;
case 5: break;
default: include("yonetici_islemleri.php");
}
}
else include("siradan.php");
?>
</td>
<td width="136" align="center" valign="top" background="/phpburada/images/150330_sag.jpg" bgcolor="#999999">
<p>
<!-- Sag Blok Kodlarim -->
<br />
<?php include ("urunler.php");?>
</p>
<p> </p>
<p><img src="/phpburada/images/coksatilan.jpg" width="130" height="27" /></p>
<p>
<?php include("encoksatanurun.php"); ?>
</p>
</td>
</tr>
<tr>
<td background="/phpburada/images/footer_arkaplan.jpg" height="40" colspan="3" bgcolor="#e6e5e1"><p>
<marquee behavior="alternate" scrollamount="2" scrolldelay="5">
<?php
if ($_GET['dil']==2) include ("adres_en.php");
else if ($_GET['dil']==1) include ("adres_tr.php");
else include ("adres_tr.php");
?>
</marquee>
</p>
</td>
</tr>
</table>
<?php ob_end_flush(); ?>
</body>
</html>havadurumu.php kodu (radio buttonların olduğu kısım)
<?php ob_start(); ?>
<?php
if(empty($_GET['ders'])){
echo "lütfen bir alan seçiniz";
}
else if(isset($_GET['ders'])){
$ders = $_GET['ders'];
header("Location:index.php?yonetici_islem=2");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
<title>Hava Durumu</title>
<style type="text/css">
.hava_durumu_bslk {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
font-weight: bold;
color: #000;
}
.radio_opsiyon {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #333;
}
</style></head>
<body>
<form id="form1" name="form1" method="get" action="havadurumu.php">
<p class="hava_durumu_bslk">Hava Durumu </p>
<form action="index.php" method="get">
<p>
<input type="radio" name="ders" value="karli"/>
Karlı<br/>
<input type="radio" name="ders" value="yagmurlu"/>
Yağmurlu
<br/>
<input type="radio" name="ders" value="gunesli"/>
Güneşli
<br/>
</p>
<p><input type="submit" name="sec" value="Seç"/><br/>
</form>
<p><a href="index.php">[Ç I K I Ş]</a></p>
<p><br />
</p>
</form>
</body>
</html>index.php de şu kodla degisimi yapmaya calisiyorum ama olmuyor bi türlü
<?php
if ($ders==gunesli) include("banner1.php");
else if ($ders==karli) include("banner2.php");
else if ($ders==yagmurlu) include("banner1.php");
else include("banner1.php");
?>