Jump to content

alexdemers

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Posts posted by alexdemers

  1. How can you put a function into a SQL line correctly?

     

    $sql = "SELECT e_mails FROM mail_useage WHERE date=date("Y-m-d", TIME() - 18000)";

     

    Would the code above work? If not, why not?

     

    Use concatenation:

     

    $sql = "SELECT e_mails FROM mail_useage WHERE date=".(date("Y-m-d", TIME() - 18000));

  2. Hey,

     

    I have an object:

     

    typeArray = ['header', 'data', 'footer', 'all'];

     

    and I want to reference these in my array:

     

    mainArray = {
        header: [0, 12, 53, 44, 2],
        data: [0, 5, 36, 45, 83],
        footer: [2, 24, 54, 44, 89],
        all: [5, 84, 44, 23, 6]
    }
    

     

     

    I want to be able to use this:

     

    var type = 'all';
    mainArray.type[3];
    

     

    But it thiniks that type is part of mainArray. Is there any way to tell JavaScript that "type" (in my case) is actually a variable and not an object/array name?

     

    Thanks

     

  3. As for step 2 and 3, they should be replace with viewing the source code instead:

     

    $page = file_get_contents('http://urlofform.com/form.php');
    

     

    Right and then how would you apply OCR on something like:

     

    <img src="qmdhstqst3q3d5hq37g5hq45347tj3q56j4y78sqwrd74jy6+q84ky35s734eyk7s
    78ylu4s88l4rs78ul869sr9ur9+§lu/7rs3lu874d73§lu6s346s4ku486sr">

     

     

    Same way a browser does.

     

    Folder: qmdhstqst3q3d5hq37g5hq45347tj3q56j4y78sqwrd74jy6+q84ky35s734eyk7s

    78ylu4s88l4rs78ul869sr9ur9+§lu

     

    File: 7rs3lu874d73§lu6s346s4ku486sr

     

    It is weird tho for a folder/file name. Even if it doesn't end with jpg or whetever the format it, if it has content-type headers it will show up properly in the browser.

  4. Well, you built the logic that mostly everybody would figure out in 30 seconds. Obviously it's step 4 that is the hardest part. I don't know any image recognition library in PHP (I would be surprised if there were any.

     

    As for step 2 and 3, they should be replace with viewing the source code instead:

     

    $page = file_get_contents('http://urlofform.com/form.php');
    

     

    ... and do some regex to get the image file path and then run the image recognition software of that single image.

     

    I cannot help you further because I never had an interest in breaking/spamming/hacking web sites.

  5. yes, they are referring to register globals being removed.  But FYI what you are doing is also bad coding practice.

     

    Would it be better to pass the string?

     

    No, this is a VERY good sign that you need to use OOP (Object Oriented Programming) or classes for your development process.

     

    Edit: typo

  6. For every letter find it's upside down ASCII value. On Windows, click Start (or the windows logo) then Run. In the run dialog, type "charmap" press enter. Now, let's say the user types "A", now look at the character map table and look for an upside down "A". Then, break down the user's string into an array and to str_replace of each of the letters.... and go on from there.

  7. The closes thing you can do is insert thousands of blank lines before starting to output your page. (stupid) visitors might say that the source is not available. Of course this method won't work with addons like Firebug.

     

    Or just play with whitespace of your HTML source.

     

    Your PHP code is already hidden.

     

    If it's for JavaScript, minimize your code.

  8. Well, as said in the sticky, headers should be set before any echo statements. If there's 1 byte of content, the headers will not work. You have two choices here. Either set the header before echoing the content, or do your insertion in the database before starting to output the table. So move your block of code to check/insert the comment in the database and move it before the loop to parse the table.

     

    Make any correction if it fails.

  9. Check line 60. You are already in PHP so no need to <? $_SERVER['PHP_SELF']; ?>.

     

    Replace that with

    action=\"".$_SERVER['PHP_SELF']."\"
    

     

    and everywhere where you used <? ?>

     

     

    Edit: Also, you shold really be cleaning your code/syntax. There's alot of confusion in there and that's where it creates problem.

  10. so if i serialize the array, i can compare one WHOLE bingo card to another? Would i need to sort the results first to make the serialized arrays the same?

     

    Thanks

     

    Snooble

     

     

    Well, bingo cards are usually sorted so I guess it should be sorted in the array. Comparing one whole bingo card to another will work but only return true or false if they are the same, they won't return the differences between the two.

  11. ok, i tried following:

    just to be sure. this doesn't work.

    if(isset($_POST['show'])) {
    $show = $_POST['show'];
    
    if(is_int($show)) {
    	//give_cookie($show);
    	setcookie("display", "30", time()*60*60);
    }
    }
    

     

    now I tried this:

    if(isset($_POST['show'])) {
    $show = mss($_POST['show']);
    
    if($show > 0) {
    	give_cookie($show);
    }
    }
    

    ok, this works perfectly now. thank you! and it should be sql injection proof too?

    anyway, now I have another issue. default is 25. when I select 30. it submits the form and does it's thing, but i need to refresh the page to make it display 30 results per page.. how do change that so it displays 30 right after submitting the form?

     

     

    I'm guessing that you do the cookie change after the parsing of the page. Try putting the if(isset($_POST['show'])) block before you echo out all of the items/articles/results.

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