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
firefox wouldnt stream mp3 files completely from my php page
hi everyone,
I have a php file trying to read and stream mp3 files. It works fine in IE but my pr
Load Animated Image while cache is serve
I have a page that loads up using cache and took about 1 to 2 minutes before it loads to the page. <
Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:
"a.b.c.d.e.f&
how do I show what a user have selected from a checkbox?
From my code below, how would i show which check boxes have been checked and which radio buttons sel
Help Optimizing code
Good Morning,
I wrote a small import function for a website of mine and I know there has to b
EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t
Load file in PHP
I have 2 files. The first is a PHP generated XML file that's dependent by 2 inputs. The second is a
using a loop help
Hi guys , i need some help. I have this loop :
while ($row = mysql_fetch_assoc($Result)) { ?&
Amend code to allow multiple attachments
Hi
I have a php page that allows the user to browse to a file (image) then sumbit, the confi
PHP page loading in Firefox but not in IE
hello,
i am currently doing a project in PHP and i have a problem. If I view the project in M