Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 04:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Coding Help Reg.php Srevoultion

Discussion on Coding Help Reg.php Srevoultion within the SRO Coding Corner forum part of the Silkroad Online category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
Coding Help Reg.php Srevoultion



Error on line 115. Code

Code:
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #FFFFFF;
}
body {
	background-color: #000000;
}
-->
</style>
<?php
//////////////////////////////////////////////////////////////////////////////////////
// IMPORTANT!!!!!!
// SEARCH FOR >>>>> YOUR_DATABASE <<<<< AND replace it with your database NAME!
// Xsense
//////////////////////////////////////////////////////////////////////////////////////
$mssql = array(
		'host' => "pmetzler-PC\SQLEXPRESS",		//Your mssql host goes here
		'user' => "sa",		//Your mssql username goes here
		'pass' => "1234"		//Your mssql password goes here
	);

function anti_injection($sql) {
   $sql 			= preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
   $sql 			= trim($sql);
   $sql 			= strip_tags($sql);
   $sql 			= addslashes($sql);
   return $sql;
}

if($_POST['activ'] == '1') {

		$accname 		= anti_injection($_POST['accname']);
		$accpass1 		= anti_injection($_POST['accpass1']);
		$accpass2 		= anti_injection($_POST['accpass2']);
		$con 			= mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
		$result1 		= mssql_query("SELECT * FROM silk.dbo.users WHERE id = '".$accname."'",$con);
		$row1 			= mssql_num_rows($result1);
		
		if(empty($accname) || empty($accpass1) || empty($accpass2)|| empty($accname)) {
			echo "<br>You didnt fill in all fields<a href='javascript:history.back()'>Go Back</a>";
		} elseif($row1 > '0' || $row2 > '0') {
			echo "<br>This Account name already exists.<a href='javascript:history.back()'>Go Back</a>";
		} elseif($accpass1 != $accpass2) {
			echo "<br>The passwords did not match<a href='javascript:history.back()'>Go Back</a>";
		} elseif($accpass1 == $accname) {
			echo "<br>Account name and password are the same.<a href='javascript:history.back()'>Go Back</a>";
		} elseif(!preg_match("/^[0-9a-zA-Z]{3,15}$/i", $accname)) {
			echo "<br>Enter a account name only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
		} elseif(!preg_match("/^[0-9a-zA-Z]{3,15}$/i", $accpass1)) {
			echo "<br>Enter a password only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
		} elseif(strlen($accname) < 3 || strlen($accname) > 15) {
			echo "<br>Username Must be above 3 and lower then 15 <a href='javascript:history.back()'>Go Back</a>";
		} elseif(strlen($accpass1) < 3 || strlen($accpass1) > 15) {
			echo "<br>Password Must be above 3 and lower then 15 .<a href='javascript:history.back()'>Go Back</a>";
		} else {

		$accpass 		= md5($accpass1);
		$con 			= mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
						  mssql_query("INSERT INTO silk.dbo.users (
						  											id,
																	password,
																	online,
																	unknown,
																	unknown2,
																	silk,
																	gold
																)
														VALUES 	(
																	'".$accname."',
																	'".$accpass."',
																	'0',
																	'0',
																	'0',
																	'0',
																	'0'
																)",$con);
?>
	<center>
		<table width="500">
			<tr>
	  			<td colspan='2' align='center'><img src="top.jpg" width="500" height="300" /></td>
			</tr>
			<tr>
	  			<td colspan="2" align="center" bgcolor="#333333">
					Welcome to srevolution! Below are your details! Keep them safe!
				</td>
			</tr>
			<tr>
	  			<td bgcolor="#666666">
					Account name: 
				</td>
				<td bgcolor="#666666">
					<b><?php echo "".$accname.""; ?></b>
				</td>
			</tr>
			<tr>
	  			<td bgcolor="#333333">
					Your password: 
				</td>
				<td bgcolor="#333333">
					<b><?php echo "".$accpass1.""; ?></b>
				</td>
			</tr>
		</table>
	</center>

<?php
		}

} else {

	$con 			= mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
	$result1 		= mssql_query("SELECT * FROM silk.dbo.users",$con);
	$row1 			= mssql_num_rows($result1);
?>	

	<form action='reg.php' method='POST'>
		<center>
			<table width="500">
				<tr>
	  				<td colspan='2' align='center'>
						<img src="top.jpg" width="500" height="300" />
					</td>
				</tr>
				<tr>
					<td bgcolor="#333333">Account Name</td>
					<td bgcolor="#333333">
						<input type='text' name='accname' maxlength='12'>
					</td>
				</tr>
				<tr>
					<td bgcolor="#666666">Password</td>
					<td bgcolor="#666666">
						<input type='password' name='accpass1' maxlength='12'>
					</td>
				</tr>
				<tr>
					<td bgcolor="#333333">Again pass.</td>
					<td bgcolor="#333333">
						<input type='password' name='accpass2' maxlength='12'>
					</td>
				</tr>
				<tr>
					<td align='center' bgcolor="#666666">
					</td>
	  				<td align='right' bgcolor="#666666">
						<input type='hidden' name='activ' value='1' />
        				<input name="submit" type='submit' value='Create Account' />
					</td>
				</tr>
			</table>
		</center>
	</form>
	
<?php
}
?>
Monaiz is offline  
Old 11/24/2010, 22:25   #2
 
