Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Have you tried checking $this->DB->error() ?
  2. Then you don't need them.
  3. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=339861.0
  4. You would echo the JavaScript out just as you would normally echo out html.
  5. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=339884.0
  6. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=339780.0
  7. Do you understand what json is?
  8. JavaScript is server side so why not take a look?
  9. If you want them in an array just put them in an array in the first place.
  10. json_encode is a php function. Most Javascript libraries (if your using one) come with some json manipulation functions. Otherwise, json is just simple JavaScript objects within a string.
  11. I still don't think it's necessary to have the entire Javascript stored in a database. You could just as easily store just the data.
  12. return exits the function where it is. You'll need to build a string (saving it into a variable) then return that once your have all the data. Looking at your code, I have to ask.... why the hell are you storing JavaScript in your database?
  13. Yes and yes. Give it a try.
  14. Instead of printing the string within your function just return it.
  15. Constants do not interpolate within a string.
  16. You can easily make a JavaScript function overwrite itself: var foo = function() { alert('say foo'); foo = function() { alert('never again say foo'); } } foo(); foo(); foo(); The first time you call foo() it will display 'say foo', every other call after that will display 'never again say foo'.
  17. You can send arrays through post and get using a syntax such as: <input type="text" name="foo[]" /> <input type="text" name="foo[]" /> <input type="text" name="foo[]" /> The value of the fields would show up as an array within the $_GET or $_POST arrays depending on your forms method. Yes, you can send it as json then use php's json_decode to turn it into a php array. As for the rest of your question. It sound more like your stuck with how to format the JavaScript to send to PHP. This is a JavaScript issue and doesn't belong in this board.
  18. Variables do not need to be surrounded by quotes. The error means that $arr_read_messages is not an array.
  19. $this refers to the current object. So, if $this->cusomlib works within your controller then customlib is a property of the controller. I'm not a codeignitor user but I suggest you take a look at how to create view helpers if you want access to your functionality from within the view.
  20. Functions should not rely on global vars. You should pass the value into the function: function foo($name){ echo $name; } foo($_SESSION['ex_name']);
  21. Yeah, this looks like a bug in SMF.
×
×
  • 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.