Jump to content

[SOLVED] Help me please


FXC

Recommended Posts

 

Hi guys, sup?

I have this code:

 

<?php

require ("config.php");
$i=$_POST[submit];

if(isset($i))
{
$ruser=$_POST[rusername];
$rpass=$_POST[rpassword];
$regcode2=$_POST[regcode];

if($regcode==$regcode2)
{
require("connect.php");
$ruser = mysql_real_escape_string($ruser);
$rpass = mysql_real_escape_string($rpass);

mysql_query("INSERT INTO users (user,pass,uploads,downloads,rep) VALUES ('$ruser','$rpass',0,0,0)") or die(mysql_error());
echo ("Succes!");
}else{
sleep(2);
echo "Wrong register code! Try again or leave.";
}

}




?>
<style type="text/css">
<!--
.style2 {color: #990033}
-->
</style>


<form action="<?php echo htmlentities(strip_tags($_SERVER['SCRIPT_URL']));?>" method="post" name="form1" class="style2" id="form1">
  <pre><label>    Username:   <input name="username" type="text" id="rusername" maxlength="12" /> Max. 12 characters
    </label>Password:<label>   <input name="password" type="password" id="rpassword" maxlength="12" /> Max. 12 characters<br /></label>Registercode:   <label><input type="text" name="regcode" id="regcode" /> Contact the admin for the code
    </label>

             <label><input type="submit"  name="submit" id="submit" value="Register" />
    </label>
  </pre>
</form>



 

 

What I want it to do is:

 

Let the user choose a user name and password and then fill in a the regcode (just a pass so not everybody can register)

 

Then I want to check if the form is send and so yes check the register code, connect to mysql and anti sql the input then put the input in the database.

The problem is that the $ruser and $password are just empty in mysql and I can't seem to echo them. They just stay empty :| Where is it going wrong?

 

Please help me guys,

 

 

Thanks alot  ;D

 

 

 

Don't know of it mathers but this page is included by my index page like: index.php?p=register

Link to comment
https://forums.phpfreaks.com/topic/122109-solved-help-me-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.