-Corelli's Avatar
 
elite*gold: 0
Join Date: Apr 2010
Posts: 127
Received Thanks: 14
me to
-Corelli is offline  
Old 11/25/2010, 11:03   #3
 
ahmed4ever2u's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 1,511
Received Thanks: 886
i wont help u -.-
ahmed4ever2u is offline  
Old 11/26/2010, 02:10   #4
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
anyone
Monaiz is offline  
Old 11/27/2010, 16:39   #5
 
elite*gold: 0
Join Date: May 2009
Posts: 478
Received Thanks: 182
which one is 115 line?
p1ter is offline  
Old 11/27/2010, 16:46   #6
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
line 115 is this
Code:
	$con 			= mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
Monaiz is offline  
Old 11/27/2010, 16:53   #7
 
elite*gold: 0
Join Date: May 2009
Posts: 478
Received Thanks: 182
i bet you haven't enabled mssql_connect function or something related with it.
p1ter is offline  
Old 11/27/2010, 17:01   #8
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
How do i enable it
Monaiz is offline  
Old 11/27/2010, 17:03   #9
 
Shane¸'s Avatar
 
elite*gold: 100
Join Date: May 2010
Posts: 1,948
Received Thanks: 1,635
Quote:
Originally Posted by Monaiz View Post
line 115 is this
Code:
	$con 			= mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
PHP Code:
mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']); 
For example?

PHP Code:
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #FFFFFF;
}
body {
    background-color: #000000;
}
-->
</style>
<?php
//////////////////////////////////////////////////////////////////////////////////////
// IMPORTANT!!!!!!
// SEARCH FOR >>>>> YOUR_DATABASE <<<<< AND replace it with your database NAME!
// Xsense
//////////////////////////////////////////////////////////////////////////////////////
$mssql = array(
        
'host' => "localhost",        //Your mssql host goes here
        
'user' => "sa",        //Your mssql username goes here
        
'pass' => "1234"        //Your mssql password goes here
    
);

function 
anti_injection($sql) {
   
$sql             preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
   
$sql             trim($sql);
   
$sql             strip_tags($sql);
   
$sql             addslashes($sql);
   return 
$sql;
}

