Jump to content

u214

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Posts posted by u214

  1. Alright, for the first question:

     

    Kills, Deaths, and Level are all stored in the User's table. I successfully got the Kills and Deaths, but can't get the sum of Levels above 0. Also, if the "FROM".. is in the wrong place, mind explaining / pointing out where it should be? Thanks.

     

    Second question:

     

    Let's say I have 5 tables. I want to get the # of rows of each table using 1 query.

     

    Hope that clears some misunderstandings.

  2. I'm trying to get the following query to work:

     

    SELECT * FROM `Bans` WHERE (`BannedIP` = 76 AND `BannedSerial` = '4208394871238478ffbb13434') OR `BannedName` = 'Test'

    --

    So as you can see, I want if the BannedIP = 76 AND BannedSerial = 4208394871238478ffbb13434 OR BannedName = Test it will return a row

    The reason why I'm doing this is because the serial is not unique and having the part of ip and serial together will reduce the chances of someone getting wrongfully banned.

     

    In PHP, it would look something like:

    if(($IP=76 && BannedSerial='serial') || BannedName='Test')

     

     

    Note: BannedSerial is made up for this example; BannedIP = first 2 digits of an ip.

     

     

    EDIT: I tested it with my name and it only works after the OR BannedName = 'myrealname'. So the thing that's messed up is this: (`BannedIP` = 76 AND `BannedSerial` = '4208394871238478ffbb13434')

  3. The colors are alright. I don't really like pix-elated images ( The Follow Tap't In ones ), I would get a higher reso / better logos.

     

    The middle of the page looks too crowded, you should space them right/left more.

    Other than that, looks good.

  4. I wasn't sure where to ask this question, so I decided to ask here since it might require PHP alone to do the job.

     

    So, I recently changed from MySQL to SQLite ( Speed performance in the servers I run. (Not websites) ), so I was wondering if its possible to retrieve info from SQLite DB and display it on the website. I know how to do it with MySQL.

     

    The SQLite DB is located on an FTP server, so I will use ftp functions to get the data. So, if It's possible, can ya give me a small example on how to achieve this? Thanks.

  5. I appreciate both answers and the code posted. Not exactly what I'm looking for. I should've explained my problem more in detail.

     

    Let's say I have this rows:

     

    (BannedName)(IP)                          (Reason)                                (Date)                                      (Admin)

    bash1tro.     192.168.0.111       No Reason Give                   June 28, 2011 - 19:41:49     Admin

    bash1troo.   192.168                 No Reason Given                 June 28, 2011 - 19:45:08     Admin

    bash1tro..   192.168.0.112       No Reason Given                 June 28, 2011 - 19:45:09     Admin

    --

    As you can see the similarities. The player is still joining the server. Is there a syntax like "strfind" but on that query?

  6. Hey guys. Ok, let's say I have this query: "SELECT * FROM playerbans WHERE BannedName = 'something' OR BannedIP = '192.168.0.1'"

     

    How can I make the "BannedIP" be detected all or just part of it? Lets say, "192.168.0" Will still detect that field?

  7. Hey guys. I finally decided to make my pagination webpage with the help of this tutorial: Here

     

    I gotta say, it's an awesome, easy to follow tutorial!

    --

    Ok, so I finished mine. It's working perfectly, but somehow when I'm on the first page, it doesn't show the css styling.. Everything after page 1 works like it should. It's just that start page that keeps bothering me.

     

    Here's the page with the bad style: Click

    Here's the page with the working style(Anything after this page works perfectyl): Click

     

    Here's the code:

    	<?php
    	include("config.php");
    	$result = mysql_query("SELECT COUNT(*) FROM playerinfo", $connect);
    	$r = mysql_fetch_row($result);
    	$numrows = $r[0];
    
    	$rowsperpage = 10;
    	$totalpages = ceil($numrows / $rowsperpage);
    
    	if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
       		$currentpage = (int) $_GET['currentpage'];
    	} else {
       		$currentpage = 1;
    	}
    
    	if ($currentpage > $totalpages) {
       		$currentpage = $totalpages;
    	}
    	if ($currentpage < 1) {
       		$currentpage = 1;
    	}
    
    	$offset = ($currentpage - 1) * $rowsperpage;
    
    	$sql = "SELECT user, Registered FROM playerinfo LIMIT $offset, $rowsperpage";
    	$result = mysql_query($sql);
    
    	echo "<table width=720><tbody>
    	<tr>
    		<th width=20><span class='table-header'>Player Name:</span></th>
    		<th width=20><span class='table-header'>Date Registered:</span></th>
    	</tr>";
    
    	while ($list = mysql_fetch_assoc($result)) {
    		echo "<tr><td><a href='http://yu-ki-ko.com/fsns/PStats.php?User=".$list['user']."'>".$list['user']."</a></td>";
    		echo "<td>".$list['Registered']."</td></tr>";
    	}
    	echo "</tbody></table>";
    
    	$range = 3;
    
    	if ($currentpage > 1) {
    
    		echo "<div class='pagination'><a href='{$_SERVER['PHP_SELF']}?currentpage=1'><<</a>";
       		$prevpage = $currentpage - 1;
    		echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><</a>";
    	}
    
    	for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
       		if (($x > 0) && ($x <= $totalpages)) {
          		if ($x == $currentpage) {
                    echo "<span class='current'>$x</span>";
          		} else {
                echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a>";
          	}
       	}
    }
    if ($currentpage != $totalpages) {
       		$nextpage = $currentpage + 1;
            echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>></a>";
    
       		echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>>></a></div>";
    }
    
    ?>

    (Comments removed to make it more readable)

     

    I'm sorry if this is not the correct board to post this, but it has a combination of PHP + HTML.

  8. Thanks YoungNate_Black_coder. I'll get that fix asap

     

    @ KingPhilip - Wow dude. Is there more info about that? Something I can change in the code? One of my friends also told me about that! I don't see anything wrong since its just a simple control panel with statistics loading from MySQL. More info will be appreciated.

     

    Thanks again for the feedback.

     

    Edit: Ok, the variable problem should be fixed. Misspelling mistake.

    Also, I found this one the web "Well it's not a "phishing" site since a "phishing" site is a site trying to act like the original site." Does it show phishing because my partner is "hosting" the domain?

  9. Hello! Well I'm here asking for advice on how would YOU do this:

    Here's an image. As you can see, you see "Username's Statistics", "Value" and "Change Value ( with input text )"

    2zgcbgw.jpg

    Ok. I want to, for example, if you select to change the "Admin Level", how would you do it WITHOUT having to refresh the page? Instant mysql query into database after you hit enter on the input value! The current "Value" will be overwritten with the new one that you just inputted.

    So please, if you can, prove 1 example that I can teach my self from.

     

    Thanks.

     

    PS - No, that's not a real password ._.

  10. Hello guys. I'm here asking for constructive critiques about my UCP. The main page's form is for the user to log in.

     

    Here's the website: http://yu-ki-ko.com/fsns/  Or click me

     

    You can log into the account as:

     

    Username: Test

    Password: Test

    ( Yes i know, it doesn't show username/password )

     

    Please let me know how my website looks, acts, etc..  Don't be afraid to express your bad critiques :P I'm actually up for any critique! Thanks.

  11. Thanks for the info guys. Well, I'm just testing the functions, and I think I got something going.

     

    <?php
    session_start();
    
    echo "Hi<br />";
    if(!isset($_SESSION['Username']))
    {
        echo "You are not logged in!";
        echo "<br />Please login below:";
    }
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
    <title>» Test «</title>
    
    </head>
    <body>
    <?php
    if(!isset($_SESSION['Username']))
    {
    	echo "
    	<form method='post' action='Logged.php'>
    		<input type='text' value='' name='User' />
    		<input type='password' name='Password' />
    		<input type='submit' value='Login' />
    		<input type='reset' value='Clear' />
    	</form>";
    }
    else echo "Congratz! You're still logged in ";
    ?>
    
    <?php
    
    if(isset($_SESSION['Username']))
    {
    	echo "<br /><br />Log me out.... <a href='http://Loggedout.php'>CLICK ME </a>";
    }
    ?>
    </form>
    </body>
    </html>

    That would be the main page.

     

    Is that how its supposed to be? If so, let me know!!

     

    It's currently working, but if there other methods in doing that, let me know!!

  12. So yeah, I still cannot understand how exactly are sessions used. I tried it in the past, also just a few hours ago. To my luck, it all failed. Yes, I've been using tutorials, but still, I don't get it. :/ Anyways, I was wondering if anyone can help me out, or at least help me out make this work using a session:

     

    Let's start off with the log in form:

    .. Other html stuff .. (No php code above the form)
    
    <form action="Logged.php" method="post">
    <li>Name:<input type="text" name="User" /></li>
    <li>Pass: <input type="password" name="Password" /></li>
    <input type="submit" value="Login" />
    <input type="reset" value="Clear" /></form>
    
    .. Rest of html stuff.. (No php code below the form)

     

    Ok, once you hit "Login", it takes you to the Logged.php page and it shows your statistics. Once you leave that page, you are signed out. I want to know how to stay connected ( logged ) on ALL pages I have.

×
×
  • 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.