robsstevejobs Posted May 17, 2019 Author Share Posted May 17, 2019 thank you it works, but I have little concern, I want to associate in the same file js validation and ajax function. instead of executing all the code, it runs a single Link to comment Share on other sites More sharing options...
justsomeguy Posted May 17, 2019 Share Posted May 17, 2019 I don't understand what you're asking. Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 17, 2019 Author Share Posted May 17, 2019 I will associate all the code jquery in the same file, unfortunately it does not work Link to comment Share on other sites More sharing options...
dsonesuk Posted May 17, 2019 Share Posted May 17, 2019 On 5/16/2019 at 7:09 AM, dsonesuk said: As only YOU! Have access to the code, I should think you did something wrong. Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 17, 2019 Author Share Posted May 17, 2019 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 More sharing options...
justsomeguy Posted May 17, 2019 Share Posted May 17, 2019 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 More sharing options...
robsstevejobs Posted May 18, 2019 Author Share Posted May 18, 2019 yes I ask if in a file js, I could put more function inside this file. Link to comment Share on other sites More sharing options...
dsonesuk Posted May 18, 2019 Share Posted May 18, 2019 You can put as many functions coding within a file as like as long as they have access to all required resources to run and is correct so it does not break functionality of code following it. Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 18, 2019 Author Share Posted May 18, 2019 in my case the code above, there are two functions the first function does not run, but jquery validation that run in the second position what can i do to run all the two Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 20, 2019 Author Share Posted May 20, 2019 Hi guys, I'm going to have my database record a unique email address what can I do in the code. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 20, 2019 Share Posted May 20, 2019 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 More sharing options...
robsstevejobs Posted May 21, 2019 Author Share Posted May 21, 2019 Hi guys, can you explain to me what can I do about any comment post Link to comment Share on other sites More sharing options...
justsomeguy Posted May 21, 2019 Share Posted May 21, 2019 It will help if you answer questions that we ask. Are you looking at your browser's developer console? Do you see the error message? Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 24, 2019 Author Share Posted May 24, 2019 hi guys, how can i check a username and email already exist in my database using php and ajax Link to comment Share on other sites More sharing options...
justsomeguy Posted May 24, 2019 Share Posted May 24, 2019 You use a select query to get matching records and see if you get any. Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 25, 2019 Author Share Posted May 25, 2019 I did not understand what you mean ... Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 28, 2019 Author Share Posted May 28, 2019 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 More sharing options...
dsonesuk Posted May 28, 2019 Share Posted May 28, 2019 You have a 'email and 'guyst_email' database column names? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 28, 2019 Share Posted May 28, 2019 You're mixing mysql and mysqli functions. They don't work together. You also immediately overwrite your insert query with a select query because you're using the same variable name. Link to comment Share on other sites More sharing options...
robsstevejobs Posted May 29, 2019 Author Share Posted May 29, 2019 ok I understand, if you have a link you can send me to try to change the code Link to comment Share on other sites More sharing options...
robsstevejobs Posted June 25, 2019 Author Share Posted June 25, 2019 Hi sir, you can help me find this server to distribute the updates in my website. here is the link I found: updates-http.cdn-apple.com/2019SpringFCS/fullrestores/041-68314/CC3C4D6, in other site when I try to download it outside the iTunes Link to comment Share on other sites More sharing options...
justsomeguy Posted June 25, 2019 Share Posted June 25, 2019 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 More sharing options...
robsstevejobs Posted June 28, 2019 Author Share Posted June 28, 2019 hi sir, how can i contact him about ios update software you have their address? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 28, 2019 Share Posted June 28, 2019 No, I don't use Apple products. Link to comment Share on other sites More sharing options...
robsstevejobs Posted July 6, 2020 Author Share Posted July 6, 2020 Hello Team , how can i check the duplicate record in the databsae rows in PHP or PDO and mysqli Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now