2

nw_check.php

<?php
  $con = mysql_connect("localhost","root","12345");
  if (!$con)
  {
    die('Could not connect: ' . mysql_error());
  }
?>

 <html>
 <body>
    <form method="POST" action="nw_check_exec.php">
        <input type="button" name="nw_update" value="NW_Update"/>
    </form>
</body>
</html>

nw_check_exec.php

<?php
    if(isset($_POST['nw_update'])){
        echo("You clicked button one!");
        //and then execute a sql query here
    }
    else {
    echo" dhur";
    }
?>

but for some reason the echo in the nw_check_exec.php is not being executed. please could you help.

1
  • Is either echo being executed in nw_check_exec.php? Commented Aug 28, 2012 at 19:50

1 Answer 1

4

I think it's because the input type is a "button" and should be a submit:

<input type="submit" name="nw_update" value="NW_Update"/>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.