Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. 1. information_schema contains a number of tables which you may find useful, such as TABLES. 2. Easiest way would be to use SQL to construct a series of RENAME TABLE statements (also using information_schema). Then run those statements. I mean like SELECT CONCAT("RENAME TABLE `", t.TABLE_SCHEMA, "`.`", t.TABLE_NAME, "` TO `", new name for the table, "`;") FROM information_schema.TABLES... Or perhaps easier would be to make a PHP script to pull the table names and execute a RENAME TABLE for each.
  2. You should also be escaping the strings.
  3. 1. What is your question? 2. Spoiler: you can't do it with just a .
  4. Yep, that would be it. Imagine what the URL looks like: sell-iphone.php?cat=AT&T so $_GET["cat"] = "AT" and $_GET["T"] = something. Does the form have more than the "cat"? If not then just make the form action=sell-iphone.php and method=get then you can <select ... onchange="this.form.submit();"> Otherwise encodeURIComponent can escape the val and make it safe for the URL.
  5. Reformat and install. God knows what's on that laptop.
  6. Keep in mind: you said "largest array element that is less than the value" so that means if you find something larger than or equal to the value then the loop should stop.
  7. The line above that should be $tbl_array[$key] = $value; but that's not the problem. As the error message says, you have an array ($tbl_array[$key]) but fputs() wants a string. So how do you want to handle that conversion?
  8. A binary search would generally be the most efficient, but if you don't already know it then I wouldn't suggest using it. Plus the fact that you have string keys makes it a bit slower and more complicated. Loop through the thresholds array and a] if the value is smaller then then stick the key in some specific variable or b] if the value is not smaller then break out of the loop. After the loop you'll have the correct key and, by looking it up in the array, the largest value.
  9. $type = "MYSQL_BOTH"; The type has to be the actual constant MYSQL_BOTH, not a string containing its name.
  10. Your database system is too old. Find a way to upgrade it or export your existing data to a new instance. FYI current version is 5.5 but anything 5.x is good enough.
  11. echo md5("apple\r");
  12. All the... the things. The number+letter bits. The pieces of time. preg_match_all('/(\d+(?:\.\d*)?)(\D)/', "10m 10.5s", $matches, PREG_SET_ORDER) && print_r($matches); Array ( [0] => Array ( [0] => 10m [1] => 10 [2] => m ) [1] => Array ( [0] => 10.5s [1] => 10.5 [2] => s ) )
  13. And level 3->4? It can't be 750*1.5=1125 XP (total 2375 XP). How about 4->5?
  14. ...Dude. Posting the same thing three times in one post doesn't make it three times easier to understand. I/We can run the math for you. Give us a couple data points to start with, such as "Level 1->2 is 1000 points" or "You hit level 100 as you reach 1M XP" or "Level 99->100 is 100K points", if you would rather a straight line (each level is the amount it took for the previous level + some fixed amount), or three data points if you want a curve (same amount as the previous level + some amount which increases as you gain levels). [edit] I may totally be overthinking this though. I'm just excited for a chance to do some math.
  15. Turn off the magic_quotes php.ini setting, and make sure you're safe against SQL injection.
  16. Could just do a preg_match_all() on /(\d+(?:\.\d*)?)(\D)/ (to grab all the $1=number $2=interval)
  17. You'd have to store the file somewhere temporarily and include something in the form which indicates to use that file (unless the user wants to upload a different file). Of course if the file itself causes an error then you wouldn't want to bother with this.
  18. That's fine - as simple as it gets.
  19. Using header() to redirect will not stop your script. It will keep on running. If that second condition also happened to match then the redirect to login.php will be overwritten with noaccess.php. Always exit; right after you send the header(). [edit] Also, does your logout process trash the entire session or just the forteid? It should get rid of everything.
  20. foreach($a as $b) [edit] It's the smiley. Hit the "disable emoticons" option in the full editor.
  21. Construct the string in three parts: $message = everything up until the foreach, then $message .= stuff inside the loop, then finally $message .= the stuff after the foreach.
  22. [edit] Ooh, nicely done Pikachu.
  23. And there's the problem. Get your host to upgrade to version
  24. If you don't mind people actually being redirected to domain.com/application/subdomain.php then you can do that: create a .htaccess in the domain.com/subdomain folder with Redirect permanent / http://www.domain.com/application/subdomain.php Otherwise if the URL has to still show the subdomain then in that same .htaccess try RewriteEngine on RewriteRule ^ /full/path/to/domain.com/application/subdomain.php%{REQUEST_URI} [L] # if that doesn't work then try without the ${REQUEST_URI} ...and if that doesn't work either then I'm not sure. I don't think [PT] will help because the target isn't a URL, can't use Alias in a .htaccess... Might have to find some way to force the PATH_INFO variable. [edit] All this assumes that CI won't muck around with the URL, like change the hostname or automatically include "/application/subdomain.php" or something equally fatal.
×
×
  • 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.