Advertisement
eimkasp

PHP Post to mysql form

Feb 19th, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.     if (isset($_POST['save']) && $_POST['save'] == 'save') {$q_cont = $_POST['Klausimas'];
  3.     $q_title = $_POST['KlausimoPav'];
  4.     $db =mysql_connect("localhost","root","burblis7") or die ("cant connect");
  5.     mysql_select_db("psichologasWP",$db) or die("unable to find database");
  6.     $duom = mysql_query("INSERT INTO wp_posts ( post_author,post_content,post_title,post_type) VALUES('2','$q_title','$q_cont', 'question')");}
  7. ?>
  8. <form action="" method="post" name="uzd_klausima">
  9.     <input name="KlausimoPav" id="KlausimoPav" type="text" />
  10. <br>
  11.     <textarea name="Klausimas" id="Klausimas" cols="20" rows="5"></textarea><br>
  12.     <input name="submit" type="submit" value="Klausti" name="ask_side" />
  13. <input type="hidden" id="save" name="save" value="save">
  14. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement