Saturday, 15 August 2015

wordpress - PHP and HTML form on same page in Word Press -



wordpress - PHP and HTML form on same page in Word Press -

i think might close here... want have form on word press page captures , inserts code db.

can set on 1 page in wordpress below (which not throwing errors, not insert data). note [php] format how plugin php in pages , posts syntax works. close code?:

<form id="edit-bio-form" action="?biosubmit" method="post"> <textarea name="bioedit" rows="15" cols="80">first line of initial text. </textarea> <input type="submit" value="update bio" name="edit-bio-form"><input type="reset"> </form> [php] function biosubmit() { // current user's info $current_user = wp_get_current_user(); //set mysql connection $dbhost = 'localhost'; $dbuser = 'xxxxx'; $dbpass = 'xxxxx'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db('_wp1'); $bioedit = $_post['bioedit']; $sql = "insert 'i541280_wp1'.'wp_usermeta' ('umeta_id', 'user_id', 'meta_key', 'meta_value') values (null, '$current_user', 'user_bio', '$bioedit')"; } [/php]

can help me code , wrong/missing? or not possible wordpress?

i have tried question people suggested php template didn't work , don't know plenty create php plugin word press.

php wordpress

No comments:

Post a Comment