Jump to content

isset on normal variables?


SirChick

Recommended Posts

I have a problem with my if statements

 

Now the variable is definitely set because when i echo it ... it displays the correct number! But the if statement loads the wrong parts.... this is what i tried:

 

When the variable is set == to 1 then it should load //code. How ever at the moment it is loading the url for the bus stop (the first url)

 

Is this because the isset doesn't work for variables and only will work for GET and POST?

 

If the answer is that it won't work for variables.. will it work for SESSIONS?

 

And if not for sessions is there a way to do it without do the if ( $busessions== '' )? Because if i do that sort of check then i get a notice error about the variable not being initially set (which is unavoidable with this feature im working on)

 

<php
If (!(isset($Busession))){
?>
<a href="londonbusprocess.php?bus=1">Bus Stop</a><br>
<?
}ElseIF($BusSession != 1){
?>
<a href="londonbusprocess.php?bus=1">Bus Stop</a><br>
<?
}else{
//code
}
?>

Link to comment
https://forums.phpfreaks.com/topic/85285-isset-on-normal-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.