Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. It's all a multidimensional array except for ["registration_metadata"]["fields"], which is a string you can decode into an object or array (whichever you like more).
  2. m.facebook.com and m.c10r.facebook.com are the exact same thing*. There's no problem there. (And continue using m.facebook.com.) What if you reset the email address? Does the new one work? * For now, and for email addresses.
  3. That may be correct for you but in the general case, and actually I would suspect your case even, that won't work. It'll use the same cache for example.com/file.php as it would example.com/path/to/file.php. The first basename() and rtrim() is totally unnecessary while the second basename() is the problem. You're also not doing any kind of checking on the names provided, like with unsafe characters (there are many which aren't valid for Windows file names) or query strings ("?") or subdirectories ("/").
  4. MySQL's DELETE has a multi-table syntax, but I would still recommend you keep it as it is now. You could do away with the temporary $q and just execute the queries directly though - cuts the number of lines in half.
  5. But /path/to/page will also match your RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)$ /index.php?slug=$1&type=$2&view=$3 [L,PT] It's ambiguous.
  6. You really should be putting quotes around those array keys when they're not inside strings*. You may not see the message but PHP complains every time you do that. As for cleaner code... I don't see much to do. <?php if ($row["PACKAGE"] != 3) { ?> <h3><a href = "<?PHP mrd("$MyProductTitle", "$row[LID]", "$_GET[category]", "$rowxxx[MR]", "index.php?page=detail"); ?>"><?php echo "$row[TITLE]"; ?></a></h3> <?PHP } ?> <?php if ($row["PACKAGE"] != 1) { ?> <?php echo "$row[TITLE]"; ?> <?PHP } ?> <p><?php echo $row["CAPTION"]; ?></p> * Unless you use the {} syntax, then you do.
  7. What code did you try? I'm sure it just needs a small change to make it work. [edit] Actually I can guess. $today will be this very second, not just "today". Everything in $schedule will be the same too: you didn't specify a time so one will get filled in for you. So rather than compare $date with $today, compare date("Y-m-d", $date) with date("Y-m-d", $today).
  8. So example.com?path=this/is/a/path/to/this/&slug=page is the destination URL, and that's supposed to be the result of going to example.com/this/is/a/path/to/this/page Right?
  9. Every directory has a . and .. entry in it, references to the directory itself and its parent directory respectively. readdir() will return every single thing in the directory including those two. Since you generally don't want to see them in a directory listing the condition is there to make sure that the is only echoed if the filename isn't "." or "..".
  10. Please don't troll us. <html> <?php error_reporting(-1); ini_set("display_errors", true); ?> <body> <h1>Today is <?php echo date("Y-m-d"); ?></h1> <p><input type="button" value="<?php echo 'This is a button'; ?>" /></p> <pre> <?php function test_getIndex_Of_Array() { $temp = array(); for ($i = 1; $i < 11; $i++) { $temp[$i - 1] = $i; } $count = sizeof($temp); for ($i = 0; $i < $count; $i++) { echo $i . ' ' . $temp[$i] . '<br>'; } } ////////////////////////////////////////////////////////////////////////////////// function test_ArraySum() { $temp = array(); for ($i = 1; $i < 11; $i++) { $temp[$i - 1] = $i; } $sum = array_sum($temp); echo $sum; } test_getIndex_Of_Array(); ?> </pre> <p><?php echo bin2hex(basename(__FILE__)); ?></p> </body> </html> What does that output?
  11. Do a View Source on that page. Are you sure there isn't a "Connection Failed" message? It would say something like Connection Failed: Unknown MySQL server host '$db_host' (110) The reason for that is that, if I may quote someone,
  12. I'd expect it to be in a "like" associative table.
  13. You mean like the three that are indented way off to the side? Code works for me. I get 0 1<br>1 2<br>2 3<br>3 4<br>4 5<br>5 6<br>6 7<br>7 8<br>8 9<br>9 10<br>55
  14. The URL you're trying is .../dillon_original.jpg&h=54&w=80&zc=2 Something's missing?
  15. Since \p{Common} includes "[characters] that are not part of an identified script" you probably don't want to include that. Otherwise, unless you really want Unicode, [a-z0-9]/i could be just fine.
  16. Whichever is the one you need, the first line is the initialization (happens before the loops) and the second line is the action you do inside that if block. Like $words = array(1,2,3,4); $num = count($words); //The total number of possible combinations $total = pow(2, $num); /* initialization */ //Loop through each possible combination for ($i = 0; $i < $total; $i++) { //For each combination check if each bit is set for ($j = 0; $j < $total; $j++) { //Is bit $j set in $i? if (pow(2, $j) & $i) { echo $words[$j] . ' '; /* action */ } } echo '<br />'; }
  17. I'm thinking either you actually need to store the indices $indices = array(0, 0, 0, 0); // then $indices[$j]++ or you just need the sum of everything $sum = 0; // then $sum += $j to sum the index, $sum++ to count
  18. With the fix I mentioned, yes it does make sense. If $words contained more than just the numbers 1-4, like words or names, then this is basically the easiest way to enumerate all the possible combinations. Actually, considering the output 1 2 1 2 3 1 3 2 3 1 2 3... if you were to, say, hit all of those numbers on the numeric keypad lock on a particular set of cars, you would be able to get in. Except this output is horribly inefficient: there's a significantly shorter list out there.
  19. I believe the answer is "because the code is buggy": $j actually should be counting to $num, not $total.
  20. ...Of course, if the question has nothing to do with URL rewriting and more about having the name of a file in a string...
  21. If you actually have a file named "2-lines-noted-pads-565.php" then just hardcode the number. Then kick yourself for actually having a file named that. Hopefully you have URL rewriting. If that's the case then your rewriting should match that number and pass it to the underlying script. Doing so depends on (cough) what you have right now...
  22. 1. Are you actually using "old.php" and "new.php", or are those placeholders for the real filenames? If so then what are those filenames? 2. Have you tried the banner one yet? Does that work?
  23. Stick the [R] flag back in. What happens now?
  24. mysql_insert_id() by itself will not cause this problem. How about posting the rest of your code, and the real stuff this time?
×
×
  • 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.