Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Well, the second way is invalid unless you have a constant defined called mydata.
  2. Do you have register_globals switched on?
  3. You have posted way to much code for me to be bothered looking at. I'll tell you now though, pages do not refresh by themselves.
  4. This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=316064.0
  5. Your trying to add a class to the #content div, what you want is.... $('a').click(function() { $('#content').load('mods/' + $(this).attr('id') + '.php') $(this).addClass('active'); }); $(this) refers to the item clicked. You really should read some basic jQuery tutorials if your going to start using it. its a VERY simple framework, that can be very powerful once you understand how it works.
  6. [ot] stynx: session_register() has been deprecated for about 7 years [/ot]
  7. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=316053.0
  8. You can move your protected files outside of the document root so they are not accessible via the web, then easily created a php page that will serv them from there.
  9. This has what to do with installing php?
  10. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316029.0
  11. http://ajaxim.com is something I've had a fair amount of success with.
  12. Your missing the closing }); from your code. $(document).ready(function() { $('a').click(function() { $('#content').load('mods/' + $(this).attr('id') + '.php'); }); Should be.... $(document).ready(function() { $('a').click(function() { $('#content').load('mods/' + $(this).attr('id') + '.php'); }); });
  13. Indeed you should. $('#content').load('mods/' + $(this).attr('id') + '.php'); Does that make things clearer?
  14. Your id's don't have hashes in them so there is no need for the replace. Your also missing a ' around the '.php' string. $('#content').load($(this).attr('id')+'.php');
  15. The idea is quite simple. <!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>Example</title> </head> <body> <section id=links> <a href=#foo>foo</a> <a href=#bar>bar</a> <a href=#bob>bob</a> </section> <section id=stage></section> </body> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function() { $('a').click(function() { $('#stage').load($(this).attr('href').replace(/#//)+'.html); }); }); </html> When you click on the link pointing to #foo, the file foo.html will be loaded into the 'stage' section. See jQuery's load() for more info.
  16. The code I posted along with the rewrite rules you posted should allow what your after.
  17. Can we see the relevant code then?
  18. Your question isn't any longer mod_rewrite related. All you need do is (within profile.php) look up the users profile data by this custom URL the user has picked. eg; if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $sql = "SELECT userdetails FROM users WHERE custom_id = '$id'"; // now execute your query and make the page from the data provided. }
  19. Your only logging in 1 user, you do not need a loop to get 1 result. I would assume your DATABASE object's doit() method isn't static either. We need to see more code. Your might want to take a look at how classes actually work in php, you seem quite off track.
  20. This... USERS::login($username, $password); Should be.... $user = new USERS; $user->login($username, $password); For starters. Your login() function also uses a while loop that is required.
  21. I suppose I wasn't very constructive, where to start? The db class is pretty well empty, I'll just ignore that. There are plenty of database abstraction classes around so I would bother writing your own. The DatabaseControl object to me looks like it should be split into Validation and Error Handling of sorts. You should take a look at how exceptions work within php. As for the User class, it is not, and should not be a type of Database (which is what happens when you extend a base class). The methods findUser() and addUser() also do not belong to a User class, they belong in a UserManager class or similar. Its not a User's job to add more Users. Does this help at all?
  22. Impossible to help you without it. Also, you haven't actually asked any question. Do you have one?
  23. Where? It does not provide any abstraction. Validation has nothing to do with a database, and simply echoing the error (html and all) from within your objects provides no flexibility whatsoever. Your checkMaxCharacters() method provides NO way of setting what the max chars are. Perfect code re-use? Nothing is duplicated now maybe, but most of this code would need to be rewritten before it would be re-usable. This does what? I can understand that you yourself are likely pretty proud of your effort and you should be. It doesn't necessarily mean its well designed though.
  24. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=315887.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.