hi I am doing a project using php in dbms and while trying to register it shows the following error...
up vote
-3
down vote
favorite
This question already has an answer here:
Deprecated: Function eregi() is deprecated in [duplicate]
3 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
Reference - What does this error mean in PHP?
31 answers
this is my code:`
if(!empty($_POST))
{
$msg="";
if(empty($_POST['fnm']) || empty($_POST['unm']) || empty($_POST['gender']) || empty($_POST['pwd']) || empty($_POST['cpwd']) || empty($_POST['mail'])||empty($_POST['city']))
{
$msg.="<li>Please full fill all requirement";
}
if($_POST['pwd']!=$_POST['cpwd'])
{
$msg.="<li>Please Enter your Password Again.....";
}
if(!eregi("^[a-z0-9_]+[a-z0-9_.]*@[a-z0-9_-]+[a-z0-9_.-]*.[a-z]{2,5}$",$_POST['mail']))
{
$msg.="<li>Please Enter Your Valid Email Address...";
}
if(strlen($_POST['pwd'])>10)
{
$msg.="<li>Please Enter Your Password in limited Format....";
}
if(is_numeric($_POST['fnm']))
{
$msg.="<li>Name must be in String Format...";
}
if($msg!="")
{
header("location:register.php?error=".$msg);
}
else
{
$fnm=$_POST['fnm'];
$unm=$_POST['unm'];
$pwd=$_POST['pwd'];
$gender=$_POST['gender'];
$email=$_POST['mail'];
$contact=$_POST['contact'];
$city=$_POST['city'];
$query="insert into user(u_fnm,u_unm,u_pwd,u_gender,u_email,u_contact,u_city)
values('$fnm','$unm','$pwd','$gender','$email','$contact','$city')";
mysqli_query($conn,$query) or die("Can't Execute Query...");
header("location:register.php?ok=1");
}
}
else
{
header("location:index.php");
}
?> `
and the error shown is: Fatal error: Uncaught Error: Call to undefined function eregi() in C:xampphtdocsonlineprocess_register.php:18 Stack trace: #0 {main} thrown in C:xampphtdocsonlineprocess_register.php on line 18
php mysql mysqli
marked as duplicate by Funk Forty Niner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 20 at 13:45
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
-3
down vote
favorite
This question already has an answer here:
Deprecated: Function eregi() is deprecated in [duplicate]
3 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
Reference - What does this error mean in PHP?
31 answers
this is my code:`
if(!empty($_POST))
{
$msg="";
if(empty($_POST['fnm']) || empty($_POST['unm']) || empty($_POST['gender']) || empty($_POST['pwd']) || empty($_POST['cpwd']) || empty($_POST['mail'])||empty($_POST['city']))
{
$msg.="<li>Please full fill all requirement";
}
if($_POST['pwd']!=$_POST['cpwd'])
{
$msg.="<li>Please Enter your Password Again.....";
}
if(!eregi("^[a-z0-9_]+[a-z0-9_.]*@[a-z0-9_-]+[a-z0-9_.-]*.[a-z]{2,5}$",$_POST['mail']))
{
$msg.="<li>Please Enter Your Valid Email Address...";
}
if(strlen($_POST['pwd'])>10)
{
$msg.="<li>Please Enter Your Password in limited Format....";
}
if(is_numeric($_POST['fnm']))
{
$msg.="<li>Name must be in String Format...";
}
if($msg!="")
{
header("location:register.php?error=".$msg);
}
else
{
$fnm=$_POST['fnm'];
$unm=$_POST['unm'];
$pwd=$_POST['pwd'];
$gender=$_POST['gender'];
$email=$_POST['mail'];
$contact=$_POST['contact'];
$city=$_POST['city'];
$query="insert into user(u_fnm,u_unm,u_pwd,u_gender,u_email,u_contact,u_city)
values('$fnm','$unm','$pwd','$gender','$email','$contact','$city')";
mysqli_query($conn,$query) or die("Can't Execute Query...");
header("location:register.php?ok=1");
}
}
else
{
header("location:index.php");
}
?> `
and the error shown is: Fatal error: Uncaught Error: Call to undefined function eregi() in C:xampphtdocsonlineprocess_register.php:18 Stack trace: #0 {main} thrown in C:xampphtdocsonlineprocess_register.php on line 18
php mysql mysqli
marked as duplicate by Funk Forty Niner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 20 at 13:45
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
1
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
1
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45
add a comment |
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
This question already has an answer here:
Deprecated: Function eregi() is deprecated in [duplicate]
3 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
Reference - What does this error mean in PHP?
31 answers
this is my code:`
if(!empty($_POST))
{
$msg="";
if(empty($_POST['fnm']) || empty($_POST['unm']) || empty($_POST['gender']) || empty($_POST['pwd']) || empty($_POST['cpwd']) || empty($_POST['mail'])||empty($_POST['city']))
{
$msg.="<li>Please full fill all requirement";
}
if($_POST['pwd']!=$_POST['cpwd'])
{
$msg.="<li>Please Enter your Password Again.....";
}
if(!eregi("^[a-z0-9_]+[a-z0-9_.]*@[a-z0-9_-]+[a-z0-9_.-]*.[a-z]{2,5}$",$_POST['mail']))
{
$msg.="<li>Please Enter Your Valid Email Address...";
}
if(strlen($_POST['pwd'])>10)
{
$msg.="<li>Please Enter Your Password in limited Format....";
}
if(is_numeric($_POST['fnm']))
{
$msg.="<li>Name must be in String Format...";
}
if($msg!="")
{
header("location:register.php?error=".$msg);
}
else
{
$fnm=$_POST['fnm'];
$unm=$_POST['unm'];
$pwd=$_POST['pwd'];
$gender=$_POST['gender'];
$email=$_POST['mail'];
$contact=$_POST['contact'];
$city=$_POST['city'];
$query="insert into user(u_fnm,u_unm,u_pwd,u_gender,u_email,u_contact,u_city)
values('$fnm','$unm','$pwd','$gender','$email','$contact','$city')";
mysqli_query($conn,$query) or die("Can't Execute Query...");
header("location:register.php?ok=1");
}
}
else
{
header("location:index.php");
}
?> `
and the error shown is: Fatal error: Uncaught Error: Call to undefined function eregi() in C:xampphtdocsonlineprocess_register.php:18 Stack trace: #0 {main} thrown in C:xampphtdocsonlineprocess_register.php on line 18
php mysql mysqli
This question already has an answer here:
Deprecated: Function eregi() is deprecated in [duplicate]
3 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
Reference - What does this error mean in PHP?
31 answers
this is my code:`
if(!empty($_POST))
{
$msg="";
if(empty($_POST['fnm']) || empty($_POST['unm']) || empty($_POST['gender']) || empty($_POST['pwd']) || empty($_POST['cpwd']) || empty($_POST['mail'])||empty($_POST['city']))
{
$msg.="<li>Please full fill all requirement";
}
if($_POST['pwd']!=$_POST['cpwd'])
{
$msg.="<li>Please Enter your Password Again.....";
}
if(!eregi("^[a-z0-9_]+[a-z0-9_.]*@[a-z0-9_-]+[a-z0-9_.-]*.[a-z]{2,5}$",$_POST['mail']))
{
$msg.="<li>Please Enter Your Valid Email Address...";
}
if(strlen($_POST['pwd'])>10)
{
$msg.="<li>Please Enter Your Password in limited Format....";
}
if(is_numeric($_POST['fnm']))
{
$msg.="<li>Name must be in String Format...";
}
if($msg!="")
{
header("location:register.php?error=".$msg);
}
else
{
$fnm=$_POST['fnm'];
$unm=$_POST['unm'];
$pwd=$_POST['pwd'];
$gender=$_POST['gender'];
$email=$_POST['mail'];
$contact=$_POST['contact'];
$city=$_POST['city'];
$query="insert into user(u_fnm,u_unm,u_pwd,u_gender,u_email,u_contact,u_city)
values('$fnm','$unm','$pwd','$gender','$email','$contact','$city')";
mysqli_query($conn,$query) or die("Can't Execute Query...");
header("location:register.php?ok=1");
}
}
else
{
header("location:index.php");
}
?> `
and the error shown is: Fatal error: Uncaught Error: Call to undefined function eregi() in C:xampphtdocsonlineprocess_register.php:18 Stack trace: #0 {main} thrown in C:xampphtdocsonlineprocess_register.php on line 18
This question already has an answer here:
Deprecated: Function eregi() is deprecated in [duplicate]
3 answers
How to display errors for my MySQLi query? [duplicate]
3 answers
Reference - What does this error mean in PHP?
31 answers
php mysql mysqli
php mysql mysqli
asked Nov 20 at 13:38
user10635446
1
1
marked as duplicate by Funk Forty Niner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 20 at 13:45
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Funk Forty Niner
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 20 at 13:45
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
1
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
1
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45
add a comment |
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
1
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
1
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
1
1
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
1
1
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
What version of PHP? php.net/manual/en/function.eregi.php says "This function was DEPRECATED in PHP 5.3.0, and REMOVED in PHP 7.0.0". It also suggests using preg_match() instead, which sounds like a sensible thing to do. Where did you get the idea to use such an old function in your new code?
– ADyson
Nov 20 at 13:39
Another thing: Your code is vulnerable to SQL Injection attacks. You should use parameterised queries and prepared statements to help prevent attackers from compromising your database by using malicious input values. bobby-tables.com gives an explanation of the risks, as well as some examples of how to write your queries safely using PHP / mysqli. Never insert unsanitised data directly into your SQL. The way your code is written now, someone could easily steal, incorrectly change, or even delete your data.
– ADyson
Nov 20 at 13:40
1
All in all, maybe, if you used some kind of tutorial or book to help you with this code, you should find a more up to date one.
– ADyson
Nov 20 at 13:40
1
You could have searched the error.
– Funk Forty Niner
Nov 20 at 13:45