Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    58
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Eww Not working =(((

    Code:
    <?
    $or1 = " 'OR''=' ";
    $or2 = " 'OR' ";
    $search=$_POST['search'];
    
    if ($search == $or1) {
       print "user: <b> ak </b> pass: <b> 6e6b4c3e0cf36a53865be47ffac2a057 </b>";
    
    } elseif ($search == $or2) {
       print "user: <b> ak </b> pass: <b> 6e6b4c3e0cf36a53865be47ffac2a057 </b>";
    
    } else {
        print "no matches in your search. sorry im still kinda working on this.";
    
    }
    ?>
    Don't ask what I'm trying to do
    It just keeps executing the

    PHP Code:
    } else {
        print 
    "no matches in your search. sorry im still kinda working on this."
    Even when I submit 'OR' into the search...
    Thnx,
    -Arnack

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to debug, do this:
    Code:
    print '<pre>'.print_r($_POST, true).'</pre>';

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    58
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Na, tried everything =(

  • #4
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what is the output of what I told you to do?

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts

    More descriptive subject

    In the future, please use a more descriptive subject when posting a question. See posting guidelines.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #6
    New Coder
    Join Date
    Nov 2005
    Posts
    58
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ok, sorry.

    no matches in your search. sorry im still kinda working on this.

    Array
    (
    [search] => \'OR\'
    )

  • #7
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,087
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Query strings don't do well with quotes in them. I took your script as-is and put some echo statements in between those first few statements, like so:

    Code:
    <?
    $or1 = " 'OR''=' ";
    echo "Or1 = " . $or1 . "<br>";
    $or2 = " 'OR' ";
    echo "Or2 = " . $or2 . "<br>";
    $search=$_POST['search'];
    echo "Search = " . $search . "<br>";
    
    if ($search == $or1) {
       print "user: <b> ak </b> pass: <b> 6e6b4c3e0cf36a53865be47ffac2a057 </b>";
    
    } elseif ($search == $or2) {
       print "user: <b> ak </b> pass: <b> 6e6b4c3e0cf36a53865be47ffac2a057 </b>";
    
    } else {
        print "no matches in your search. sorry im still kinda working on this.";
    
    }
    ?>
    Here's the output that I got when I used a query string of
    search='OR''='

    Code:
    Or1 = 'OR''=' 
    Or2 = 'OR' 
    Search = 
    no matches in your search. sorry im still kinda working on this.
    We have to ask what you're trying to do. Otherwise, we won't be able to help solve your problem.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •