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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.