-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
HOw about a PHP security section?
.josh replied to willpower's topic in PHPFreaks.com Website Feedback
I'm pretty sure this thread was originally posted in the tutorial help section...hence my link to the tutorial. -
HOw about a PHP security section?
.josh replied to willpower's topic in PHPFreaks.com Website Feedback
you mean like...this one? -
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()
-
yeah i knew that. Good call Barand. I was too focused on the whole multiple queries separated by a ; to think about it.
-
Marking the lines and posting the error message usually helps in getting a faster response.
-
[SOLVED] Getting data from a Particular Column and Row in a Table
.josh replied to noirsith's topic in PHP Coding Help
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); -
php does not support multiple queries like that. You need to run each query string individually.
-
Need list of files in a directory containing a string...
.josh replied to tibberous's topic in PHP Coding Help
http://php.net/glob -
[SOLVED] mysql posts "Array" instead of post form value
.josh replied to lilwing's topic in PHP Coding Help
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. -
Okay well then why not just use ******** ?
-
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')";
-
[SOLVED] ($string != 0) evaluates to false? Why?
.josh replied to Laogeodritt's topic in PHP Coding Help
As to why.... http://us.php.net/manual/en/types.comparisons.php#49327 -
Please point in the right direction regarding comment text in a blog
.josh replied to lordvader's topic in PHP Coding Help
Are you wanting like a textarea with a set height like so? <textarea height = '2' width = '20'> asdflkjsafd asdflkjsdflkj asdflkjsfdl sdflkjsadflkj </textarea> -
[SOLVED] MYSQL AND PHP INSERT data into multiple table
.josh replied to ronnie88's topic in PHP Coding Help
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. -
$sess = session_id(); $addtocart = "insert into tbl_cart values ('', '$_POST[product_id]', '1', '$sess',now())";
-
[SOLVED] MYSQL AND PHP INSERT data into multiple table
.josh replied to ronnie88's topic in PHP Coding Help
$result = mysql_query($q,$conn) or trigger_error(mysql_error(), E_ALL); -
[SOLVED] randomly displayed array- how to order?
.josh replied to aabbbiee's topic in PHP Coding Help
before your loop, sort($images) -
Not with php. At least, not the drawing part. You need to do that with javascript or flash.
-
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.
-
viewing source of quote.html shows you have methos = 'post' instead of method = 'post'
-
http://www.phpfreaks.com/tutorial/php-basic-database-handling
-
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.
-
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))
-
.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.
-
select the password from the db, then compare it to md5($_POST['currentpassword'])