MortHub MortHub - 4 months ago 8x
HTML Question

Boolean PHP value is empty when being passed in URL. How do I retrieve it using $_GET[]?

I've been having a pretty dumb problem as of late.

I'm using the header function to redirect to a confirmation page. I'm declaring $error = false at the top of the php sendmail page.

Here is the conditional on the sendmail page:

error='.$error.'type=cell&desc=' . $message);
else {
'&type=cell&fname=' . $inputFName .'&lname=' . $inputLName . '&email=' .
$inputEmail . '&phnum=' . $inputPhnum . '&model=' . $inputModel .
'&color=' . $inputColor . '&desc=' . $inputSummary);

The problem I'm getting is, when I look at the URL and the get variables, the error portion is empty. For example, my url will look like: confirmation.php?error=&type=cell&fname=Test&lname=Name& etc...

For some reason the error variable is NOT being passed. What's the problem?


You could pass another value as a "boolean", or simply use 1 / 0;



and then

if ($_GET["error"] === "no") {
} else {

or if you're going to use the number method, remember:

1 == true; 0 == false.