Problem loading .php page

Compaq ?
December 30, 2009 at 21:40:12
Specs: Windows 98, ?
I have a php page, such as website.com/files/defualt.php, that just won't load.
at the very beginning of the page, I have a
 <?php
     header("Location: ?home");
     function home(){
          /...code.../
     }
?>

This is not all of the code, if I need to post all of it, I will. But the problem is that the page takes forever to load, and when finished, it shows no content. I have used different browsers.

See More: Problem loading .php page

Report •


#1
December 31, 2009 at 15:55:58
I re-wrote the page, and now it loads. But there is still a problem, and I can't figure out what it is! Here's my code:
<html>
<?php
	$home_button="<a href='/u_i/default.php?home'>.public_html?#/u_i/default.php?home</a>";
	$hr="<hr />";
	$head=array (
		"<head>"
		"<title>Caswell Site</title>"
		"</head>"
	);
	$startpage=array (
		"<form action='/u_i/default.php?home'>"
		"<input type=submit value='Start Page' style='border: 0px #000000; color: #FFFFFF; background-color: #000000' />"
		"</form>"
	);
	printf($head);
	printf("<body>");
	printf($home_button);
	printf($hr);
	printf($startpage);
	function home() {
		printf("<center><b><u>Currently viewing:</u></b>\n/u_i/default.php?home");
		printf("<pre>\n\n\n\n");
		printf("\n         You must <a href='?login'>Login</a> or <a href='?reg'>Register</a>.");
		printf("
</center>");
}
function login() {
?>
<center>
		<h1>Login</h1>
		<form action="/u_i/usr.php?uch" method="get">
		Username: <input type=text name="usr" />
		Password: <input type=password name="pass" />
		<input type=submit value="Login" style="border: 0px #000000; color: #FFFFFF; background-color: #000000" />
		</form>

</center>
<?php
}
function reg() {
?>
<center>
		<h1>Register</h1>
		<form action="?load" method="get">
		Desired Username: <input type=text name="uname" />
		Desired Password: <input type=password name="pwd" />
		E-mail (We won't spam you!): <input type=text name="email"> />
		<h2>Notice: It may take several minutes to a month to validate your account.  This is due to a lack of funding for resources, and having only one operator/admin.  Thank you.</h2>
		<input type=submit value="Submit" style="border: 0px #000000; color: #FFFFFF; background-color: #000000" />
		</form>
		
</center>
<?php
}
function load() {
if ($_GET['uname'] == "admin" || "sys")
{
?>
<script type="text/javascript">
alert("Incorrect username!\n Username cannot be 'admin' or 'sys'");
</script>
<?php
header("Location: ?reg");
}
elseif ($_GET['email'] == NULL)
{
?>
<script type=text/javascript>
alert("You must have an email!\n Error cause: $_GET['email']==NULL");
</script>
<?php
header("Location: ?reg");
}
else {
$uname_io=fopen("/sys/usr_io.txt", "a");
fwrite($uname_io, $_GET['uname']);
fclose($uname_io);
$pwd_io=fopen("/sys/pwd_io.txt", "a");
fwrite($pwd_io, $_GET['pwd']);
fclose($pwd_io);
$email_io=fopen("/sys/email_io.txt", "a");
fwrite($email_io, $_GET['email']);
fclose($email_io);
header("Location: ?vsent");
}
}
function vsent() {
printf("<center></center>");
}
?>
</body>
</html>


Report •

#2
January 7, 2010 at 17:38:11
Fixed it... there was a config problem.

Report •

#3
February 16, 2010 at 13:04:40
Dear DOSprogrammeR,

I am having the same trouble. What was your config fix, please?


Report •

Related Solutions


Ask Question