Thursday, 7 February 2019

MySql : Form Submission For Not localhost


   <!--<META http-equiv="refresh" content="1;URL=http://publish.gengkomik.com/publish.php">-->


 <body>
      <div id = "main" class="container card">
     
      <?php
        //trigger when post submit
         if(isset($_POST["submit"])){

          //make connection to db
        $servername = "localhost";
        $username = "yourDBuser";
        $password = "YourDBpass!";
        $dbname = "yourDBname";
     
        // Create connection
        $conn = new mysqli($servername, $username, $password,$dbname);

          //declare value first
          $artist = $_POST['artist'];
          $image = $_POST['image'];
          $description = $_POST['description'];
          $facebook = $_POST['facebook'];
       

          // Check connection
          if ($conn->connect_error) {
             die("Connection failed: " . $conn->connect_error);
          }

          //make query

          $sql = "INSERT INTO publish SET
          `artist`='".$artist."',
          `image`='".$image."',
          `facebook`='".$facebook."',
          `date`=NOW()
          ";
         
        //   $sql = "INSERT INTO publish SET (artist, image, facebook, date)
        //     VALUES ('$artist', '$image', '$facebook'";


if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

          $conn->close();
         }
      ?>
   
 
      </div>
</body>

</html>

email mailto: pretext

 <a href="mailto:designoutsourced.com+info@gmail.com?subject=Maklumat%20lanjut%20pakej&body=Hai,%20saya%20berminat%20tahu%20lebi...