New to PHP

It looks as though your form is in the wrong place. The usual logic for a form is something along the lines of

if ( form_submitted ) {
  validate inputs,
  set error messages
}
if ( form_submitted & no_errors ) {
  send email
} else {
  if ( errors ) {
    display error messages
  }
  display form
}

Note: this is not PHP code, just pseudo code to show the logic.

However, your tutorial is clearly out-of-date, as I mentioned earlier, you need to ditch the mysql_* calls.

1 Like

Thanks

Please where can I get a more recent tutorial that will helpful

Thanks

Please where will I place this code in the script. Under html tags or what

I have to say if I were learning PHP I would start with something a lot simpler than a log-in system. I would get to understand PHP before I started to get into mySQL.

It can be difficult finding online courses as so many are out-of-date.

As far as the code goes, you can drop in and out of PHP within an HTML document simply by surrounding your PHP code with <?php and ?> tags.

I suggest trashing that whole folder and starting over. You need to read the PHP manual on php.net to learn more about PHP.

The first thing that most new comers who are learning any language almost always never do their research on the history of the language they are using.

  • What happened in order for this language to be how it is today?

  • Who invented/ created this language?

  • When was this language invented/ created?

  • Where was it invited/ created?

  • Why did the author invent/ create this language?

  • How did the author do it?

So many people I’ve seen that only used a language because they Googled “How to make a login system” and then poof. First result was PHP or ASP.NET or whatever came up first as the result. Almost every single person who’ve done this, will most likely not know where the language originated from and will most likely not understand how Unix base or Linux base the language is.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.