Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. oh just the error case. did you look in firebug to see if the sql was in the response? or another option i used when testing ajax scripts was to just use mail() and mail myself debug code.
  2. great post guys. thanks for the info. i checked out codeigniter before but just didn't have the time to learn it. i'll take a look a kahana too.
  3. not exactly sure why you would get a js error. what is the error? the sql should just show in the response with the 0 or 1. you might want to test your login script without ajax first to make sure it works properly.
  4. ok I have to ask. Why are you passing "<span id=phone_numberDISP></span>" as a variable?? if you want to just pass a ten digit phone number why are you passing that span tag? if you really need to pass it then use this: <a href="http://mywebsite.com?phone=<? echo url_encode("<span id=phone_numberDISP></span>"); ?>" target="_blank" > CLICK HERE </a> then use $phone = url_decode($_GET['phone']); to decode it.
  5. this may or may not fix the issue. if ($num_rows == '1') mysql_num_rows returns an int and your are checking against a string. php may understand what you're trying to do and do the conversion for you but for good coding practise, you should do: if ($num_rows == 1)
  6. put a echo $sql; after your $sql definition then check the response to see what it looks like. run it in phpmyadmin or mysql query browser if you have it to see if the result set looks right.
  7. if your passing that as a variable you probably want to url_encode() it then decode it on the other end.
  8. Open up Firebug and go to the console (console must be open before you load the page) and it will show you the ajax calls. Click on the ajax URL in the console and it will show you the response. Let us know what it's returning.
  9. mysql_query returns a results set. from that you need to get the rows from the result set. $query = "select Name, from CES"; $results = mysql_query($query); while($row = mysql_fetch_array($results)) { echo "<option value=\"" . $row[server] . "\">" . $row[NAME] . "</option>"; }
  10. you can try upping the memory of PHP: ini_set('memory_limit','32M');
  11. can you post your code? basically set a success variable when you process your post data. now when you get to your html output, check that success value. if it's true, show a success message and if it's false show the form again.
  12. you php script uses "username" and "pwid": $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string(md5($_POST['pwid'])); So you need to changed your Ajax variables to reflect that.
  13. good catch. can't believe i missed that. that's likely the problem.
  14. did you check the ajax response to make sure? in your success just add: alert(data); or can use Safari Web Inspector or Firebug in Firefox.
  15. ok so for queries where you are using both fields in the where clause, it would be faster to have one index on both fields compared to one indexes on each field? All of our tables are MyISAM.
  16. echo out your query and check for an sql error.
  17. i would stay away from a flat file username/password system. if your user base grows, trying to authenticate will get really slow. either way, don't store your password as plain text. generate them a new password which they can change or give them a link to reset their password.
  18. yea anyone good with pattern matching could make a good pattern for it but the pattern matching syntax never set in for me.
  19. here is what i normally do for password resets: -user submits username -generate a hash code and update their account record with the hash -send that user an email with a reset password link that has their account and hash code in it -click the link. it verifies the username with the hash code and lets them reset their password -once the password is reset remove the hash code from their account so the link no longer works you could set up a timestamp as well so the link is only good for 24hrs or whatever. this system should be pretty solid.
  20. this would be easy with preg_match but my patterns suck so i would just do: $first_occurance = strpos($post,"[special]"); $special_code = substr($post,$first_occurance+9,2);
  21. instead of using mysql_affected_rows() just put the result of mysql_query in the if statement. From the manual for mysql_query:
  22. echo out your query to make sure it looks ok and echo mysql_affected_rows() to see actually how many rows were effected.
  23. when you use mysql_result you need to put the field name in quotes. $category = mysql_result($cat_results, $i, "cat_name"); that is likely your problem.
  24. np and thanks for checking the website =)
×
×
  • 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.