Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Since running a query actually makes you get all the results (which mysql_query() does automatically for you) stick a LIMIT 1 on the end so that if there are results you'll only have to discard the one row.
  2. The code itself is simple but what's going on behind the scenes is definitely worth an explanation. $row doesn't exist, as I'm sure you've noticed. But in this context, PHP will create both $row and $row[$field->name] (with a null value) automatically. The proper way of writing that loop would be $row = array(); while($field = $result->fetch_field()) { $row[$field->name] = null; $paramatere[] = &$row[$field->name]; } The next thing to see is the &. That means "reference to", as in "$paramatere[] is a reference to $row[$field->name]". Normal assignment means just "a copy of", but with this the two variables actually refer to the same thing, and if you changed the value of one then the other would be "updated" automatically. So now $paramatere is an array with a lot of references to stuff in $row - one for each field. The array then goes into $stmt->bind_param() by way of call_user_func_array(). As for why it does this? mysqli_stmt::bind_result() and ::bind_param() are not normal functions in the sense that you pass in values as arguments and they return values to you. Instead you pass in variables, as references, and the functions then modify (bind_result) or repeatedly access (bind_param) the values with no extra effort on your part. To do this they both require variables which are references - you can't just pass in a variable normally because that'll just be a copy and the functions won't work. The whole point of that $row stuff and references and call_user_func_array() are to pass in an unknown number of variable references to the function.
  3. http://forums.phpfreaks.com/topic/271512-php-telnet-script-timeout/
  4. 40th-50th table? How many do you have? What are they for and why are there so many?
  5. Oh boy. 1. You posted your database credentials on a public forum. 2. I doubt your password actually contains a newline character in it. 3. == means comparison, = means assignment. Your $eMail line is using the wrong one. 4. When you set $eMail you put single quotes around $_POST. Variables do not work in single-quoted strings. Get rid of the quotes entirely and put two around the "eMail" array key instead. 5a. In generateRandomString() why is the variable called $User_ID? 5b. You give a default of 16 but the string you're shuffling only has 10 digits. 5c. User IDs should not be randomly generated. 6. For $searchquery you never set the value of $User_ID. 7. You call eMailCheck() without giving it any arguments. You need to tell it what email to check. 8. You call generateRandomString() but all you do is assign $User_ID=16. 9. The function definition of eMailCheck() needs {}s around the body of the code. 10. It also doesn't have any parameters for code to pass in the email. Variables like $eMail from outside the function are not available inside the function. 11. See points #4, #7 (needs the user ID), #9, and #10 (which applies to $User_ID and $con) for PostInformation() too.
  6. ...Hmm. Okay. Wonder what I was thinking of. I even contradicted myself with the position()=1. I misread the question and thought the problem was finding the username. "after the 5166".
  7. There's a kinda brute-force method on determining the next combination, which I agree with Psycho to be the hardest part, but I'm still thinking if there's a smarter alternative. About that number: I calculated that assuming you can devise an expression in one array to match an expression in the other array. Not that it's one expression totaling a single number. Like $array1 = array(2, ; $array2 = array(3, 7, 20); and 2+8=3+7 (4) is the best answer, as opposed to 2*2+8*2=20 (4 but higher). Otherwise it's just 151 ^ 6 = 11,853,911,588,401 combinations. (151 because 0 is a valid multiplier - the term isn't in the equation) 1. It would be a fatal error, not a catchable exception. The script would die. 2. Written well there wouldn't be any memory problems - it would just take a really, really long time to stop. There's a maximum of 150 on the multiplier.
  8. I'd use something like DOMDocument to find all the form fields you want and grab their default values (which you do according to the type of field, like dropdown or textbox or radio button). Depends on the structure of the page, and whether they're using lots of IDs or class names or whatever.
  9. glob will probably be easier to use.
  10. How does 10+73=83 fit into the problem? [edit] And are you prepared for the 140,515,219,945,627,518,837,736,801 possible combinations to examine before returning failure?
  11. What about the people who would buy it on their Mac and install it on their Windows computer? Don't want their business?
  12. And you say it's not working because... why?
  13. Google will notice when you do things differently for its bot than for normal users. If you close your website then you should lose rank. Your stuff is completely inaccessible. Users shouldn't go to your site. As soon as Google realizes you've closed shop it'll start dropping you off the search results. Why do you have to shut down? I can't think of anything that would take a whole month to deal with.
  14. Since it's just your own database, log in as root.
  15. I think you have the wrong indexes on the tr and td too. Starts counting at zero. Also, your expression isn't doing what you think it's doing. [X] is not an offset, it's a condition. Try this more correct and more powerful version which goes directly to the cell you want without the guesswork of where it is: //table[@class='responsedata']//td[text()='5166']/following-sibling::td[position()=1] [edit] Also, the doesn't need to be closed. The parser is smart enough to know that it's automatically closed.
  16. So you have a copy of everything? Or the posts actually live on your database while the rest is in the per-blog database? What blogging software are you using?
  17. One word: regex. preg_match_all('/(?<=#)\w+/', $message, $matches); Do a print_r($matches) to see what the output looks like.
  18. And in comes the old and very often overlooked element. <button type="submit" class="sbmt" value="jour" name="lnk">Journalism</button>
  19. Respectively, DISTINCT and COUNT(DISTINCT ...). Any reason why there are so many duplicates?
  20. I'm not entirely sure what you're trying to do here. The client isn't just a simple telnet connection? Is the script trying to connect to itself? What's the "shell code here" you're executing? Why are you nohuping anything? Why port 86? Are you simulating a "BroadCam Video Streaming Server" or "Micro Focus Cobol" (as mentioned here)?
  21. Look at your highlighted code. Does anything seem wrong?
  22. It's not. images is an array of objects that your code set up somewhere. Try images.src instead.
  23. An IFRAME makes no sense. The other two will both return the same string, the only difference is that cURL gives you more control over how it retrieves the URL.
  24. If that's HTML then something involving DOM (like DOMDocument) would be better.
×
×
  • 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.