Okay, I've only been out of the conversation for a little over an hour and already have a lot of catching up to do. Apologies in advance for the length of this post...
code-a;10997260 wrote:You may very well be asked for a snail mail addy so I can send you some delicious home made organic thank yous.
A verbal (well, I guess 'written' since I probably won't hear you from where I live) 'thank-you' is quite enough, especially considering that posting personal details isn't allowed on the forums (for better or worse, unfortunately).
code-a;10997260 wrote:Luckily I am not concerned about safety just yet, as much as making this work, but as soon as it works, that will be directly my next mission is securing everything tight.
Be careful with that mindset; I can't count the number of times I've heard promises of "Oh we'll work that in at the end before this release..." that are either a) completely forgotten, or b) intentionally overlooked ("Ah, well, we really need to get this out the door... can't we just worry about that in the next revision?" - insert endless loop here).
code-a;10997260 wrote:One recommendation I was given was not to use sessions, only cookies for safety.
That's about the exact opposite of the truth.
Session data is (only) stored on the server. The only piece of information stored on the client-side of things is the session ID (which gets propagated most often through a cookie, optionally through the query string in the URL). As such, users can't modify session data; the only risk, then, is "session hijacking" where they somehow are able to determine someone else's session ID value and "hijack" their session by duplicate that ID value in their requests. More info on that can be found by Google'ing "PHP session hijacking" I'm sure.
code-a;10997260 wrote:I am a little at the mercy of the tutorial I build from
Change "a little" to "fully" and I think you've nailed a common problem. 🙂 Just remember, it doesn't take any intelligence or experience whatsoever to write up your own tutorial and post it on the Internet, so YMMV (greatly).
code-a;10997260 wrote:I believe my error now has to do with my mysql_connect... I am seeing that this is where you were saying you should not put user data.
Not at all.. at least, that isn't what I was referring to in my reply above. And besides, you won't likely ever need user-supplied data just to connect to your MySQL server anyway.
What I was referring to was using user-supplied data in the actual SQL queries you send to the server.
code-a;10997260 wrote:
<?php
//session
session_start();
Is there really whitespace before the opening '<?php' tag? If so, you should remove it, as that should cause errors when you try to call [man]session_start/man since that whitespace is considered as output.
code-a;10997260 wrote://login check function
function loggedin()
{
if (isset($_SESSION['username'])||isset($_COOKIE['username']))
{
$loggedin = TRUE;
return $loggedin;
}
}
Er... that seems quite misleading. All I have to do to be considered "logged in" is manufacture a cookie named 'username' and give it any value I want?
code-a;10997260 wrote:It is not letting me log in, and I have been having trouble with my server logging into phpmyadmin too.
Well that's understandable, since you can't "log in" to phpMyAdmin anyway; phpMyAdmin is just a PHP application that provides a GUI to access a MySQL server. The only credentials you would give phpMyAdmin are the ones it needs to make a connection to the MySQL server.
code-a;10997260 wrote:It's saying there is an error in the user/pword, and I have tried the phpmyadmin login info. Did not work.
If you are able to access your MySQL server via phpMyAdmin using a set of credentials, then those same credentials will work in your own PHP application (which is no different than phpMyAdmin at a higher level - both are simply PHP applications making a connection to a MySQL server).
code-a;10997272 wrote:Yah, as soon as you guys said that I was thinking I better get hip to the new connect, so I'll go change that now.
Just to clarify, note that the [man]MySQLi[/man] extension is an entire new library of functions - not just a difference in connecting to a MySQL DB.