Hi everyone. i would like your help on how i can pass TWO variables within one other page using the GET Argument.
There are 2 scripts. At the first maybe is invalid the line
<td align=center><a href=\"remove_from_students.php?id=$id_student am=$am \">DELETE</a></td>.
But i want to pass am variable too within remove_from_students.php.
what i need to do?
the first script:
Code: Select all
<?
include("ptyxiakidbinfo.php");
mysql_connect($host,$username , $password);
mysql_select_db($database) or die( "Unable to select database");
$get_list = ("SELECT id_student , f_name , l_name , am , typical_examino FROM student ORDER BY typical_examino " ) ;
$get_list_res = mysql_query($get_list) or die (mysql_error());
$display_block .= "
<table celpadding=3 cellspacing=2 border=1 width=98%>
<tr>
<th>FNAME:</th>
<th>LNAME:</th>
<th>ΑΜ:</th>
<th>SEMESTER</th>
<th>ACTION</th>
<th>ACTION</th>
</tr>";
while ($line=mysql_fetch_array($get_list_res))
{
$id_student=$line["id_student"];
$f_name=$line["f_name"];
$l_name=$line["l_name"];
$am=$line["am"];
$typical_examino=$line["typical_examino"];
$display_block .= " <tr>
<td align=center>$f_name<br></td>
<td align=center>$l_name<br></td>
<td align=center>$am<br></td>
<td align=center>$typical_examino<br></td>
<td align=center><a href=\"remove_from_students.php ?id=$id_student am=$am \">DELETE</a></td>
<td align=center><a href=\"edit_from_students.php?id=$id_student\">CHANGE</a></td>
</tr>";
}
$display_block .= "</table>";
?>
<?
print $display_block;
print "<br><br><a href=\"adminpage.html\">RETURN TO INDEX</a>";
?>Code: Select all
<?
include("ptyxiakidbinfo.php");
mysql_connect($host,$username , $password);
mysql_select_db($database) or die( "Unable to select database");
if ($_GET[id] != ""){
$delete_student = "DELETE FROM student WHERE id_student =$_GET[id] ";
if (mysql_query($delete_student ) )
{
echo "THE LINE WAS DELETED! <br><br><a href=\"delete_edit_student.php\">RETURN TO EDIT</a><br><br><a href=\"adminpage.html\">RETURN TO INDEX</a>";
}else {
echo "THE LINE WAS NOT DELETED , ERROR!!<br><br><a href=\"delete_edit_student.php\">RETURN TO EDIT</a><br><br><a href=\"adminpage.html\">RETURN TO INDEX</a>";
}
$delete_student_marks="DELETE FROM students_marks WHERE student_am =$_GET[am]";
if (mysql_query($delete_student_marks ) )
{
echo "THE LINE WAS DELETED! <br><br><a href=\"delete_edit_student.php\">RETURN TO EDIT</a><br><br><a href=\"adminpage.html\">RETURN TO INDEX</a>";
}else {
echo "<br><br><a href=\"delete_edit_student.php\">THE LINE WAS NOT DELETED ,ERROR</a><br><br><a href=\"adminpage.html\">RETURN TO INDEX</a>";
}
}
?>