9, January 2009

Online game - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Online game
« previous next »
Pages: [1] Print

Author Topic: Online game  (Read 1495 times)
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« on: Dec 26, 2005, 08:48:50 AM »

HI.

I am just practecing to create online game. Embarrassed

And i have i problem : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/r/rpg.h16.ru/WWW/bk/reg.php on line 31
Table 'rpg6.users' doesn't exist

As i know i have to have admin for database, i have it. And i have to create table  'rpg6.users'  and i dont know number of fields! I also dont know another things, such as Field, Type, Attributes, Null, Default, Extra.

THANKS Cool
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #1 on: Dec 26, 2005, 08:53:19 AM »

show us the code that u are using for the file that is displaying the errors..

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« Reply #2 on: Dec 26, 2005, 09:19:46 AM »

<?
/*Middleages Enlightment         */
/*September 2004                 */
/*programming by chisto_tolyan   */
/*                               */
/*регистрация                    */

include "conf.cfg";

$chas = date("H");
$server_date=date("d.m.Y", mktime($chas-$GSM));
$server_time=date("H:i:s", mktime($chas-$GSM));

$data = mysql_connect($rpg6, $rpg6, $624153);
    if(!mysql_select_db($rpg6,$data)){
     print "Ошибка при подключении к БД<BR>";
     echo mysql_error();
     die();
    }

