[Fwd: Re: [PHP-DB] Having more problems]
--- Begin Message --- On Sun, 2002-07-07 at 01:07, Shiloh Madsen wrote: > The newbie is still having troubles heh. Maybe some kind soul can tell > me what im doing wrong this time. This is the code for a page I am > working on. When I try to bring up the page in a browser, I just get a white page, >instead of having the HTML display. Anyone able to tell me why? > > > > > > > > Login Page > > $dbhost = "127.0.0.1"; > $dbuser = "root"; > $db = "LoginInfo"; > > $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass); your @ supresses error messages from php > if (! $LoginDB) { try if (! isset($LoginDB)) die(mysql_error()); instead > print "Unable to connect to the database server at this time."; > exit(); > } else { > mysql_select_db("GameDB",$LoginDB); > if (! @mysql_select_db("GameDB") ) same as above your @ supresses error messages from php again try $ConnDB=mysql_select_db("GameDB") if(! isset(($ConnDB)) die(mysql_error()); > print "Unable to locate the Game Database."; > exit(); > } > ?> > > body { color: white; background: black; } > > alt="D&D Resource Page" border="0">" > > > > Login: > Password: > > > > > } > ?> > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > --- End Message --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Having more problems
Several things I've noticed. One, you have not body tags in your code anywhere. Just applying a style to the body doesn't (aas far as I know doesn't declare it in your code. Secondly, and I don't konw if you left it out to protect the innocent, but you haven't supplied a password for the database (assuming your using passwords, which is advisable). You are not doing anything with database either. Are you trying to select a record from it or just checking if exists? Howard -Original Message- From: Peter Lovatt [mailto:[EMAIL PROTECTED]] Sent: Sunday, 7 July 2002 5:26 PM To: Shiloh Madsen; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Having more problems You are missing a tag to mark the start of the body, so all your content will be part of the header, I think! HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: Shiloh Madsen [mailto:[EMAIL PROTECTED]] > Sent: 07 July 2002 06:07 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Having more problems > > > The newbie is still having troubles heh. Maybe some kind soul can tell > me what im doing wrong this time. This is the code for a page I am > working on. When I try to bring up the page in a browser, I just > get a white page, instead of having the HTML display. Anyone able > to tell me why? > > > > > > > > Login Page > > $dbhost = "127.0.0.1"; > $dbuser = "root"; > $db = "LoginInfo"; > > $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass); > if (! $LoginDB) { > print "Unable to connect to the database server at this time."; > exit(); > } else { > mysql_select_db("GameDB",$LoginDB); > if (! @mysql_select_db("GameDB") ) > print "Unable to locate the Game Database."; > exit(); > } > ?> > > body { color: white; background: black; } > > alt="D&D Resource Page" border="0">" > > > > Login: > Password: > > > > > } > ?> > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Having more problems
You are missing a tag to mark the start of the body, so all your content will be part of the header, I think! HTH Peter --- Excellence in internet and open source software --- Sunmaia www.sunmaia.net [EMAIL PROTECTED] tel. 0121-242-1473 --- > -Original Message- > From: Shiloh Madsen [mailto:[EMAIL PROTECTED]] > Sent: 07 July 2002 06:07 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Having more problems > > > The newbie is still having troubles heh. Maybe some kind soul can tell > me what im doing wrong this time. This is the code for a page I am > working on. When I try to bring up the page in a browser, I just > get a white page, instead of having the HTML display. Anyone able > to tell me why? > > > > > > > > Login Page > > $dbhost = "127.0.0.1"; > $dbuser = "root"; > $db = "LoginInfo"; > > $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass); > if (! $LoginDB) { > print "Unable to connect to the database server at this time."; > exit(); > } else { > mysql_select_db("GameDB",$LoginDB); > if (! @mysql_select_db("GameDB") ) > print "Unable to locate the Game Database."; > exit(); > } > ?> > > body { color: white; background: black; } > > alt="D&D Resource Page" border="0">" > > > > Login: > Password: > > > > > } > ?> > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Having more problems
Read my second answer... I find very strange that closing curly bracket *}* after the tag. Try to remove the closing one from the *ELSE* statement. > -Original Message- > From: Shiloh Madsen [mailto:[EMAIL PROTECTED]] > Sent: Sunday, July 07, 2002 2:33 AM > To: César Aracena > Subject: Re: [PHP-DB] Having more problems > > Actually, its weird, this problem came up after I input this section of > the page: > > mysql_select_db("GameDB",$LoginDB); > if (! @mysql_select_db("GameDB") ) > print "Unable to locate the Game Database."; > exit(); > } > > If i delete that part, then my page displays normally. i tried adding an > } else { to it, but that gives me an error. > > César Aracena wrote: > > >At a first glance, it seems to me that the PHP part is ok. Maybe the > >problem is in the HTML part of the page... try to put
RE: [PHP-DB] Having more problems
On the other hand... what are you closing of PHP after the form? Maybe you should consider writing your code in a more clear way... try indenting it all. > -Original Message- > From: César Aracena [mailto:[EMAIL PROTECTED]] > Sent: Sunday, July 07, 2002 2:16 AM > To: 'Shiloh Madsen'; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Having more problems > > At a first glance, it seems to me that the PHP part is ok. Maybe the > problem is in the HTML part of the page... try to put
RE: [PHP-DB] Having more problems
At a first glance, it seems to me that the PHP part is ok. Maybe the problem is in the HTML part of the page... try to put