Page 1 of 1

[Resolved]Problem[Resolved]

Posted: Sat Jun 25, 2011 4:13 pm
by Baseball435
Hey everyone, well im working on my game and im trying to make a error check thing and what im doing is im trying to include a file by doing:

Code: Select all

include("all.php");
But whenever I refresh the page it always says:

Code: Select all

Internet Explorer cannot display the webpage
which for me is what it says when I dont have internet. The when I don't include it it works fine. does anyone know why this is happening and how to fix it?

The code that Im using in the file is:

Code: Select all

if(isset($_SESSION['dead'])) {
	if($_SESSION['dead'] == 1) {
		mysql_query("UPDATE `users` SET `ex`='0', `ey`='0' WHERE `username`='$username'");
		header("Location: rest.php");
	}
}

Re: Problem

Posted: Sat Jun 25, 2011 4:16 pm
by Nexus
Well when you do include I think you generally do it like this

Code: Select all

<?php
include 'all.php';
?>

PHP doesn't handle double quotations well

Re: Problem

Posted: Sat Jun 25, 2011 4:19 pm
by Baseball435
nvm i got it XD

It wasnt the quotation marks, it had nothing to do with that. It was because the page I was redirecting to also had the include file and it made an infinite loop because it will just keep redirecting to itself over and over. So I just took it out of the rest.php page and it worked fine :P Sorry for posting a stupid topic :P

Re: Problem

Posted: Sat Jun 25, 2011 4:21 pm
by Nexus
Oh haha sorry for giving a wrong answer anyways :P

Re: Problem

Posted: Sat Jun 25, 2011 4:58 pm
by Jackolantern
Glad you got it fixed! However, the include() function can be called both ways, just like echo(). Both ways are equal :)

Could you mark this as resolved?

Re: Problem

Posted: Sat Jun 25, 2011 6:47 pm
by Perry
I could be wrong but in the future you might try putting "include_once (...)" instead of "include (...)" I think that would prevent this from happening.

Re: [Resolved]Problem[Resolved]

Posted: Sat Jun 25, 2011 6:47 pm
by Baseball435
Yup, no problem, and thanks! :D