Author Topic: Global Login System (Implementation Discussion)  (Read 83984 times)

TinMan

  • Autococker
  • Posts: 1347
Re: Global Login System (Implementation Discussion)
« Reply #120 on: September 01, 2006, 03:07:58 PM »
4.x ftw!

Smokey

  • Autococker
  • Posts: 1172
Re: Global Login System (Implementation Discussion)
« Reply #121 on: September 01, 2006, 03:08:09 PM »
upgrade the server.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #122 on: September 01, 2006, 03:23:59 PM »

TinMan

  • Autococker
  • Posts: 1347
Re: Global Login System (Implementation Discussion)
« Reply #123 on: September 01, 2006, 03:37:52 PM »
I stick to 4.x, why? Because as I've both experienced and been told of, 4.x is stable and works with most everything that I've tried on it.
Some of my stuff doesn't work in 5.x, pretty sure that phpMyAdmin has some issues with it and stuff like that too...

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #124 on: September 01, 2006, 03:45:02 PM »
Hmm... 5.x is what I've been using locally, so I know what I've done works.

TinMan

  • Autococker
  • Posts: 1347
Re: Global Login System (Implementation Discussion)
« Reply #125 on: September 01, 2006, 03:47:59 PM »
Then you're good to go with it. :P

loial21

  • Autococker
  • Posts: 2807
Re: Global Login System (Implementation Discussion)
« Reply #126 on: September 01, 2006, 05:35:42 PM »
Upgrade server. Let me know if you need funds.

Smokey

  • Autococker
  • Posts: 1172
Re: Global Login System (Implementation Discussion)
« Reply #127 on: September 01, 2006, 05:58:29 PM »
lol, you dont pay to update mysql..

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #128 on: September 01, 2006, 07:53:08 PM »
Ok, so it's all updated now (after following about 5 different tutorials.  I hate Linux).

Now I have a stupid question.  After you log in, using POST, I put a "continue" link for ease, like so:
<a href=\"$phpfile\">Continue</a>

But when you click continue, even though the link says "testlogin.php", it goes there with the post data again, bringing you back to the screen saying you've logged in successfully... with the continue link....

If I copy and paste the link in the browser, though, it takes me back to the main page.  What's up with that, and how do I make it just do it with a link?

Smokey

  • Autococker
  • Posts: 1172
Re: Global Login System (Implementation Discussion)
« Reply #129 on: September 01, 2006, 08:16:27 PM »
Ok, so it's all updated now (after following about 5 different tutorials.  I hate Linux).

Now I have a stupid question.  After you log in, using POST, I put a "continue" link for ease, like so:
<a href=\"$phpfile\">Continue</a>

But when you click continue, even though the link says "testlogin.php", it goes there with the post data again, bringing you back to the screen saying you've logged in successfully... with the continue link....

If I copy and paste the link in the browser, though, it takes me back to the main page.  What's up with that, and how do I make it just do it with a link?

whos needs <a href=\"$phpfile\">Continue</a>?

Code: [Select]
header("Refresh: 3; URL=/testlogin.php");
Automatic redirection after 3 seconds..

IronFist

  • Autococker
  • Posts: 1304
_
« Reply #130 on: September 01, 2006, 08:34:31 PM »
Post removed
« Last Edit: July 25, 2010, 10:43:23 PM by IronFist »

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #131 on: September 01, 2006, 10:11:47 PM »
It's all the same php file.  You can try it out here: http://www.dplogin.com/testlogin.php

Smokey

  • Autococker
  • Posts: 1172
Re: Global Login System (Implementation Discussion)
« Reply #132 on: September 01, 2006, 10:22:08 PM »
Some ajax to tell the user if the name is taken:

Register page:
Code: [Select]
<script src="clienthint.js" type="text/javascript"></script>
<form action="register.php" method="post">
Username:<br>
<input type="text" id="username" name="username" onkeyup="showHint(this.value)"> <span id="txtHint"></span>
<input type="submit" value="Submit">
</form>


clienthint.js

Code: [Select]
var xmlHttp

function showHint(str)
{
if (str.length==0)
{
document.getElementById("txtHint").innerHTML=""
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}       
var url="check.php"
url=url+"?q="+str
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
   document.getElementById("txtHint").innerHTML=xmlHttp.responseText
   }
}

function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
  {
  objXMLHttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
return objXMLHttp
}


check.php

Code: [Select]
<?PHP
include "db.php";
$query = $_GET['q'];
$sql_username_check = mysql_query("SELECT * FROM `members` WHERE username='$query'");
$username_check = mysql_num_rows($sql_username_check);
if ($username_check > 0) {
  echo "<font color='#FF0000'>This username is taken</font>";
}
else {
  echo "<font color='#00FF00'>Username Available!</font>";
}
?>

Smokey

  • Autococker
  • Posts: 1172
Re: Global Login System (Implementation Discussion)
« Reply #133 on: September 01, 2006, 10:25:44 PM »
Sorry to double post, but this is worth a post of its own.


Any way at all the someone is going to be able to sqlinject the system?
Make sure you have your
 
Code: [Select]
'
's

TinMan

  • Autococker
  • Posts: 1347
Re: Global Login System (Implementation Discussion)
« Reply #134 on: September 02, 2006, 01:27:52 AM »
Updating in linux is a pain with .rpm's, that's why we use .deb's and apt-get.  8)

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #135 on: September 05, 2006, 01:22:02 PM »
I think everything had quotes but some id's which should always be numeric.  I went ahead and put quotes around everything, though.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #136 on: September 06, 2006, 01:15:27 AM »
Great... now I'm getting this:

Fatal error: Call to undefined function: mysql_connect() in /var/www/html/index.php on line 5

I didn't touch anything and now all of a sudden it decides those functions are undefined?  I'm guessing this is a delayed effect of my updating mysql.

KnacK

  • Global Moderator
  • Autococker
  • Posts: 3039
Re: Global Login System (Implementation Discussion)
« Reply #137 on: September 06, 2006, 07:02:26 AM »
There should nto be anything delayed within MySQL....

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Global Login System (Implementation Discussion)
« Reply #138 on: September 06, 2006, 08:07:44 PM »
So... any ideas on how to fix it?  MySQL is running.  PHP is running.  Somewhere along the line they decided to quit communicating with each other.

b00nlander

  • Autococker
  • Posts: 784
Re: Global Login System (Implementation Discussion)
« Reply #139 on: September 07, 2006, 12:12:42 AM »
are you running php5.0?  might wanna check if the mysql-library is defined in the php.ini
there was some issue with php5 and the wrong or missing declaration of the mysql.so / libmysql.dll I think.