boboreo1222 Posted April 24, 2007 Share Posted April 24, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/ Share on other sites More sharing options...
shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 post your code? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237536 Share on other sites More sharing options...
boboreo1222 Posted April 24, 2007 Author Share Posted April 24, 2007 For config.php? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237538 Share on other sites More sharing options...
shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 and all the pages that have errors on Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237540 Share on other sites More sharing options...
boboreo1222 Posted April 24, 2007 Author Share Posted April 24, 2007 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> Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237544 Share on other sites More sharing options...
shaunrigby Posted April 24, 2007 Share Posted April 24, 2007 What exactly are you trying to do? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237549 Share on other sites More sharing options...
boboreo1222 Posted April 24, 2007 Author Share Posted April 24, 2007 I am trying to connect to my database and I am trying to get the login box on my page. Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237551 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 Please help me. I am trying to set it up for www.bobbykingmagic.com but it wont stay like that. The domain will change Plzz help me Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237563 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 Does anyone see what is wrong with my code? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237569 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237570 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 I added the code to my page. There was a big long thing about it couldnt connect to the database. And I cant get login.php to appear on my site. Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237571 Share on other sites More sharing options...
laron Posted April 25, 2007 Share Posted April 25, 2007 can you post the error? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237573 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 Dude, Google is your friend Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237574 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237575 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 Are the files "config.php" and "login.php? in the same directory as "main.php"? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237577 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 I dont have a main.php Would that fix it though if I did? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237579 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 sorry, i meant index.php Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237581 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 No. Should I put Index.php and index2.php in the "Database" folder? Or do I just put index.php? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237585 Share on other sites More sharing options...
shaunrigby Posted April 25, 2007 Share Posted April 25, 2007 www.php.net sit there for an hour and look at functions such as sessions, includes, mysql_connect etc we are here to help you, not do it for you Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237587 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 I know. I asked for help. I cant figure it out. I asked what I did wrong. That is help, isnt it? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237589 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 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"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237592 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 Ok. so I dont put index.php in the folder "Database" I just add that code to the top of Index.php? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237595 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237599 Share on other sites More sharing options...
boboreo1222 Posted April 25, 2007 Author Share Posted April 25, 2007 Yes. Index.php is in my root directory In the database folder I have: Config.php admin.php editprofile.php login.php logout.php members.php messages.php online.php register.php Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237601 Share on other sites More sharing options...
sanfly Posted April 25, 2007 Share Posted April 25, 2007 So, did changing the path of the included files work then? Quote Link to comment https://forums.phpfreaks.com/topic/48535-solved-newbie-database-help/#findComment-237604 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.