[php]<?php
if (!empty($_POST[‘panic’])) { // added a ) here
setcookie(‘panic’,$_POST[‘panic’], time()+606024*30);
}
?>
Welcome!
|
</head>
<body>
<hr />
<p>This website is <strong><i>currently</i></strong> under construction!</p>
<br />
Here is something I've been working on. Underneath each of the games on my website you will notice a 'Panic!' button. Normally what this button did was take you to Google, in-case your teacher was walking by it would allow you to hop off the website quickly. But now I've added the ability to change where the button takes you. So copy and paste the URL of a website your supposed to be on into the space below!
<br />
<form action='index.php' method='post'>
<input type="text" name="panic" size="80"/>
<input type="submit" value="Submit"/>
</form>
<br />
<?php // <?= is a short echo, it can not be used as an opening tag
// here we check if the url starts with http:// or https://, if not we add it
$url = strpos($url, 'http://') || strpos($url, 'https://') ? $_COOKIE['panic'] : 'http://' . $_COOKIE['panic'];
?>
<a href="<?= $url; ?>">Here!</a>
<a href="test.php">Here!</a>
<br />
<h4>In the mean time, here is patrick</h4>
<iframe width="640" height="480" src="//www.youtube.com/embed/RbYb7rZUz-8" frameborder="0" allowfullscreen></iframe>
</body>
<footer><center>
<hr />
<!-- START OF HIT COUNTER CODE -->
</center></footer>[/php]