?>
<HTML>
<HEAD>
<TITLE>Средневековье - регистрация</TITLE>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?
   if(!empty($login)){
    $QUERY = mysql_query("SELECT id FROM users WHERE login='$login'");
    $CHECK = mysql_fetch_array($QUERY);
       if($CHECK){
        print "<SPAN CLASS='err'>Ошибка!Логин \"$login\" уже занят! Выберите другой логин.<BR>";
        print "<A HREF=\"javascript:history.back()\" CLASS='link'>назад</A>";
        die();
       }

    if(empty($ip))
    {
               if (getenv('HTTP_X_FORWARDED_FOR'))
                {
                        $ip=getenv('HTTP_X_FORWARDED_FOR');
                }
                       else
                {
                        $ip=getenv('REMOTE_ADDR');
                }
    }

    $login=htmlspecialchars($login);
    $login=trim($login);
    $password=htmlspecialchars($password);
    $level = "0";
    $email=htmlspecialchars($email);
    $icq=htmlspecialchars($icq);
    $homepage=htmlspecialchars($homepage);
    $name=htmlspecialchars($name);
    $city=htmlspecialchars($city);
    $birthday=htmlspecialchars($birthday);
    $about=htmlspecialchars($about);
    $about=str_replace("\n","<BR>",$about);
    $password = base64_encode($password);
    $def_city = "Моунтаун";
    $def_city_game = "mountown";
    $def_room = "пл.Базарная";
      if($sex == "male"){
       $def_obraz = "m/1.gif";
      }
      else{
       $def_obraz = "f/1.gif";
      }
    $def_status = "рекрут";

    $INSERT = "INSERT INTO `users`(login,login_display,password,mail,sex,icq,homepage,name,hobie,town,birthday,date,reg_ip,city,city_game,obraz,status,room) VALUES('$login','$login','$password','$email','$sex','$icq','$homepage','$name','$about','$city','$birthday','$server_date-$server_time','$ip','$def_city','$def_city_game','$def_obraz','$def_status','$def_room')";
    $SQL = mysql_query($INSERT);

       if($SQL){
        print "<SPAN CLASS='norm'>Регистрация прошла успешно!<BR>Авторизируйтесь с <a href='index.php' class='link'>главной страницы</a>.</SPAN>";
        $INSERT_REPORT = mysql_query("INSERT INTO `report`(date,time_stamp,login,action,type,ip) VALUES('$server_date-$server_time','".time()."','$login','Персонаж зарегистрировался','0','$ip')");
       }
       else{
        echo mysql_error();
       }
   }
   else{
?>
<script>
function sub(){
n=document.registration;
if(n.login.value==""){alert('Вы не ввели Ваш логин!!!');}
else if(n.password.value==""){alert('Вы не ввели Ваш пароль');}
else if(n.password_confirm.value==""){alert('Вы не подтвердили пароль!!!');}
else if(n.password.value!=n.password_confirm.value){alert('Пароли в полях не совпадают!!!');}
else if(n.email.value==""){alert('Вы не ввели Ваш e-mail!!!');}
else if(n.birthday.value==""){alert('Вы не ввели Вашу дату рождения!!!');}
else if(n.rules.checked!=true){alert('Вы должны принять правила The Middleages: Enlightment');}
else{
n.submit();
}
}
</script>
<CENTER>
<FORM NAME="registration" ACTION="reg.php" CLASS="norm" METHOD="POST">
<TABLE BORDER="0" CELLPADDING="7" CELLSPACING="7" WIDTH="400" BGCOLOR="rgb(248,248,248)" CLASS="tab">
<TR><TD>
<CENTER>
<SPAN CLASS="header">
The Middleages
</SPAN>
</CENTER><BR>
Регистрация. Заполните все поля.
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="200">
Логин <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="login" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Пароль <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="password" NAME="password" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Подтвердите пароль:
</TD>
<TD>
<INPUT TYPE="password" NAME="password_confirm" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
E-mail <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="email" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
Ваш пол:
</TD>
<TD>
<SELECT NAME="sex" CLASS="field" STYLE="width=203;">
<OPTION VALUE="male">Мужской</OPTION>
<OPTION VALUE="female">Женский</OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD>
ICQ UIN <SMALL>(макс. 15 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="icq" CLASS="field" SIZE="30" MAXLENGTH="15">
</TD>
</TR>
<TR>
<TD>
Имя <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="name" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
Сайт <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="homepage" CLASS="field" SIZE="30" VALUE="http://" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Город <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="city" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
День рожденья <SMALL>(макс. 10 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="birthday" CLASS="field" SIZE="30" MAXLENGTH="10">
</TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD>
Немного о себе <SMALL>(макс. 1024 симв.)</SMALL>:<BR>
<TEXTAREA NAME="about" CLASS="field" ROWS="6" COLS="60" MAXLENGTH="1024"></TEXTAREA><BR>
<INPUT TYPE="checkbox" NAME="rules">Я принимаю <A HREF="rules.php" CLASS="link" TARGET="blank">правила The Middleages</A><BR>
<INPUT TYPE="checkbox" NAME="subscribe">Я хочу подписаться на "The Middleages News"<BR><BR>
<INPUT TYPE="button" OnClick="sub()" CLASS="but" VALUE="Зарегистрировать" STYLE="width=382">
</TD></TR>
</TABLE>
<br>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<!--Rating@Mail.ru COUNTER--><script language="JavaScript" type="text/javascript"><!--
d=document;var a='';a+=';r='+escape(top.document.referrer)
js=10//--></script><script language="JavaScript1.1" type="text/javascript"><!--
a+=';j='+navigator.javaEnabled()
js=11//--></script><script language="JavaScript1.2" type="text/javascript"><!--
s=screen;a+=';s='+s.width+'*'+s.height
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth)
js=12//--></script><script language="JavaScript1.3" type="text/javascript"><!--
js=13//--></script><script language="JavaScript" type="text/javascript"><!--
d.write('<a href="http://top.mail.ru/jump?from=654449 Visit through proxy"'+
' target=_top><img src="http://top.list.ru/counter Visit through proxy'+
'?id=654449;t=134;js='+js+a+';rand='+Math.random()+
'" alt="Рейтинг@Mail.ru"'+' border=0 height=40 width=88><\/a>')
if(11<js)d.write('<'+'!-- ')//--></script><noscript><a
target=_top href="http://top.mail.ru/jump?from=654449 Visit through proxy"><img
src="http://top.list.ru/counter?js=na;id=654449;t=134 Visit through proxy"
border=0 height=40 width=88
alt="Рейтинг@Mail.ru"></a></noscript><script language="JavaScript" type="text/javascript"><!--
if(11<js)d.write('--'+'>')//--></script><!--/COUNTER-->

</TD>
<TD ALIGN="right" VALIGN="TOP">
<SPAN CLASS="small">
The Middleages: &copy2004.<BR>
By chisto_tolyan
</SPAN>
</TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
</FORM>
</CENTER>
</HTML>

<?
   }
?>
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #3 on: Dec 26, 2005, 09:34:48 AM »

are u sure that the username you are using to connect to ur mysql db has DBA rights?

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8357
43129 credits
Members referred : 3



« Reply #4 on: Dec 26, 2005, 12:57:32 PM »

You need the tables that are described in the INSERT statements :

users :

login,login_display,password,mail,sex,icq,homepage,name,hobie,town,birthday,date,reg_ip,city,city_game,obraz,status,room

report :

date,time_stamp,login,action,type,ip

To see what type each field is, just check the variables in the insert statements

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Monetizing Old Posts
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #5 on: Dec 26, 2005, 02:21:50 PM »

xefus, what is the code for ur conf.cfg file?

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« Reply #6 on: Jan 04, 2006, 06:37:43 AM »

i got that i have to do another one Sad
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #7 on: Jan 04, 2006, 07:30:43 AM »

is this a 3rd party script or is this something you wrote yourself?

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« Reply #8 on: Jan 04, 2006, 07:31:45 AM »

NO
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« Reply #9 on: Jan 04, 2006, 07:32:29 AM »

Does any one know where any online games? (RPG)
aka J Love
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 884
1636 credits
Members referred : 4



« Reply #10 on: Jan 04, 2006, 07:43:31 AM »

so its a 3rd party script then?

Visit through proxy Visit through proxy Visit through proxy

Last blog : phpHaze 1.59.1 in Development
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8357
43129 credits
Members referred : 3



« Reply #11 on: Jan 04, 2006, 08:36:46 PM »


Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Monetizing Old Posts
I will send you to /dev/null/
**
Gender: Male
Posts: 77
24 credits
Members referred : 0



« Reply #12 on: Jan 09, 2006, 10:17:10 AM »

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=1066
Tags : mysql databases Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Online game
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jan 09, 2009, 09:25:12 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 38.657
Total Topics: 7.772
Total Members: 4.660
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: mahendra

31 Guests, 4 Users online :

16 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2009 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.