Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. If you wanted to put it into a variable called $foo.... <?php if (isset($_POST['slider'])) { $foo = $_POST['slider']; }
  2. Do you know what startx actually does? Sorry, but if you want to do this, your going to need to do more investigating yourself.
  3. Arrays really are one of the fundamentals you need to understand thoroughly. They are simple, yet very powerful. echo $document[0]['document_name'];
  4. Sorry, I didn't really read the post. Just use the html equivalents &#91; &#93; maybe?
  5. Your still being quite vague so I'll just give you a simple example. foreach ($document as $doc) { echo $doc['id'] . '<br />'; echo $doc['document_name'] . '<br />'; echo $doc['document_ext'] . '<br />'; echo $doc['download_file_name'] . '<br />'; echo $doc['upload_dt'] . '<br />'; }
  6. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=307132.0
  7. Just do what you have done in your example. As long as you stay between the quotes it'll be fine.
  8. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=307126.0
  9. Just to prove the data is actually coming back from php. In this example, the slider sends the numbers 0-26 to php, php now responds with the corresponding letter of the alphabet. <?php if (isset($_POST['slider'])) { @header("Content-type: application/json"); $alpha = range('A','Z'); echo json_encode(array('data' => $alpha[$_POST['slider']])); die(); } else { ?> <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" type="text/css" /> </head> <body> <div id="foo">Data returned from php will show here.</div> <div id="scrollbar"></div> </body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#scrollbar').slider({ value: 0, max: 25, slide: function(event, ui) { $('#scrollbar').slider('value', ui.value); $.ajax({ type: 'post', url: '#', datatype: 'json', data: {'slider': ui.value}, success: function(fromphp) { $('#foo').html(fromphp.data); } }); } }); }); </script> </html> <?php } ?>
  10. And just because I was bored. Here is a complete stand alone working example. <?php if (isset($_POST['slider'])) { @header("Content-type: application/json"); echo json_encode(array('data' => $_POST['slider'])); die(); } else { ?> <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css" type="text/css" /> </head> <body> <div id="foo">Data returned from php will show here.</div> <div id="scrollbar"></div> </body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#scrollbar').slider({ value: 0, slide: function(event, ui) { $('#scrollbar').slider('value', ui.value); $.ajax({ type: 'post', url: '#', datatype: 'json', data: {'slider': ui.value}, success: function(fromphp) { $('#foo').html(fromphp.data); } }); } }); }); </script> </html> <?php } ?>
  11. A simple example using jQuery UI's slider plugin. $(document).ready(function() { $('#scrollbar').slider({ value: center*between, slide: function(event, ui) { $('#scrollbar').slider('value', ui.value); $.ajax({ type: 'post', url: 'yourphpscript.php', data: {slider: ui.value} }); } }); }); yourphpscript.php <?php if (isset($_POST['slider'])) { $variable = $_POST['slider']; }
  12. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=307094.0
  13. Of course it was ignored, your don't use any of the data retrieved from the SELECT.
  14. global variables are a terrible idea for numerous reasons. They should be avoided at all times. Functions accept arguments and can return data, use this instead.
  15. Diving straight into applications such as Drupal & Joomla is probably going to be pretty confusing for a newcomer to programming. You'll probably at least want to build a few apps of your own before trying to pull apart and build on top of other peoples code. While I haven't actually looked at either Drupal or Joomla, I should imagine they are fairly large and complex applications. Drupal isn't really focused on OOP either so I can't imagine it is too well designed. As for comparing these two to Ruby. Ruby is a programming language, Drupal & Joomla are applications written in PHP. Its apples vs cars. There is no way to compare them.
  16. You might want to read the manual entry again then. The optional arguments are explained. Both the second and third arguments are passed by reference meaning they can be accessed again from outside the function. The second arg is an array containing all output produced by the command. the third is the exit status.
  17. Can you post the code between tags so we can actually read it?
  18. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=307054.0
  19. There are examples of this in the manual. date.
  20. Well, use exec then but take a look at the manual and the extra arguments you can provide it.
  21. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=307055.0
  22. Connecting to a database does not retrieve data. You seem to be wrapping your results within another array. Can we see how you are actually creating this array?
  23. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=307058.0
×
×
  • 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.