I am trying to get the id from the index.php to pass through doLandingPage.php to doAttendance.php. but doesn't seeem to get the id to doAttendance.php since it is not a form.
Notice: Undefined index: id in C:\xampp\htdocs\junhao\doAttendance.php on line 5
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\junhao\doAttendance.php on line 9 Unknown system variable 'name'
index.php
<div class="row" style="position:absolute; left:35%;top:40%;">
<form method="post" action="doLandingPage.php">
<div class="search row">
<div class="small-12 columns">
<input name="search" type="text" placeholder="Enter your name..">
</div>
<div class="small-12 columns">
<center>
<input type="submit" name="Submit" value="Submit" class="button round">
</center>
</div>
</div>
</form>
</div>
doLandingPage.php
<body id="page-2">
<div class="container">
<nav>
<ul>
<li><a href=""></a></li>
</ul>
<div class="overlay-button ">
<a class="btn-open" href="#"></a>
</div>
</nav>
<div class="overlay">
<div class="wrap">
<ul class="wrap-nav">
<li><a href="#">Menu</a>
<ul>
<li><a href="http://localhost:8080/file/index.php">Home</a></li>
<li><a href="http://localhost:8080/file/guests.php">Guest List</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row" style="position:absolute; left:35%;top:40%;">
<form method="post" action="doLandingPage.php">
<div class="row">
<div class="large-12 columns">
<div class="row">
<center>
<?php
if(mysql_num_rows($query) > 0){
while($row = mysql_fetch_array($query))
{
$id = $row['id'];
$name = $row['name'];
$table = $row['table'];
echo "<h1>$name</h1>";
echo "<h2>$table</h2>";
echo "<a href='http://localhost:8080/file/index.php' class='button'>BACK</a>";
echo "<a href='http://localhost:8080/file/doAttendance.php?id=<?php echo $row['id'];?>' class='button'>I'M HERE!</a>";
}
} else {
echo "<h1>Name not found.</h1><br>";
}
?>
</center>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
doAttendance.php
<?php
include "dbFunctions.php";
extract($_POST);
$id = $_REQUEST['id'];
$presence = 'Yes';
$selectQuery = "SELECT * FROM guests WHERE id = '$id'";
$selected = mysql_query($connect, $selectQuery) or die(mysql_error($connect));
if (mysql_num_rows($selected) > 0) {
} else {
$sql = "UPDATE guests SET presence='$presence' WHERE id = '$id' ";
$updated = mysql_query($connect, $sql) or die(mysql_error($connect));
}
?>