if(
$_POST['activ'] == '1') {

        
$accname         anti_injection($_POST['accname']);
        
$accpass1         anti_injection($_POST['accpass1']);
        
$accpass2         anti_injection($_POST['accpass2']);
        
$con             mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
        
$result1         mssql_query("SELECT * FROM silk.dbo.users WHERE id = '".$accname."'",$con);
        
$row1             mssql_num_rows($result1);
        
        if(empty(
$accname) || empty($accpass1) || empty($accpass2)|| empty($accname)) {
            echo 
"<br>You didnt fill in all fields<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$row1 '0' || $row2 '0') {
            echo 
"<br>This Account name already exists.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$accpass1 != $accpass2) {
            echo 
"<br>The passwords did not match<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$accpass1 == $accname) {
            echo 
"<br>Account name and password are the same.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$accname)) {
            echo 
"<br>Enter a account name only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$accpass1)) {
            echo 
"<br>Enter a password only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
strlen($accname) < || strlen($accname) > 15) {
            echo 
"<br>Username Must be above 3 and lower then 15 <a href='javascript:history.back()'>Go Back</a>";
        } elseif(
strlen($accpass1) < || strlen($accpass1) > 15) {
            echo 
"<br>Password Must be above 3 and lower then 15 .<a href='javascript:history.back()'>Go Back</a>";
        } else {

        
$accpass         md5($accpass1);
        
$con             mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']);
                          
mssql_query("INSERT INTO silk.dbo.users (
                                                                      id,
                                                                    password,
                                                                    online,
                                                                    unknown,
                                                                    unknown2,
                                                                    silk,
                                                                    gold
                                                                )
                                                        VALUES     (
                                                                    '"
.$accname."',
                                                                    '"
.$accpass."',
                                                                    '0',
                                                                    '0',
                                                                    '0',
                                                                    '0',
                                                                    '0'
                                                                )"
,$con);
?>
    <center>
        <table width="500">
            <tr>
                  <td colspan='2' align='center'><img src="top.jpg" width="500" height="300" /></td>
            </tr>
            <tr>
                  <td colspan="2" align="center" bgcolor="#333333">
                    Welcome to srevolution! Below are your details! Keep them safe!
                </td>
            </tr>
            <tr>
                  <td bgcolor="#666666">
                    Account name: 
                </td>
                <td bgcolor="#666666">
                    <b><?php echo "".$accname.""?></b>
                </td>
            </tr>
            <tr>
                  <td bgcolor="#333333">
                    Your password: 
                </td>
                <td bgcolor="#333333">
                    <b><?php echo "".$accpass1.""?></b>
                </td>
            </tr>
        </table>
    </center>

<?php
        
}

} else {

    
$con             mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']);
    
$result1         mssql_query("SELECT * FROM silk.dbo.users",$con);
    
$row1             mssql_num_rows($result1);
?>    

    <form action='reg.php' method='POST'>
        <center>
            <table width="500">
                <tr>
                      <td colspan='2' align='center'>
                        <img src="top.jpg" width="500" height="300" />
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#333333">Account Name</td>
                    <td bgcolor="#333333">
                        <input type='text' name='accname' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#666666">Password</td>
                    <td bgcolor="#666666">
                        <input type='password' name='accpass1' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#333333">Again pass.</td>
                    <td bgcolor="#333333">
                        <input type='password' name='accpass2' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td align='center' bgcolor="#666666">
                    </td>
                      <td align='right' bgcolor="#666666">
                        <input type='hidden' name='activ' value='1' />
                        <input name="submit" type='submit' value='Create Account' />
                    </td>
                </tr>
            </table>
        </center>
    </form>
    
<?php
}
?>
I corrected it, I guess. If it doesn't work, feel free to tell me.
Shane¸ is offline  
Old 11/27/2010, 17:36   #10
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
kk atm im uploading to website host
Monaiz is offline  
Old 11/27/2010, 17:54   #11
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by .Shane. View Post
PHP Code:
mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']); 
For example?

PHP Code:
<style type="text/css">
<!--
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #FFFFFF;
}
body {
    background-color: #000000;
}
-->
</style>
<?php
//////////////////////////////////////////////////////////////////////////////////////
// IMPORTANT!!!!!!
// SEARCH FOR >>>>> YOUR_DATABASE <<<<< AND replace it with your database NAME!
// Xsense
//////////////////////////////////////////////////////////////////////////////////////
$mssql = array(
        
'host' => "localhost",        //Your mssql host goes here
        
'user' => "sa",        //Your mssql username goes here
        
'pass' => "1234"        //Your mssql password goes here
    
);

function 
anti_injection($sql) {
   
$sql             preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
   
$sql             trim($sql);
   
$sql             strip_tags($sql);
   
$sql             addslashes($sql);
   return 
$sql;
}

