Jump to content

coolcam262

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by coolcam262

  1. I think the best way to do this would be to use rowspan. Just do: $rowspan = ceil($length / $mins_per_row); // where ceil is rounding it up then in the cell of the table of the appartment just do <td rowspan='" . $rowspan . "'>
  2. You almost had it but instead it is: if (mysql_num_rows($sql) > 0){ // Process hamsters }else{ echo 'There are no hamsters in the field! Feel free to let the cat out.'; } mysql_num_rows() uses the result of the sql. You were just using $term which was the result of a post.
  3. Like what is said in the above post you shouldn't ever store a users password in a text format. You should at least md5 encrypt it and then if a user forgets their password either allow them to enter their username and email and give them a new, randomly generated password or make them choose a new one when emailed a specific link. Then just update the database with the md5ed new password.
  4. Well basically youtube tries to make it as easy as possible to allow you to do what you're doing. They create an xml file that tells you information about your latest videos. For example this is the xml of my channel: http://gdata.youtube.com/feeds/api/users/coolcam262/uploads It shows the latest videos I have created. To find yours just use the url http://gdata.youtube.com/feeds/api/users/username/uploads You can then look through it and you will find your videos. Of course you don't want to just display all this text, you want it to look nice! To do that you need to parse the xml to php. There's loads of premade functions for us to use but basically all they do is take the xml file and turn it into arrays! For example it might look something like: $youtube['videos']['1']['desc'] and this might show the very first video you made's description. One function that has been made is called xml2php that converts... xml to php! All you need to do is include the xml2php.php file in your code. Google how to use and download the function, it's really simple. I hope I helped!
  5. Hi, I don't think you want to actually upload the files, you just want to get the youtube videos and display them. It's not that difficult but you will need to use an xml file to get the youtube information. I think this tutorial is what you want: It's not the one I used before I don't think but it's made by the same person so it should be alright.
  6. I have tried to install myBB but it is exactly the same, it logs me out seconds after logging in! Why would this be?
  7. I've got other people to test it in firefox, chrome and ie and it doesn't work on any of them. Why does it work on yours and noone elses?!
  8. bump- I just need someone else to test the login at projectstratos.com/forum as all the computers I have tried it on it doesn't work! PLEASE! :'(
  9. That's strangee, I'm using firefox 3.6 but on windows 7, I doubt it would make a difference so could someone else try? Oh and before you ask I have deleted my cache! This problem has been persistant for over a week now.
  10. Okay but what browser are you using, I have tried this both in firefox and ie on three seperate computers, one of them is not even connected to the same network! Is there anything I could try? And just to confirm, you are using the phpbb3 login page and not my sites?
  11. Well, could try waiting 10 seconds as this is not the problem, I have tried it on different computers. The problem is that it doesn't stay logged in, no matter what the url is, you can log into the forum and go to another part of the site or even just refresh the page and you are still logged out. Thanks, Cameron
  12. When you log in you are immediately, if not then after a few seconds, logged out!
  13. You can now, don't worry about the intergration, I'll fix that later. Username: test password: testing4 Thanks, Cameron
  14. Thanks! This has fixed everything but the phpbb3 forum. I tried intergrating it and it stopped working however even once I had completely reinstalled it it still didn't work! This is the the empty forum, you can login with the username of test and the password of testing. Your login details will be confirmed and you can navigate the site but then you will be logged out again seconds afterwards. Why?! Thanks
  15. This is the whole of header.INC (emphasis on the inc ): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <?php session_start(); include "global.php"; $sql5 = "SELECT * FROM comments WHERE `pending_approval`='1'"; $res5 = mysql_query($sql5) or die(mysql_error()); $new_comments = mysql_num_rows($res5); $sql6 = "SELECT * FROM posts WHERE `pending_approval`='1'"; $res6 = mysql_query($sql6) or die(mysql_error()); $new_posts = mysql_num_rows($res6); $new_admin = $new_comments + $new_posts; $new_mod = $new_comments; ?> <html> <head> <title>Project Stratos</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div style="text-align: center;"> <div id="wrapper"> <!--Menu--> <div id="menu"> <ul id="menubar"> <li><a href="http://projectstratos.com/index.php">Home</a></li> <li><a href="http://projectstratos.com/blog.php">Blog</a></li> <li><a href="http://projectstratos.com/forum">Forum</a></li> <li><a href="http://projectstratos.com/about.php">About</a> <ul> <li><a href="http://projectstratos.com/contact.php">Contact</a></li> <li><a href="http://projectstratos.com/history.php">History</a></li> <li><a href="http://projectstratos.com/forum/faq.php">FAQ</a></li> </ul> </li> <?php ////Login logout or register/////// if ($_SESSION['uid']) { echo "<li><a href=\"http://projectstratos.com/logout.php\">Logout</a></li>"; } else{ echo "<li><a href=\"http://projectstratos.com/login.php\">Login</a></li>"; echo "<li><a href=\"http://projectstratos.com/register.php\">Register</a></li>"; } $sql = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) != 0){ $row = mysql_fetch_assoc($res); if($row['admin'] == '1'){ if($new_admin == '0'){ echo "<li><a href=\"http://projectstratos.com/admin.php\">Admin</a></li>"; } else { echo "<li><a href=\"http://projectstratos.com/admin.php\">Admin (".$new_admin.")</a></li>"; } } if($row['admin'] == '2'){ if($new_mod == '0'){ echo "<li><a href=\"http://projectstratos.com/admin.php\">Admin</a></li>"; } else { echo "<li><a href=\"http://projectstratos.com/admin.php\">Admin (".$new_mod.")</a></li>"; } } } ////End Login logout or register/// ?> </ul> </div> <!--End Menu--> <table> <tr> <td id="content_wrapper" border="0"> <table> <tr> <td id="content_cell"> <div id="body_content">
  16. I found something I was doing wrong, I included header.inc when I was editing header.php! I still have an error message though: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web035/b357/ipg.projectstratoscom/header.inc:2) in /hermes/bosweb/web035/b357/ipg.projectstratoscom/header.inc on line 3 Isn't that basically saying you can't include it there because you've already included it there!? Well this line 3 is just session_start(), what's going on?! Thanks, Cameron
  17. I have tried adding session start to the top of my header page without success so I wil try re-writing the code as you sugested later to today but I don't understand why this would work. Thanks
  18. Hello, for some reason I am unable to get the following code to work: <?php echo "<h1>Login</h1>"; if ($_SESSION['uid']) { echo " You are already logged in, if you wish to log out, please <a href=\"./logout.php\">click here</a>!\n"; } else { if (!$_POST['submit']) { echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; echo "<form method=\"post\" action=\"./login.php\">\n"; echo "<tr><td>Username</td><td><input type=\"text\" name=\"username\"></td></tr>\n"; echo "<tr><td>Password</td><td><input type=\"password\" name=\"password\"></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Login\"></td></tr>\n"; echo "</form></table>\n"; }else { $user = addslashes(strip_tags(($_POST['username']))); $pass = addslashes(strip_tags($_POST['password'])); if($user && $pass){ $sql = "SELECT id FROM `users` WHERE `username`='".$user."'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ $sql2 = "SELECT id FROM `users` WHERE `username`='".$user."' AND `password`='".md5($pass)."'"; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) > 0){ $query = mysql_query("SELECT locked FROM `users` WHERE `username`='".$user."'"); $row2 = mysql_fetch_assoc($query); $locked = $row2['locked']; $query = mysql_query("SELECT active FROM `users` WHERE `username`='".$user."'"); $row3 = mysql_fetch_assoc($query); $active = $row3['active']; $query = mysql_query("SELECT email FROM `users` WHERE `username`='".$user."'"); $row3 = mysql_fetch_assoc($query); $email = $row3['email']; if ($active ==1){ if ($locked == 0){ $date = date("j")."<sup>".date("S")."</sup> ".date("F, Y"); mysql_query("UPDATE users SET last_login='$date' WHERE username='$user'"); $row = mysql_fetch_assoc($res2); $_SESSION['uid'] = $row['id']; $previous = $_COOKIE['prev_url']; echo " You have successfully logged in as " . $user . "<br><br><a href='" . $previous . "'>Click here</a> to go to the previous page.\n"; }else { echo "Your acount has been locked out due to a violation of the rules, if you think there has been a mistake please <a href='contact.php'>contact us</a>."; } } else { echo "You need to activate your account! Please check your email ($email)"; } }else { echo " Username and password combination are incorrect!\n"; } }else { echo " The username you supplied does not exist!\n"; } }else { echo " You must supply both the username and password field!\n"; } } } ?> It says that I have logged in successfully but the session is not created. You can find the script here and log in with the username "test" and the password "testing". I'm not sure what more information I should add. Thanks, Cameron
  19. I have used this for appinclude page but now that I want to list things, I will ask a third time, is there a cheat sheet that will actually convert from the V1 SDK to V2 functions? I have not got this error: Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /hermes/bosweb/web035/b357/ipg.projectstratoscom/facebook/client/facebook.php on line 451 This is because I added this line: $friends = $facebook->api('/me/friends'); This is the code that is causing the error on facebook.php: if (isset($result['error'])) { throw new FacebookApiException($result); } where "throe new Facebook..." is the line 451. Thanks Cameron
  20. You could even just do: If(strlen($row['pincode'])==4) $pincode='0'.$pincode;
  21. I'm sorry this might look like a bump but it's not, I forgot to add this and I'm not sure how to edit it. Does anyone else know of some sort of cheat sheet I could use?
  22. No, it already is. I tried doing the oposite of what you said, and change the appinlcude expression, but it doesn't work either.
  23. Hmm.. Thank you so much but this is getting ridiculous! I've got ANOTHER error: Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /hermes/bosweb/web035/b357/ipg.projectstratoscom/facebook/client/facebook.php on line 543 Also, I am not getting id or name, why would this be. Is there some sort of cheat sheet I can use to "convert" the old sdk to the new one? How simple would that be, is the basic idea the same?
×
×
  • 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.