Jump to content

irkevin

Members
  • Posts

    295
  • Joined

  • Last visited

Posts posted by irkevin

  1. i have an sql which looks like below

     

    <?php
    //require the config file
    require ("config.php");
    
    //make the connection to the database
    $connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
    $db = @mysql_select_db($db_name,$connection)or die(mysql_error());
    
    //build and issue the query
    $sql ="SELECT * FROM banned WHERE type = 'user'";
    $result = @mysql_query($sql,$connection) or die(mysql_error());
    
    while ($sql = mysql_fetch_object($result)) 
    {
    $banned = $sql -> no_access;
    
    echo "<option value=\"$banned\">$banned</option>";
    }
    ?>

     

    but when it executes, i get this message, what does it mean?

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(no_access, type) WHERE no_access = 'tester'' at line 1

  2. If i don't use the set_include_path, i get this error message

     

    Warning: main(../test2.php) [function.main]: failed to open stream: No such file or directory in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 2

     

    Warning: main() [function.include]: Failed opening '../test2.php' for inclusion (include_path='.;c:\php4\pear') in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 2

    World

     

     

  3. <?php
    set_include_path('C:\hshome\tipa-mu\mu-anime.com\');
    include('../test2.php');
    echo "World";
    ?>

     

    when i use the code above, i get this

     

    Parse error: syntax error, unexpected '.' in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 3

     

    i tried with backslashes as well, but no good..  tired removing the C: also. but not good.. why won't it work for me :S

  4. i'm on a windows server.. and it doesn't seems to work..

     

    test2.php is in the root. and test1.php is in a folder name test

     

    thats y i made

     

    include('../test2.php');

     

    but it won't work on windows server....

  5. Parse error: syntax error, unexpected $end in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 5

     

    even when removing the extra quote.. this is weird. wonder why it is not working .. tried it with backslashes also. but nothing

  6. when i use this

     

    <?php
    set_include_path('C:/hshome/tipa-mu/mu-anime.com/'");
    include "../test2.php";
    echo "World";
    ?>

     

    i get this message

     

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 3

  7. when i use the code you gave me.. i get this message

     

    Parse error: syntax error, unexpected '.' in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 3

     

    honestlu, i don't find any errors in the code.. so why is it showing an error message?

  8. i have a code i made to make a little test.. im on a windows server..

     

    <?php
    set_include_path('C:\hshome\tipa-mu\mu-anime.com\');
    include("../test2.php");
    echo "World";
    ?>

     

    i get this error message and can't seem to find the solution. can anyone figure this for me please?

     

    Parse error: syntax error, unexpected $end in C:\hshome\tipa-mu\mu-anime.com\test\test1.php on line 5

  9. Hi everyone, someone mind tell me if there are some changes i need to make with this code?

     

    <?php
    include('config.php');
    include('functions.php');
    mysql_connect($server, $dbusername, $dbpassword);
    mysql_select_db("$user_online");
    
    $uname = $_SESSION['user_name'];
    if (!$uname)
    { 
    $guest = "1"; 
    } 
    else
    { 
    $guest = "0"; 
    }
    $ip = $_SERVER['REMOTE_ADDR'];
    $time = time();
    $query = "SELECT * FROM user_online WHERE ip = '$ip'";
    $result = mysql_query($query);
    if (mysql_num_rows($result) == 1)
    {
          $query2 = "UPDATE user_online SET uname='$uname',time='$time',guest='$guest' WHERE ip = '$ip'";
          $result2 = mysql_query($query2);
    }
    else
    {
          $query2 = "INSERT INTO user_online (uname,ip,time,guest)VALUES('$uname', '$ip', '$time','$guest')";
          $result2 = mysql_query($query2);
    }
    
    $time3 = time() - 300;
    $query3 = "DELETE FROM user_online WHERE time < $time3";
    $result3 = mysql_query($query3);
    $query4 = "SELECT * FROM user_online WHERE guest = '1'";
    $result4 = mysql_query($query4);
    $guestonline = mysql_num_rows($result4);
    $query5 = "SELECT * FROM user_online WHERE guest = '0'";
    $result5 = mysql_query($query5);
    $memonline = mysql_num_rows($result5);
    $totalonline = $guestonline + $memonline;
    echo 
    "Guests: $guestonline<br />
    Members: $memonline<br />
    Total: $totalonline<br /><br />";
    ?>

     

    sometimes, it shows only one user online even if there are more than one user logged in in my site

     

  10. hello peeps..

     

    I have a shoutbox on my website, it's in an iframe.. and now i have a refresh button in it, basically, when i hit the refresh button, it should refresh only whats inside the iframe.. it's working great it IE, but in firefox, it refresh the whole page.. why is it so? here's the code im using with this refresh button

     

    <input type="button" value="Reload" onClick="javascript:history.go(0);" class="submit">

     

    Can someone tell me how to prevent it from refreshing the whole page? it only happen in FF

  11. Hi i have a little problem there and this is getting me mad..

     

    My iframe displays well in FF, but it won't show up in IE.

     

    here's the code

     

    <table border="0" width="76%" cellpadding="0" cellspacing="0">
    <tr>
    <td align="left" valign="top"><iframe src="shout.php" name="shout" scrolling="NO" width="100%" height="100%" frameborder="0" marginheight="0" marginwidth="0" allowtransparency="true"></iframe></td>
    </tr>
    </table>

     

    Whats wrong?

  12. Oh thanks for the quick response. . and what about global function.. I think it's something like that

     

    function whatever(){

    global $first;

    echo $first;

    }

     

    what does the global means there?

     

    P.S: sorry if i'm not using google for this.. i really want to get answers from people in this forum. this will give me some idead how it really works

     

     

  13. hi, sorry to bug you with this but can someone give me a brief explanation or code example of what

     

    case and break do in php? and what about classes?

     

    If it's a long explanation, then disgard this post!

     

    Thanks in advance

  14. If you want a good and running login script, try this one

     

    http://www.mpdolan.com/downloads.htm

     

    From this, you'll be able to understand how a login script works and how to design one later

     

    P.S[to any moderators] : If the link posted cause a problem with phpfreaks, forgive me and delete it please. Thanks for your comprehension

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