Jump to content

Blank Page!! Arghh


Stainystain

Recommended Posts

Hey guys,

 

New to forum, and PHP for that matter... I'm sure you'll be able to tell!

 

So I have created a HTML form and a corresponding update.php page and a PHP page for viewing the data and have uploaded to my server (iPower)

In iPower I have created a mysql database using the same fields / names etc and have manually entered a few entries.

 

Problem is, when I submit the form it simply goes to a blank page (no error message) and when checking in iPower the data has not been submitted.

 

Also, if I open the PHP page for viewing the database in my browser (guest_info.php) it comes up as blank as well...

 

I have no idea, like I say I am a complete amateur at this, kinda forced into it! (I graduated in Oceanography!!)

 

So if anyone of you very helpful people out there want to have a quick scan at my code and tell me where I've been an idiot, it would be greatly appreciated!!

 

( also... is there a difference between ' and " use? )

 

Many thanks in advance,

 

Regards,

Simon

 

guest_info.php (for viewing the data)

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Information</title>
</head>

<body>
<?php
// make connection
mysql_connect ("******.ipowermysql.com", "******", "******") or die ('I dunno...' .mysql_error());
mysql_select_db ("rose_guest_list");

//build query
$query = mysql_query ("SELECT * FROM guest_info");

//display results
while ($row = mysql_fetch_array($query)) 
{ echo	"<br/> Cruise: ".$row['Cruise'].
	"<br/> Date: ".$row['Date'].
	"<br/> Adults: ".$row['No_Adults'].
	"<br/> Kids: ".$row['No_Kids'].
	"<br/> Name: ".$row['Name'].
	"<br/> Email: ".$row['Email'].
	"<br/> Phone: ".$row['Phone'].
	"<br/> Staying: ".$row['Staying'].
	"<br/> Payment: ".$row['Payment'].
	"<br/> Info: ".$row['info'].
	"<br/>";}

?>
</body>
</html>

Link to comment
Share on other sites

the first few lines of code now look like:

 

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
mysql_connect ('******.ipowermysql.com', '******', '******') or die ('I dunno...' .mysql_error());
mysql_select_db(rose_guest_list);

 

But still no joy, still shows a blank page with no source code to view

 

How frustrating...

Link to comment
Share on other sites

Mgallforever,

 

Yeah sorry, I have made amendments to the PHP section as suggested to view any error codes, and have simply shown that in that last section of code I posted.  The HTML elements are all there, see my first post to view the complete code (minus the amendments obviously :) )

 

Link to comment
Share on other sites

Ahhh ok yeah, sorry.

 

Nope it is completely blank, no html code either - no <!DOCTYPE... etc etc just white.

 

It is the same if I type the URL in a browser (Firefox, IE  & Safari ) or if on the iPower file manager I preview the page... both give me nothing.

 

 

Link to comment
Share on other sites

Sounds like the uploading of the files to your server is failing and you actually have empty files on the server.

 

