/    Sign up×
Community /Pin to ProfileBookmark

blank pages … ?

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;
}
}
}
?>
[/code]

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

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@pnajSep 08.2004 — You might be suffering from the *new* way of accessing server/http variables.

The *new* way of referring to $HTTP_POST_VARS is $_POST

See [URL=http://www.phpbuilder.com/manual/language.variables.predefined.php]Predefined variables[/URL] in the manual for a full explanation.

EDIT: Just noticed you are actually using $_POST further down the code so maybe you just forgot this one!!
Copy linkTweet thisAlerts:
@k0r54authorSep 08.2004 — sorry im lost lol, where have i used the old one?
Copy linkTweet thisAlerts:
@k0r54authorSep 08.2004 — it appears to be a problem with passing on the variable :s
Copy linkTweet thisAlerts:
@pnajSep 09.2004 — In the call to the filled_out function ...


//check to see if it is filled out

if (!filled_out($HTTP_POST_VARS)) {


PS. What does 'lol' mean ?
Copy linkTweet thisAlerts:
@HellspireSep 09.2004 — This really has nothing to do with it, but note that you can make your script much neater if you use

echo <<<END

END;

This allows you to have multiple lines for the same echo statement.

echo "

";

is the same. Look it up in the php manual under output.

Also, a stylistic method would be to add n to the end of each of your lines, as your output will appear on the same line

Just a thought for you :p
×

Success!

Help @k0r54 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...