[Resolved]Problem[Resolved]

For discussions about game development that does not fit in any of the other topics.
Post Reply
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

[Resolved]Problem[Resolved]

Post 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");
	}
}
Last edited by Baseball435 on Sat Jun 25, 2011 6:46 pm, edited 2 times in total.
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: Problem

Post 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
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Problem

Post 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
User avatar
Nexus
Posts: 293
Joined: Sat Jun 18, 2011 10:42 pm

Re: Problem

Post by Nexus »

Oh haha sorry for giving a wrong answer anyways :P
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Problem

Post 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?
The indelible lord of tl;dr
User avatar
Perry
Posts: 409
Joined: Tue Jun 23, 2009 4:26 pm

Re: Problem

Post 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.
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: [Resolved]Problem[Resolved]

Post by Baseball435 »

Yup, no problem, and thanks! :D
Post Reply

Return to “General Development”