A problem with the registration

03/16/2013 15:53 pawelxx99l#1
Hello
I have the following problem with the registration

after adding the ODBC System DNS name of the end-user which I downloaded, and are to this code gives the example of 1234 and the data placed in config.inc.php
then edited and added register.php file where the data from the enterprise manager in lines 24 and 25 say that it was elovron login and password 1234
These files oczywiściwe threw to XAMP htdocs directory and went on your IP address has already been available on the web about everything was fine went to the register and there crashes bugs me here they are:

Quote:
1) Notice: Use of undefined constant step2 - assumed 'step2' in D:\xampp\htdocs\register.php on line 5

2) Notice: Undefined variable: errorStr in D:\xampp\htdocs\register.html on line 141

3) Notice: Use of undefined constant step2 - assumed 'step2' in D:\xampp\htdocs\register.php on line 16
are the errors that wiudać immediately after entering the page
but after completing the registration form owiele more crashes here are some of them:

Quote:
Notice: Use of undefined constant step2 - assumed 'step2' in D:\xampp\htdocs\register.php on line 5

Notice: Use of undefined constant step2 - assumed 'step2' in D:\xampp\htdocs\register.php on line 5

Notice: Use of undefined constant ZoneGroup - assumed 'ZoneGroup' in D:\xampp\htdocs\register.php on line 23

Warning: odbc_connect(): in D:\xampp\htdocs\register.php on line 24

Warning: odbc_do() expects parameter 1 to be resource, boolean given in D:\xampp\htdocs\register.php on line 30

Warning: odbc_fetch_row() expects parameter 1 to be resource, null given in D:\xampp\htdocs\register.php on line 31

Warning: odbc_result() expects parameter 1 to be resource, null given in D:\xampp\htdocs\register.php on line 32

Notice: Use of undefined constant username - assumed 'username' in D:\xampp\htdocs\register.php on line 33

Notice: Use of undefined constant username - assumed 'username' in D:\xampp\htdocs\register.php on line 34

Notice: Use of undefined constant username - assumed 'username' in D:\xampp\htdocs\register.php on line 35

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 36

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 37

Notice: Use of undefined constant username - assumed 'username' in D:\xampp\htdocs\register.php on line 38

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 38

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 39

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 40

Notice: Use of undefined constant password2 - assumed 'password2' in D:\xampp\htdocs\register.php on line 41

Notice: Use of undefined constant password1 - assumed 'password1' in D:\xampp\htdocs\register.php on line 41

Notice: Use of undefined constant mail - assumed 'mail' in D:\xampp\htdocs\register.php on line 42

Notice: Use of undefined constant referred - assumed 'referred' in D:\xampp\htdocs\register.php on line 43

Notice: Undefined index: referred in D:\xampp\htdocs\register.php on line 43
if anyone wants to see for yourself what are the errors that you can see them at [Only registered and activated users can see links. Click Here To Register...]

my file register.php
Quote:
PHP Code:
<?php 

require_once "config.inc.php"

if(isset(
$_SESSION[step2]) && isset($_POST[step2])) { 
$errorStr formStep3(); 
if(
$errorStr!=null){ 
require_once(
'register.html'); 
}else{ 
require_once(
'success.html'); 
$suc=$success
unset(
$_SESSION[step2], $_SESSION[step1]); 
}} 
else { 
require_once(
'register.html'); 
$_SESSION[step2] = 1; } 

function 
formStep3(){ 
$errors = array(); 
$errorStr null

$strSql="select * from Tbl_user where user_id='$_POST[username]'"
if (
$_POST[ZoneGroup]=="zone1") { 
$account_odbc odbc_connect('account','ELOVRON-SERV','xxxxxxx'); 
} elseif (
$_POST[ZoneGroup]=="zone2") { 
$account_odbc odbc_connect('account2','ELOVRON-SERV','xxxxxx'); 
} else { 
die (
"<p><b>·ÖÇřѡÔń´íÎó!</b></p>"); 

$user_result=odbc_do($account_odbc,$strSql); 
$result_query=odbc_fetch_row($user_result); 
if (
odbc_result($user_result,1)!= ""$errors[] = "This Accountname already exists, please choose another one."
if(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$_POST[username])) $errors[]="You are only alowed to use uppper and lower cases in English in your username."
if(
strlen($_POST[username])) $errors[] = "The length of your username can't be less than 3 characters"
if(
strlen($_POST[username])>15$errors[]= "The length of your username can't be more than 15 characters"
if(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$_POST[password1])) $errors[]="You can only use English Characters of Upper case and lower case in your password. Try again"
if(
preg_match("/^[0-9]{3,15}$/i",$_POST[password1])) $errors[]="You are not alowed just to input numbers as your password."
if(
$_POST[username]==$_POST[password1]) $errors[]= "Accountname and password can't be the same!"
if(
strlen($_POST[password1])) $errors[] = "The length of the password can't be less than 3 characters"
if(
strlen($_POST[password1])>15$errors[] = "The length of the password can't be more than 15 characters"
if(
$_POST[password2]!=$_POST[password1]) $errors[] = "Password does not match"
if(!
preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i",$_POST[mail])) $errors[]="Your E-mail Adress is not valid. Please enter a valid one."
if(
strlen($_POST[referred])>20$errors[] = "The length of the referred name can't be more than 20 characters"
if(
sizeof($errors)>0){ 
$errorStr .= "<br><font>"
$errorStr .= "You have the following error(s):"
foreach(
$errors as $error
$errorStr .= "<li>$error</li>"
$errorStr .= "</font><br><br>"
}else{ 

$passwd_user=md5($_POST[password1]); 
$dk_time=strftime("%y%m%d%H%M%S"); 
list(
$usec1$sec1) = explode(" ",microtime()); 
$dk_user_no=$dk_time.substr($usec1,2,2); 

$dk_account_query="insert into user_profile(user_no,user_id,user_pwd,resident_no,user_type,login_flag, 
login_tag,ipt_time,login_time,logout_time,user_ip_addr,server_id) values('
$dk_user_no','$_POST[username]','$passwd_user','801011000000' 
,'1','0','Y','05/06/2009 00:00:00',null,null,null,'000')"


$dk_account_query2="insert into Tbl_user(user_no,user_id,user_pwd,user_mail,user_answer, 
user_question) values('
$dk_user_no','$_POST[username]','$_POST[password1]','$_POST 
[mail]',0,0)"


$dk_account_result1=odbc_do($account_odbc,$dk_account_query); 
$dk_account_result2=odbc_do($account_odbc,$dk_account_query2); 
odbc_close($account_odbc); 


return 
$errorStr


?>
my config.inc.php file

Quote:
PHP Code:
<?php

//żŞĘĽsession
session_start();

//ÉčÖò»˝řĐбľµŘ»ş´ć
header('Expires: '.date('D,d M Y H:i:s',mktime(0,0,0,1,1,2000)).' GMT');
header('Last-Modified:'.gmdate('D,d M Y H:i:s').' GMT');
header('Cache-control: private, no-cache,must-revalidate');
header('Pragma: no-cache');

$db_name="Elovron";
$db_host="localhost";
$db_user="sa";
$db_pwd="1234";
?>
my file register.html
HTML Code:
[CODE]	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />

	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<link href="stylin.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="image.css" />
	<title>Elovron Rejestracja</title>


<!--
The following are CSS Conditional Comments to fix 
IE's min-height non-existence and also, the fact 
that serif fonts do not render exactly the same 
size in all browsers. "lt IE 6" is equivalent to 
"less than IE 6". -ubik
-->

<!--[if lt IE 6]>
<style type="text/css">
.content {height:250px}
#main {height:400px}
h1 {font-size:50px}
</style>
<![endif]-->

<!--[if IE 6]>
<style type="text/css">
.content {height:190px}
#main {height:400px}
h1 {font-size:55px}
</style>
<![endif]-->


</head>



<body>
<div id="container">

<div id="header">
<h1></h1>
</div>


<div id="menu">

		<!-- Tutaj zaczyna się menu-->
		
        <a class="item" href="http://www.elovpolska.pl/index.html" title="Link do strony głównej serwisu">Strona Główna</a>

<a class="item" href="http://www.mysite.pl/O.gra.html" title="Opis Gry">O Grze</a>

         <a class="item" href="http://www.mysite.pl/download.html" title="Pobierz Klienta Gry">Download</a>


<a class="item" href="http://www.mysite.pl/register.html" title="Rejestracja Konta">Rejestracja</a>

         <a class="item" href="http://www.mysite.pl/forum/" title="Doł?cz do naszego Forum">Forum</a>
		 
<a class="item" href="http://www.mysite.pl/kontakt.html" title="Można się z nami skontaktować telefoniczne i mailowo">Kontakt</a>
			
					
										<!-- Tutaj konczy się menu -->



<div class="leftbox">
<h4>Elovron</h4>

												<ul><li>Graj teraz </li>

<li>za darmo</li>

						<li></li>

						

					</ul>
</div>



</div> <!--End "Menu" or left column in other words-->


<!-- All content inside the "main" container should be wrapped with "bottomRight" 
and "content" containers, for the box effect. -->

<div id="main">

<div class="bottomRight">
<div class="content">
					<!-- Tutaj zaczyna się treść -->

<h2>Rejestracja konta Elovron</h2>

<p>



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Account Registration</title>
<style type="text/css">
<!--
body,td,th {
	color: #FFFFFF;
}
body {
	background-color: #000000;
}
.style5 {	FONT-WEIGHT: bold; COLOR: #999999
}
.STYLE13 {FONT-WEIGHT: bold; COLOR: #FFFFFF; }
.STYLE14 {color: #FFFFFF}
.STYLE15 {
	font-size: 30px;
	font-weight: bold;
	color: #990033;
}
-->
</style></head>

<body><center>
<TABLE height=20 cellSpacing=0 cellPadding=0 width=461 border=0 bgcolor="#000000">
<TBODY>
              <TR>
                <TD width=10 rowspan="2" vAlign=top><IMG height=15 
                  src="http://www.elitepvpers.com/forum/images/type1.gif" width=2></TD>
                <TD><div align="center">
                  <p class="STYLE15">Wypełnij pola by móc zacząć grać</p>
                </div></TD>
              </TR>
              <TR>
                <TD><p class="STYLE6">
                  <?=$errorStr ?><br>
</p>
                </TD>
              </TR>
  </TBODY></TABLE>

<table width="778" height="330" 
                                border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
  <form method="post" action="register.php">
    <input type="hidden" name="step2" value="1" />
    <center>
      <tbody>
        <tr>
          <td height="37" class="STYLE13"><div align="left"><span class="STYLE1">Wybierz Serwer:</span></div></td>
          <td class="STYLE13"><p>
            <label>
              <input name="ZoneGroup" type="radio" value="zone1" checked="checked" />
              <span class="STYLE1"> Twój Serwer to Elovron</span></label>
            <span class="STYLE1">
              <label></label>
              <br />
              <label></label>
            </span></p></td>
        </tr>
        <tr height="40">
          <td width="130" class="style5 STYLE14">&nbsp;&nbsp;
              <div align="left">Nazwa_konta </div></td>
          <td width="210"><div align="left">
            <input name="username" type="text" value="" />
          </div></td>
          <td width="438" class="STYLE13"><div align="left">Tylko litery i cyfry bez znaków specjalnych. Długość nazwy konta nie może mieć mniej niż 3 a nie więcej niż 15 znaków.</div></td>
        </tr>
        <tr>
          <td height="40" class="STYLE13">&nbsp;&nbsp;
              <div align="left">Hasło</div></td>
          <td height="40"><div align="left">
            <input name="password1" type="password" value="" />
          </div></td>
          <td height="40" class="STYLE13"><div align="left">Tylko litery i cyfry bez znaków specjalnych. Od 3 do 15 znaków.</div></td>
        </tr>
        <tr>
          <td height="40" class="STYLE13">&nbsp;&nbsp;
              <div align="left">Powtórz Hasło</div></td>
          <td height="40"><div align="left">
            <input name="password2" type="password" value="" />
          </div></td>
          <td height="40" class="STYLE13"><div align="left">Powtórz powyżej wprowadzone hasło.</div></td>
        </tr>
        <tr>
          <td height="40" class="STYLE13">&nbsp;&nbsp;
              <div align="left">E-mail</div></td>
          <td height="40"><div align="left">
            <input name="mail" type="text" value="" />
          </div></td>
          <td height="40" class="STYLE13"><div align="left">Podaj Aktualny adres E-mail Zeby miec mozliwośc odzyskania hasła</div></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td colspan="2" class="STYLE13">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="3" height="10"><input name="submit" type="submit"  value="Utwórz Konto" /></td>
        </tr>
      </tbody>
    </center>
  </form>
</table>
</center>
</body>


<!-- Tutaj kończy się rejestracja-->	
</div>
</div>



</div>

<!--If you have many links, you can edit the margin-left in "#footer a" in the CSS--> 
<div id="footer">


<!--please keep designed by message, I made it small and dark. thanks-->
<p>Kontakt: <a href="mailto:[Only registered and activated users can see links. Click Here To Register...]">pomoc</a> | Opracowanie <a href="http://www.mysite.pl">Elovron Clon 2Moons</a></p>

</div>

</div>
</body>
</html><td></td>[/CODE]
my question is if you can somehow fix it if you can please answer it because I can not deal with it for 2 weeks fighting the thanks you in advance for your help and sorry for my english
03/16/2013 17:36 alexmak96#2
$db_name="Elovron"; must be $db_name="account";


$account_odbc = odbc_connect('account','sa,'1234');
} elseif ($_POST[ZoneGroup]=="zone2") {
$account_odbc = odbc_connect('account2','sa','1234');
03/16/2013 21:13 ihatehacks#3
That is the sloppiest pile of shitty code that I've seen in a long time.

It's not even worth my time trying to fix it for you.
03/17/2013 10:09 pawelxx99l#4
I tried to do with the other party registration script that I found on the internet at forums
but all the work went for naught still have the same problems pop up and registration can not be completed jeszcze4 can someone has any ideas how to fix this I used the advice alexmak96 and nothing helped
03/17/2013 10:35 alexmak96#5
Maybe u didn't setted up ODBC right
03/17/2013 14:55 pawelxx99l#6
Quote:
Originally Posted by alexmak96 View Post
Maybe u didn't setted up ODBC right
See below I set the ODBC final test comes in all the same positive view


step one

[Only registered and activated users can see links. Click Here To Register...]

step two

[Only registered and activated users can see links. Click Here To Register...]

step three

[Only registered and activated users can see links. Click Here To Register...]

The fourth step

[Only registered and activated users can see links. Click Here To Register...]

step Five

[Only registered and activated users can see links. Click Here To Register...]

The sixth step

[Only registered and activated users can see links. Click Here To Register...]

seventh step

[Only registered and activated users can see links. Click Here To Register...]


of expensive ODBC or account two iteż acted as the test was successfully completed what I needed to do to fix this problem
03/17/2013 22:27 janvier123#7
NON ODBC script => [Only registered and activated users can see links. Click Here To Register...]
requires mssql_connect