Solved

Error

Posted on 2007-03-29
6
167 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

706 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

21 Experts available now in Live!

Get 1:1 Help Now