Jump to content

Recommended Posts

Here is my code

 

<html>
<head>
<title> Call52 Admin Panel </title>
</head>
<body bgcolor="e5e4e4">
<center>
<h1> Call52 Admin Panel </h1>

<?php

if(isset($_POST['submit'])){

$user_input = $_POST['password'];
$user_input_crypt = crypt($user_input);
$password = crypt('password');
if (crypt($user_input, $password) == $password) {
?>

<a href="./index.php">Main</a> - <a href="./pins.php">Pins</a> - <a href="./paidusers.php">Paid Users</a> - <a href="./settings.php">Site Settings</a><br><br>

<h3> Stats </h3>


<?php
if (crypt($user_input, $password) == $password) {
   echo "<font color='green'>Correct Password!</font>";
} else {

  echo "<font color='red'>Incorrect Password!</font><br><br>";
  echo "The Password you typed came back as: $user_input_crypt <br> it should have been: $password";
  
  }

} else {

$password = crypt('sc55207');

?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="password">
<input type="submit" name="submit" value="submit">
</form>

<?php
}
?>

</body>
</html>

 

Here is the error

 

Parse error: syntax error, unexpected $end in /home/a4428795/public_html/demos/call52/admin/index.php on line 50

Link to comment
https://forums.phpfreaks.com/topic/175737-unexpected-end/
Share on other sites

} else {

  echo "Incorrect Password!

";
  echo "The Password you typed came back as: $user_input_crypt 
it should have been: $password";
  
  } 
} else {

 

unexpected $end almost..pretty much always means you're either missing a bracket or have an unnecessary one someowhere

 

EDIT: now that I look back..you have quite a few missing brackets..

Link to comment
https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926099
Share on other sites

you have to add more brackets

 

<html>

<head>

<title> Call52 Admin Panel </title>

</head>

<body bgcolor="e5e4e4">

<center>

<h1> Call52 Admin Panel </h1>

 

<?php

 

if(isset($_POST['submit'])){

 

$user_input = $_POST['password'];

$user_input_crypt = crypt($user_input);

$password = crypt('password');

if (crypt($user_input, $password) == $password) {

?>

 

<a href="./index.php">Main</a> - <a href="./pins.php">Pins</a> - <a href="./paidusers.php">Paid Users</a> - <a href="./settings.php">Site Settings</a><br><br>

 

<h3> Stats </h3>

 

 

<?php

if (crypt($user_input, $password) == $password) {

  echo "<font color='green'>Correct Password!</font>";

} else {

 

  echo "<font color='red'>Incorrect Password!</font><br><br>";

  echo "The Password you typed came back as: $user_input_crypt <br> it should have been: $password";

 

  }

 

} else {

 

$password = crypt('sc55207');

 

?>

 

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

<input type="text" name="password">

<input type="submit" name="submit" value="submit">

</form>

 

<?php

}

} <===i guess you miss this bracket...just try to add this bracket

?>

 

</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/175737-unexpected-end/#findComment-926366
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.