This question already has an answer here:
I'm getting this error whenever I try opening my new game website. Does someone here have any ideas on how to fix this?
<?php
$size = $_GET["size"];
/** Default dimensions **/
$width = "960";
$height = "550";
/** Show **/
switch($size) {
default:
break;
case 'large':
$width = "1185";
$height = "679";
break;
case 'huge':
$width = "1792";
$height = "1027";
break;
case 'tiny':
$width = "706";
$height = "405";
break;
}
?>
</div>
Yes, you don't have size set in your request; thus, the index 'size'
in variable $_GET
is not set (i.e. undefined). If you request like so default.php?size=large
it should be gone (if you don't do anything to unset it elsewhere).
Additionally you really should check whether it's set or not with somehting like:
$size = isset($_GET["size"]) ? $_GET["size"] : 'normal';
which will check if size=something
is in your query and if it's not will default to 'normal'
.