Jump to content

Database


robsstevejobs

Recommended Posts

this is my query code 

 

$(document).ready(function(){
$('#submit').click(function(event){
 
event.preventDefault();
var name = $('#name').val();
var email = $('#email').val();
if(name == '' || email == '')
{
$('#error_message').html("Tous les champs sont obligatoire");
}
else
{
$('#error_message').html('');
$.ajax({
type:'POST',
url:'connexion.php',
data:{name:name, email:email},
success:function(data){
$("form").trigger("reset");
$('#success_message').fadeIn().html(data);
setTimeout(function(){
$('#success_message').fadeOut("Slow");
}, 2000);
 
}
 
});
}
 
});
});
,
 
$(function(){
 
$('#formu').validate({
rules:{
email:{
required:true,
email:true



 
}
 
}


 
});


 
});
 
</script>
 



 
Link to comment
Share on other sites

Check your browser's error console, you have random punctuation in there.  You should really make an effort also to keep your code formatted and indented without a bunch of extra lines so that it's easy to read.

Link to comment
Share on other sites

Did you fix the syntax error in your code above?  The reason it doesn't work is because you have a syntax error.  That's why you need to look at your browser's developer console to see the error message.

Link to comment
Share on other sites

Hi guys, someone can help me for my database. I will only when registering the form that make the comparison to enter it, like username and email using ajax and php.

this is my code

 

<?php
if(isset($_POST['email'])){
$servername = "localhost";
$username = "root";
$password = "Robss123";
$dbname = "news";
 
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
$email = $_POST['email'];
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
 
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
 
$sql = "INSERT INTO guyst(name,email)
VALUES('$name', '$email')";
$sql ="SELECT *FROM guyst WHERE guyst_email='$email'";
$result = mysql_query($conn,$sql);
if($result->num_row >0)
{
   echo 'cet email est déjà utilisée';
}
 
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
 
}
$conn->close();
 
function test_input($data)
{
$data=trim($data);
$data=stripslashese($data);
$data=htmlspecialchars($data);
return $data;
}
 
?>
Link to comment
Share on other sites

  • 4 weeks later...

If I use wget with that it gives me a 403 response, you want people to help you get around Apple's authentication?  If you want to distribute Apple's software, then contact Apple and tell them you want to distribute their software.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...