Php - mysql select?
Posted on
16th Feb 2014 07:03 pm by
admin
hi, i have this code:
Code: <?php
session_start();
// dBase file
include "config.php";
if ($_GET["op"] == "login")
{
if (!$_POST["username"] || !$_POST["password"])
{
die("You need to provide a username and FG-Pass.");
}
// Create query
$id = "SELECT member_id FROM `members` "
."WHERE `name`='".$_POST["username"]."' "
$q = "SELECT * FROM `members` "
."WHERE `name`='".$_POST["username"]."' "
."AND `p_locked`=0 "
."AND SELECT field_13 FROM `pfields_content` "
."WHERE `id`='".$id."' "
."AND WHERE `field_13`=('".$_POST["password"]."') "
//`pass`=('".$_POST["password"]."') "
."LIMIT 1";
// Run query
$r = mysql_query($q);
if ( $obj = @mysql_fetch_object($r) )
{
// Login good, create session variables
$_SESSION["valid_id"] = $obj->id;
$_SESSION["valid_user"] = $_POST["username"];
$_SESSION["valid_time"] = time();
// Redirect to member page
Header("Location: shop.php");
}
else
{
// Login not successful
die("Sorry, could not log you in. Wrong login information.
Or your fg has been locked. Please contact Smilie.");
}
}
else
{
//If all went right the Web form appears and users can log in
echo "<form action="?op=login" method="POST">";
echo "Username: <input name="username" size="15"><br />";
echo "FG-Password: <input type="password" name="password" size="8"><br />";
echo "<input type="submit" value="Login">";
echo "</form>";
}
?>
Error:
Parse error: syntax error, unexpected T_VARIABLE in /home/b2ku00/public_html/fg/login.php on line 17
I don't get this.. I can't find any error in line 17 :
No comments posted yet
Your Answer:
Login to answer
51
33
Other forums
JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library
Standard DES encryption script?
Can anybody point me to a tutorial or a short script that shows how to encrypt some text with salt i
Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place
Perplexing problem showing a .jpg
Please disregard..........I figured it out
Remove values in array2 from array1
I have two arrays.
Array 1 is where the array key holds various different numbers. For exampl
Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe
Creating a unique 'control panel' for each user
Hi there,
I'm thinking of designing a site that will allow users to sign up and have their ow
ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE
there is a table (transito) with two fields of clob
Help! refer to a friend script with captcha code
Hi guys, I am posting on here in desperate need for some help with an ongoing search I have been doi
Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor