I tried a some tutorials that showed if you click on a link ex: index.php it in its URL it becomes index.php?page=sample.php
using the include()
I try doing it but doesn't work,I checked everything and all is correct.
im using PHP5.3
ERROR: Notice: Undefined index: tutorials in C:\wamp\www\quick_login\index.php on line 21
CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<table width="422" height="220" border="1" cellpadding="0" cellspacing="2">
<tr>
<th width="87" scope="col">Header</th>
</tr>
<tr>
<td>
<a href="index.php">Home</a><br>
<a href="index.php?page=tutorials">Tutorials</a>
</td>
<td width="323">
<?php
$page = $_GET['page'];
if($page){
include('inc/' .$page.'.php');
}
else{
echo "<b>Start Home</b>";
}
?>
</td>
</tr>
</table>
</body>
</html>
Does anyone know how to make it work?
using the include()
I try doing it but doesn't work,I checked everything and all is correct.
im using PHP5.3
ERROR: Notice: Undefined index: tutorials in C:\wamp\www\quick_login\index.php on line 21
CODE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<table width="422" height="220" border="1" cellpadding="0" cellspacing="2">
<tr>
<th width="87" scope="col">Header</th>
</tr>
<tr>
<td>
<a href="index.php">Home</a><br>
<a href="index.php?page=tutorials">Tutorials</a>
</td>
<td width="323">
<?php
$page = $_GET['page'];
if($page){
include('inc/' .$page.'.php');
}
else{
echo "<b>Start Home</b>";
}
?>
</td>
</tr>
</table>
</body>
</html>
Does anyone know how to make it work?