Everything seems fine, why doesn't test.php work
Posted: Tue Apr 06, 2004 12:54 am
Who can help?
All I get on my test.php page is a white page. Everything seems to be fine though when I look at the html source of my first page.
What am I doing wrong?
What I want is a listing of the products that have been checked on my first page (for now, I'd like to send a confirmation email later).
This is the first page:
<form method="get" action="test.php">
This is the test.php page
Thank you for reading and eventually answering this question.
All I get on my test.php page is a white page. Everything seems to be fine though when I look at the html source of my first page.
What am I doing wrong?
What I want is a listing of the products that have been checked on my first page (for now, I'd like to send a confirmation email later).
This is the first page:
<form method="get" action="test.php">
Code: Select all
<?php # Script 2 - lijst.php
//shows all the products that are still available
$page_title = 'look at the list';
//connect to the database
require_once ('../mysql_connect.php');
//make the query
$query = "SELECT lijst.l_id, lijst.l_prod, lijst.l_cat, lijst.l_prijs
FROM lijst
WHERE ((Not (lijst.l_sold_yn)=1)) ORDER BY lijst.l_cat, lijst.l_prod";
//run the query
$result = @mysql_query ($query);
//if it ran ok, display the records
if ($result)
{
echo '<table align="left"
cellspacing="2" cellpadding="2" width="90%" border="0">
<tr bgcolor="#CCFFFF">
<td align="center" width="20"><b><font face="Arial, Helvetica, sans-serif" size="2">id</font></b></td>
<td align="center" width="200"><b><font face="Arial, Helvetica, sans-serif" size="2">product</font></b></td>
<td align="center" width="200"><b><font face="Arial, Helvetica, sans-serif" size="2">waarvoor</font></b></td>
<td align="center" width="80"><b><font face="Arial, Helvetica, sans-serif" size="2">prijs</font></b></td>
<td align="center" width="150"><b><font face="Arial, Helvetica, sans-serif" size="2">kadootje(s) aanvinken</font></b></td>
</tr>
';
//fetch and print all the records
while ($row = mysql_fetch_assoc($result))
{
?><tr bgcolor="CCFFFF">
<td align="left" <font face="Arial, Helvetica, sans-serif" size="1" ><?echo $row[l_id]; ?></td>
<td align="left" <font face="Arial, Helvetica, sans-serif" size="1" ><?echo $row[l_prod]; ?></td>
<td align="left" <font face="Arial, Helvetica, sans-serif" size="1" ><?echo $row[l_cat]; ?></td>
<td align="right" <font face="Arial, Helvetica, sans-serif" size="1"><?echo $row[l_prijs]; ?></td>
<td <div align="center"><input type="checkbox" name="<?echo $row['l_id'];?>"></td>
</tr>
<?
}
echo'</table>';
//Free up the resources
mysql_free_result ($result);
} else {//if it did not run ok
echo '<p>Oops! Mum made a technical error, please try again later</p>
<p>' .mysql_error() .'</p>';
}
//close the database
mysql_close();
?>
<input type="submit">
</form>
</td>
</tr>
</table>
<?phpThis is the test.php page
Code: Select all
<?
echo $HTTP_POST_VARS['chk[]'];
/*
$aantal = count($_POST['chk']);
echo 'aangevinkt zijn:<br>';
for($i=0; $i<$aantal;$i++)
{
echo $i .'----' . $_POST['chk'][$i] .'<br>';
}
*/
?>