Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. I'm pretty sure this thread was originally posted in the tutorial help section...hence my link to the tutorial.
  2. you mean like...this one?
  3. actually md5() isn't really considered secure anymore, as there are tons of hash tables out there that people can use to just brute force the password. You should at least use a salted sha1()
  4. yeah i knew that. Good call Barand. I was too focused on the whole multiple queries separated by a ; to think about it.
  5. Marking the lines and posting the error message usually helps in getting a faster response.
  6. Yes, you can do that with mysql_result(). You can either do a blanket $sql = "select * from table"; $result = mysql_query($sql); $row = 0; // row 1 cuz it starts at 0 $col = 1; // col 2 cuz it starts at 0 $val = mysql_result($result, $row, $col); But that's not really very efficient unless you're wanting to be able to grab multiple pieces of data and the "x,y coords" are variable. If you're looking for retrieving just 1 cell in a table, you should write your query string to return only that cell to begin with. Example: tNames id name 0 John 1 Mary 2 Jane 3 Mike $sql = "select name from tNames where id = 1"; $result = mysql_query($sql); $name = mysql_result($result, 0, 0);
  7. php does not support multiple queries like that. You need to run each query string individually.
  8. since username is a radio button, you're only going to have one checked in your form, so there's no reason to make name = 'username[]' an array. just make it name = 'username' and it will post to $_POST['username'] like all your other vars.
  9. Okay well then why not just use ******** ?
  10. No you would still use one query string with all your columns/values. And unless your table is named "table" your table name needs to go where 'table' is in your query. And you're using the same column name in every single one of those query strings there... just use your original query string except with your sanitized vars instead of the posted vars. $sql="INSERT INTO clients (client_fname, client_lname, client_address, client_city, client_state, client_zipcode, client_phone, client_cphone, client_email, client_website, client_notes) VALUES('$client_fname','$client_lname','$client_address','$client_city','$client_state','$client_zipcode','$client_phone','$client_cphone','$client_email','$client_website','$client_notes')";
  11. As to why.... http://us.php.net/manual/en/types.comparisons.php#49327
  12. Are you wanting like a textarea with a set height like so? <textarea height = '2' width = '20'> asdflkjsafd asdflkjsdflkj asdflkjsfdl sdflkjsadflkj </textarea>
  13. Okay I think I know what the problem is. function addNewUser($username, $password){ global $conn; $q = "INSERT INTO users VALUES ('$username', '$password')"; return mysql_query($q,$conn); $q = "INSERT INTO virtuala VALUES ('$username')"; return mysql_query($q,$conn); } When you do your first return, php ignores the rest of the code in the function, so your 2nd query is never getting executed.
  14. $sess = session_id(); $addtocart = "insert into tbl_cart values ('', '$_POST[product_id]', '1', '$sess',now())";
  15. $result = mysql_query($q,$conn) or trigger_error(mysql_error(), E_ALL);
  16. before your loop, sort($images)
  17. Not with php. At least, not the drawing part. You need to do that with javascript or flash.
  18. Well there are a ton of regular tutorials for flash and actionscript in general, how to achieve effects, etc... I mean if you're looking for tutorials in actual game design...well that's not really flash dependent; I'd be looking in other places besides a flash site... I mean, that's kind of like wanting to make a game in php so you go to php sites looking for how to make a game. Well php is just a language. That's not really the important part. It's just the medium.
  19. viewing source of quote.html shows you have methos = 'post' instead of method = 'post'
  20. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  21. GIGO. Nothin' personal. p.s.- You did not say anything about what your website did, only that you decided to test how fast it did whatever it is it did.
  22. It works the way it's supposed to. 0 is a valid number so you're setting the limit to 0 and therefore no results are being returned. if(!empty($_GET['limit']) && is_numeric($_GET['limit']) && ($_GET['limit'] > 0))
  23. .05-.08s is pretty fast. But does that mean your code is optimal? There's no way we can tell you if .05-.08s is good for your script or not, seeing as how we don't know how long your script is or what it's doing. And it would probably be easier for people to help you out if you provided a link to the thread/post concerning the log. I mean well, helpful for me, anyways. My crystal ball cracked last week and it's still in the shop.
  24. select the password from the db, then compare it to md5($_POST['currentpassword'])
×
×
  • 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.