Jump to content

Search the Community

Showing results for tags 'PHP Java Script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello guys. I am new here. Well, I have some codes written in php. And I have several forms (insert, update etc.). And I have that confirmation box written in Java Script. The thing is next: when I click on submmit in my insert form the box shows up and when I click on OK the data is submmited in the database, but when I click on CANCLE the data is submmited too and I do not want that. Can anybody helps me please??? THIS IS MI INSERT CODE. <?php $con=mysqli_connect("localhost","root","",""); // Provjeri konekciju if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // Varijable za sigurnost $naziv_artikla = mysqli_real_escape_string($con, $_POST['naziv_artikla']); $cijena_artikla = mysqli_real_escape_string($con, $_POST['cijena_artikla']); $na_stanju = mysqli_real_escape_string($con, $_POST['na_stanju']); // Sql upit za insert novih podataka u bazu $sql="INSERT INTO artikli (naziv_artikla, cijena_artikla, na_stanju) VALUES ('$naziv_artikla', '$cijena_artikla', '$na_stanju')"; // Provjera upita if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo header ("Location: index1.php"); mysqli_close($con); ?> THIS IS CONFIRMATION BOX (JAVA SCRIPT). <script> function myFunction() { var x; if (confirm("Da li želite da sačuvate promjene?") == true) { x = "You pressed OK!"; } else { x = "You pressed Cancel!"; } document.getElementById("demo").innerHTML = x; } </script>
×
×
  • Create New...