
Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Can you show me an example of how you can do this? Where you can tell the difference between a mismatched password and a user not existing, and only do one query?
-
Why would you need to SQL selects? You simply encrypt the password before running any query and then compare that with the one in the database. There's no need for any second SQL select. I used the wrong word then, Query not select. You're still hitting the DB.
-
I'm just curious what problem you think there would be with loading an encyrpted password (I'm talking a one way hash). There's many ways you can do a login, but if you're not pulling out the password you have to do at minimum 2 SQL selects (unless of course you don't want to differentiate between user not found, and user/password mismatch, which you might but users would hate). If you pull it you can limit it to one. Obviously 1 query doesn't make a huge difference but it just seems easier to me then selecting for the username, then selecting for a match on username and password. If it's encyrpted, why does it matter?
-
If you have your passwords encrypted, sure there is. To compare against the encrypted version of the submitted password. Because we KNOW you're not storing passwords plain text, right?
-
I also prefer the second way, and I find it easier to match. I think it just depends on what you first saw when learning.
-
You'll probably want to use a templating system, I like Smarty, and tokens. This is a complex project, but google can help you find many tutorials.
-
What I would do in your situation is create a step by step tutorial for how he can resize his images using something free like Piknik, and give him that.
-
The immediate problem is you never run that query, you just assign it to a string value. You will need to add in a lot of error checking and data sanitation as well but that's the first problem, you never run it.
-
Ever been entering your phone number into 3 text fields, and the focus moves to the next one after 3 digits? I believe to do this you use javascript to set which element has focus. Unless you're talking about the mouse pointer, not the text cursor.
-
the project I was working on required the user to be logged in, perhaps that was why I had to use cURL. Thanks for the correction.
-
Ah I may have been incorrect on the first point then. I know cURL is the functionality you SHOULD use for this. Anyway it seems like the problem at this point is your preg_match and I fail at regex. Hope someone else can help, sorry.
-
Curl!! You need curl.
-
file_get_contents does not work that way, it's only for files on your server. try printing $content to the screen to see what you get. What you're trying to do will need a function which my mind has completely blanked on now, but I have used in the past...and it's driving me nuts that I can't recall the term for it. Hopefully someone else knows the functionality I'm thinking off... grrr.
-
ph mysql - help with do/while and incrementing index
Jessica replied to azukah's topic in PHP Coding Help
Your example will still print each image twice, as he described in the original problem. OP, can you post your new code to demonstrate the solution? -
ph mysql - help with do/while and incrementing index
Jessica replied to azukah's topic in PHP Coding Help
In the above example, I don't see $row ever defined. It is not going to be easy to do it while you're selecting the data, you want to select the data then loop through it. -
ph mysql - help with do/while and incrementing index
Jessica replied to azukah's topic in PHP Coding Help
For each result, you are outputting that result and the next one. You are also being redundant with the do/while loop, you end up selecting the data multiple times. You will want to get all of the results into an array *(you've already done that) and then loop through it (using for), that way you can increment the iterator manually. You could also use foreach but it might be trickier given what you're trying to do. -
You're welcome!
-
Yes. And it needs to be able to connect to MySQL to do so. If that page doesn't know your MySQL username and password, how would MySQL trust it?
-
*headdesk*. I feel sort of justified in my question now. good luck.
-
Are you asking me if I saved and uploaded the file? Really? No, you're imagining it. Why do YOU think if you comment out a section of code it would still execute?
-
Is that the entire code? Did you remember to save and upload it if you need to do so?
-
After $accounts = loadAccounts(); add this line: print_r($accounts); What do you get?
-
Did you mean to mark this as solved? The error is occurring because that is not a valid key for $_POST. At the top of your page try adding print_r($_POST) and seeing what that array contains.
-
There's no PHP function inside your string. You have a MySQL function COUNT, but no PHP functions.
-
Sessions will end when you close the browser, that is the nature of a session. You'll want to store the information in a database on your server.