php - Data not inserting in MySQL -
i making script guy , uses advanced outgoing api (not familiar). gives me url post variable stored in http://example.com/your_script.php?email_address={u_email}&firstname={u_firstname}
. here php code. problem cannot read post values. when echo it, it's empty.
note: instruction api manual.
advanced outgoing api can have 5 urls each product/podcast/rss feed/membership notified whenever subscriber event happens. can enter these urls clicking on "edit notifications/custom fields" particular item. system post following variables urls you've entered. can include of variables below "tags" in url , system replace tag actual value. way can post values existing script expects variable name different ones listed below. example, notification url be: http://example.com/your_script.php?email_address={u_email}&firstname={u_firstname} . system post variables below to: http://example.com/your_script.php?email_address=joe@example.com&firstname=joe
$con = mysql_connect("localhost","xyz","xyz","xyz"); // establish connection insert in first table. $username = $_post['paypal_email']; // username of user. $rawpass = $_post['access_code']; // raw password. $pass = md5($rawpass); // password of user encrypted md5. $email = $_post['email_address']; // e-mail of user. $time = date("y-m-d h:i:s"); echo $username; echo $pass; echo $email; echo $time; mysql_query("insert wpinrootusers ('user_login', 'user_pass', 'user_email', user_registered, 'user_status') values ('$username', '$pass', '$email', '$time', 0), $con"); // insertion wpinrootusers table. mysql_close($con); // close connection. $con = mysql_connect("localhost","xyz","xyz","xyz"); // establish connection insert in second table. mysql_query("insert customers ('receipt', 'prod_num', 'email') values ('$rawpass', '6', '$email')", $con); // insertion customers table. mysql_close($con); // close second connection.
with mysql have do:
$con = mysql_connect("localhost","xyz","xyz");
and select database:
$db = mysql_select_db("xyz");
the code used connect database works mysqli (i stands improved) , should consider switching mysql mysqli
Comments
Post a Comment