- Beranda
- Komunitas
- Tech
- Website, Webmaster, Webdeveloper
Help cara kirim Value form tanpa submit


TS
azies02
Help cara kirim Value form tanpa submit
Minta tolong Master, ane adatugas bikin web

Mau tanya Gimana caranya biar ketika klik radio butom, iklan yang di tampilin hanya iklan dari area yang di klik pada radio butom
Pilih Area<br>
<form name="area1">
<table>
<tr><td><INPUT TYPE="RADIO" id="1" name="area" value="Cilegon" >Cilegon
<td><INPUT TYPE="RADIO" id="2" name="area" value="Lebak">Lebak
<td><INPUT TYPE="RADIO" id="3" name="area" value="Pandeglang">Pandeglang
<td><INPUT TYPE="RADIO" id="4" name="area" value="Serang kab">Serang Kab.
<td><INPUT TYPE="RADIO" id="5" name="area" value="Tangerang">Tangeran
<td rowspan="2"><div id="refres" style="display:none"><button><img src="image/refresh.PNG" height="15" width="15"/></button></div>
</tr>
<tr><td><INPUT TYPE="RADIO" id="6" name="area" value="Tangerang Selatan">Tangerang Selatan
<td><INPUT TYPE="RADIO" id="7" name="area" value="Serang kota">Serang Kota
<td><INPUT TYPE="RADIO" id="8" name="area" value="Anyer">Anyer
<td><INPUT TYPE="RADIO" id="9" name="area" value="Baros">Baros
<td><INPUT TYPE="RADIO" id="10" name="area" value="Carita">Carita
</tr>
</table>
</form>
<?php do { ?>
<div class="isi">
<div class="foto">
<img src="iklan/<?php echo $row_Recordset1['foto']; ?>" width="150" height="120" style="border: 2px solid #778899;padding:3px;"/>
</div>
<div class="harga">
<span style="float:right;color:#FFA500;" ><b>Rp <?php $harga=number_format($row_Recordset1['harga'],0,",","."); echo $harga; ?>,00</b> </span>
</div>
<div class="judul">
<div style="color:#4169E1; font-size:20px;"><b><?php echo $row_Recordset1['judul_iklan']; ?><b></div>
<div style="font-size:10px; margin-top:15px;"><img src="image/lokasi.PNG" width="12" height="17"/> <?php echo $row_Recordset1['area']; ?> <img src="image/kondisi.PNG" width="12" height="15"/> <?php echo $row_Recordset1['kondisi']; ?> </div>
<div style="font-size:15px; margin-top:17px;"><?php $date=$row_Recordset1['time']; echo dateAgo($date); ?></div>
</div>
</div>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<table border="0">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf(">First</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf(">Previous</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf(">Next</a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf(">Last</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_koneksi, $koneksi);
$query_Recordset1 = "SELECT * FROM iklan ORDER BY id_iklan DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $koneksi) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

Mau tanya Gimana caranya biar ketika klik radio butom, iklan yang di tampilin hanya iklan dari area yang di klik pada radio butom
Spoiler for Html:
Quote:
Pilih Area<br>
<form name="area1">
<table>
<tr><td><INPUT TYPE="RADIO" id="1" name="area" value="Cilegon" >Cilegon
<td><INPUT TYPE="RADIO" id="2" name="area" value="Lebak">Lebak
<td><INPUT TYPE="RADIO" id="3" name="area" value="Pandeglang">Pandeglang
<td><INPUT TYPE="RADIO" id="4" name="area" value="Serang kab">Serang Kab.
<td><INPUT TYPE="RADIO" id="5" name="area" value="Tangerang">Tangeran
<td rowspan="2"><div id="refres" style="display:none"><button><img src="image/refresh.PNG" height="15" width="15"/></button></div>
</tr>
<tr><td><INPUT TYPE="RADIO" id="6" name="area" value="Tangerang Selatan">Tangerang Selatan
<td><INPUT TYPE="RADIO" id="7" name="area" value="Serang kota">Serang Kota
<td><INPUT TYPE="RADIO" id="8" name="area" value="Anyer">Anyer
<td><INPUT TYPE="RADIO" id="9" name="area" value="Baros">Baros
<td><INPUT TYPE="RADIO" id="10" name="area" value="Carita">Carita
</tr>
</table>
</form>
<?php do { ?>
<div class="isi">
<div class="foto">
<img src="iklan/<?php echo $row_Recordset1['foto']; ?>" width="150" height="120" style="border: 2px solid #778899;padding:3px;"/>
</div>
<div class="harga">
<span style="float:right;color:#FFA500;" ><b>Rp <?php $harga=number_format($row_Recordset1['harga'],0,",","."); echo $harga; ?>,00</b> </span>
</div>
<div class="judul">
<div style="color:#4169E1; font-size:20px;"><b><?php echo $row_Recordset1['judul_iklan']; ?><b></div>
<div style="font-size:10px; margin-top:15px;"><img src="image/lokasi.PNG" width="12" height="17"/> <?php echo $row_Recordset1['area']; ?> <img src="image/kondisi.PNG" width="12" height="15"/> <?php echo $row_Recordset1['kondisi']; ?> </div>
<div style="font-size:15px; margin-top:17px;"><?php $date=$row_Recordset1['time']; echo dateAgo($date); ?></div>
</div>
</div>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<table border="0">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf(">First</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf(">Previous</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf(">Next</a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf(">Last</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
Spoiler for php:
Quote:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_koneksi, $koneksi);
$query_Recordset1 = "SELECT * FROM iklan ORDER BY id_iklan DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $koneksi) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
Diubah oleh azies02 28-10-2014 13:33
0
5K
Kutip
10
Balasan


Komentar yang asik ya
Urutan
Terbaru
Terlama


Komentar yang asik ya
Komunitas Pilihan