Buat
file bernama hello.php dan
meletakkannya di direktori root web server
Anda (DOCUMENT_ROOT) dengan konten berikut:
Contoh # 1 pertama kami PHP script: hello.php
<html>
<head>
<title> PHP Uji </ title>
</ head>
<body>
<? php echo '<p> Hello World </ p>';?>
</ body>
</ html>
Gunakan browser Anda untuk mengakses file dengan URL web server Anda, berakhir dengan referensi file / hello.php.
Ketika
mengembangkan secara local URL ini akan menjadi
sesuatu seperti http://localhost/hello.php atauhttp://127.0.0.1/hello.php tapi
ini tergantung pada konfigurasi web
server. Jika semua sudah dikonfigurasi dengan benar, file ini akan diurai oleh PHP danoutput berikut akan dikirim ke browser Anda:
<html>
<head>
<title> PHP Uji </ title>
</ head>
<body>
<p> Hello World </ p>
</ body>
</ html>
Tidak ada komentar:
Posting Komentar