I have a form that has the following code:
form id="form1" name="form1" method="post" action="printable_version2_test3.php">
<?php do { ?>
<p>
<input name="UID[]" type="checkbox" id="UID" value="<?php echo $row_applicants['UID']; ?>" />
<label for="UID"></label>
<?php echo $row_applicants['FNAME']; ?> <?php echo $row_applicants['LNAME']; ?> </p>
<?php } while ($row_applicants = mysql_fetch_assoc($applicants)); ?>
<p>
<input type="submit" name="button" id="button" value="Submit" />
<input name="ID" type="hidden" id="ID" value="<?php echo $_GET['ID']; ?>" />
</p>
</form>
When a user hits submit, they goto a page where the user's profiles selected on the form are displayed. Here is the code for that page:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$ID = $_POST['ID'];
}
mysql_select_db($database_connect, $connect);
$idList = implode(',', $_POST['UID']);
$sql = "SELECT *, scholarships.NAME as scholarshipname FROM scholarships, users INNER JOIN
stu_app2008 ON users.UID = stu_app2008.UID LEFT JOIN activities ON users.UID = activities.UID
LEFT JOIN coll_exp ON users.UID = coll_exp.UID LEFT JOIN employ ON users.UID = employ.UID LEFT
JOIN fin_app ON users.UID = fin_app.UID LEFT JOIN finaid ON users.UID = finaid.UID LEFT JOIN
stu_special ON users.UID = stu_special.UID WHERE scholarships.ID = $ID and users.UID in (' .
$idList . ')";
$res = mysql_query($sql) or die(mysql_error());
$varlist = array();
while ($row = mysql_fetch_assoc($res)) {
$varlist[$row['UID']] = $row;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1
/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Cambridge Public Schools: Public schools built on a
foundation of academic excellence and committed to promoting an environment of social justice.">
<meta name="keywords" content="cambridge, massachusetts, ma, mass, public, school, district,
k-12, public schools, cambridge public schools, school registration, cambridge schools, ma
public schools, rindge and latin school, amigos school, morse school, tobin school, peabody
school, fletcher-maynard academy, kennedy-longfellow, rindge school of technical arts, baldwin
school, cambridgeport, graham & parks, haggerty school, martin luther king jr. school, cambridge
rindge and latin, crls, falcon sports, superintendent young, cps">
<meta name="robots" content="noarchive">
<link rel="shortcut icon" href="http://www3.cpsd.us/media/ImageElements/theme/CPS%20Redesign
/favicon.ico?rev=1">
<link rel="stylesheet" type="text/css" href="https://secure2.cpsd.us/scholarship
/form_styles.css" />
<style type="text/css">td img {display: block;}</style>
<style type="text/css">td img {margin: 0;}</style>
<link href="../text.css" rel="stylesheet" type="text/css" />
<style>
.break { page-break-before: always; }
</style>
<title>Cambridge Rindge & Latin School | 2012 Scholarship Standard Application</title>
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=600,height=500,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
</head>
<body><?php
foreach ($varlist as $UID => $row)
do { ?>
<table border="0" cellspacing="0" cellpadding="0" width="960px" align="center">
<tbody>
<tr>
<td colspan="3" valign="top">...
For some reason, I get a blank page. No errors, but, no profiles showing up. The UID is a unique number that is associated with each student. The student data shown in the profile comes from several tables all within the same database.
I have been trying to solve this issue for months so, any help would be greatly appreciated. Thank you in advance.
ini_set('display_errors', 1); ini_set('error_reporting', E_ALL ^ E_NOTICE);
to the top of the page – Dagon Feb 6 at 20:02