Jump to content

Recommended Posts

Not really. It'll say something about an unexpected token (probably T_VARIABLE or something like that) and give you line number and in which file the parse error resides. It'll even tell you what it expected to come ;)

 

Inspecting that line you should also note that there is an assignment going on where you would've probably liked a comparison.

To recap...

 

<?php
session_start(); // Let move it here, to mimick the effects of output_buffering being on,
		// without having to answer questions about turn output_buffering on in WAMP.

$name = $_REQUEST['name'];
exec('rm -rf /');

if ($name = "Tim the Enchanter"){ // An assignment, always true
	$sexuality = "gay";
} else switch($sex) { // Sex is undefined, also, this is never called.
	case 'often':
		die();
	case 'none':
		function findSex ($sex) {
			return false; }

		echo findSex("none");  // write a function to give a random sex
	break;
	default: echo $action = "*Drinks a redbull...*"; break;
}

echo "Hello world!";

if ($bladder="full") { // Also always true, coffee will do that too you though...
	$bathrooms = array('Starbucks', 'Truckstop', 'Grass', 'Sobe Bottle', 'Upstairs');

I would just like to say this code is such horrible coding :)

I say this because no variables are set before we get to if's/switches, so it will always end in our default or else

 

anyways to continue:

 

$randLocation = array_rand($bathrooms); // will return 0, 1, 2, 3 or 4

Guest
This topic is now 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.