Solved

Error

Posted on 2007-03-29
6
176 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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 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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 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