Jump to content

Recommended Posts

Register.php :

<div align="center"></br></br></br></br></br></br></br></br>
<form method="post" action="sendaccinfo.php" name="register">
<table>
<tr>
<td><strong><font color="#8A2BE2">noTrebitel:</font></strong></td><td><input type="text" name="username" maxlength="12"/></br></td>
</tr>
<tr>
<td><strong><font color="#8A2BE2">naroLa:</font></strong></td><td> <input type="password" name="pass"/></br></font></td>
</tr>
<input name="userip" value="<? echo $_SERVER['REMOTE_ADDR']; ?>" type="hidden"/>
<tr><td></td><td><div align="right"><input type="submit" value="peGistrirai cE"/></div></td></tr>
</table>
</form>
</div>

And here is the login.php which I renamed to sendaccinfo.php :

<?
$ip = $_POST['userip'];
$username = $_POST['username'];
$pass = $_POST['pass'];

include 'condb.php';
$query = "SELECT ip FROM users WHERE ip='$ip'";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){$match=true;}
if (isset($match)){$msg="weche si se registriral!";
}else{$query = "INSERT INTO users (ip, username, password) VALUES('$ip', '$username', '$pass')";
mysql_query($query) or die(mysql_error());
$msg="Registrira se uspeshno!";
}
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
mysql_close();
?>

your php script is not coded in correct terms.

 

<?
$ip = $_POST['userip'];
$username = $_POST['username'];
$pass = $_POST['pass'];

include 'condb.php';
$query = "SELECT ip FROM users WHERE ip='$ip'";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){$match=true;}
if (isset($match)){$msg="weche si se registriral!";
}else{$query = "INSERT INTO users (ip, username, password) VALUES('$ip', '$username', '$pass')";
mysql_query($query) or die(mysql_error());
$msg="Registrira se uspeshno!";
}
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
mysql_close();
?>

 

at the starting of the code change

<? 

to

<?php

try to use this script for your sendaccinfo.php

 

<?php
// get all data from forms
$ip = $_POST['userip'];
$username = $_POST['username'];
$pass = $_POST['pass'];

// connect to db
include 'condb.php';

// ask mysql
$query = "SELECT ip FROM users WHERE ip='$ip'";

// get result from mysql
$result = mysql_query($query);

while($row = mysql_fetch_assoc($result)){
$match=true;
}
if (isset($match)){
$msg = "weche si se registriral!";
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
}else{$query = "INSERT INTO users (ip, username, password) VALUES('$ip', '$username', '$pass')";
mysql_query($query) or die(mysql_error());
$msg = "Registrira se uspeshno!";
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
}

mysql_close();
?>

try creating a new page with only this codes

 

test.html

<div align="center"></br></br></br></br></br></br></br></br>
<form method="post" action="check.php" name="register">
<table>
<tr>
<td><strong><font color="#8A2BE2">noTrebitel:</font></strong></td><td><input type="text" name="username" maxlength="12"/></br></td>
</tr>
<tr>
<td><strong><font color="#8A2BE2">naroLa:</font></strong></td><td> <input type="password" name="pass"/></br></font></td>
</tr>
<input name="userip" value="<? echo $_SERVER['REMOTE_ADDR']; ?>" type="hidden"/>
<tr><td></td><td><div align="right"><input type="submit" value="peGistrirai cE"/></div></td></tr>
</table>
</form>
</div>

 

check.php

<?php
$ip = $_POST['userip'];
$username = $_POST['username'];
$pass = $_POST['pass'];


include 'condb.php';
$query = "SELECT ip FROM users WHERE ip='$ip'";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){$match=true;}
if (isset($match)){
$msg = "weche si se registriral!";
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
}else{$query = "INSERT INTO users (ip, username, password) VALUES('$ip', '$username', '$pass')";
mysql_query($query) or die(mysql_error());
$msg = "Registrira se uspeshno!";
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
}

mysql_close();
?>

 

if it works means there is something wrong with your server or your full page script.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.