Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Everything posted by spiderwell

  1. nice code snippet, mind if i use it?
  2. yeah this is a no brainer, get a domain name that has the company name in it!!
  3. in the WHERE part of the clause you have back ticks on the value of ID, remove those, I assume it is an integer value? WHERE ID = $ID");
  4. even though I tried this already, it seems to have fixed my issue this time round! odd, but at least I can move on! if (html == "1") changed to if (html == 1) I thought it would have handled the return as a string but perhaps not..
  5. yeah i found it easy to use and ideal personally and tie it into php cms often
  6. my flat has a shared washing machine and drier with the other flat in the building. a pound in the machine gets you 1 hour, which is only enough time for the quick wash! the drier is 20pence for 7 minutes lol I got myself to only washing all my stuff in one quick wash once a week, lol.
  7. sure but all it outs puts is 0 or 1. also if i do alert(html) or use .html(html) it puts 1 or 0 into that so I cant work out why javascript isnt executing the if statement correctly. <?php require_once("../../classes/sentry.php"); require_once('../../classes/dbconnector.php'); //create objects for page $connector = new DbConnector(); //create database connection $sentry = new Sentry(); //set up page variables $var_username = ""; //default $var_password = ""; //default if (isset($_POST['username'])) $var_username = $_POST['username']; if (isset($_POST['password'])) $var_password = $_POST['password']; if($sentry->checkLogin($_POST['username'],$_POST['password'],10)) { echo "1"; } else { echo "0"; } I have passed the variables directly to a_login.php in the address bar to check it outputs both 0 and 1, and it does. If i log in correctly i get the message 'The username or password was incorrect 1' the 1 is the html passed back, so in my mind it should be returning the if not the else. if i log in incorrectly i get the message 'The username or password was incorrect 0'. its very annoying!!
  8. i have a login form, thats ajax submitted, and response page spits out 0 or 1 on success or failure (of login) but I cant seem to get the jscript to notice the differnce!!. It always executes the else statement from beow. Any ideas? its driving me mad! var dataString = 'username=' + name + '&password='+password; //alert (dataString);return false; $.ajax({ type: "POST", url: "a/a_login.php", data: dataString, cache: false, success: function(html) { alert(html); if (html == "1") { $('#messagebox').html('Login successful, loading site...'+html); $("#messagebox").fadeIn(800); $('#logincontainer').fadeOut(1500); } else { $('#messagebox').html('The username or password was incorrect'+html); $("#messagebox").fadeIn(800); } }, error: function() { $("#messagebox").show(); $('#messagebox').html('There was an error with the login'); } }); return false;
  9. its a real shame php doesnt have application variables like asp, that would have been ideal for this
  10. from here: http://php.net/manual/en/function.mysql-real-escape-string.php this is probably why you are getting an error
  11. you could do it several ways, one would be to have insert.php check that its been posted to by registration.php and if not, then stop loading. you could use .htaccess file to restrict insert.php
  12. is the shout box open to all, or do you have to be logged in to use it? how are you ercognising a user as banned? by IP address? or attemtepd login? cookiee?
  13. id is the variable name being passed, you could use anything as long as you know what you are using that variable for.
  14. do hackers count?
  15. when you have your login script do you store the userid into the session variable? there must be some mechanism that you use to keep users logged in and identify them. use that to extract your userid.
  16. you wont get it done in php as an onclick/change is a javascript trigger. The best you can do i would say is use javascript to trigger the page to post, then the php page you post to can do the session bit.
  17. Surely you can respond with the appropriate message when they attempt to login?
  18. looks like you answered your own problem there buddy, mark it solved
  19. happy birthday
  20. I'm loving this thread, I plan to try out and check everyones versions later, and heck maybe even try make one my self
  21. rather than save a path in the database, just save the file name and have the path as a site variable/constant. that would be easier to manage I think
  22. I don't mean to sound condescending, but I was a teaching assistant on a first-year university level programming course (Object Oriented Programming and Design). The course load was 7.5 ECTS-credits. I would have expected my students to be able to solve that problem. Indeed the exam was creating a Tron-like game with a GUI and simple AI strategies for computer based players using Java. The only programming course prior to that one was Introduction to Programming, which used functional programming, so the for many students, it was the first time they had to program imperatively. I think perhaps I need to have some education, Ive been scripting for a long time, and can deal with most demands that small to medium datadriven websites would have. I only recently started to do OOP but I have only learnt from books and online resources and forums similar to this one. I would be amazed if I could get this test up and running in an hour or two. Maybe I ought to have a go just to see , also I am off to google factory method! lol I think my biggest downfall is I only really know what I have had to learn, so many things have slipped past me, particularily in theory of programming and structure of code etc. I never forget the day i discovered recursion by accident/necessity, and thought I had found something AMAZING, only for my mate to laugh at me, but way I see it, I can't be that dumb if I managed to create it in the first place without knowing it before!!
  23. The test isn't difficult if you have a solid grasp of OOP fundamentals. Not syntax, but the real fundamentals. The test is asking a few things: 1. Does the person know how to use abstract classes? 2. Does the person know the Factory Method, perhaps the most common creational pattern in use? 3. Can the person use objects in a loop while testing for certain edge cases (the special abilities of each warrior)? OOP is the dominant programming paradigm. That's not a value statement, merely an observation. It's something new developers need to learn if they want to work for someone else. Well I con't have OOP sussed yet, but I have held positions in companies which were definately above junior or entry level and they didn't require any OOP, mind you that said my new role does and i'm learning fast!!!
  24. maybe its me but that seems quite a test for a junior position. I was expecting something more like a form with validation or paging through a dataset. making a simple game I would say is more moderate level than junior. good luck though.
  25. long as no one does what this dumb chick did and sold her forehead for tattoo advert.
×
×
  • 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.