|
i use the fllowing php procedure to enter user logininfo from an externally captured form or from any other datbase
$sql = "INSERT INTO jos_users(name, username, email, password, usertype, block, sendEmail, gid, registerDate, lastvisitDate, activation, params) VALUES ('$stfirstname', '$username', '$email', '$password', '$usertype', '$block', '$sendmail', '$gid', '$senderdate', '$lastvisit', '$activation', '$params');" ;
$query = mysql_query($sql) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error());
//--------------------------------get data from ""jos_users""---------------------------------------- $sql3 = "SELECT id, name FROM jos_users WHERE name='$stfirstname' "; $query3 = mysql_query($sql3) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error()); $results = mysql_fetch_array($query3); // get rsult row into results variable array. $value = $results['id']; $name4acl = $results['name']; $section_value = "users"; $order_value = "0"; $hidden = "0"; //------------------------entering dat into """'jos_core_acl_aro""""---------------------------
$sql2 = "INSERT INTO jos_core_acl_aro(section_value, value, order_value, name, hidden) VALUES ('$section_value', '$value', '$order_value', '$name4acl', '$hidden');" ;
$query2 = mysql_query($sql2) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error());
//----------------------entering data into """""jos_comprofiler""""""------------------------------------- $id = $value; $user_id = $value;
$sql4 = "INSERT INTO jos_comprofiler (id, user_id, firstname, middlename, lastname, hits, message_last_sent, message_number_sent, avatar, avatarapproved, approved, confirmed, lastupdatedate, registeripaddr, cbactivation, banned, banneddate, unbanneddate, bannedby, unbannedby, bannedreason, acceptedterms) VALUES ('$id', '$user_id', NULL, NULL, NULL, '0', '0000-00-00 00:00:00', '0', NULL, '1', '1', '1', '0000-00-00 00:00:00', '', '', '0', NULL, NULL, NULL, NULL, NULL, '0');" ;
$query4 = mysql_query($sql4) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error());
//----------------getting data from """""" jos_core_acl_aro""""" ------------------------------------------- $sql6 = "SELECT id FROM jos_core_acl_aro WHERE value='$value' "; $query6 = mysql_query($sql6) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error()); $results6 = mysql_fetch_array($query6); // get rsult row into results variable array. $acl_aro_id = $results6['id']; $groupid = "18";
//--------------------------------entering data into """""jos_comprofiler""""""--------------------------------------
$sql5 = "INSERT INTO jos_core_acl_groups_aro_map (group_id, section_value, aro_id) VALUES ('$groupid', '' , '$acl_aro_id');" ; $query5 = mysql_query($sql5) or die("Server Error. Please contact the site administrator with the error below.<br />" . mysql_error());
|