Jump to content

robsstevejobs

Members
  • Posts

    30
  • Joined

  • Last visited

Posts posted by robsstevejobs

  1. 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

  2. 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;
    }
     
    ?>
  3. 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

  4. 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>
     



     
  5. 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

  6. how to fix this problem, because i made the ajax call but still reload the page and then it does not insert the data into database

  7. but the url does not function on, i will save the data in the database, i notice the insert.php link does not work to save the information in the database

  8. Look my code 

     

    <form id="news" action="" method="POST">

     

                <label for="name">Nom</label>

                    <input type="text" name="name" id="name" placeholder="votre nom" required>

                    <Br>

                     <br>

                <label for="email">E-mail</label>

                <input type="email" name="email" id="email" placeholder="votre mail" required>

                <br>

                <br>

                <input type="submit" name="submit" id="submit" value="newsletters">

                <span id="error_message" class="text-danger"></span>

                <span id="success_message" class="text-success"></span>

     

            </form>

     

     

    This is Ajax code

     

     

     

    $(document).ready(function(){

            $('#submit').click(function(){

     

              var name = $('#name').val();

              var email = $('#email').val();

              if(name == '' || email == '')

              {

                $('#error_message').html("All field are required");

              }

              else

              {

                $('#error_message').html('');

                $.ajax({

                        url:"validate.php",

                        method:"POST",

                        data:{name:name, email:email},

                        success:function(data){

                           $("#news").trigger("reset"); 

     

                              $('#success_message').fadeIn().html(data);  

                              setTimeout(function(){  

                                   $('#success_message').fadeOut("Slow");  

                              }, 2000);

                          

                        }

     

                });

              }

              

            });

          });

     

    </script>

×
×
  • Create New...