Current location: Hot Scripts Forums » Programming Languages » PHP » Reason for white/empty/blank screen when loading a php page ?


Reason for white/empty/blank screen when loading a php page ?

Reply
  #1 (permalink)  
Old 12-02-04, 02:05 PM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Reason for white/empty/blank screen when loading a php page ?

I am trying to install a php script and when I try to pull it up via the web all I get is a blank/empty/white screen. I know this is vague, but I was wondering if there is there a common reason why this happens ?
Reply With Quote
  #2 (permalink)  
Old 12-02-04, 07:09 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
Posting your code will help someone to figure it out. It could be caused by several things.
Reply With Quote
  #3 (permalink)  
Old 12-02-04, 07:14 PM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
There's many php files, but since it all starts with an installer, ill post that

Quote:
<?

if (!isset($action)) {

?>

<html><head><title>Installation</title></head><body>

<form action="" method="POST">

<table align=center width=70%>

<tr><td align=right>Sql Server:&nbsp;</td><td align=left><input type="text" name="serv" size="40" value="localhost"></td></tr>

<tr><td align=right>Sql login:&nbsp;</td><td align=left><input type="text" name="logi" size="40"></td></tr>

<tr><td align=right>Sql password:&nbsp;</td><td align=left><input type="text" name="passw" size="40"></td></tr>

<tr><td align=right>Database name:&nbsp;</td><td align=left><input type="text" name="d_name" size="40"></td></tr>

<tr><td align=center colspan=2><input type="hidden" name="action" value="install"><input type="submit" value="save" size="40">&nbsp;<input type="reset" value="clear" size="40"></td></tr></table>

</form></body></html>

<?

}

if (isset($action) && $action=="install")

{

$file = fopen("conf.php","r") or die ("No access to the file");

$rf = fread($file,filesize("conf.php")) or die ("No access to the file");

fclose($file);

$rf = eregi_replace("nameofserver",$_SERVER['SERVER_NAME'],$rf);

$rf = eregi_replace("nameofdbserver",$serv,$rf);

$rf = eregi_replace("dblogin",$logi,$rf);

$rf = eregi_replace("dbpassword",$passw,$rf);

$rf = eregi_replace("dbname",$d_name,$rf);

$file = fopen($_SERVER["DOCUMENT_ROOT"]."/inc/siteconf/".$_SERVER['SERVER_NAME'],"w") or die ("No access to file");

fwrite ($file,$rf) or die ("Please CHMOD 777 yourservername file");

fclose($file);

mysql_connect($serv, $logi, $passw) or die("can't connect to the database");

mysql_select_db($d_name) or die("can't select the database");



$fp = fopen($_SERVER["DOCUMENT_ROOT"]."/dump.sql","r+");

$content = fread($fp, filesize($_SERVER["DOCUMENT_ROOT"]."/dump.sql"));

fclose($fp);

$cont1 = explode(";", $content);

for ($i = 0; $i < count($cont1); $i++)

mysql_query($cont1[$i]);

header("Location: /index.php");

}

?>
I can try and do it manually from what I gather this is what the installer tries to accomplish

1) Save host path, user, pass, db to conf.php
2) create [sitename] config in /inc/siteconf/ with 777 CHMOD
3) Fill DB with dump.sql

Is this all it's asking to be done?

Last edited by ajs; 12-02-04 at 07:16 PM.
Reply With Quote
  #4 (permalink)  
Old 12-02-04, 10:07 PM
CMIVXX's Avatar
CMIVXX CMIVXX is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Your essentially receiving an error because PHP has choked somewhere. If you have access to the error logs, take a peek at the error log and you will be able to see what's wrong.

On the other hand, just make an .htaccess file (assuming the server is Linux) and put this in the file:

Code:
php_flag display_errors on 
php_value error_reporting 7
This website has a quick breakdown for what the error numbers mean...
http://www.help.websiteos.com/suppor...es_and_php.htm

Good luck. If your still stuck, drop the errors on here and we'll see what we can do.
Reply With Quote
  #5 (permalink)  
Old 12-02-04, 11:46 PM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
I am using a linux server and added that to the .htaccess file, where do I get the reports as it still displays a blank screen.
Reply With Quote
  #6 (permalink)  
Old 12-03-04, 01:36 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
didnt se the ! in the first if
my bad

but now i see a new issue.. the form action is set to "".. does it submit to self?
replace it with "<? echo $_SERVER['PHP_SELF']; ?>"

also this code requires register_globals to be enabled (baad thing).. so check if its on
(php.ini)

Last edited by <?Wille?>; 12-03-04 at 01:42 AM. Reason: my bad
Reply With Quote
  #7 (permalink)  
Old 12-03-04, 01:57 AM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
oops n/m...
Reply With Quote
  #8 (permalink)  
Old 12-03-04, 01:58 AM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by <?Wille?>
didnt se the ! in the first if
my bad

but now i see a new issue.. the form action is set to "".. does it submit to self?
replace it with "<? echo $_SERVER['PHP_SELF']; ?>"

also this code requires register_globals to be enabled (baad thing).. so check if its on
(php.ini)
Oh, I got the script from someone else, Is there a way around register_globals ?
Reply With Quote
  #9 (permalink)  
Old 12-03-04, 03:06 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ajs
Oh, I got the script from someone else, Is there a way around register_globals ?
sure.. you send all info from form with method post.. so what you need to do is replace all thease $rf = eregi_replace("nameofdbserver",$serv,$rf);
to to something like this
$rf = eregi_replace("nameofdbserver",$_POST['serv'],$rf);
the action var also needs to be with $_POST[].. define from where they come and there is no need for register_globals to be enabled

hope it helps
Wille
Reply With Quote
  #10 (permalink)  
Old 12-03-04, 03:12 AM
ajs ajs is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the tip.

I just checked with my hosting provider and register_globals is on

Last edited by ajs; 12-03-04 at 03:22 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Loading a new web page petrinjak PHP 9 11-01-04 09:57 PM
Mouseover with Single PHP page rjwebgraphix PHP 7 09-16-04 05:15 PM
question about updating a page or database for an, php and mysql updating mikewooten PHP 1 02-12-04 12:11 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 05:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.