Jump to content

Html

Members
  • Content count

    360
  • Joined

  • Last visited

Community Reputation

7 Neutral

1 Follower

About Html

  • Rank
    Member
  • Birthday 03/17/1989

Profile Information

  • Location
    Greater London

Recent Profile Visitors

13,031 profile views
  1. Html

    redirect into three different level website from login

    Unlikely, that anyone gaining access to accounts would be possible, since a lot of free services are now designed with features that don't make it easy as it may of been, like ten years ago for anyone to login to an account. But yes, certainly if a site is going to be online 24/7 should have some kind of encryption, or hash, the examples files I have from the youtube video tutorial I got from, which went nowhere had a basic hash use.
  2. Html

    Php.ini file?

    My web connection only returned today. No I don't get much of what is going on with Php, I'm not able to go forward with this. May be I don't have a mind for language, may be the problem. The aim here is to get a profile page to link with a registered name, I don't know about the comment task just yet, I'll want to do that after. The profile page has a hyperlink as we can see in the code I've pasted above, <a href="profile.php?id=<?php echo $user_id; ?>"><button class="button button-block" name="View profile"/>View profile</button></a> So here I am again. At least with video I can learn something, but obviously you mean that I can't learn the theory, and the process of it all. In order to succeed with web languages or programming ones, it is necessary to know. I did sent a private comment to the video creator of the files I downloaded, so who ever it is, is still active with that video. Recent comments answered by the uploader.
  3. Html

    Php.ini file?

    For the moment, a registered name and a comment box internally, to post their comments, to appear on their own index, that is simply goal here. As for comment or sending messages to other profiles, I don't know how or what ever that is going to work out. As for the inc, that was from the tutorial, I left that out as the tutorial got to to a point where it went a different direction, so I decided to forget that, left this, as you can see, and then returned, and then left again, and now I'm back, over a week later have that book you suggested, and I can't make much out of it. So the profile index was a first easy step to get going, and I can't get that functioning. I even took a look at the first book I got. May as well not even have it.
  4. Html

    Php.ini file?

    There isn't any inc. That was from the tutorial you saw a little off, that leads to nowhere. Right, the profile link is the focus which would lead to the profile index, then the comment box for the registered name, which is what I would want, I don't mean a profile link to view another registered name's index. There wouldn't be any reason for that, since the db only has four, five names registered. Well I didn't really need to ask one, I'm still on the same subject. I'm going in circles here.
  5. Html

    Php.ini file?

    Right, What I have is a registration system, so the registration takes place, then there is the box that is available to post a comment, it doesn't go anywhere as there is no code for that. Then there is a link to the profile page, which should somehow create one for the least, with the result above, the profile? etc That is the focus here, now that has something to do with validation. <a href="profile.php?id=<?php echo $user_id; ?>"><button class="button button-block" name="View profile"/>View profile</button></a> <?php /* Displays user information and some useful messages */ session_start(); // Check if user is logged in using the session variable if ( $_SESSION['logged_in'] != 1 ) { $_SESSION['message'] = "You must log in before viewing your profile page!"; header("location: error.php"); } else { // Makes it easier to read $first_name = $_SESSION['first_name']; $last_name = $_SESSION['last_name']; $email = $_SESSION['email']; $active = $_SESSION['active']; } $user_id=""; if ($_SERVER["REQUEST_METHOD"] == "GET") { if (isset($_GET["id"])) { $user_id=$_GET["id"]; } ///process profile to id retrieved } date_default_timezone_set('Europe/London'); include 'comments.php.inc'; include 'connect.inc.php'; ?> <!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <title>Welcome <?= $first_name.' '.$last_name ?></title> <?php include 'css/css.html'; ?> </head> <body> <div class="form"> <h1>Welcome</h1> <a href="profile.php?id=<?php echo $user_id; ?>"><button class="button button-block" name="View profile"/>View profile</button></a> <br> <p> <?php // Display message about account verification link only once if ( isset($_SESSION['message']) ) { echo $_SESSION['message']; // Don't annoy the user with more messages upon page refresh unset( $_SESSION['message'] ); } ?> </p> <?php // Keep reminding the user this account is not active, until they activate if ( !$active ){ echo '<div class="info"> Account Created! </div>'; } ?> <?php echo "<form method='POST' Action='".setComments."'> <input type='hidden' name='uid' value=''> <input type='hidden' name='date' value='".date('Y-m-d H:M:S')."'> <textarea name='message'></textarea> <button type='submit' name='commentSubmit'>Comment</button> </form>"; ?> <h2><?php echo $first_name.' '.$last_name; ?></h2> <p><?= $email ?></p> <a href="logout.php"><button class="button button-block" name="logout"/>Log Out</button></a> </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script> </body> </html>
  6. Html

    Php.ini file?

    So once registered, the login must process validation? To then be able to post comments from that name, to the db and then some kind of get on the profile received the comments from a db. From viewing the book, Learn php, it just doesn't make sense to me, there isn't anything I can make of to get my task down. I read the chapter of validation, but yes I can't make much of anything from it.🤔 I tried youtube yesterday again for a video tutorial, so far nothing new, just the typical money ad revenue attempt videos I imagine. This is the login.php <?php /* User login process, checks if user exists and password is correct */ // Escape email to protect against SQL injections $email = $mysqli->escape_string($_POST['email']); $result = $mysqli->query("SELECT * FROM users WHERE email='$email'"); if ( $result->num_rows == 0 ){ // User doesn't exist $_SESSION['message'] = "User with that email doesn't exist!"; header("location: error.php"); } else { // User exists $user = $result->fetch_assoc(); if ( password_verify($_POST['password'], $user['password']) ) { $_SESSION['email'] = $user['email']; $_SESSION['first_name'] = $user['first_name']; $_SESSION['last_name'] = $user['last_name']; $_SESSION['active'] = $user['active']; // This is how we'll know the user is logged in $_SESSION['logged_in'] = true; header("location: profile.php"); } else { $_SESSION['message'] = "You have entered wrong password, try again!"; header("location: error.php"); } }
  7. Html

    Php.ini file?

    Hmm, I don't quite get the validate part. I did try and edit the active property in the mysql database, that doesn't do anything. From 0-1. I took a look at the video of the files I downloaded months back, so the narrator explained some basics of the code, login and logout, of course, he went through the verify.php, which explained about confirming an account. I of course have skipped that, I edited the profile page to remove the verify link so therefore I edited the active. But he was using a localhost to do the task, doesn't matter too much.
  8. Html

    Php.ini file?

    I had some idea it would be from the previous posts, Validate that how? Is this required? <?php session_start(); if (isset($_SESSION['logged']) && $_SESSION['logged'] == 1) { //do nothing } else { $redirect = $_SERVER['PHP_SELF']; $_SESSION['redirect'] = $_SERVER['PHP_SELF']; header('Location: login.php?redirect=' . $redirect); /* header('Refresh: 5; URL=login.php?redirect=' . $redirect); echo 'You are being redirected to the login page!<br>'; echo 'If your browser doesn\'t support this, <a href="login.php?redirect=' . $redirect . '">Click here</a>'; */ die(); } ?>
  9. Html

    Php.ini file?

    So the $user_id= needs a link? Then the other user posted auth_.php I thought what is here there is fine, for this. When I read back, there is also this profile.php?id=
  10. Html

    Php.ini file?

    The user is id is 1, or 2, 3, and so on. So the code from the profile page has to get that from the database. Obviously I have got the form and all of that, via the package from a tutorial, its using what is there, trying to get that, and try and build on it, like with this task. This is the correct step. $user_id="1"; if ($_SERVER["REQUEST_METHOD"] == "GET") { if (isset($_GET["id"])) { $user_id=$_GET["id"]; }
  11. Html

    Php.ini file?

    In mysqli, there is a session field, states active 0, does 1 mean, a registered name is currently logged in? That is from the sql code of that login system I downloaded a few months back. `active` BOOL NOT NULL DEFAULT 0, As for the user Id, so once registered, the profile needs an index page, the link from the internal login doesn't work, I'm back to the problem with the profile page, I want one of those. In the previous post you stated, that I have to think in small parts, so a profile page displays posted info from a mysql db, data isn't sent to it, so how do I go about getting this profile page working, and a comment box working, which sends to the db. I'm stuck, I have that book, but its states one point, and then I'm reading what you've stated previously, I need some pointers.
  12. Html

    Php.ini file?

    $user_id=""; if ($_SERVER["REQUEST_METHOD"] == "GET") { if (isset($_GET["id"])) { $user_id=$_GET["id"]; } This is on profile.php As for sessions must a 0 be 1, if logged in, on the mysql db?
  13. Html

    Php.ini file?

    How do I do that then? I've pasted the code examples, of what I have, this book explains in chapters information about php, and what each example does, but I don't get the whole relation to what I have. This is one of the reasons I would of preferred video, but that isn't an option for the moment. The more I think about this, it seems like I'm only going to get as far as getting a profile to send comments to an index, I'm going to need some examples, I know that doesn't really help me.
  14. Html

    user agreement

    Web page generator is what you'd need, I guess. You don't have word?
  15. Html

    Php.ini file?

    I did get a copy of this book, I'm still not quite sure where to go. Like I've repeated in the past posts, I have a login system which obviously works, but what it doesn't do is send comments from a profile page, that would be an internal one, not an index of a profile. The chapters in the book have 7, and 8 Making web forms is 7, which I have one already, and 8 is remembering information and databases. 10 is cookies and sessions. It is still all meters apart to me.
×