<?php
global $mainframe, $database, $my;
global $mosConfig_live_site;
global $Itemid;
//This is the default auto generated code
$database->setQuery( "INSERT INTO #__chronoforms_4 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['user_reg_frm']."' , '".$_POST['gender']."' , '".$_POST['firstname']."' , '".$_POST['lastname']."' , '".$_POST['address']."' , '".$_POST['city']."' , '".$_POST['state']."' , '".$_POST['country']."' , '".$_POST['zip']."' , '".$_POST['phone']."' , '".$_POST['country0']."' , '".$_POST['email0']."' , '".$_POST['email1']."' , '".$_POST['email2']."' , '".$_POST['password']."' , '".$_POST['passwordConfirm']."' , '".$_POST['bMonth']."' , '".$_POST['bDay']."' , '".$_POST['bYear']."' , '".$_POST['00N30000001VGOk']."' , '".$_POST['00N30000001VGOl']."' , '".$_POST['00N30000001VGNX']."' , '".$_POST['00N30000001Yspe']."' , '".$_POST['CAPTCHAResponse']."' , '".$_POST['email']."' , '".$_POST['acknowdge_terms']."' , '".$_POST['privacy_policy']."' , '".$_POST['purchase_agreement']."' , '".$_POST['submit']."' , '".$_POST['sponsor_id']."');" );
This is my code
$database->setQuery( "INSERT INTO #__users(name,username,email,password,usertype,gid,registerDate) VALUES ( '".$_POST['firstname']."' , '".$_POST['lastname']."' ,'".$_POST['email0']."','".MD5($_POST['password'])."','Registered','18','". date('Y-m-d')."')");
$value=mysql_insert_id();
$database->setQuery( "INSERT INTO #__core_acl_aro(section_value,value,order_value,name,hidden) VALUES('users','$value','0','".$_POST['firstname']."' ,'0')");
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
Bob i am trying to insert the username and password into the above two tables in order to login into the joomla from the username and password which i have creatd with the help of chrono forms.
Thanks
Shiva<br><br>Post edited by: shivananda, at: 2007/07/30 13:43