if(
$_POST['activ'] == '1') {

        
$accname         anti_injection($_POST['accname']);
        
$accpass1         anti_injection($_POST['accpass1']);
        
$accpass2         anti_injection($_POST['accpass2']);
        
$con             mssql_connect($mssql['host'],$mssql['user'],$mssql['pass']);
        
$result1         mssql_query("SELECT * FROM silk.dbo.users WHERE id = '".$accname."'",$con);
        
$row1             mssql_num_rows($result1);
        
        if(empty(
$accname) || empty($accpass1) || empty($accpass2)|| empty($accname)) {
            echo 
"<br>You didnt fill in all fields<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$row1 '0' || $row2 '0') {
            echo 
"<br>This Account name already exists.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$accpass1 != $accpass2) {
            echo 
"<br>The passwords did not match<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
$accpass1 == $accname) {
            echo 
"<br>Account name and password are the same.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$accname)) {
            echo 
"<br>Enter a account name only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(!
preg_match("/^[0-9a-zA-Z]{3,15}$/i"$accpass1)) {
            echo 
"<br>Enter a password only with 0-9 , a-z and A-Z.<a href='javascript:history.back()'>Go Back</a>";
        } elseif(
strlen($accname) < || strlen($accname) > 15) {
            echo 
"<br>Username Must be above 3 and lower then 15 <a href='javascript:history.back()'>Go Back</a>";
        } elseif(
strlen($accpass1) < || strlen($accpass1) > 15) {
            echo 
"<br>Password Must be above 3 and lower then 15 .<a href='javascript:history.back()'>Go Back</a>";
        } else {

        
$accpass         md5($accpass1);
        
$con             mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']);
                          
mssql_query("INSERT INTO silk.dbo.users (
                                                                      id,
                                                                    password,
                                                                    online,
                                                                    unknown,
                                                                    unknown2,
                                                                    silk,
                                                                    gold
                                                                )
                                                        VALUES     (
                                                                    '"
.$accname."',
                                                                    '"
.$accpass."',
                                                                    '0',
                                                                    '0',
                                                                    '0',
                                                                    '0',
                                                                    '0'
                                                                )"
,$con);
?>
    <center>
        <table width="500">
            <tr>
                  <td colspan='2' align='center'><img src="top.jpg" width="500" height="300" /></td>
            </tr>
            <tr>
                  <td colspan="2" align="center" bgcolor="#333333">
                    Welcome to srevolution! Below are your details! Keep them safe!
                </td>
            </tr>
            <tr>
                  <td bgcolor="#666666">
                    Account name: 
                </td>
                <td bgcolor="#666666">
                    <b><?php echo "".$accname.""?></b>
                </td>
            </tr>
            <tr>
                  <td bgcolor="#333333">
                    Your password: 
                </td>
                <td bgcolor="#333333">
                    <b><?php echo "".$accpass1.""?></b>
                </td>
            </tr>
        </table>
    </center>

<?php
        
}

} else {

    
$con             mssql_connect($mssql['localhost'],$mssql['sa'],$mssql['1234']);
    
$result1         mssql_query("SELECT * FROM silk.dbo.users",$con);
    
$row1             mssql_num_rows($result1);
?>    

    <form action='reg.php' method='POST'>
        <center>
            <table width="500">
                <tr>
                      <td colspan='2' align='center'>
                        <img src="top.jpg" width="500" height="300" />
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#333333">Account Name</td>
                    <td bgcolor="#333333">
                        <input type='text' name='accname' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#666666">Password</td>
                    <td bgcolor="#666666">
                        <input type='password' name='accpass1' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#333333">Again pass.</td>
                    <td bgcolor="#333333">
                        <input type='password' name='accpass2' maxlength='12'>
                    </td>
                </tr>
                <tr>
                    <td align='center' bgcolor="#666666">
                    </td>
                      <td align='right' bgcolor="#666666">
                        <input type='hidden' name='activ' value='1' />
                        <input name="submit" type='submit' value='Create Account' />
                    </td>
                </tr>
            </table>
        </center>
    </form>
    
<?php
}
?>
I corrected it, I guess. If it doesn't work, feel free to tell me.
Of course it doesn't work! You should select the values in the array using their keys.

My guess is that his webhost doesn't have MSSQL connection support.
I use x10hosting.
lesderid is offline  
Old 11/27/2010, 17:58   #12
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
let me signup for x10
Monaiz is offline  
Old 11/27/2010, 18:04   #13
 
elite*gold: 0
Join Date: Nov 2010
Posts: 76
Received Thanks: 7
Quote:
Originally Posted by lesderid View Post
Of course it doesn't work! You should select the values in the array using their keys.

My guess is that his webhost doesn't have MSSQL connection support.
I use x10hosting.
Wait so does the code that guy gave me work or no
Monaiz is offline  
Old 11/27/2010, 18:13   #14
 
Shane¸'s Avatar
 
elite*gold: 100
Join Date: May 2010
Posts: 1,948
Received Thanks: 1,635
Quote:
Originally Posted by lesderid View Post
Of course it doesn't work! You should select the values in the array using their keys.

My guess is that his webhost doesn't have MSSQL connection support.
I use x10hosting.
I tought he is hosting the reg page from localhost with xammp or apache. Nvm
Shane¸ is offline  
Old 11/27/2010, 18:26   #15
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by Monaiz View Post
Wait so does the code that guy gave me work or no
It doesn't, just use the original page. (with another webhost)
lesderid is offline  
Closed Thread


Similar Threads Similar Threads
*NEW CODING ART!!!..........:::::~WhiteLight D3D~:::::..........*NEW CODING ART!!!
09/21/2010 - WarRock Hacks, Bots, Cheats & Exploits - 25 Replies
http://250kb.de/u/100911/p/m4buevNCZhoQ.PNG Download: Multiupload.com - upload your files to multiple file hosting sites! VirusScan: VirusTotal - Free Online Virus, Malware and URL Scanner Funktionen: SuperJump Teleport NoSpread NoRecoil



All times are GMT +2. The time now is 04:31.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.