Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Sepodati

  1. I thought you sounded like an annoying fucking twat I've heard before... http://forums.devshed.com/php-development/978085-curl-experiments-post2977611.html#post2977611
  2. Gets quiet in here with all those bridges burning, doesn't it?
  3. var_dump() doesn't have any formatting. It's meant to dump the variable so you can see what it contains. It's for troubleshooting. Why would you need a "pretty print" when it's just for troubleshooting?
  4. How does that code even run? There's no opening bracket for your if(preg_match(...)) line or a closing bracket for your function.
  5. Don't hold your breath waiting on me. You have your answer.
  6. You can't remove the if() condition and leave the related "else" code.
  7. If you know you want X partitions of Y rows each, then just get X*Y random rows. As you're displaying them, every Y rows, save that as a new CSV file. I still don't see why this can't be done all in a single processing step.
  8. Well, preg_match_all() will give you all of the matches and you could just display the last one. If the match is always at the end of the string, you could still use preg_match() and change your pattern to '#\((.*?)\)$#', where adding the '$' means the end of the line. Or, a bit hacky, but you could strrev() the string, use preg_match() as you are and then strrev() the match to display it correctly.
  9. Why not just display and export the randomly selected rows in one step? I don't see the need for a temporary table at all. What's the larger problem you're trying to solve? Is it really just "give me X random rows from the table as a CSV" ?
  10. If you don't need them, don't put them into the array in the first place. I agree with the above, too. What's the real problem you're trying to solve / system you're trying to create? Maybe there's a better way to do this from the very start. -John
  11. Wait, is it required to have the colon in the key name for the array passed to execute()? Because I'm not doing that and it's working for me with SQLite. Maybe it depends on the driver? I have a demo in like 20 minutes, so I'm not changing anything right now.
  12. PHP is telling you there's no such thing as $_SESSION['id']. The 'id' index in $_SESSION is undefined. I don't see anything in the code where you're attempting to set the $_SESSION value, either. $_GET['nx_version'] is going to contain the value of the dropdown after the form is submitted. Again, when the page first loads, though, it's not going to be there. If you reference it, you'll get the "undefined index" error again. If you want to determine whether it's set or not, use isset(). I don't really follow what you're doing with the array_keys() thing either... $array_id[array_keys($array_id)[0]]; (???) -John
  13. Why are you even doing this in general? Banned words from what? Throw up asterisks for the big seven or whatever and fucking move on. EDIT: I threw fucking in there to see what this forum did, btw.
  14. Why do you even have "return" in there? what are you doing?
  15. From the manual: (emphasis mine) If you want two characters as the token, then use something else. Probably regular expressions, since you're talking about there maybe or maybe not being a space.
  16. I don't see any point to the first query. You're not doing anything with it unless there's additional code you're not showing. Without JS/ajax, you'll have to create your first <select> similar to what you're doing. Then, after the form is submitted, in your processing code, validate $_GET['descr_ger'] using the filter_* functions and add a WHERE clause to your query referencing the value. You'll want to check out PDO or the mysqli functions to create that query securely. Stop using the mysql() deprecated functions. From the results of that query with the WHERE clause limiting results to a matching descriptive value, you can create all of the other input boxes you want. -John
  17. That flow seems like it'd be confusing to the user. Why not display a message saying no such ID exists. If you just redirect, the user has no idea what happened. You're already determining whether the ID exists in the current query. If no rows are returned, then no ID was matched.
  18. JSFiddle site is very useful, but Firefox and Chrome (and probably the others) allow you to right-click on an HTML page element and click "inspect" or "inspect element". From there, you can "fiddle" with the CSS in the styles tab or area. Changes are real time, so you can adjust or add values there until you see what you want. I'm in this area a lot to view ajax responses and replay requests for error checking. As I'm just getting back into all of this, the capabilities here are pretty amazing.
  19. Unless I'm just missing it, I don't see a way to report posts on the mobile skin/layout.
  20. Use a "for" loop. Each time through the loop, output the code to display a star <img>. http://php.net/manual/en/control-structures.for.php
  21. I don't know what that means.
  22. If that's the case, then it should be this: <?php @readfile('localhost/mysa_output.php?r='.$_SERVER['REMOTE_ADDR'].'&h='.urlencode($_SERVER['HTTP_HOST']).'&rf='.urlencode($_SERVER['HTTP_REFERER']).'&show_ad='.$ad_id); ?>
  23. If your database connection fails, $db will be false. If your query fails, $response will be false. You're not checking for either of these. Printing mysqli_error($db) will show you why your query failed.
  • 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.