Unexpected T_string
PHP Code:$query = “select * from users where username=’$username’ and password=’$password’”;
Printable View
Unexpected T_string
PHP Code:$query = “select * from users where username=’$username’ and password=’$password’”;
PHP Code:$query = "SELECT * FROM `users` WHERE `username` = '".$username."' AND `password`= '".$password."'";
unexpected t-string again
I fail to see the issue?Quote:
$error = “Bad Login”;
the line before the error:
Quote:
if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
Use " not “
You're using the wrong symbol...
You're using “ when it's ".
;p thanks guys.
Is it possible using ajax or w.e to submit the form and if successfull show the members navi if not show the login again?
yeah..
You can use scriptaculous ajax.updater and QueryString method.
grr what's wrong with this?
How do i make it so it doesn't show the login after member stuff if there logged in?Quote:
<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include("login.html");
?>
You really don't get PHP, lol.PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ($_SESSION['username'] == $username)
{
echo("member stuff.");
}
include("login.html");
?>
PHP Code:<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include_once "login.html";
?>
How's that going to work Assasinator...?Quote:
PHP Code:<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include_once "login.html";
?>
invent your code = http://zetolic.com/ still shows login.
remove the include("login.html"); bit then..
EDIT:
Should work.PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ($_SESSION['username'] == $username)
{
echo("member stuff.");
}
else
include("login.html");
?>
Simple...PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ( isset( $_SESSION["username"] ) && $_SESSION['username'] == $username && !empty( $_SESSION["username"] ) )
{
echo("member stuff.");
}
else
{
include("login.html");
}
?>
still shows login.html below it :(
I'm confused.
Simon,
Surely you dont need the isset bit, If it contains the username then of course its going to be set?
That'll DEFINATELY work...PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ( isset( $_SESSION["username"] ) && $_SESSION['username'] == $username && !empty( $_SESSION["username"] ) )
{
echo("member stuff.");
}
else
{
include("login.html");
}
?>
Actually, you probably do need it...Quote:
Surely you dont need the isset bit, If it contains the username then of course its going to be set?
If the session ISN'T set then the value will be blank/null. If the $username variable isn't set (logged out) then it'll be blank/null. Using isset will stop it showing the members stuff if the session doesn't exists.
now even if i'm logged in it doesn't show the members links :( oh well.