Jump to content

elhama

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by elhama

  1. yes, because when you click the link the flashplayer=no will dissapear, to prevent this, do like so on all the links: [code] <?php if($_GET['flashplayer'] == "no") $flashplayer = 'no'; else $flashplayer = 'yes'; ?> <a href=link.php?flashplayer=<? echo $flashplayer; ?>>Link here </a>[/code]
  2. [quote author=redarrow link=topic=104024.msg414860#msg414860 date=1155447224] correct you have to add a time stamp if you want if 24 hours long [/quote] haha yeah, but its just the way I work, date("YmdHis") will give something like this: 19950911234510 and I feel more comfy working with that :)
  3. www wont matter anyways, http://google.com will make just as good as http://www.google.com :)
  4. Well.. you could use a substr() and cut the text and check the first 7 letters, if they aren't http:// you could add it like this  $something = "http://".$something; The code would be something like this? [code=php:0] <?php $check_text = substr($link, 0, 7); if($check_text != "http://") $link = "http://".$link; ?> [/code]
  5. [quote author=dual_alliance link=topic=104023.msg414722#msg414722 date=1155417631] Ok well l have this code: [code=php:0]<?php if("$accessLevel" !== 9){ echo 'You do not have permission to access the admin control panel!'; }else{ [/code] [/quote] I think you forgot an exit; right after the echo, you could rather try using die("You do not have permission to access the admin control panel!"); Try doing it this way [code=php:0] <?php if ($accessLevel != 9) {     die("You do not have access to the admin panel!"); } ?> [/code]
  6. It's quite simple. Heres a small tutorial how to do it ^^ First create a new table in your db called let's say "iplogin". With the columns: - uid - auto increment - unique - max letters 200 - login_ip - varchar - max letters 40 - last_login - bigint - 100( ? ) add this code when you login This is rather sloppy work as it's very late, but it should be something like this: [B] Might contain minor errors [/B] [code] <?php $user_ip = $REMOTE_ADDR; $check_ip = mysql_fetch_array(mysql_query("SELECT * FROM iplogin where login_ip='$user_ip'")); if($check_ip[uid] != ""){ $time_now = date("YmdHis"); $time_then = $check_ip[last_login]; $time_intervall = 30;  // This checks how long time before he can log in again (Seconds) if(($time_now - $time_intervall) <= $time_then){ die("You have recently logged in"); } else{ $allow_login=1; $newtime = date("YmdHis"); mysql_query("UPDATE iplogin set last_login='$newtime' where login_ip='$REMOTE_ADDR'"); } } else{ $allow_login =1; $newtime=date("YmdHis"); mysql_query("INSERT INTO iplogin (login_ip, last_login) VALUES('$REMOTE_ADDR', '$newtime')"); } // TO THE LOGIN PART if($allow_login == 1){ // Login stuff here } else{ die("SIMON SAYS YOU ARE NO LOGIN LOL!"); } ?> [/code]
  7. Ah damn it! I didn't realize it was that simple! :D Haaha! Thanks alot mate!! ;)
  8. What I want to do is to SELECT * from members, but I want to order it by 'type' (order by type DESC), but I want it to also to order by category in the second hand, kinda hard to explain, do anyone understand what I'm trying to do? Thanks!
  9. Yes lessur, thats exactly what I'm trying to do...
  10. Alright, Didn't get any good responds yesterday so I try again, my thread kinda died.. So the problem is now that I have to limit the data to a max of 25 per page, which is simple by itself, but also what I have to do is to keep it categorized, and I just can't seem to get through with it, can someone enlighten me please? Here is some example code I've tried to fix, but it keeps messing up! The loops gets screwed up.. Here's what I want to get Category 1 - Comment 1 - Comment 2 Category 2 - Comment 1 - Comment 2 Note: This is only testing/example code of what I'm meaning Code: [code] <b> <? echo "<table border=1>"; if(!isset($_GET['page'])){         $numPage = 1; } else{         $numPage = $_GET['page']; } $rowsPerPage = 2; $offset = ($numPage - 1) * $rowsPerPage; $testy = mysql_fetch_array(mysql_query("SELECT category FROM myfriends limit $offset, 1")); $test = mysql_query("SELECT * FROM myfriends limit $offset, $rowsPerPage"); $category=$testy[category]; while(($category < 5) && ($t = mysql_fetch_array($test))){         if($category==1)         $cat_text = "Friends";         if($category==2)         $cat_text = "Family";         if($category==3)         $cat_text = "School";         if($category==4)         $cat_text = "The Rest";         echo "<tr><td>$cat_text</td></tr>";         $test3 = mysql_query("SELECT * FROM myfriends where category='$category' limit $offset, $rowsPerPage") or die(mysql_error());                 while($e = mysql_fetch_array($test3)){                 echo "<tr><td>$e[comment]</td></tr>";                 } $category = $category+1; } echo "</table>"; $topage = $numPage +1; echo "<a href=test.php?page=$topage>></a>"; ?> </b> [/code]
  11. I have no idea, never tested it. but I tested readfile and it works -perfectly- however test them both and take whatever fits the best for you! :D
  12. Well then the total limit will be 75, plus maybe one of the categories are 0 and one of the categories are 10? The whole script will get messed up..
  13. <? readfile('http://yourlink.com/yourfile.html'); ?>
  14. You can't put them seperatly, because then you can't put the 25 per page limit on the query
  15. It means you messed up the SQL query
  16. Okay, I'm sorry.. I'll explain You have a table with lets say 100 items. There are four categories and what you want to do is to put all of these items up on the website, but you want to keep a limit of max 25 items per page, so lets say one category has 10 items and one category has 15 items, that would mean it would look like this on the website, the thing is however I do it, it get messed up Category 1 1 ..etc.. 10 Category 2 1 .... 15 Next Page>>
  17. I've gotten into quite some trouble, see what I'm trying to do is put up the database data up in a list, but the problem is that the data is put up in categories like so: Category 1: 1 2 3 Category 2: 1 2 3 (Total of 4 categories) So the problem is now that I have to limit the data to a max of 25 per page, which is simple by itself, but also what I have to do is to keep it categorized, and I just can't seem to get through with it, can someone enlighten me please? Here is some example code I've tried to fix, but it keeps messing up! The loops gets screwed up.. [B] Note: This is only testing/example code of what I'm meaning[/B] [CODE] <? echo "<table border=1>"; if($_GET['page'] == ""){         $numPage = 1; } else{         $numPage = $_GET['page']; } $rowsPerPage = 2; $offset = ($numPage - 1) * $rowsPerPage; $testy = mysql_fetch_array(mysql_query("SELECT * FROM myfriends limit $offset, 1")); $test = mysql_query("SELECT * FROM myfriends limit $offset, $rowsPerPage"); $category=$testy[category]; while(($category < 5) && ($t = mysql_fetch_array($test))){         if($category==1)         $cat_text = "Friends";         if($category==2)         $cat_text = "Family";         if($category==3)         $cat_text = "School";         if($category==4)         $cat_text = "The Rest";         echo "<tr><td>$cat_text</td></tr>";         $test3 = mysql_query("SELECT * FROM myfriends where category='$category' limit $offset, $rowsPerPage") or die(mysql_error());                 while($e = mysql_fetch_array($test3)){                 echo "<tr><td>$e[comment]</td></tr>";                 } $category = $category+1; } echo "</table>"; $topage = $numPage +1; echo "<a href=test.php?page=$topage>></a>"; ?> [/CODE]
×
×
  • 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.