Pages

Ads 468x60px

Selasa, 03 April 2012

Program REQUIRE pada PHP

Program REQUIRE pada PHP
Contoh require1

<html>
<head>
<title>..::TUGAS REQUIRE::..</title>
</head>
<body>
<?php
$b="Saya Sedang Makan";
function eLha($teks)
{
echo("<i>$teks</i>");
}
?>
</body>
</html>

require 2

<html>
<head>
<title>..::TUGAS REQUIRE::..</title>
</head>
<body>
<?php
require("r1.php");
elha("eLha Sedang Apa ??");
{
echo("<br>");
echo($b);
}
?>
</body>
</html>

Program INCLUDE pada PHP

Program INCLUDE pada PHP
CONTOH INCLUDE 1

<html>
<head>
<title>..::TUGAS Include::..</title>
</head>
<body>
<?php

$color = 'green';
$fruit = 'apple';

?>
</body>
</html>

Program FOR pada PHP

Program FOR pada PHP

<html>
<head>
<title>..::TUGAS FOR::..</title>
</head>
<body>
<?php
$max = 10;
for ($counter1 = 1; $counter1 <= $max; $counter1++)
echo ("eLha <br>");
?>
</body>
</html>

Program SWITCH pada PHP

Program SWITCH pada PHP

<html>
<head>
<title>..::TUGAS SWITCH::..</title>
</head>
<body>
<?php
switch ($pesan)
{
case Sabtu:
echo "Kerja setengah hari";
break;
case Minggu:
echo "Libur";
break;
default:
echo "Ayo kerja!";
}
?>
</body>
</html>
setelah di jalankan

Program WHILE Pada PHP

program WHILE Pada PHP

<html>
<head>
<title>..::TUGAS WHILE::..</title>
</head>
<body>
<?php
  $count=1;
  while($count<=10)
   {
    echo("Nama saya eLha <br>");
    $count++;
   }
?>
</body>
</html>
setelah di jalankan

program IF pada PHP

Program IF pada PHP


<html>
<head>
<title>..::TUGAS IF::..</title>
</head>
<body>

membuat profil dengan HTML

bagaimana membuat profil dengan HTML,okeee untuk membuat pertama-tama
1.buat scriptnya di notepad
   contoh:

<html>
<head>
<title>..::PROFIL::..</title>
</head>
<body background="D:\Nurul Ilmah\STIMED NUSA PALAPA\Kuliah\Semester 4\ramlah\couple2-320x200.bmp">
<fieldset>
<legend><b>My Profil</b></legend>
<table>
<tr>

  <td rowspan="6" width="150px"><img src="image.gif" /></td>
  <td><b><font color="blue">Nama </b></td>
  <td><font color="blue">:</td>
  <td><font color="blue">Ramlah</font></td>

</tr>
<tr>
    <td><b><font color="blue">NIM </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">01010010</td>
</tr>
<tr>
    <td><b><font color="blue">Alamat </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">Jl.Urip Sumoharjo No.13</td>
</tr>
<tr>
    <td><b><font color="blue">Jurusan </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">Sistem Informasi</td>
</tr>
<tr>
    <td><b><font color="blue">No.Tlp </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">085399674209</td>
</tr>
<tr>
    <td><b><font color="blue">E-mail </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">ramlah_stimed@yahoo.com</td>
</tr>
</table>
</fieldset>
</body>
</html>
2.nah,,setelah save as dengan misalnya profil.html
3.kemudian di jalankan di mozilla dsb
  setelah di jalankan tampilan akan seperti ini