Page 1 of 1

Re: class variable erro

Posted: Fri Jul 22, 2011 10:38 am
by VARUN006
what troubled me this time around is cookies......i understood its meaning n what does it do.....
but this line:
if(isset($msg)
is making me confused....as far as i knw the isset function is used to check wether the form is submitted or not...now then y is ($msg) is in parenthesis...wat does this line actually mean??will it check wether $msg value is submitted or not,or what will it do???i have not given any button or submit values $msg in the below code....kindly tell me what does this line actually does...


<?php
if(isset($_POST['submitted'])){
setcookie('font_size',$_POST['font_size']);
setcookie('font_color',$_POST['font_color']);
$msg = '<p>Your settings have been entered...click <a href="view.php">HERE</a>to
see them in action.</p>';
}
?>
<html>
<head>
<title>
CUSTOMIZE YOUR SETTINGS
</title>
</head>
<body>
<?php
if(isset($msg)){
print $msg;
}
?>

pls help.....

Re: class variable erro

Posted: Tue Aug 16, 2011 8:59 am
by kasuals
Old thread, but I'm bored so:

isset — Determine if a variable is set and is not NULL

http://www.php.net/manual/en/function.isset.php

All it is doing is making sure that $msg is not empty, and if it's not empty that print $msg.