Membuat Website Sederhana Dengan Menggunakan PHP


Download Project,gambar Dan Database Yang Sudah Jadi

Klik Disini

Download Css Menu generator Portable

Klik Disini

Cara penginstalan
#32 Bit
Download Css Menu Generator Kopi di Program files
#64 Bit
Download Css Menu Generator Kopi di Program files(86)


============================================================
Kata Kunci

-hitcounter.php
-pol.php
-prosespol.php
-tampilpol.php

============================================================
hitcounter.php

<?php
mysql_connect("localhost","root","");
mysql_select_db("baru1");
if(!isset($_SESSION['okay']))
{
 $_SESSION['okay']=session_id();
 mysql_query("update pendatang set jumlah = jumlah + 1");
}
$data = mysql_query("select * from pendatang ");
$tampil = mysql_fetch_array($data);
$a = $tampil[0];
if($a<10){
echo "<h1>000000".$a."</h1>";
}
else if($a<100){
echo "<h1>00000".$a."</h1>";
}
else if($a<1000){
echo "<h1>0000".$a."</h1>";
}
else if($a<10000){
echo "<h1>000".$a."</h1>";
}
else if($a<100000){
echo "<h1>00".$a."</h1>";
}
else if($a<1000000){
echo "<h1>0".$a."</h1>";
}else{
echo $a."</h1>";
}


?>

============================================================
pol.php

<form id="form1" name="form1" method="post" action="prosespol.php">
  <p>&nbsp;</p>
  <table width="66%" border="    0           2" cellspacing="0" cellpadding="0">
    <tr>
      <td>Pelayanan E-Comerce manakah menurut anda bagus </td>
    </tr>
    <tr>
      <td><label>
<input type="radio" name="tpilihan" id="radio" value="1" />     
Lazada
      </label></td>
    </tr>
    <tr>
      <td><label>
        <input type="radio" name="tpilihan" id="radio2" value="2" />
      </label>
      Shopie</td>
    </tr>
    <tr>
      <td><input type="radio" name="tpilihan" id="radio3" value="3" />
      Tokopedia</td>
    </tr>
    <tr>
      <td><input type="radio" name="tpilihan" id="radio4" value="4" />
      Zelora</td>
    </tr>
    <tr>
      <td><label></label></td>
    </tr>
  </table>
  <p>
    <input type="submit" name="button" id="button" value="vote" />
  </p>
</form>

============================================================

prosespol.php

<?php
include"templates/bagian1.php";
mysql_connect("localhost","root","");
mysql_select_db ("baru1");
$pil=$_POST["tpilihan"];
if($pil=="1")
{mysql_query("update vote set lazada=lazada+1");}
else if ($pil=="2")
{mysql_query("update vote set shopie= shopie +1");}
else if ($pil=="3")
{mysql_query("update vote set tokopedia=tokopedia+1");}
else
{mysql_query("update vote set zalora=zalora+1");}
echo" <h2><marquee>TERIMA KASIH ATAS PILIHAN ANDA </marquee><H2>";
echo "klik <a href=tampilpol.php> disini </a> untuk melihat hasil poling sementara";
include"templates/bagian2.php";
?>

============================================================

tampilpol.php

<?php
include "templates/bagian1.php";
mysql_connect ("localhost","root","");
mysql_select_db("baru1");
$cari=mysql_query("select*from vote");
$data=mysql_fetch_array ($cari);
$jlh1=$data[0];
$jlh2=$data[1];
$jlh3=$data[2];
$jlh4=$data[3];
$total=$jlh1+$jlh2+$jlh3+$jlh4;
$p1=round($jlh1/$total*100,2);
$p2=round($jlh2/$total*100,2);
$p3=round($jlh3/$total*100,2);
$p4=round($jlh4/$total*100,2);
echo "<h2> HASIL SEMENTARA <hr>";
?>

lazada
<table>
<tr>
<td width="<?php echo $p1?>"bgcolor="red" height="10">
<td><?php echo $p1."%"?></td></tr>
</table>
<br />
shopie
<table>
<tr>
<td width="<?php echo $p2?>"bgcolor="green" height="10">
<td><?php echo $p2."%"?></td></tr>
</table>
<br />
tokopedia
<table>
<tr>
<td width="<?php echo $p3?>"bgcolor="yellow" height="10">
<td><?php echo $p3."%"?></td></tr>
</table>
<br />
zalora
<table>
<tr>
<td width="<?php echo $p4?>"bgcolor="green" height="10">
<td><?php echo $p4."%"?></td></tr>
</table>
<br />
klik <a href="home.php"> KEMBALI </a> KE HALAMAN UTAMA
<?php
include"templates/bagian2.php";
?>
============================================================


Membuat Website Sederhana Dengan Menggunakan PHP Membuat Website Sederhana Dengan Menggunakan PHP Reviewed by Leo on 13:39 Rating: 5

No comments