Jumat, 06 September 2013

Share it Please
Cara Membuat Web dari localhost (php)
kalian harus menginstall Xampp dan sublimetext terlebih dahulu
Pertama buat folder di C:SYSTEM/xampp/htdocs dengan nama rplweb (tidak menggunakan spasi)
Lalu buat file di sublime dengan nama index.php
lalu diisi dengan code dibawah ini ..

<html>
<head>
<title>WEB JURUSAN</title>
</head>
<link rel="stylesheet" type="text/css" href="css/css.css">
<body>
<table border="0" class="menu-top">
<tr>
<td><a href="index.php?page=home">Home</a></td>
<td><a href="index.php?page=profile">Profile</a></td>
<td><a href="index.php?page=gallery">Gallery</a></td>
<td><a href="index.php?page=contact">Contact Us</a></td>
<td>
<form method="post" action="#">
<input type="text" placeholder="Masukan Keyword" name="txtCari"/>
<input type="submit" value="Search"/>
</form>
</td>
</tr>

</table>
<div class="main">
<div class="content">
<?php
$p = $_GET['page'];
if ($p=="home"){
//echo "Halaman home";
include "home.php";
}
else if($p=="profile"){
//echo "Halaman Profile";
include "profile.php";
}
else if($p=="gallery"){
//echo "Halaman gallery";
include "gallery.php";
}
else if($p=="contact"){
//echo "Halaman Contact US";
include "contact.php";
}
?>
</div>
<div class="box-menu">
<table width="100%">
<tr><td>
<table width="100%" class="other-link">
<tr><td class="active">Link Other</td></tr>
<tr><td><a href="#">E-Learning</a></td></tr>
<tr><td><a href="#">Facebook</a></td></tr>
<tr><td><a href="#">Twitter</a></td></tr>
</table>
</td></tr>
<tr><td>

<table width="100%" class="other-link">
<tr><td class="active">Polling</td></tr>
<tr><td>Baik Sekali</td></tr>
<tr><td>Baik</td></tr>
<tr><td>Cukup</td></tr>
</table>

</td></tr>
<tr><td><table width="100%" class="other-link">
<tr><td class="active">Kunjungan</td></tr>
<tr><td>Ip <?php echo $_SERVER['REMOTE_ADDR']; ?></td></tr>
<tr><td>Hari ini : </td></tr>
<tr><td>Minggu ini :</td></tr>
</table></td></tr>
</table>
</div>
</div>
</body>
</html>

jika sudah, kita membuat text stylenya atau css
kita klik file lalu new file
save dengan nama css.css
lalu isi dengan Code berikut


body{
background-color: black;
font-family: arial;
font-size: 12px;
line-height: 200%;
}
.menu-top{
margin-top:50px;
margin-bottom: 20px;
margin-left: auto;
margin-right: auto;
width: 950px;
font-size: 44;
font-family: "angelic war"

}
.main{
border:solid 1px #DDD;
width: 950px;
background-color:#FFF;
border-color: black;
margin-bottom: 20px;
margin-left: auto;
margin-right: auto;
overflow: hidden;
}
.content{
width: 650px;
float: left;
margin: 10px;
padding: 2px;
}
.box-menu{
width: 250px;
float: left;
margin: 10px;
padding: 2px;
overflow: hidden;
}
.other-link{
border-collapse:collapse;
}
.other-link tr td{
border:solid 1px #DDD;
height: 25px;
padding: 5px;
}
.active{
border-radius: 5px 5px 0 0;
background-color: black;
color: red;
font-family: "acquaintance";
}
h2{
color:red;
}
a{
color: red;
text-decoration: none;
}
a:link{
color: red;
}
a:hover{
text-decoration: underline;
text-decoration: red;
}

lalu kita buat menu'a seperti Home , Profile , dsb
caranya kita buat new file lagi lalu namakan dengan home.php
diisi dengan code berikut

<html>
<body>
<b><h1>Halaman Home</h1></b>
<hr width="100%">
<div align="justify">
<img src="gambar/cihuyy.jpg" width="250px" height="175px" style="float:left;margin-right:10px;border:solid 2px #DDD;"/>
Web ini adalah web percobaan sebagai pelajaran Produktif Rekayasa Perangkat Lunak (RPL) Basic
</div>
</body>
</html>
(untuk yang bertuliskan merah bisa kalian rubah sesuai keinginan)

lalu kita buat profile.php
sebenarnya code'a sama tapi yg berbeda ada di
<b><h1>Halaman Home</h1></b>
ini codingan untuk profile.php

<html>
<body>
<div>
<h1>Halaman Profile</h1>
<hr width="100%">
<img src="gambar/foto1156.jpg" width="200px height="200px" style="float:left;margin-right:10px;border:solid 5px #07F6D7">
</div>
</body>
</html>

Cukup segini aja dulu cara membuat web sederhana melalui localhost / php
Salam Sejahtera

Written by

Hello , My name is Sony Surahman.I'am a newbie Blogger

0 komentar:

Posting Komentar

Tolong kalau komentar pake bahasa yang sopan ya... :)

© 2014 T-A_Blog'z. All rights resevered. Designed by Templateism | Edited by Me