Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. trq

    Need Help

    Post your actual code then.
  2. Responding to a request with a static file is almost always more efficient than re-generating a new page dynamically upon each request.
  3. trq

    Need Help

    <?php echo $list_f['username'];?>
  4. trq

    Need Help

    Its never a good idea to code with short tags <? ?> because some servers have this option disabled. Always use <?php ?> Does that answer your question? Fix your problem?
  5. trq

    Need Help

    How should we know? You haven't exactly described your problem well.
  6. I'm really not sure what gave you the idea that that method would be at all efficient.
  7. What exactly is the problem? To see if the username is already in use execute a SELECT query with the username as part of a WHERE clause.
  8. You can't. Think about it. Firstly, there is no such thing as a connection using http, you simply make a request and the server responds. Now, if you where to fool a server into thinking you where using some one else's ip address, where do you think the server would send the response to?
  9. Where is realEscape() defined?
  10. There is no substitute for filter_var, you would need to write it yourself.
  11. function bob2(Bob $obj) { would force $obj to be of type Bob which is in this case what you want.
  12. $B does not exist within your bob2 function, you will need to pass it in as an argument. <?php require_once("bob.php"); $B = new Bob; $B->loud(); function bob2(Bob $obj) { $obj->loud(); } bob2($B); echo "oh noes"; ?>
  13. There are clear descriptions and examples within the link to the manual I already posted.
  14. If the script you want executed is a php script it should contain a shebang line on the very first line. This lets the shell know what program should execute your script. eg; #/usr/bin/php <?php // some php script ?> You can now simply put; 10 * * * * /path/to/your/script.php in your crontab. Otherwise, without the shebang, you need to actually specify what program to use to execute your script within the crontab entry; 10 * * * * /usr/bin/php /path/to/your/script.php
  15. I'll just repeat my last response. You really should look into what Ajax actually is.
  16. So, take a look at the link in the previous reply.
  17. Your registration form should already have an action pointing to a processing script. Within that script you would need to insert a call to the mail function.
  18. You might want to look into what Ajax actually is. It has nothing to do with page element effects.
  19. Is there any particular reason you have chosen to use php to create these dumps? MySql is quite capable of doing this alone.
  20. Your best (and most logical) approach would be to change the DNS records to point to the new server. Otherwise, you could nfs mount the remote directory locally and do it that way but it would slow your site down considerably.
  21. Using jQuery this would be a simple task. A VERY simple example, not tested. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script> $('#thumbs ul li').hover( function() { img = $(this).find('img').attr('src').replace('-thumb', '-full'); $('#stage').html('<img src="' + img + '" />'); }, function() { $('#stage').html(''); } ); </script> </head> <body> <div id="thumbs"> <ul> <li><img src="image1-thumb.jpg" /></li> <li><img src="image2-thumb.jpg" /></li> <li><img src="image3-thumb.jpg" /></li> </ul> </div> <div id="stage"></div> </body> </html> You'll need the images image1-thumb.jpg , image1-full.jpg etc etc
  22. IIS7 has url re-writing abilities, otherwise, you'll need to fork out for a third party isapi filter such as isapi_rewrite3.
  23. The part in cPanel that asks for a remote host would need to be the hostname (or ip address) of the site you wish to allow access to your database. The part in your connection however would need to be the name of the server hosting the database.
  24. The point of functions is to package code into small encapsulated, reusable, callable pieces of code. Globals break 2 of the three things functions set out to do, encapsulation and re-usability. They also (as you are now experiencing) make things very difficult to debug.
  25. With all those globals I'm not sure why your bothering with functions at all. Functions accept parameters, use them.
×
×
  • 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.