Jump to content

Html

Members
  • Posts

    640
  • Joined

  • Last visited

Everything posted by Html

  1. That is interesting, so this place is pretty much a forum online with moderators, and some administrators.
  2. That is a question only you can answer. I guess you have learnt Html 5. Do you use books at all? As for learning entirely, that would be sometime, a year or two I would think. I have never gotten far with any of this, simply, because my mind isn't focused on languages, I imagine, not sure what could be exactly, a learning difficulty may be, I don't know. Some people can learn this subject others struggle, and get by, and many give up. I was looking at SQL developer job roles, I imagine it was for may be Twitter, but required computer science for a role at an IT company, now of course is more programming, but similarities with web languages. I haven't a chance of ever doing that like on a free lance or something, not sure how these jobs actually work out, but yeah there going to be local to a company.
  3. Html

    Php.ini file?

    Ah I see, The host I use, has a plan for £50 for a year or something. I use a basic £11.39p hosting per month, only when I can, so I have to cancel if I don't have that amount. So this certificate authentication isn't really cheap, it is separate from a package. The free host I use is ad based, and just for the testing, has no real features, sub domains, but that is it, free forum packages and all that, but pretty pointless in learning php 7/mysql. Obviously I'm trying to create an account registration site, so something really basic like I've stated in the previous posts, sadly I can't get anywhere with this. The whole certificate cost is out of the question, I can only just try and make the site work. I'm stuck with that.
  4. Html

    Php.ini file?

    Hmm, so what can you inform on this, what do I need to do to have a padlock for just simply registering to begin with, that wasn't on the free host or the paid host I am using.
  5. Html

    Php.ini file?

    Okay, that wasn't any help. I wanted to inquire, what about secure transfer for data, like a secure connection. I don't have one of those on the host I am using.
  6. Html

    Php.ini file?

    This tutorial may assist me with what I'm trying to do. https://www.youtube.com/watch?v=zvXgsouIzVg
  7. Html

    Php.ini file?

    Right, I thought that was the key to the problem. So now the login page requires the code he has pasted, catered to what I have there or use that and edit it.
  8. Html

    Php.ini file?

    I pasted that bit of code from Justsomeguy, it didn't actually do anything, it stopped the page from working, so I removed it.
  9. Html

    Php.ini file?

    Right, and what does that new link do? It only loads as profile.php?= As for Justsomeguy's post, that code fits into the profile php file $stmt = $pdo->prepare('SELECT id, username FROM users ORDER BY username ASC'); $stmt->execute(); $accounts = $stmt->fetchAll(); foreach ($accounts as $account) { echo '<a href="profile.php?id=' . $account['id'] . '">' . $account['username'] . '</a><br>'; }
  10. Html

    Php.ini file?

    Okay from the top, so the code I put into the profile has that link, as well as the get code that dsonesuk mentioned in the previous post. I left that out, so there is no link in that part there. $user_id=""; <body> <div class="form"> <h1>Welcome</h1> <a href="profile.php?id-1"><button class="button button-block" name="View profile"/>View profile</button></a> <p>
  11. Html

    Php.ini file?

    Right, but if I add a link onto that page, the page won't load with the 1, how would it know? The bit at the bottom is the part that would work that out. <?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-1"><button class="button button-block" name="View profile"/>View profile</button></a> <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> </body> </html> Just below the welcome tag, I duplicated the button used for logout, and renamed it, and added a the link. Of course this doesn't go anywhere..
  12. Html

    Php.ini file?

    Once registered, the next page profile.php with a link to confirm, I removed that, and added in a textbox, as I've display in the previous code postings. I would need to add a profile link to then display that user's profile page so 1. So, that below would be the hyperlink. profile.php?id=1
  13. Html

    Php.ini file?

    <?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 } ?> So like that?
  14. Html

    Php.ini file?

    Erm, right so id 1 which is in the db as a name, and surname, how does that get into a file. The primary profile.php is the same for any name registered. So a profile.php?id-1 this would be a new empty page linked from profile.php.
  15. Html

    Php.ini file?

    As I stated in previous posts, I need more the narration to understand what to do. Okay if I leave aside this sent a comment task to the db, and display it on a profile page. Once I register an account, how do I create a profile page? Like an index, with a textbox there, obviously the textbox is sort of straightforward since that is the html, and I have done that previously.
  16. Html

    Php.ini file?

    Yes, I just wanted it the way I preferred it. I really don't know what I'm going to do, I'm stuck at this moment, I can perhaps give that tutorial in the book a go, but from there on, I don't know. Thank you for the advice. I did try and look for some other tutorials certain keywords on the video site, yes nothing. I also tried this with Java programming for Android, haven't gotten far with that either, made a program, doesn't install on an old mobile device. How ever, there are plenty of video tutorials with some quality sadly compared to the PHP stuff.
  17. Html

    Php.ini file?

    Hey there Justsomeguy, Interesting outlook you've stated there, I did buy one book which I had hoped would help with this, early in the year. I think I did mention it in another thread. Php 7 in easy steps by Mike McGrath, I got that on Amazon UK for under £10. It appears the only useful tutorial in it was a contact form. As for the youtube, well I prefer the more narrated stuff, reading from a book just isn't the same for me. As for knowing the theory, not really, no. I had banked on learning some of that in a video tutorial, all I can really do is just try them out. But I've stumbled here, as trying to get something from one clip tucked into another has stopped so far from getting the result I wanted. I'm going to see what else I can find. Thanks for the book suggestions. I think the video narration is more suitable for me. In the Chapter Making a connection, it explains about making a forum. I may of overlooked that part. Now this person uses connect_db.php Creating a forum, Then goes on to state a database table , post_id, first_name, creating a table in the SQL box in the db area, done that in the first tutorial. Processing messages, If( isset($_POST['message'])) { If(!empty(trim($_POST['message']))) {$first_name = addslashest($_POST['first_name']);} else { fail('First Name');} } ('../connect_db.php'); $sql = "INSERT INTO forum (first_name,) and etc Values('$first_name'. etc add failure code, etc, then save as process.php Confirming Success, Then on the next page that section, shows a display of text. Hmm. I could take a snapshots of these pages. Of course this doesn't use an existing name, it requires to type one in a form, and then it is processed to save in a db.
  18. Html

    Php.ini file?

    I don't know if that tutorial includes anything about user accounts and id for comments linked with them. The tutorial I think is about logging into a site, comment on a video linked from youtube. But the fact that you have stated this a bit more clearly for me to get, means that I may have to refer to another clip for this sort of task. That tutorial was the next best thing available. As the login system was just that, the user of that video tutorial hadn't gone further with it sadly, perhaps if he had, I may never of posted for this task here. As for tutorials, youtube is really my chance for learning. One reason I never got moving with web design was the web page tutorials. But after so many years, find it difficult to focus on this. But if I want to try and get something going, which I sort of have..with the help of a tutorial, and somebody's source files, just sort of cater it to my need, and sort of learn along the way.
  19. Html

    Php.ini file?

    Erm, the login system I am using doesn't have that sort of setup. I only realised that, it is a first name, and surname only registration, so the account would have a page, but no actual name change feature. But the problem here isn't that, it is getting the comments to the db to load on an index page. The comment bit is a priority, otherwise there isn't anything to work with. I don't know what to do, if the tutorial info hasn't worked, I'm a bit lost here with this.
  20. Html

    Php.ini file?

    Hmm, right.. Okay, well I decided to leave the whole confirmation email feature out, therefore there are linking bits of that in the profile.php up there. As for linking a comment with a particular name for a profile index page. Well the database has one id 1, so therefore a name with that. So id 1 in my sql db has to be linked for one profile page, as you state above. I don't have a page for it, I doubt this login system creates an index page for a user, it uses both a first name and surname, so no actual user alias. I suppose have a profile link in the kind of control panel with the textbox there, so the user clicks on that to load a profile page. As for the comment database task. Not sure about that. The login system is separate as I stated from that other youtube user's stuff, I'm sure a bit of code here and there it should be okay..
  21. Html

    Php.ini file?

    Okay, While leaving the comment insert task aside, With having created an account, how would the comment be sent to the user's index page? As there isn't one at the moment. I think the video tutorial further sort of explains this, there are two more videos after that one there. But obviously, without a comment being sent to the database, it is too early for that step. <?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']; } 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> <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> </body> </html>
  22. Html

    Php.ini file?

    No there is no setcomments page or anything, according to the video tutorial that was the man explained it. In fact I'll give the exact section in the tutorial. https://youtu.be/1LmPeHX7RRo?t=4m6s
  23. Html

    Php.ini file?

    The top is included, I just copied it incomplete yesterday. As for the code, I don't know, I just added in that code from that tutorial into another code from another tutorial's login system file.
  24. Html

    Php.ini file?

    I didn't notice that, unfortunately that hasn't change the result, still a 404 loads. Really shouldn't the comment be sent to the database, and not go to another page. I also change db back to connect.inc. since that is what it was, nothing.
  25. Html

    Php.ini file?

    I did try a tutorial on how to add a comment box into a profile.php file, once registered using a registration.php file that is from the login system. That hasn't worked, just leads to a 404. Sent a message to the tutorial creator, hopefully may be a few pointers. I think it could be the way it works, or may be I've done something wrong, but I can't think what. I've typed up what he narrated, the clip is from just over two years ago, pretty recent. Requires adding in a include connect.inc. This is a comments.inc file <?php function setComments(){ if (isset($_POST['commentSubmit'])){ $uid=$_POST['uid']; $date=$_POST['date']; $message=$_POST['message']; $sql="INSERT INTO comments"(uid, date, message) VALUES('$uid, $date, $message); $result=mysqli_query($conn, $sql); } } <? And this below is the profile.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']; } date_default_timezone_set('Europe/London'); include 'comments.php.inc'; include 'db.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> <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> As for the confirmation email. So what can I do to get that going?
×
×
  • Create New...