Solved

Error

Posted on 2007-03-29
6
170 Views
Last Modified: 2007-03-29
<?php
require_once ‘config.inc.php’;
require_once ‘db.inc.php’;
require_once ‘functions.inc.php’;

if (logged_in())
{
  if (isset($_GET[‘action’]) && $_GET[‘action’] == ‘logout’)
  {
    logout();
    Header(‘Location: index.php’);
    exit();
  }
  echo ‘You are currently logged is as: ‘ . $_SESSION[’secure’][‘username’] . ‘.
‘;
  echo ‘Click <a href="index.php?action=logout">here</a> to logout’;
}
if (isset($_POST[‘login’]))
{
  $username = $_GET[‘username’];
  $password = $_GET[‘password’];
  if (login($username, $password))
  {
    Header(‘Location: index.php’);
    exit();
  }
  else
  {
    echo ‘Invalid username/password combination.’;
  }
}
else
{
?>
<form action="" method="post" name="form1">
Username: <input type="text" name="username" value="">
Password: <input type="password" name="password" value="">
<input type="submit" name="login" value="Login">
</form>

Click <a href="register.php">here</a> to register;
<?php
}
?>

I am getting following error

Parse error: syntax error, unexpected ':' in /home/XXX/public_html/rdb/index.php on line 11
0
Comment
Question by:CalmSoul
6 Comments
 
LVL 2

Expert Comment

by:wakemup
ID: 18818236
Is this the index file or another file? Chance are your 'Header' is being sent and it's the index page where the error is...
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 18818261
Yupyup...  the header is firing and redirecting to index.php, which contains a syntax error.  Post the first 15 lines of index.php, and we can isolate the problem for you.
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 18818286
this is index.php page....

<?php
require_once ‘config.inc.php’;
require_once ‘db.inc.php’;
require_once ‘functions.inc.php’;

if (logged_in())
{
  if (isset($_GET[‘action’]) && $_GET[‘action’] == ‘logout’)
  {
    logout();
    Header(‘Location: index.php’);
    exit();
  }
  echo ‘You are currently logged is as: ‘ . $_SESSION[’secure’][‘username’] . ‘.
‘;
  echo ‘Click <a href="index.php?action=logout">here</a> to logout’;
}
if (isset($_POST[‘login’]))
{
  $username = $_GET[‘username’];
  $password = $_GET[‘password’];
  if (login($username, $password))
  {
    Header(‘Location: index.php’);
    exit();
  }
  else
  {
    echo ‘Invalid username/password combination.’;
  }
}
else
{
?>
<form action="" method="post" name="form1">
Username: <input type="text" name="username" value="">
Password: <input type="password" name="password" value="">
<input type="submit" name="login" value="Login">
</form>

Click <a href="register.php">here</a> to register;
<?php
}
?>
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18818508
Maybe it is just my browser (or maybe my eyes) but it seems like you are using slanted quotes instead of a single quote (aka apostrophe).  PHP will work with double quotes or single quotes (') but the slanted quotes (at times not even matching) should cause an error.  They seem to be in both pages.

bol
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 18818572
If those are actually backtick characters (`) then that causes PHP to try to execute the contents in a shell.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 18818847
I'm glad I could help.  I'm especially glad it wasn't my eyes or monitor. :)

Thanks for the grade, the points, and the fun question.

bol
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now