Jump to content

[SOLVED] [NEWBIE] Database help


boboreo1222

Recommended Posts

I need MAJOR Help

The site has to be done by tomarrow and I have a problem

 

Well, I added a folder Called "Database" to my server, uploaded all my files, and ran the SQL crap, and I went to add the login to my page and it wont work.  I have all the SQL stuff right in config.php..

 

I need major help.

Link to comment
Share on other sites

Ok. Config.php is

<?
   ob_start(); // allows you to use cookies
   $conn = mysql_connect("database","usersystem","imcooling12");
   mysql_select_db(bobbykig_database) or die(mysql_error());
   //fill in the above lines where there are capital letters.
   $logged = MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]'");
   $logged = mysql_fetch_array($logged);
   //the above lines get the user's information from the database.
?>

 

and my main page is all I need it on.  The code is

 

<?
ob_start();
include ("config.php");
?>
<?
include("login.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Grand Habbo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="BBD2E3" background="layout/background7.gif" bgproperties="fixed" link="#000000" alink="#000000" vlink="#000000">
<div align="center">
  <table width="600" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td height="130" colspan="7" valign="top"><img name="" src="banner.gif" width="600" height="130" alt=""></td>
    </tr>

    <tr> 
      <td width="15" rowspan="3" valign="top"><img name="" src="border_left.gif" width="15" height="440" alt=""></td>
      <td bgcolor="#FFFFFF" width="110" height="200" valign="top"><div align="left">
<font color="#000000" style="font-family: Verdana; font-size: 10px"><br>
<center><b>Navigation</b>
<br>
<a href="index2.php" target="content">Home</a>
<br>
<a href="Staff.php" target="content">Staff</a>
<br>
<a href="Jobs.php" target="content">Jobs</a>

<br>
<a href="News.php" target="content">News</a>
<br>
<a href="Forum.php" target="content">Forum</a>
<br>
<a href="Community.php" target="content">Community</a>
<br>
<a href="Disclaimer.php" target="content">Disclaimer</a>
<br>
<a href="Contactus.php" target="content">Contact Us</a>
<br>
<a href="StaffLogins.php" target="content">Staff Logins</a>
</div></td>

      <td width="20" rowspan="3" valign="top"><img name="" src="content_right.gif" width="20" height="440" alt=""></td>
      <td width="310" rowspan="3" valign="top"><div align="center"><iframe name="content" src="index2.php" height="440" width="310" frameborder="0"></iframe></div></td>

      <td width="20" rowspan="3" valign="top"><img name="" src="content_right.gif" width="20" height="440" alt=""></td>
      <td width="110" valign="top"><img name="" src="Uploadme3.gif" width="110" height="200" alt=""></td>
      <td width="15" rowspan="3" valign="top"><img name="" src="content_right.gif" width="15" height="440" alt=""></td>
    </tr>
    <tr> 
      <td height="40" valign="top"><img name="" src="divider.gif" width="110" height="40" alt=""></td>

      <td valign="top"><img name="" src="divider.gif" width="110" height="40" alt=""></td>
    </tr>
    <tr> 
      <td height="200" valign="top"><img name="" src="Uploadme1.gif" width="110" height="200" alt=""></td>

      <td valign="top"><img name="" src="uploadme2.gif" width="110" height="200" alt=""></td>
    </tr>
    <tr> 
      <td height="15" colspan="7" valign="top"><img name="" src="border_bottom.gif" width="600" height="15" alt=""></td>
    </tr>

  </table>

<font color="#000000" style="font-family: Verdana; font-size: 10px">
<br>

© 2004. <a href="http://www.habbonet.co.uk" target="_blank"><b>Habbonet.co.uk</b></a> Creations.





</div>
</body>
</html>

Link to comment
Share on other sites

Sorry, but you will need to be clearer about where exactly your problem lies?

 

Are you seeing any error messages?

 

Is the problem that you cant connect to the database?

 

Is the problem that login.php is not being displayed on your main page?

 

Please, be VERY specific

Link to comment
Share on other sites

I googled it already.

 

I thought I could get help since it is PHP.

Warning: main(config.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 3

Warning: main(config.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 3

Warning: main(config.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 3

Warning: main(): Failed opening 'config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bobbykig/public_html/index.php on line 3

Warning: main(login.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 6

Warning: main(login.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 6

Warning: main(login.php): failed to open stream: No such file or directory in /home/bobbykig/public_html/index.php on line 6

Warning: main(): Failed opening 'login.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bobbykig/public_html/index.php on line 6

Link to comment
Share on other sites

No

 

When you include a file, you have to put the path of the file you are including relative to the path of the file you are including it in.

 

eg:

 

<?
ob_start();
include ("database/config.php");
?>
<?
include("database/login.php");
?>

Link to comment
Share on other sites

Give it a try.....

 

Just to recap:

 

index.php should be in your root directory

 

you have a folder in your root directory called "database"

 

in the "database" folder, you have login.php and config.php

 

Is this all correct?

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.