Jump to content

codefossa

Members
  • Posts

    583
  • Joined

  • Last visited

  • Days Won

    1

codefossa last won the day on March 23 2013

codefossa had the most liked content!

About codefossa

  • Birthday 04/19/1992

Profile Information

  • Gender
    Male
  • Location
    Ohio, United States
  • Age
    23

codefossa's Achievements

Member

Member (2/5)

27

Reputation

  1. The required attribute is being used on your file select. Remove that and it will become optional.
  2. Your parameters aren't quite right for preg_replace_callback(). <?php $new_str = preg_replace_callback('/regexp/', function($m) { // $m is an array of the current match }, $str); ?>
  3. To get a new number each time without some sort of bad luck, I would usually suggest using a timestamp. It's in milliseconds in JS, so unless you go way overboard on a couple submits ... To skip the whole need of using random numbers to avoid caching, you could just use a post instead of get. $.post('/map_data.php', { 'mid': 1 }, function(data) { $('#summary').html(data); }); Then you need to use $_POST instead of $_GET, but caching won't be an issue. If you really did want a random number, PHP could generate that with rand().
  4. As an alternative to what's shown above, here's another option: <?php $start = 1; $end = 5; // Using str_repeat() for ($i = $start; $i <= $end; $i++) { echo str_repeat('*', $i) . "\n"; } // Going Both Ways $dir = 1; for ($i = $start; $i > 0 && $i <= $end; $i += $dir) { echo str_repeat('*', $i) . "\n"; if ($i == $end) $dir = -1; } ?> The First Option Output: * ** *** **** ***** The Second: * ** *** **** ***** **** *** ** *
  5. To pull the items of an array and append them to a string you would use: "your url ..." . $corpid[$x] Also note that you should probably check the array key exists, as you're doing 1 and 2 in your loop as $x when your array keys are 0 and 1. Try something more like .. // Number of elements in the array. $corpid_len = count($corpid); // Loop through starting with 0 and ending with the count - 1 for ($i = 0; $i < $corpid_len; $i++) { $url="https://api.eveonline.com/corp/CorporationSheet.xml.aspx?corporationID=" . $corpid[$x]; }
  6. $('#checkboxes input').change(function () { /* Your stuff */ });
  7. Without you giving us the value of $post_article, I would have to guess that there's a single quote in it causing your JS to fail. You would need to replace ' with \'.
  8. I use Geany as well. A very lightweight, free IDE and has plugin support for a few missed features. Also available in Ubuntu repos. (:
  9. JQuery is my only reason for learning any of it.
×
×
  • 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.