quickstopman Posted April 7, 2008 Share Posted April 7, 2008 to likwidmonster lol i like to not make sense when i make websites, and that picture isn't me. i have yet to update the main page to the real perpous of the site, you can check it out soon to see the real perpous Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-511588 Share on other sites More sharing options...
likwidmonster Posted April 8, 2008 Author Share Posted April 8, 2008 I have noticed that you like to express yourself on websites and the php_test.php gave me an error, what do I do? Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-511692 Share on other sites More sharing options...
quickstopman Posted April 8, 2008 Share Posted April 8, 2008 well what was the error? then we can find the source of the problem Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-511778 Share on other sites More sharing options...
lewis987 Posted April 8, 2008 Share Posted April 8, 2008 HAHA... this has literally made me laugh!!! anyway... the problem with the code, if no-one else hasn't already noticed, it says: <?PHP echo "PHP is working; ?> That is wrong, it is meant to be: <?PHP echo "PHP is working"; ?> You MUST close ALL quotes (" OR ') otherwise you will get stupid (really stupid) errors. But go ahead and try the correct code in this post and, since it has given you an error, PHP IS WORKING! Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512261 Share on other sites More sharing options...
quickstopman Posted April 8, 2008 Share Posted April 8, 2008 wow sorry, im incredibly stupid but i guess it proved that you have php lol Thanks for pointing that out!! Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512283 Share on other sites More sharing options...
lewis987 Posted April 8, 2008 Share Posted April 8, 2008 then again... you are only 14... and im 18... well nearly... but ive been doing php for almost a year... and jsut started to learn javascript... so yea... just tell me if thats all you needed to know likwidmonster. Due to the fact that it did give you an error, kinda makes it obvious that php is enabled. so just install any php script. and you domain will probably have MySQL aswell... so have a look into that and see what you can really achieve Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512309 Share on other sites More sharing options...
likwidmonster Posted April 8, 2008 Author Share Posted April 8, 2008 It has an error it says "/home/content/d/a/r/darrencoon/html/nathan/test.php" as I said I, am using my teacher's sub domain. He said this happened because I do not have it going to a database. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512420 Share on other sites More sharing options...
haku Posted April 9, 2008 Share Posted April 9, 2008 Then your teacher doesn't know what he is talking about - the 'php is enabled' script doesn't require a database. Give us the rest of the error. That was only a path name, not an error. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512584 Share on other sites More sharing options...
Psycho Posted April 9, 2008 Share Posted April 9, 2008 ...as I said I, am using my teacher's sub domain. as I said, using a sub-domain doesn't mean anything. You probably just picked up the snippet of code that had the syntax error as identified on the previous page. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-512716 Share on other sites More sharing options...
likwidmonster Posted April 9, 2008 Author Share Posted April 9, 2008 Then you don't know how to read then mjdamato I got the code from lewis987! Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513073 Share on other sites More sharing options...
Psycho Posted April 9, 2008 Share Posted April 9, 2008 Then you don't know how to read then mjdamato I got the code from lewis987! No I can read perfectly fine. Nowhere did you state what code you used that produced the error you posted on Reply#31 (in Reply#26 you stated that haku's code produced an error). So where, exactly, did you state that you used the code provided from lewis987? Why are you being so argumentative? For some reason you are hung up on the obsession that because your site is being run on a sub-domain that it would somehow function differently. That is just not the case. I'm not trying to be rude (unlike trying to question someone's reading ability), but you seem to ignore everything that everyone has stated. When asked a question by those trying to help you, you only respond with partial responses or change the subject entirely. If we ask you to try somethign and it doesn't work, just post back EXACTLY what did or did not work along with any error messages. We do not have access to your system so we rely upon you to give complete and accurate details. As haku stated, the error you recieved supports the fact that PHP is enabled for you. However, you didn't respond to his request to provide the full error which would explain the problem (which is in all likelyhood just a syntax error). Also, as he stated, your 'instructor' doesn't know what he is talking about - PHP does not require a database. You can create a PHP page that interacts with a database, but that is another matter. First let's get the PHP issue straitened out. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513103 Share on other sites More sharing options...
haku Posted April 9, 2008 Share Posted April 9, 2008 You are more patient than I damato - this kid is starting to annoy me. Kid: damato said it, but I'll say it again - get it out of your head that it matters that you are on a subdomain. It doesn't. It will function exactly the same as a domain. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513139 Share on other sites More sharing options...
likwidmonster Posted April 9, 2008 Author Share Posted April 9, 2008 Okay! I, am not trying to be argumentative! It may seem like that. The whole reason of this thread was to try to make a login in JavaScript then I wanted to know what I could do with a linux sub-domain. I wish I had a domain but I dont, so i ,am trying to learn all I can from this so eventually I can have one and know what I, am doing! I do not have any software I think you mentioned that below. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513248 Share on other sites More sharing options...
Psycho Posted April 9, 2008 Share Posted April 9, 2008 Well, you CAN'T do a login with JavaScript (at least not one that is of any value - anyone could log in by looking at the page source). You CAN do it with PHP (with or without a database - just use a flat file). There is no such thing as a "Linux sub-domain". The fact that the server is Linux vs. Windows or a sub-domain or a domain has nothing to do with any of this - nothing. Again, from the partial error message you posted (Which you still haven'tprovided full details for) it appears you can use PHP. If that's the case you can have a login function. If no database is availabel then you can use flat files. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513340 Share on other sites More sharing options...
likwidmonster Posted April 9, 2008 Author Share Posted April 9, 2008 okay thankyou! Ummm.... Can you tell me how to do a flat file? and sorry you have to put up with me P.S.aku you just not talk if i, am annoying you! (Non-sarcastic) Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513359 Share on other sites More sharing options...
Psycho Posted April 9, 2008 Share Posted April 9, 2008 Ok, here is a vert, very simple script that would work - although it would need a lot more work. Also, there are ready made classes that will allow you to use flat files just like a database. Create a text file called user_list.txt and enter the username and passwords like so: michael|testing robert|whatever Then create a PHP file such as this: <?php function validUser() { $uname = $_POST['uname']; $pword = $_POST['pword']; $accountFile = "user_list.txt"; $accounts = file($accountFile); foreach ($accounts as $userData) { list($username, $password) = explode('|', $userData); if (trim(strtolower($username))==trim(strtolower($uname))) { return (trim($password)==trim($pword)); } } return false; } $error = ''; if (isset($_POST['uname']) || isset($_POST['uname'])) { if (validUser()) { echo "<html><head></head><body>Log user in.</body></html>"; exit; } else { $error = "Username/password entered invalid"; } } ?> <html> <head></head> <body> <?php echo $error; ?> <form method="post"> Username: <input type="text" name="uname" value="<?php echo $_POST['uname']; ?>"><br> Username: <input type="password" name="pword"><br> <button type="submit">Submit</button> </form> </body> </html> Again this is only a basic example and I would not suggest using this code as is - but I'm not going to take the time to code all of this out. This only shows that it will work. Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513436 Share on other sites More sharing options...
likwidmonster Posted April 10, 2008 Author Share Posted April 10, 2008 thankyou! Quote Link to comment https://forums.phpfreaks.com/topic/97351-how-do-you-make-user-acounts-and-user-login-on-a-website/page/2/#findComment-513898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.