Jump to content

[SOLVED] A simple login not working !?!


DeathStar

Recommended Posts

I made a simple login for a page..

but for some reson its not working?!?

error:

Parse error: syntax error, unexpected T_STRING in 1/2/3/4/login_test.php on line 2

 

 

here the code:

<?php
start session();
include 'config.php';
$ip = $_SERVER['REMOTE_ADDR'];
$charid = $_POST['charid'];
$year=date('Y');

session_login ();
if (!$_POST['charid'])
{
print "ID?";
}
else if (!$_POST['passwd'])
{
print "Password?";
}
else
{
  mysql_query("UPDATE TABLE 'users' SET logedin='0' WHERE charid=$charid");
  mysql_query("UPDATE TABLE 'users' SET  ip='$ip',laston=unix_timestamp() WHERE charid=$charid");
  }
header("Location:home.php");


print "<title>Admin Panel :: IP $ip</title><br />
<form action=login_test.php method=post name=login onsubmit=\'session_login();\'>ID: <input type=text name=charid><br>
Password: <input type=password name=passwd><br>
<input type=submit value=login></form>";
?>

Link to comment
https://forums.phpfreaks.com/topic/37449-solved-a-simple-login-not-working/
Share on other sites

Sorry, that is where you try and call this function. However, you cannot call php functions from javascript as php runs on the server and javascript on the client.

 

However... I asked where you define this function? session_login() is not a standard php function... have you defined this function yourself?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.