Jump to content

Html

Members
  • Posts

    640
  • Joined

  • Last visited

Everything posted by Html

  1. Html

    Php.ini file?

    According to another video on the that site, to get an email confirmation sent to a user's email, it requires editing a file. But I'm thinking may be to edit the php code, which I imagine is the bottom part there, and once registered just login to a user's index, and from there can logout, post a comment to the user accounts index. I believe that would require another separate mysql database?
  2. Html

    Php.ini file?

    I see, the reason I need to change this is I downloaded a new login system, that fortunately works and is up to date compared to what I was using last month. Available on youtube, the tutorial, and the source, so I edited the files according to what I need. I now need to get a confirmation email to be sent to an email once an account has been registered. The alternative could be to remove this feature, due to what has been stated in the above posts. Once registered, and auto logged in, there is a link to click, which doesn't lead anywhere. I think verify.php is the file to get that working, as for the login part where the link is, one of the other files, I think it would be register.php // Add user to the database if ( $mysqli->query($sql) ){ $_SESSION['active'] = 0; //0 until user activates their account with verify.php $_SESSION['logged_in'] = true; // So we know the user has logged in $_SESSION['message'] = "Confirmation link has been sent to $email, please verify your account by clicking on the link in the message!"; // Send registration confirmation link (verify.php) $to = $email; $subject = 'Account Verification ( clevertechie.com )'; $message_body = ' Hello '.$first_name.', Thank you for signing up! Please click this link to activate your account: http://localhost/login-system/verify.php?email='.$email.'&hash='.$hash; mail( $to, $subject, $message_body ); header("location: profile.php"); } else { $_SESSION['message'] = 'Registration failed!'; header("location: error.php"); } } So that bit there, about verifying, I guess replace that register.php code with something else to get to a profile index, it won't be the index.php since that is the register and login form. It is a quite a nice setup. It was nice somebody setup such a modern and well design login system. I could may be just remove that bit, it is on the register.php, so that sort of becomes a Thanks for registering page once done, then from there, a comment box to post comments, now that requires a new mysql database according to another video tutorial which is about making a comment box for a user.
  3. Html

    Php.ini file?

    Hello, Where do I find a php.ini file. I am using a paid host. Thank you.
  4. The username is created by the system, and uses the database name. As for the directory, public_html has 755, the connect.inc. has 644, index.php the same. Registration.php 644. I changed it back to localhost, and instead of using the database, I used the username and db, which is how it appears to work with this paid host.
  5. I don't know about that, I setup a paid account and moved my page to that. I did everything the same over, so I'm not sure what could of caused that. I then changed the permissions now, and it states couldn't connect to the db. I used the ip address of the mysql server or localhost, it doesn't change the result of not being able to connect to the database, for a connect file and post.php file updates. On the free host I was using 644 permissions. So what would be the difference, change a few values for connecting to the database, should bring problems, could it be a php version problem?
  6. Hello, I'm not able to get a php page to display, I get the following error from visiting the page. 644 or 777 should be okay?
  7. Html

    Browser Discussion

    I guess with the phase out of flash, anyone still running an XP system, using Firefox which is still supported for it, would have less of a memory problem? Ads, and youtube for example, I still have an XP system, stopped using it in late 2016.
  8. So somebody copied a whole site from this place
  9. Hi, While this code worked until now, I've added a new database field, so email. When I try that out, it gives an error, like as stated in the code, in the database I added email. But as for what it should be registered as in the properties, I don't know. Thank you. <?php require 'connect.inc.php'; if (isset($_POST['fname']) and isset($_POST['lname']) and isset($_POST['uname']) and isset($_POST['email']) and isset($_POST['pwd']) and isset($_POST['pwd2']) and !empty($_POST['fname']) and !empty($_POST['lname']) and !empty($_POST['uname']) and !empty($_POST['email']) and !empty($_POST['pwd']) and !empty($_POST['pwd2'])) { $fname = mysqli_real_escape_string($conn, $_POST['fname']); $lname = mysqli_real_escape_string($conn, $_POST['lname']); $uname = mysqli_real_escape_string($conn, $_POST['uname']); $email = mysqli_real_escape_string($conn, $_POST['email']); $pwd = $_POST['pwd']; $pwd2 = $_POST['pwd2']; //The mysqli_real_escape_string prevents sql injection... We are hashing the passwords, so we don't need to do it on those lines. /*This line checks to make sure the passwords match*/if ($pwd != $pwd2) { echo 'The passwords you entered didn\'t match'; } else { $check = "SELECT * FROM users WHERE uname = '$uname'"; $res = mysqli_query($conn, $check); /*This line checks to make sure the user exists*/if (mysqli_num_rows($res)>0) { echo 'That username is taken.'; } else { $sql = "INSERT INTO users (fname, lname, uname, email, pwd, ) VALUES ('$fname', '$lname', '$uname', '$email' '$pwd')"; if (!mysqli_query($conn, $sql)) { echo 'Error!'; } else { echo 'Account created! <br> Click <a href="index.php">Here</a> to login'; } } } } ?>
  10. Html

    Drop down menu

    Hi, I have posted this example, so I want day, then month and year of birth. I've made a start there, so where do I go from here? <select> <option value="">1</option> <option value="">2</option> <option value="">3</option> <option value="">4</option> <option value="">5</option> </select>
  11. Html

    Drop down menu

    Hi, I want to create a drop down menu, like used for entering a date of birth. I looked on the Learn html section, and I also tried searching, I couldn't find what I need specifically to do. Thank you.
  12. In honest truth, I haven't learnt anything by memory. I just did what the video explained, and got the functioning problem solved by that guy. He left some comments as you can see. But yeah, I'm rudderless here, I don't know where to go from here.
  13. Sure, but how do I learn without the knowledge, I watched the video because that was the way I could learn, and so far I have got somewhere with this, I'm stuck with this error, as well beyond once logging in, text box post text to an index page linked with the user created on the database. I need examples to continue with this.
  14. Hmm, I watched the video which he explained what to do, and so on and then he made those custom clips of how to get the pages to work with the free web host since what I tried just didn't work, so i was lucky to stumble on his videos and the fact that he could respond, which I mentioned in the above posts. So what he did, was correct, could you not copy what is there and may be try on your host? I imagine you have a host free or paid. I don't know what to do, what exactly do suggest I do to get this login to work, I want to able to post to the user rich's index page, that is my goal here. I think using what is there I feel is the correct step for now, it isn't a public site, so I'm not concerned about security. The hash he provided removed or remains isn't that good at all? I remember reading about Yahoo via Yahoo news and the UK's the Guardian newspaper about not having various data encrypted well.
  15. This below is what loads the index.php page, so after registration of the registration.php page, it loads again, with a link to go to the index to login. There is a comment which states account registered. <?php session_start(); require 'connect.inc.php'; if (isset($_POST['uname']) and isset($_POST['pwd']) and !empty($_POST['uname']) and !empty($_POST['pwd'])) { $uname = mysqli_real_escape_string($conn, $_POST['uname']); $pwd = $_POST['pwd']; $check = "SELECT * FROM users WHERE uname = '$uname'"; $res = mysqli_query($conn, $check); $row = mysqli_fetch_assoc($res); if (mysqli_num_rows($res)<1) { echo 'That user wasn\'t found'; } else { $pwd = PASSWORD_VERIFY($pwd, $row['pwd']); $dbuser = $row['uname']; $dbpwd = $row['pwd']; if ($uname == $dbuser and $pwd == $dbpwd) { $id = $row['id']; $_SESSION['id'] = $id; header("Location: dashboard.php"); exit(); } else { echo 'That username and password didn\'t match'; } } } ?> <!DOCTYPE html> <html> <head> <title>Login</title> </head> <body> <h3>Login</h3> <form action="dashboard.php" method="POST"> <!-- This line should have been set to the current page were editing --> <input type="text" name="uname" placeholder="Username"><br> <input type="password" name="pwd" placeholder="Password"><br> <input type="submit"> </form> <p>Click <a href="registration.php">HERE</a> to register</p> As for the code, this or that, I didn't create any of it, all based off that man's video tutorial on youtube, I lucky enough to get this working thanks to him. You clearly know much better at Pre hyper text processor language, that is something I do remember about the acronym php.
  16. Nope, the login link then loads after registering, and once clicked type in the username and password, and it goes nowhere.
  17. Hmm, okay, seems informative enough. As for the code which is the obvious problem, the database was created using the control panel setting and the rows added, so that wasn't a problem. It is the code and posting to the database which does work on my example register, but to login into a dashboard, that doesn't work. What could I have done to stop that from working? I found some php files on a storage disk, that somebody had made for me in 2007, but a year after I gave up on the web design interest. The difference between then and now is the video site with narrated tutorials, so a book isn't a must, but a book is helpful for reference. Like I stated I viewed a clip, and I was lucky enough to get the help of that man who narrated a couple of clips explaining why I couldn't get the code all above to work, so he created an account on the free web host and tested it out. I haven't got a reply from him. He may be busy, or doesn't care much to help me beyond what he did help me with.
  18. Unfortunately, after having tried months ago using some random videos, and they turned out not to be useful when I tried here to get some help with them, but how it was setup the connected wasn't there. So now with the other tutorial I saw last month, the code is now out of date from what you've stated. So I'm now stuck. Hmm, okay to break it down, I want to send some details to the Mysql db, so include email and password, I have the login there. Is it enough to use index.php, and then another page for the posting of the details to the mysql? Because from that to the registration where that is even more, I find that all confusing. And once I register, the dashboard doesn't load. So logining doesn't work once registered. I don't know what I could of done, all I did was add a login html code above the registration, unless the code was designed to fail after a few tries, I don't know. Thanks.
  19. Oh, well I didn't know any of this. I assumed it was okay, other clips show similar stuff. I was glad this guy helped me out, It is a start. Hmm, well could you create a simple post email and pwd with up to date code for me? I can then try get some kind of a login link for it.
  20. The person who helped correct the php code he had made in his video, made it so that if I created rich1, it can't be created again. As for, the table so okay lets just keep really basic, one user has a comment box that posts to the accounts index, which I don't have one for the username, first I can't even get into the dashboard. He did leave some comments, but I'm still rusty with all of this, it was only a week or ago he corrected and made it work with a free host. He had created his own account and based the example files off it, and recorded some clips explaining a little of he did. <?php require 'connect.inc.php'; if (isset($_POST['fname']) and isset($_POST['lname']) and isset($_POST['uname']) and isset($_POST['pwd']) and isset($_POST['pwd2']) and !empty($_POST['fname']) and !empty($_POST['lname']) and !empty($_POST['uname']) and !empty($_POST['pwd']) and !empty($_POST['pwd2'])) { $fname = mysqli_real_escape_string($conn, $_POST['fname']); $lname = mysqli_real_escape_string($conn, $_POST['lname']); $uname = mysqli_real_escape_string($conn, $_POST['uname']); $pwd = $_POST['pwd']; $pwd2 = $_POST['pwd2']; //The mysqli_real_escape_string prevents sql injection... We are hashing the passwords, so we don't need to do it on those lines. /*This line checks to make sure the passwords match*/if ($pwd != $pwd2) { echo 'The passwords you entered didn\'t match'; } else { $check = "SELECT * FROM users WHERE uname = '$uname'"; $res = mysqli_query($conn, $check); /*This line checks to make sure the user exists*/if (mysqli_num_rows($res)>0) { echo 'That username is taken.'; } else { $pwd = PASSWORD_HASH($pwd, PASSWORD_BCRYPT, array('cost' =>12)); $sql = "INSERT INTO users (fname, lname, uname, pwd) VALUES ('$fname', '$lname', '$uname', '$pwd')"; if (!mysqli_query($conn, $sql)) { echo 'Error!'; } else { echo 'Account created! <br> Click <a href="index.php">Here</a> to login'; } } } } ?> <!DOCTYPE html> <html> <head> <title>Register Account</title> </head> <body> <h3>Login</h3> <form action="dashboard.php" method="POST"> <input type="text" name="uname" placeholder="username"><br> <input type="password" name="pwd" placeholder="password"><br> <input type="submit" name="Login" value="Login"> <br> <h2>Create Account</h2> <form action="registration.php" method="POST"> <!-- This line should have been set to the current page were editing --> <input type="text" name="fname" placeholder="first name"><br> <input type="text" name="lname" placeholder="last name"><br> <input type="text" name="uname" placeholder="username"><br> <input type="password" name="pwd" placeholder="password"><br> <input type="password" name="pwd2" placeholder="confirm password"><br> <input type="submit" name="submit" value="Register"> </form> </body> </html> <?php session_start(); if (!isset($_SESSION['id'])) { header("Location: index.php"); //The above bit of code checks to make sure the user is logged in... If they're not, it will kick them back to the login page... } require 'connect.inc.php'; /*Dont change this line */$id = $_SESSION['id']; /*This line tells PHP to get the user information from mysql*/$getuser = "SELECT * FROM users WHERE id = '$id'"; $res = mysqli_query($conn, $getuser); /*This line will let you use $row['something here']' to pull information from the database*/$row = mysqli_fetch_assoc($res); echo 'Welcome, '. $row['fname']. '<br><a href="logout.php">Logout</a>'; //As you can see, we don't have a var in here called fname, so that's a good example of the mysqli_fetch_assoc function pulling the information 'fname' from the database. ?> <?php session_start(); require 'connect.inc.php'; if (isset($_POST['uname']) and isset($_POST['pwd']) and !empty($_POST['uname']) and !empty($_POST['pwd'])) { $uname = mysqli_real_escape_string($conn, $_POST['uname']); $pwd = $_POST['pwd']; $check = "SELECT * FROM users WHERE uname = '$uname'"; $res = mysqli_query($conn, $check); $row = mysqli_fetch_assoc($res); if (mysqli_num_rows($res)<1) { echo 'That user wasn\'t found'; } else { $pwd = PASSWORD_VERIFY($pwd, $row['pwd']); $dbuser = $row['uname']; $dbpwd = $row['pwd']; if ($uname == $dbuser and $pwd == $dbpwd) { $id = $row['id']; $_SESSION['id'] = $id; header("Location: dashboard.php"); exit(); } else { echo 'That username and password didn\'t match'; } } } ?> <!DOCTYPE html> <html> <head> <title>Login</title> </head> <body> <h3>Login</h3> <form action="index.php" method="POST"> <!-- This line should have been set to the current page were editing --> <input type="text" name="uname" placeholder="Username"><br> <input type="password" name="pwd" placeholder="Password"><br> <input type="submit"> </form> <p>Click <a href="registration.php">HERE</a> to register</p> </body> </html>
  21. I had followed a youtube video tutorial, and got help from the creator of the video, as for a comment box I searched for that, so i returned here. So for this ID row in the users table, how would that work with rich1 login details? uname, fname, lname is an example of what is in the users table in site db. Well yes text, date and time. As for a login section on the registration.php page, how does that work? Or what could be the problem there?
  22. The site database has the table called users, and then listed is a username and password. So for comments on an accounts index page, I'm not sure how this is suppose to work. I can't even get the registration page to get to the logout link page, I don't know what happened there. Once registered it would load a link on the same page and it would take me to the logout link. So there I want a comment box, which isn't really the problem, but getting it to post, as you stated "justsomeguy", I need to post the details to the site db. <h3>Login</h3> <form action="dashboard.php" method="POST"> <input type="text" name="uname" placeholder="username"><br> <input type="password" name="pwd" placeholder="password"><br> <input type="submit" name="Login" value="Login">
  23. Honestly, I don't know. I have a database called site, so html code for the box and a submit button, and then what next?
  24. Hi, I have some pages setup, that create an account, I would like to post a comment to the accounts index page, there isn't an account index page, just a page that has a logout link. I know I need a comment box so the logout page can have that, but posting a comment in a comment box, would require an Id I guess, I used a tutorial to help me, and the creator of the tutorial helped me getting the whole login working as he configured his differently as it was done on a local system, and not a free web host. Thanks.
  25. I appreciate you now stating that. Flipping tutorials clips, may be the narrator was just out to generate some revenue. I once bought a python book last year, all I got was printouts, it was complete utter rubbish. So the example doesn't work at all?
×
×
  • Create New...