用户名密码重定向页面段落

I'm trying to make it so that if the username or password is wrong it redirects back to the page and makes the paragraph that says 'wrong username or password visible'

else{
 echo "<script type=\"text/javascript\">
  document.getElementById("wrong").visibility:visible;
       </script>";
 header('Location:../');

 }

Why don't you set a variable in PHP that contains a value based on whether the username and password are correct then use that where you need the text to show?

$blnCorrent = false;

// Do you checks

} else {

   $blnCorrect = FALSE;

}

// in your HTML

<?php

if($blnCorrect === FALSE)
{

   // Show the text

}

?>

You're missing a couple of escapes in your current output.

else {
    echo "<script type=\"text/javascript\">
            document.getElementById(\"wrong\").visibility:visible;
            </script>";
    header('Location:../');
 }

Because you're encapsulating the output in double quotes you need to escape any double quotes you want to appear in the output with a \