Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Zane

  1. eh..I was just wondering since the numbers 17 through 31
    are both greater than 16 and NOT a power of two
    that they would all be classified as
    ALL of these
    ----------------------
    1    E_ERROR
    2    E_WARNING
    4    E_PARSE
    8    E_NOTICE
    16  E_CORE_ERROR

    I'm assuming they are


    I just wrote the loop wrong...
    that IF will always return true regardless I just realized...unless the result is 0


  2. OMG I learned something!
    thanks so much guys

    Now I just have to grasp the other operators.
    In retrospect I learned that if I do
    $a & ~$b

    $b is basically removed from $a IF it exists....or turned off essentially.

    Just gonna do another test in my head ... I'm not even using a PHP server at all BTW.  This is all straight up calc.exe, php.net and you guys.

    So Considering
    echo decbin(E_ALL & ~(E_CORE_WARNING | E_COMPILE_WARNING | E_USER_WARNING));
    returns 10101011111

    echo decbin(E_ALL | ~(E_CORE_WARNING & E_COMPILE_WARNING & E_USER_WARNING));
    should return.....
    -
    -
    -time goes by
    -
    [code]
    E_CORE_WARNING (0000100000) & E_COMPILE_WARNING(0010000000) & E_USER_WARNING(1000000000)
    (0000100000 & 0010000000 & 1000000000) = 0000000000
    ~0000000000 = 1111111111
    E_ALL(1111111111) & 1111111111 = 0000000000
    [/code]



    Furthermore...
    say I went
    error_reporting(E_ALL >> 5)
    translating to.......
    1111111111 -> 0000011111 -> 31
    31 translating to E_CORE_ERROR I guess since 32 hasn't been reached yet...right?
  3. Ok...it's making much more sense now

    So say I wanted to show all errors except

    E_CORE_WARNING - 32 bits
    E_COMPILE_WARNING - 128 bits
    E_USER_WARNING - 512 bits

    would I say?
    in a non-constant sense
    [code]
    $showErrors = 11111111111;                //E_ALL
    $showErrors = $showErrors & ~100000        // ~E_CORE_WARNING
    $showErrors = $showErrors & ~10000000    // E_COMPILE_WARNING
    $showErrors = $showErrors & ~100000000  //E_USER_WARNING
    error_reporting($showErrors);
    [/code]

    or another quesiton
    would $showErrors
    then equal?
    10101011111
  4. ReCap again...
    alright

    I'm a permissionless user
    $zanesPerms = 0x00000000;

    the Admin gives me posting rights
    $zanesPerms = $zanesPerms | 0x00000128
    //$zanePerms now equals ... 0x00000128?

    if the Admin then gave me Delete user rights... 0x00000064
    Explain to me the way barand did, how the variable is changed.

    would zanesPerms be 0x00000192? or something else and why

    I appreciate your help a lot
  5. If it's custom 404 pages your wanting, you'll have to edit the 404.shtml file to forward those variables to 404.php.

    I can't remember the exact instructions but I can find out for you in a second


    UPDATE:
    take a look at this tutorial
    http://www.onlamp.com/pub/a/onlamp/2003/02/13/davidsklar.html

    EDIT:
    Nevermind, if you have it redirecting to 404.php already on an error then you must already have that setup
    you need to tell 404.php to use the $_SERVER['REDIRECT_URL'] variable
  6. I don't seem to follow your question all the way..

    are these separate columns
    [quote]
    1 : red pie <#> green pie <#> blue pie <#> yellow pie
    2 : blue pie <#> yellow pie
    3 : green pie <#> blue pie <#> yellow pie
    [/quote]
    or is it data all in one column....shown per row

    My question is how would you end up with the order
    Red
    Green
    Yellow
    Blue

    I can't see that order appearing anywhere.
  7. In reference to this post
    http://www.phpfreaks.com/forums/index.php/topic,110890.msg450649.html#msg450649

    So to check my understanding..using as little jargon as possible.

    At the beginning you have NO permissions..meaning just that
    then say you want to allow them to delete a user
    Delete a user has it's own numeric ...hex..value..whatever
    say 0x00000064

    if I want to append that permissioin to the $perms variable I use the | operator?
    [code=php:0]$perms = $perms | 0x00000064[/code]

    [color=teal]Considering I don't use constants in this example which I know you preached on so much and I'd like to say I agree on but for the sake of understanding...yeah[/color]

    and I validate it with the & operator?
    [code=php:0]if($perms & 0x00000064) //Can delete users[/code]

    Say I did it vice versa?

    [code=php:0]
    $perms = $perms & 0x00000064;
    if($perms | 0x00000064) //Then what
    [/code]
  8. Wow
    I completely understand how it works
    but I have no clue why I would use it now.
    I can't spot the convenience of it
    Thank you for the extensive examples though Barrand

    I'm sure one day something will spark and I'll need to dig deep into the binary aspects of what I'm doing.
    omg my brain hurts from that one.
    I knew I shouldn't have asked such a question...lol
  9. I've always wondered how that feature would work.  It baffles me everytime.
    But the idea I come up with everytime at the end is this.

    You would want it so that you can tell if they've seen the post or not...not the thread.
    cuz if you think about it.  Everytime someone posts a new reply...that's a new post you haven't seen.  And once you view the thread again you have.

    It makes it that much harder though.  I'd say have an extra column in the users table for posts read and continue to populate a serialized array you have in there...maybe at a fulltext datatype.

    Just throwing an idea out there not sure of it's quality
    Hope I inspired something
  10. Every now and again I stumble on something about PHP I've never heard about.
    I was looking at Operator Precedence and found a bitwise operator.

    I looked further into it and found out there were more of those, but I have no clue where or when I would use them.  I can't understand the examples.

    Can anyone enlighten me here.  Gimme a scenario were I'd use a bitwise operator?
    Thanks
  11. wow..this is an interesting thread
    well for my turn.

    I'm 20 years old. I'm from the farthest west city you can go in North Carolina.  For those of you who watch the news, it's the city where they caught [url=http://en.wikipedia.org/wiki/Eric_Robert_Rudolph]Eric Rudolph[/url] (one of the Top Ten Most Wanted)
    The first time I remember really soaking myself into a computer was with an old Gateway2k running Windows 3.1 Never thought I would be making anything useful on one though.  By the time high school rolled around I could take them apart and troubleshoot whatever as well as make some sort of cheesy website with Homestead/Geocities/Angelfire/ or Tripod.  I can't even remember how I found PHP.  I guess I just knew that I needed a way to create a form and found the best way and wala.

    I go to a Community College aiming towards a Computer Technology Systems degree and am struggling through the welcome path to the "real world."  I speak English and Spanish..(thanks to 10 years of dedication) and I like to party and get ~retarded.
  12. I think it would be a good idea to give your navation links a background-color and some padding instead of just being underlined.

    It would seem more modular, if that's what you're going for.

    Like the breaking news...if you gave each LI a background color
  13. Well for one
    [code]
    it's supposed to be
    $query="INSERT INTO movie (name, genre, description) VALUES ('$mname', '$genre', '$mdesc')";
    $result = mysql_query($query)or die('Error!' . mysql_error());
    [/code]
    not
    [quote]
    $query ="INSERT INTO movie (name, genre, description) VALUES ("$mname", "$genre", "$mdesc")"
    or die('Error!' . mysql_error());
    mysql_query($query);
    [/quote]
  14. As long as you don't allow them to create variables make PHP statements
    you should have to worry about malicious code.

    if you block thing like
    {
    }
    $
    =
    ->

    and as long as they don't have access to any global variables like _POST or _GET
    there's nothing dangerous that could happen...



    [quote]
    To modify this to allow letters as well, I would use? (assuming I first make the input lowercase)
    Code:

    if(ereg("[^a-z0-9()\*\/\\\^\+-\s]+", $textInput))
      echo "Not a Valid Mathmatical function";
    else
      eval($textInput);
    [/quote]

    yeah...you can also set for uppercase too
    [^a-zA-Z0-9()\*\/\\\^\+-\s]
×
×
  • 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.