melewatkan variable lewat url

 Happy Coding.
<html>
<head>
<?php
// file name : website.php
// description : melewatkan variable pada sebuah url
?>
<title>Learn about passing variable on url</title>
</head>
<body>
<?php
$mymovie=urlencode('life is simple');
echo "<a href="myweb.php?favmovie=$mymovie">";
echo "click here to see information about my favorite movie";
echo "</a>"
?>
</body>
</html>

And then..

<html>
<head>
<?php
// file name : myweb.php
// description : melewatkan variable pada sebuah url
?>
<title>my movie - <?php echo $_GET['favmovie']; ?></title>
</head>
<body>
<?php
echo "my favorite movie is - ";
echo $_GET['favmovie'];
?>
</body>
</html>

Related Posts

Posting Komentar