How can i use a button with php? -


how can use button or form php?

<button formmethod="get" neme="1" type="button">click</button> <?php      if ($_get["1"]) {         require_once "0000.php";         $query = mysql_query("select * op");         while ($rwo = mysql_fetch_object($query)) {             $rwo-> id;         }     } ?> 

an error shown. trying if clicks on button, results show up.

  • typo neme="1" should name="1"
  • i think still need <form> tag wrapped around button
  • you'll want echo $rwo->id; see results
  • use isset avoid undefined index notices
  • use input type="submit" instead of type="button"

<form>     <button formmethod="get" name="1" type="submit">click</button> </form> <?php      if (isset($_get["1"])) {         require_once "0000.php";         $query = mysql_query("select * op");         while ($rwo = mysql_fetch_object($query)) {             echo $rwo->id;         }     } ?> 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo