Hi, i am using this code
[code=php]
<?PHP
session_start();
//page required for login checks and validations
require_once(‘../../../functions/validation.php’);
require_once(‘../../../functions/page_build.php’);
//check for to make sure they are logged in
reg_session_check();
$Name = $_GET[Name];
//check to see if it is filled out
if (!filled_out($HTTP_POST_VARS)) {
echo “<?PHP”;
echo “session_start();”;
echo “//page required for login checks and validations”;
echo “require_once(‘../../../functions/validation.php’);”;
echo “//check for to make sure they are logged in”;
echo “reg_session_check();”;
echo “$Name = $_GET[Name];”;
echo “?>”;
page_header();
echo ” <p class=’top10mainred’>Sorry you did not fill out the box!</p>”;
availability_availability();
page_footer();
exit;
} else {
//connect to the server
$conn = mysql_connect(“localhost”,”miranda”,”xxxxxx”);
//connect to the database
mysql_select_db(“miranda”,$conn) or die(mysql_error());
//check if it is or isn’t available
$avcheck = “SELECT Available FROM $Name WHERE Code = ‘$_POST[Code]'”;
//results of this query
$avcheck_res = mysql_query($avcheck,$conn) or die(mysql_error());
//check for num of rows
if(mysql_num_rows($avcheck_res)==!1) {
echo “<?PHP”;
echo “session_start();”;
echo “//page required for login checks and validations”;
echo “require_once(‘../../../functions/validation.php’);”;
echo “//check for to make sure they are logged in”;
echo “reg_session_check();”;
echo “$Name = $_GET[Name];”;
echo “?>”;
page_header();
echo ” <p class=’top10mainred’>That code did not exist in the database!</p>”;
availability_availability();
page_footer();
exit;
//code exists
} else {
//retreive value of availability
$Available = mysql_result($avcheck_res, 0,’Available’) or die(mysql_error());
//if it equals yes set it to No
if ($Available ==’Yes’) {
//redirect to yes page
echo “<?PHP”;
echo “session_start();”;
echo “//page required for login checks and validations”;
echo “require_once(‘../../../functions/validation.php’);”;
echo “//check for to make sure they are logged in”;
echo “reg_session_check();”;
echo “$Name = $_GET[Name];”;
echo “?>”;
page_header();
echo ” <p class=’top10mainwhite’>The $Name is currently <span class=’top10mainred’><strong>available</strong></span></p>”;
echo “<form action=’availability_yn.php?Name=”.urlencode($Name).”?Available=”.urlencode(Yes).”‘ method=’post’ enctype=’multipart/form-data’>”;
availability_availability();
page_footer();
exit;
} else {
//redirect to No page
echo “<?PHP”;
echo “session_start();”;
echo “//page required for login checks and validations”;
echo “require_once(‘../../../functions/validation.php’);”;
echo “//check for to make sure they are logged in”;
echo “reg_session_check();”;
echo “$Name = $_GET[Name];”;
echo “?>”;
page_header();
echo ” <p class=’top10mainred’>The $Name is currently <span class=’top10mainred’><strong>unavailable</strong></span></p>”;
echo “<form action=’availability_yn.php?Name=$Name?Available=No’ method=’post’ enctype=’multipart/form-data’>”;
availability_availability();
page_footer();
exit;
}
}
}
?>
What happens is “filled out” check to see the previous field is filled out now if it is blank it returns it properly the pages loads fine as it should.
Any time the other ones are called upon i.e there is no rows or there is and it is either Yes or No
the page returns blank just a white page. I dont understand coz i have used this code before but instead of building the page i have redirected it but this saves me so much time lol. Also filled out works fine but it is the same echo code :s i dont know
Any ideas
Thanks