Jump to content

F1Fan

Members
  • Posts

    1,182
  • Joined

  • Last visited

Everything posted by F1Fan

  1. Then I don't understand what you're trying to do. Could you explain a little more? Show you're existing code then what the unwanted results are. Don't display any code that you're not already using.
  2. What's wrong with this? $array[] = $level;
  3. Change the event from "onclick" on each option to "onchange" in the select tag. Then use "this.value" to determine the selected value. Also, this is JavaScript, not PHP, so it really should have been posted in the JS board, and you should move this to a function to have better control over it.
  4. Is this in a loop or something? All I know to tell you is that you can just add "?someVariableName=someVariableValue" to the end of the "somepage.php" to pass variables to the new page.
  5. I have no idea what code you're talking about. Something to do with the query string?
  6. I know nothing about cakephp, but did you try what I posted?
  7. Well, I don't recognize what you're using to create that $html object, but looking at the code you listed makes me think you may be able to do something like this: echo $html->image('icons/new.png', array( 'alt'=>'New Product Icon', 'width'=>$logo_size[0], 'height'=>$logo_size[1], 'border'=>'0', 'onclick'=>'window.location=\'somepage.php\'', 'style'=>'cursor:pointer;', 'class'=>'ProductLogo'));
  8. Put that form in a div, hide the div using style="display:none;" and give it an ID, let's say dialogForm. Then just do this: $(document).ready(function() { $('#opener').click(function() { $('#dialogForm').dialog('open'); }); }); Also, it sounds like you are still missing some jQuery files. Are you getting any JS errors?
  9. As for it being flat, it sounds like you aren't pointing to the proper jQuery file. About the documentation, it is very good for showing you how to make the modal dialog. What are you having trouble with? How to handle the form? Ajax?
  10. Here's what you're looking for: http://jqueryui.com/demos/dialog/#modal
  11. Well, you certainly could just put every table into one DB. But, there are a few advantages to splitting them up. First: organization. If you're the type of person that organizes your files into folders, it's the same principle. Second: security. If something happened and a hacker managed to inject some SQL into your code somewhere, if you have your tables is several different DBs, they will only be able to affect ones in that one DB.
  12. You'll have to post your PHP code for us to answer that. What are you doing with the data? Inserting into a DB or what?
  13. ignace is right, you can't rely on JS, nor can you rely on readonly. However, if you use the method I suggested, it would at least make it more difficult, and less obvious, for users to circumvent it. I won't be able to help any further without seeing some code.
  14. You could use JavaScript, but why are you using a textarea for this? Why not use a span to display the data, and a hidden input if you need to pass the data through a form?
  15. You actually don't need to use Ajax for this. You can use fairly simple JS. Just create a JS function that changes the source of the left image. Then, when you load the page, and the thumbnails on the right, just pass the large image source into that JS function with an onclick event.
  16. I need to do more teaching, and less doing!
  17. $output= mysql_query(select count(*) from email_subscriptions); $row = mysql_fetch_row($output); echo "Join " . $row[0] . " other users on our mailing list";
  18. Lucky! That pic is one I took at the 2002 USGP. I also went to the most recent USGP at Indy with a few buddies. Lot's of fun!
  19. $array = array(); foreach (explode("\r\n", $mystring) as $string){ if (!empty($string)){ $array[] = trim($string); } } echo implode(', ', $array);
  20. Post your code for the page that is to be in the iframe. There should be something on that page that will have a height that you can extract to then assign to the iframe's height. If there isn't one, maybe one can be created.
  21. I struggled with this one for a long time before discovering the ridiculously simple solution. Here it is: Rather than using the same Ajax object over and over, just create a new one within your JS function. So, here's an example where one object is used over and over, and cannot handle multiple simultaneous requests: function getHTTPObject() { var xmlhttp; if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject(); function doSomeStuff(){ // use the http object to do Ajax stuff here... } Here's the above code changed to allow multiple simultaneous requests: function getHTTPObject() { var xmlhttp; if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } function doSomeStuff(){ var http = getHTTPObject(); // use the http object to do Ajax stuff here... } Notice that all I did was move the creation of the http object to inside the function, making it a private variable. Just do that within each function that you use the object, and you should be set. One note, however; If users will be on this page for long periods of time, there is a possibility that all the objects may start taking up too much memory. If that becomes an issue, and if there are only ever, say 3 events that may occur at the same time, then globally create 3 events, one for each use. Then, you'll only ever have 3 objects created, but it will still allow simultaneous calls.
  22. I have no idea why you're using session variables, so I'm ignoring that. $query = "INSERT INTO table (service, tracker) VALUES "; $inserts = array(); for ($i = 1; $i <= 24; $i++){ if (isset($_POST['service_'.$i])){ $inserts[] = "('service_$i', '".$_POST['service_'.$i]."')"; } } if (count($inserts) > 0){ $query .= implode(', ', $inserts); $result = mysql_query($query) or die(mysql_error()); } else{ echo "Nothing checked!"; }
  23. Post your code. Also, what type of SQL are you using? There are several ways you could do this, but your code will help narrow down what will work, and what will be best.
  24. Oh, you want to to that for every column? Then, yes, I suppose that would work. There may still be a way to do that in SQL.
  25. <?php $allRows = array(); $result = mysql_query("SELECT image_link FROM adverts ORDER BY RAND()",$connection); while($row = mysql_fetch_array($result)){ $allRows[] = $row; } // Now you can use $allRows with the pagination class ?>
×
×
  • 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.