Download one of your files to a different name (so that you don't overwrite the original) and check exactly what is in it.

Link to comment
Share on other sites

are you putting the error reporting in front of the html code like:

 

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Information</title>
</head>

<body>
<?php
// make connection
mysql_connect ("******.ipowermysql.com", "******", "******") or die ('I dunno...' .mysql_error());
mysql_select_db ("rose_guest_list");

//build query
$query = mysql_query ("SELECT * FROM guest_info");

//display results
while ($row = mysql_fetch_array($query)) 
{ echo   "<br/> Cruise: ".$row['Cruise'].
      "<br/> Date: ".$row['Date'].
      "<br/> Adults: ".$row['No_Adults'].
      "<br/> Kids: ".$row['No_Kids'].
      "<br/> Name: ".$row['Name'].
      "<br/> Email: ".$row['Email'].
      "<br/> Phone: ".$row['Phone'].
      "<br/> Staying: ".$row['Staying'].
      "<br/> Payment: ".$row['Payment'].
      "<br/> Info: ".$row['info'].
      "<br/>";}

?>
</body>
</html>

Link to comment
Share on other sites

Ok thanks mgallforever,

 

So iPower support should be able to sort me out?! Ha... they're rubbish, but I'll give it a go!

 

Weird thing is iPower MySQL Beta, where my database is, can create code:

 

 <?php 
$link = mysql_connect('******.ipowermysql.com', '******', '******'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
echo 'Connected successfully'; 
mysql_select_db(rose_guest_list); 
?> 

 

When I created a test page with this code I'm sure (terrible memory) it worked at first.  Now it doesn't work as the full URL, but if i preview it from iPower it works....?!

Also, when using the URL the page is blank but... viewing the source code it shows all the spiel at the top:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body>

 

Like I say I'm a real beginner, but this is weird right...?!

 

I've had numerous problems with iPower before, could it be them?

 

 

Link to comment
Share on other sites

Paste this in and see if you get any errors returned from the db selection and/or query.

 

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Information</title>
</head>

<body>
<?php
// make connection
mysql_connect ("******.ipowermysql.com", "******", "******") or die ('I dunno...' .mysql_error());
mysql_select_db ("rose_guest_list") or die('Unable to select DB.');

//build query
$query = mysql_query ("SELECT * FROM guest_info") or die(mysql_error());

//display results
while ($row = mysql_fetch_array($query)) {
echo   "<br/> Cruise: ".$row['Cruise'].
      "<br/> Date: ".$row['Date'].
      "<br/> Adults: ".$row['No_Adults'].
      "<br/> Kids: ".$row['No_Kids'].
      "<br/> Name: ".$row['Name'].
      "<br/> Email: ".$row['Email'].
      "<br/> Phone: ".$row['Phone'].
      "<br/> Staying: ".$row['Staying'].
      "<br/> Payment: ".$row['Payment'].
      "<br/> Info: ".$row['info'].
      "<br/>";}

?>
</body>
</html>

Link to comment
Share on other sites

Thanks again guys for this help, much appreciated.

 

Ok so I didn't place the error code in it's own separate php code in front of the html head... but have done now and still no error code from my code.

 

PFMaBiSmAd - in the iPower file manager you can edit the code for each page, there doesn't seem to be an issue with empty files?

 

However I copied Pikachu2000's code into a new page and got the following error code!!:

 

Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\sites\friendshiprose\tester2.php on line 17

 

Getting there!!

 

 

Link to comment
Share on other sites

Arghhhh!!

 

So after PFMaBiSmAd brilliantly found some iPower instructions (I should have found them right, but I have no faith in iPower...) , you would have thought it would all be sorted...

 

Nope, still the same issue - have fiddled around with the code (' and " and $) and the code location, but still no joy - same completely blank page

 

This is exactly how iPower say to write it:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Untitled Document</title>
</head>

<body>
<?php
$username = "******";
$password = "******";
$host = "******.ipowermysql.com";
$database = "guest_info"
$rose_connect = mysql_connect($******.ipowermysql.com,$name,$password); or die ('I dunno...' .mysql_error());
mysql_select_db($rose_guest_list,$rose_connect);

//build query
$query = mysql_query ('SELECT * FROM guest_info');

//display results
while ($row = mysql_fetch_array($query)) 
{ echo	'<br/> Cruise: '.$row['Cruise'].
	'<br/> Date: '.$row['Date'].
	'<br/> Adults: '.$row['No_Adults'].
	'<br/> Kids: '.$row['No_Kids'].
	'<br/> Name: '.$row['Name'].
	'<br/> Email: '.$row['Email'].
	'<br/> Phone: '.$row['Phone'].
	'<br/> Staying: '.$row['Staying'].
	'<br/> Payment: '.$row['Payment'].
	'<br/> Info: '.$row['info'].
	'<br/>;}

?>
</body>
</html>

Link to comment
Share on other sites

That may be how they said to do it, but it's just like it was to begin with and not giving you any errors to debug with. Just for grins, upload the one that I inserted in post #14 in this thread. Let's see if the errors are the same. Also, when you're in your FTP client, poke around to see if there's a PHP error log file.

Link to comment
Share on other sites

Ahh yeah, I managed to resort back to my old crappy code.

 

I tried it with your code but with no joy - no error code this time either... I fiddled around a couple of times to try and make it fit with the new iPower way (trial and error trial and error!) but no joy.  this was the last one I tried:

 

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Information</title>
</head>

<body>
<?php
$username = "******";
$password = "******";
$host = "******.ipowermysql.com";
$database = "guest_info"
$rose_connect = mysql_connect($******.ipowermysql.com,$name,$password); or die ('I dunno...' .mysql_error());
mysql_select_db ($rose_guest_list,$rose_connect) or die('Unable to select DB.');

//build query
$query = mysql_query ('SELECT * FROM guest_info') or die('Idunno 2...' .mysql_error());

//display results
while ($row = mysql_fetch_array($query)) 
{ echo	'<br/> Cruise: '.$row['Cruise'].
	'<br/> Date: '.$row['Date'].
	'<br/> Adults: '.$row['No_Adults'].
	'<br/> Kids: '.$row['No_Kids'].
	'<br/> Name: '.$row['Name'].
	'<br/> Email: '.$row['Email'].
	'<br/> Phone: '.$row['Phone'].
	'<br/> Staying: '.$row['Staying'].
	'<br/> Payment: '.$row['Payment'].
	'<br/> Info: '.$row['info'].
	'<br/>;}

?>
</body>
</html>

 

 

What the...?!?! I just typed in the tester URL I did with your code in randomly, (the one from earlier on - not the code pasted above), and it is now working?!

I've had issues with iPower randomly showing pages, then the next day not, the same with images (really common)...

 

Do I trust that this is sorted?!  Any ideas why it would do this?!

 

Thanks for all of your help

Link to comment
Share on other sites

Well you have one error that I can see directly:

<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex" />

<title>Guest Information</title>
</head>

<body>
<?php
$username = "******";
$password = "******";
$host = "******.ipowermysql.com";
$database = "guest_info"
$rose_connect = mysql_connect($******.ipowermysql.com,$name,$password); or die ('I dunno...' .mysql_error());
mysql_select_db ($rose_guest_list,$rose_connect) or die('Unable to select DB.');

//build query
$query = mysql_query ('SELECT * FROM guest_info') or die('Idunno 2...' .mysql_error());

//display results
while ($row = mysql_fetch_array($query)) 
{ echo   '<br/> Cruise: '.$row['Cruise'].
      '<br/> Date: '.$row['Date'].
      '<br/> Adults: '.$row['No_Adults'].
      '<br/> Kids: '.$row['No_Kids'].
      '<br/> Name: '.$row['Name'].
      '<br/> Email: '.$row['Email'].
      '<br/> Phone: '.$row['Phone'].
      '<br/> Staying: '.$row['Staying'].
      '<br/> Payment: '.$row['Payment'].
      '<br/> Info: '.$row['info'].
      '<br/>';}// you were missing the ' after <br/>

?>
</body>
</html>

 

Good luck

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.