Jump to content

dabaR

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by dabaR

  1. Funkeh! $type = $_GET['type']; if ('team' == $type) { $team = $_GET['team']; $stats = get_team_stats($team); display_team_stats($stats); } elseif ('player' == $type) { $player = $_GET['player']; $stats = get_player_stats($player); display_player_stats($stats); } else { die('You can only look up stats for a team or a player'); } function get_team_stats($team_name) { //somehow get the stats, make sure you use mysql_real_escape_string() on the $team_name, otherwise people can erase all your data, reference http://en.wikipedia.org/wiki/SQL_injection } function get_player_stats($player_name) { //get the stats for the player, again use mysql_real_escape_string() on $player_name for same reason as above } function display_team_stats($stats) { //turn the stats array into HTML } function display_player_stats($stats) { //turn the stats array into HTML }
  2. This guy wrote it already. This is only if you want to use AJAX for your form, which I am pretty sure you don't since it will increase complexity. Just make it work, then make it fancy later. http://www.developertutorials.com/tutorials/ajax/getting-started-with-ajax-in-jquery-8-05-11/page1.html There are also page2, page3, 4, 5 of that tutorial, linked in the "Tutorial pages" section
  3. I don't think you understand what a switch is for, based on your code. What functionality are you trying to implement?
  4. You mean like a "Welcome dabaR" div? Unless you are doing AJAX, you would in your PHP have a if ($logged_in) { show_div(); }
  5. Yes, it is possible, write it out, and if it does not work, post again. BTW, switch($team) { case "$team": is like saying "if (true) { ... }"
  6. It works just fine in my Firefox 3.6.3 on Ubuntu.
  7. Find out which server is running the web server (usually 'nobody' or 'www-data'), and which user is the owner of the directory where you are creating a/b/c/d. If they are not the same, that is your problem.
  8. Oh, OK. Yes that is what you want then. You can read php.net/in_array if you need more examples.
  9. $series_ids = db_query("SELECT id FROM series"); foreach ($series_ids as $series_id) { $images_for_series = db_query("SELECT image_something FROM images WHERE series_id = " . db_quote($series_id)); $random_image_from_series = array_rand($images_for_series); do_something($random_image_from_series); } Hope that helps!
  10. You mean like this if(in_array($recordData['zip'], array(1, 2, 3))) { ... } ?
  11. From http://ca2.php.net/chmod Do you know how to check for this? Do you have full control over this server, or is this a hosting company's server?
  12. Great. What does your nickname stand for? PM if you don't want EVERYONE to know
  13. I always thought it stood for Send Mail To People
  14. I would just like to add that SwiftMailer is not hard to use, well-documented, robust enough to meet pretty much anyone's needs, and can of course send attachments.
  15. Sorry, I don't understand. Are you saying that it does not save a value when a value is provided?
  16. I suggest using SwiftMailer: http://swiftmailer.org/docs/sending-quickref
  17. Oh, well... You can't pick how you are going to use the autosuggest() call. It says to give it 2 parameters, one for the field id, other for the thing that will be populated with possible results. <h1>Search with Auto Suggest</h1> <input name="fieldid-1" id="fieldid-1" type="text" onkeyup="javascript:autosuggest('fieldid-1','resultsid-1')"/> <div id="resultsid-1" class="results"></div> All you do is make a copy of that, with fieldid-2 and resultsid-2, should be pretty straightforward.
  18. You should include jQuery http://jquery.com/ and give all the checkboxes you want auto-checked a class="auto-check", and the "check all" checkbox an onclick="$('.auto-check').each(function(index) { this.attr('checked','checked');});" event. Some references: http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/toggle-multiple-checkboxes-with-jquery-7 , http://api.jquery.com/each/
  19. write a loop that sleeps http://ca2.php.net/sleep for a few seconds and loops until file exists http://ca2.php.net/manual/en/function.file-exists.php and prints out how many times it looped. Or something. Maybe the jpeg creation function just takes that long. :-/
  20. You can usually extract the <style>...</style> into a CSS file, then include it with the <link ... /> tag. Same for javascript, just take the "..." from <script>...</script> and place into separate file, which you then include with <script src="file.js"></script>.
  21. I still think my solution will work, did you give it a shot?
  22. Hi there. Maybe you can try building on one of the examples here: http://php.net/manual/en/function.imagejpeg.php They seem to have some memory freeing thing at the end.
  23. I'd try var prev_track; on the top, then just prev_track= data.prev_track; later in the anon. function.
  24. What? I mentioned all the problems with the SVG output in my first post.
×
×
  • 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.