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. You are missing the period for $.getJSON(). If that's not your issue, you should check your JS console to see if you're failing to parse the return. Maybe output the return in your console and see what that is. You can just do a $.get() and $.parseJSON() if you want to be able to output the data as well as parse it.
  9. You just need something to tell which should show / hide. You can use the value in your above example and have that be the value of a parameter on the other selects. When onchange triggers, you can hide them all then show the one(s) you want. https://jsfiddle.net/aLkz2aw1/
  10. https://jsfiddle.net/xvfp1nqL/ You can just use the .hover() function in jQuery. You can also set an attribute like data-bg if you want to set a different background for each element you're hovering. You would have something like ... https://jsfiddle.net/xvfp1nqL/1/
  11. It looks like the only thing you're missing is getting the value of the input, or I'm missing what the question actually is? Here's what I think you're wanting. https://jsfiddle.net/bme5ahjs/
  12. Your ID for 'targettemp' has a space at the end causing your JS selector to fail.
  13. http://jsfiddle.net/y3j81fr0/ You can change the input type to text to see it happen. Just setting the value to: (new Date()).getTime()
  14. Add some PHP to the top of your page setting the header to not cache the page. <?php header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> Or if you must use plain HTML. <meta http-equiv="expires" content="Sun, 01 Jan 2014 00:00:00 GMT"/> <meta http-equiv="pragma" content="no-cache" />
  15. That should work fine. // http://jsfiddle.net/qcr1qws4/ var first = "Thomas"; var second = "Jack"; if (first == second) alert("Same Name"); if (first == "Thomas") alert("First person's name is Thomas.");
×
×
  • 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.