Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Code does not work in v7 but work in v6

Asked Modified Viewed 1,338 times
D
deals
D
deals 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

This code in Custom Pages

<br><br>
<center>
<?php
   mysql_select_db("$rdb");

$email = get_magic_quotes_gpc() ? $_POST['email']    : mysql_escape_string ($_POST['email']);
$user= get_magic_quotes_gpc() ? $_POST['user']    :  mysql_escape_string($_POST['user']);
$pass= get_magic_quotes_gpc() ? $_POST['pass']    : mysql_escape_string($_POST['pass']);

if  (empty($_POST['user']) or empty($_POST['pass']) or empty($_POST['email'])){
   $cont='&#1053;&#1077; &#1079;&#1072;&#1087;&#1086;&#1083;&#1085;&#1077;&#1085;&#1099; &#1074;&#1089;&#1077; &#1076;&#1072;&#1085;&#1085;&#1099;&#1077;.';
}
elseif(!preg_match("/^[a-zA-Z0-9]+$/i", $pass)){
   $cont='&#1055;&#1072;&#1088;&#1086;&#1083;&#1100; &#1076;&#1086;&#1083;&#1078;&#1077;&#1085; &#1089;&#1086;&#1089;&#1090;&#1086;&#1103;&#1090;&#1100; &#1090;&#1086;&#1083;&#1100;&#1082;&#1086; &#1080;&#1079; &#1073;&#1091;&#1082;&#1074; &#1080; &#1094;&#1080;&#1092;&#1088;.';
}
elseif(!preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i", $email)){
   $cont='&#1053;&#1077; &#1087;&#1088;&#1072;&#1074;&#1080;&#1083;&#1100;&#1085;&#1099;&#1081; email.';
}
else
{
$cont='&#1057;&#1086;&#1079;&#1076;&#1072;&#1085;&#1080;&#1077; &#1072;&#1082;&#1082;&#1072;&#1091;&#1085;&#1090;&#1072; &#1091;&#1089;&#1087;&#1077;&#1096;&#1085;&#1086; &#1079;&#1072;&#1074;&#1077;&#1088;&#1096;&#1077;&#1085;&#1086;!';

$q  = mysql_query("SELECT * FROM account WHERE username = '$user' ");
$q2 = mysql_num_rows($q);

if($q2 == 0){$query = mysql_query("INSERT INTO account (username, password, email) VALUES ('$user', SHA1(CONCAT(UPPER('$user'),':',UPPER('$pass'))), '$email')") ;
}
}
mysql_select_db("$db_name");
?>
<form name="form1" method="post">
   &#1051;&#1086;&#1075;&#1080;&#1085;/Username:<br>
  <input type="text" name="user" id="user"><br>
   &#1055;&#1072;&#1088;&#1086;&#1083;&#1100;/Password:<br>
   <input type="password" name="pass" id="pass"><br>
   E-Mail: <br>
   <input type="text" name="email" id="email"><br>
   <br><font color=red /><b /><?php print $cont ?><br><br>
   <input type="submit" name="Submit" value="&#1047;&#1072;&#1088;&#1077;&#1075;&#1080;&#1089;&#1090;&#1088;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100;">
   <input type="reset" name="Clear" value="&#1054;&#1095;&#1080;&#1089;&#1090;&#1080;&#1090;&#1100;">
   </form>

</center>


Error:


Notice: Undefined index: email in C:\xampp\htdocs\viewpage.php(34) : eval()'d code on line 6

Notice: Undefined index: user in C:\xampp\htdocs\viewpage.php(34) : eval()'d code on line 7

Notice: Undefined index: pass in C:\xampp\htdocs\viewpage.php(34) : eval()'d code on line 8


How to correct this error?
0 replies
There are no post found.

Category Forum

General Discussion

Labels

None yet

Statistics

  • Views 0 views
  • Posts 0 posts
  • Votes 0 votes
  • Topic users 1 member

1 participant

D
D
deals 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet