This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2011-01-24 18:28:42

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: CHeck it out!

*sigh*

Well, you can use:
setcookie("username", $username, time()+1000);

with $username being a variable of their logged-in user name. That would let you make cookies to check for log-in.

You could get the value with:

$_COOKIE['username"] or check if it's set with

if (isset($_COOKIE["username"]))

Last edited by SeptimusHeap (2011-01-24 18:28:50)


http://i46.tinypic.com/dw7zft.png

Offline

 

#27 2011-01-24 18:39:15

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: CHeck it out!

good job! i'll work on it!

Offline

 

#28 2011-01-24 18:47:13

MiffinTheMuffin
Scratcher
Registered: 2010-12-11
Posts: 1000+

Re: CHeck it out!

The site is down...


http://i.imgur.com/FDvbV.png

Offline

 

#29 2011-01-24 19:26:54

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: CHeck it out!

MySql Database with Usernames and passwords:

<?php
$con = mysql_connect("servername","username","pass");
if (!$con)
  {
  die('Error: ' . mysql_error());
  }

// Create database
if (mysql_query("CREATE DATABASE un _pass",$con))
  {
  echo "Database created";
  }
else
  {
  echo "Error: " . mysql_error();
  }

// Create table
mysql_select_db("un_pass", $con);
$sql = "CREATE TABLE Users
(
Username varchar(15),
Password varchar(15),
)";

// Execute query
mysql_query($sql,$con);

mysql_close($con);
?>


Makes a MySQL database and a table with usernames and passwords.

mysql_query("INSERT INTO Users (Username, Password)
VALUES ('$_POST[username]', '$_POST[password]') ")

Adds a UN and pass to the list when connected using
$con = mysql_connect("servername","username","pass");
if (!$con)
  {
  die('Error: ' . mysql_error());
  }

Last edited by SeptimusHeap (2011-01-24 19:27:04)


http://i46.tinypic.com/dw7zft.png

Offline

 

#30 2011-01-25 16:06:41

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: CHeck it out!

Cool! thats good! I'll have to add it...

Offline

 

#31 2011-01-25 17:28:57

jfmlove6
Scratcher
Registered: 2010-12-20
Posts: 1000+

Re: CHeck it out!

Is this going to be for the social network thingy you were going to make with some other people? Oh, and I also left a comment.


http://bbsimg.ngfiles.com/1/23337000/ngbbs4e84d18f6a0ee.jpg

Offline

 

#32 2011-01-25 17:31:06

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: CHeck it out!

jfmlove6 wrote:

Is this going to be for the social network thingy you were going to make with some other people? Oh, and I also left a comment.

yes this is.

Offline

 

Board footer