I wrote this form in index.php :

<form action="login.php" method="POST"> <input type="text" name="login" /><br /> <input type="password" name="pass" /><br /> <input type="submit" name="submit" value="кнопка" /> </form> 

and here is the code in login.php :

 <?php if ($_POST['pass']=="123" and $_POST['login']=="admin") { ..если пасс робит } else { ..если пасс неверен } ?> 

But I get some kind of mistake. Why? Write what is wrong.

  • 2
    like a mistake? - oneboy
  • one
    How do I know, update and write that in the folder the login and index php errors ( - Sasha Osipov
  • It will be correct like this: <? Php if (($ _POST ['pass'] == "123") && ($ _ POST ['login'] == "admin")) - Vfvtnjd
  • Where and what exactly writes? - oneboy
  • one
    That's what he writes, although I replaced it! > Parse error: syntax error, unexpected '.' in D: \ home \ test1.ru \ www \ login.php on line 2 - Sasha Osipov

2 answers 2

if I understand correctly, the problem is solved like this

 <?php if ($_POST['pass']=="123" and $_POST['login']=="admin") { echo '..если пасс робит'; } else { echo '..если пасс неверен'; } ?> 
  • +1 echo went offline) - Palmervan
  • and how to do if I need when I clicked on the button tossed to the blog? - Sasha Osipov
  • What should be put in echo instead? - Sasha Osipov
  • 2
    Is not it easier to first read the basics? And then set tasks? - Fucking Babai

H. @ Sasha Osipov if you write like this

..if pass robit

in php, the errors will not end!

in php comments are written:

 //вот так #вот так /*вот так*/ 

And syntax error, unexpected '.' this is the first point in your -> .. if pass robit

  • 2
    And I thought it was just a replacement of the real code for the question ... - Oleg Arkhipov
  • one
    so from ... well, I don’t even think that it is there “.. if the pass is roby” - oneboy
  • 2
    mda.selo guys ... ) - Vfvtnjd
  • Duck, I just left it there, and I replaced it myself! - Sasha Osipov