Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 5 1 2 3 4 5
Re: PHP help [Re: Blade280891] #202214
04/13/08 20:53
04/13/08 20:53
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
well, if you don't submit any dbhost data, how do you expect the var to be filled?

Re: PHP help [Re: Blade280891] #202215
04/13/08 20:54
04/13/08 20:54
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
What input field does refer to "dbhost"? I can't see it, and I don't know what this variable should contain (as the name is not very descriptive)...

At least your problem is that the 'dbhost' variable is empty since it is not filled in by the form.

EDIT: what broozar said \:D


Click and join the 3dgs irc community!
Room: #3dgs
Re: PHP help [Re: Blade280891] #202216
04/13/08 20:55
04/13/08 20:55
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
Ok, soz my mistake , i missed a $_POST thing. SO again problem sovled


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: PHP help [Re: Blade280891] #202225
04/13/08 21:41
04/13/08 21:41
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
Does anyone no how to set user rights/classes?
My idea was to add a value to them in the MySql database and then each time someone logs in check for that value.

I also have this code
 PHP:

<?php
// Random Game Design: PHP Website Template
//  Version 1
//  Copyright Dean Whitehouse, 2008
include 'db_connect.php';
include 'config_table.inc.php';


$sql_user = "CREATE TABLE $user(
user_id int(10) AUTO_INCREMENT NOT NULL PRIMARY KEY,
user_name varchar(100) NOT NULL,
user_password varchar(100) NOT NULL,
user_email varchar(100) NOT NULL,
user_timezone  char(3) NOT NULL,
user_hideemail  tinyint(3) unsigned NOT NULL,
user_ip varchar(20) NOT NULL,
user_ban tinyint(3) unsigned NOT NULL,
user_realname varchar (40) NOT NULL,
user_age int(10) unsigned NOT NULL,
user_class varchar(100) NOT NULL,
userlevel tinyint(1) unsigned NOT NULL
)";

$make_user= mysql_query($sql_user);

$checkifexist = mysql_query ("SELECT * FROM '$user' LIMIT 0,1");

if ($make_user)
{
echo("'$user' Table Created. <form action='make_admin.php'>
<input type='submit' value='Continue' name='check'>
</form>");
}
else
{
echo("Table all ready exists. Please go back and enter a different name.<FORM>
<form action='name_tables.php'>
<INPUT TYPE='submit' VALUE='Back'></FORM>");
}
mysql_close();
?>


but the back button doesn't work.
the address changes from
create_tables.php?check=Continue
to
create_tables.php?


Last edited by Blade28081991; 04/13/08 21:54.

My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: PHP help(urgent) [Re: Blade280891] #202607
04/15/08 23:01
04/15/08 23:01
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline OP
Serious User
Blade280891  Offline OP
Serious User

Joined: Jan 2008
Posts: 1,580
This code, below is supposed to check the database for the user level, if the level = 1, this would be given the admin cookie. If the level = 0 , this would get given the user cookie, but i can't get it to work.

If anyone knows it would really help.
 PHP:

<?php

include '../includes/db_connect.php';
include '../includes/config_table.inc.php';


$user_name = $_POST["user_name"];        
$user_password = $_POST["user_password"];    

if ($user_name && $user_password)        
{

$salt = substr($user_password, 0, 2);
$userPswd = crypt($user_password, $salt);
$login_check = mysql_num_rows(mysql_query("SELECT * FROM `$user` WHERE user_name='$user_name' AND user_password='$userPswd'" ));
    $check_ad = mysql_query("SELECT * FROM `$user` WHERE userlevel = '0'");
    $check_us = mysql_query("SELECT * FROM `$user` WHERE userlevel = '1");

    if ($login_check == 1 && $check_ad)    
    {
    echo "Logged In Sucessfully. Please wait while you are redirected";    
echo "<meta http-equiv='refresh' content='2; url=setadmincookie.php?&u=$username&p=$user_password'>";
    }
    
    else
    if ($login_check == 1 && $check_us)    
    {        
        echo "Logged In Sucessfully. Please wait while you are redirected";    
echo "<meta http-equiv='refresh' content='2; url=setcookie.php?&u=$username&p=$user_password'>";
    }
    
    else
    {
        echo 'Login failed. Username and Password did not match database entries.';    
    }
}

else    
{
    echo "Form was not completed. Please go back and make sure that the form was fully completed.";    
}


mysql_close();

?>




My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Page 5 of 5 1 2 3 4 5

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1