Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. $code = mysql_real_escape_string($code); mysql_query("INSERT INTO paybutton (code) VALUES ('$code')")or die(mysql_error());
  2. It is an awesome framework. I don't do much without it anymore.
  3. You might want to look into mod_rewrite. Its an Apache module for rewriting urls. http://modrewrite.com/
  4. jQuery is a popular Javascript framework (See http://jquery.com). It uses $ to refer to the jQuery object which in turn provides all of jQuery's functionality. var foo = $('#foo'); The variable foo would now hold a reference to the element with an id of 'foo' wrapped within a jQuery object. This allows you to easily use jQueries methods on said element. eg; var foo = $('#foo'); foo.click(function() { alert('You clicked the foo element'); }); Where 'click' is a method of the jQuery object.
  5. Nope, in this case (as I said) it is the jQuery object.
  6. Why? The method you are using is much better as it allows you to keep your javascript separate from your markup. Nothing in particular. $ is just another variable. In this case it looks like it is the jQuery framework.
  7. htmlentities.
  8. And you can't see that?
  9. In terms of a login page, it would be both (Ajax) client-side and server-side. http://www.jformer.com is a nice little jQuery based lib that Ive been using a little lately which has been nice. There's not much documentation around but the examples are good enough.
  10. fopen, fwrite & fclose are used to create files. As for forcing a download, there is a simple example in our FAQ/Code snippet repository board.
  11. Do you know php and Javascript? Where exactly are you stuck?
  12. This is a terrible way of executing queries because you have no checks in place to see if they actually succeed. In fact, writing code like that leaves no opportunity to fit a check in. At minimum a SELECT statement should be executed something like.... $sql = "SELECT * FROM forum_question WHERE id='$delete'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { // $result is now safe to use in here. } else { // no results where found, handle the error } } else { // your query failed, handle the error }
  13. Yes, $fet will need to be passed to mysql_fetch_object. Its not the only error though. You really should check your queries actually execute before continuing. The second SELECT statement will fail, its missing any WHERE clause. It should be combined with the first one anyway for efficiencies sake.
  14. Its easy enough to make. function do_something($var) { echo "This is $var within do_something()"; } function call($arg, $callback) { if (function_exists($callback)) { $callback($arg); } } call('Hello', 'do_something'); I'm kinda missing the point though. There are likely better ways to approach this if you tell us what your actually trying to do.
  15. Store your query within a variable and then echo it, its the easiest way to debug these issues.
  16. $fet is a result resource, your treating as though it where an object.
  17. Doesn't this somehow indicate that you actually don't know enough of the right material to get through the course?
  18. Where are you stuck exactly?
  19. Set error_reporting to E_ALL and make sure you have display errors on. Obviously your call to require_once is failing and your error reporting is set to low to see any helpful information.
  20. This completely depends upon how your host has configured php. If it has been installed as an Apache module you cannot use a local php.ini, if its CGI you may be able to. Generally though, the php.ini is controlled & maintained by your server administrator.
  21. Javascript executes on the client while php executes on the server. They have little to do with each other and php's settings have no effect on Javascript at all.
  22. Um, functions declared within a class in php are called methods. I hope this clears things up on your end.
  23. What exactly are you having trouble with? The command itself? Or how to execute the php script?
  24. Methods are functions that belong to a class or object.
×
×
  • 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.