Solved

Error

Posted on 2007-03-29
6
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

739 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