I have an array created from form data that I need passed through a function parameter. However I get a fatel error "Method name must be a string".
Here's my code:
function ebtron_registration($UserR
eg)
{
$FName=$UserReg[0];
$MI=$UserReg[1];
$LName=$UserReg[2];
$Email=$UserReg[3];
$Groups=$UserReg[4];
$Country=$UserReg[5];
$Address=$UserReg[6];
$City=$UserReg[7];
$State=$UserReg[8];
$ZipCode=$UserReg[9];
$Phone=$UserReg[10];
$Fax=$UserReg[11];
//
$DateUserCreated=date("Y-m
-d H:i:s");
$Password=generatePassHash
($DateUser
Created, $UserReg[12]);
//
$UserID=$Email;
$AltUserTable=NULL;
$AltUserID=0;
$UserAccess=0;
$UserStatus=0;
$user = new userscls;
$user->add_User_Entry($Use
rID,$Passw
ord,$DateU
serCreated
,$AltUserT
able,$AltU
serID,$Ema
il,$UserAc
cess,$User
Status);
$user->add_UserProfile_Ent
ry($Profil
eID,$UserI
D,$FName,$
MI,$LName,
$Email,$Gr
oups,$City
,$State,$Z
ipCode,$Co
untry,$Pho
ne,$Fax);
}
echo "<p class=\"inputtxt\" style=\"font-size:18px;tex
t-align:le
ft;\">";
echo "<span style=\"font-size:22px;\">
EBTRON New User Registration</span>";
echo "<br>First Name: <span style=\"font-size:10px;\">
".$registr
ation[0]=$
_POST['txt
FNAME'];
echo "<br></span>MI: <span
style=\"font-size:10px;\">
".$registr
ation[1]=$
_POST['txt
MI'];
echo "<br></span>Last Name: <span style=\"font-size:10px;\">
".$registr
ation[2]=$
_POST['txt
LNAME'];
echo "<br></span>Email: <s
pan style=\"font-size:10px;\">
".$registr
ation[3]=$
_POST['txt
Email'];
$ebreps->getReps_RepCompan
y($_POST['
selEbtronR
eps']);
$registration[4]=$_POST['s
elEbtronRe
ps'];
echo "<br></span>Ebtron Rep Company: <span style=\"font-size:10px;\">
".$ebreps-
>reps_repc
ompany;
echo "<br></span>Country:
<span style=\"font-size:10px;\">
".$registr
ation[5]=$
_POST['sel
Countries'
];
echo "<br></span>Address:
<span style=\"font-size:10px;\">
".$registr
ation[6]=$
_POST['txt
Address'];
echo "<br></span>City: <sp
an style=\"font-size:10px;\">
".$registr
ation[7]=$
_POST['txt
City'];
if($_POST['selCountries']=
="254")
{
echo "<br></span>State: <s
pan style=\"font-size:10px;\">
".$registr
ation[8]=$
_POST['sel
States'];
}
else
{
echo "<br></span>State: <s
pan style=\"font-size:10px;\">
".$registr
ation[8]=$
_POST['sel
States'];
}
echo "<br></span>Postal Code: <span style=\"font-size:10px;\">
".$registr
ation[9]=$
_POST['txt
ZipCode'];
echo "<br></span>Phone: <s
pan style=\"font-size:10px;\">
".$registr
ation[10]=
$_POST['tx
tPhone'];
echo "<br></span>Phone: <s
pan style=\"font-size:10px;\">
".$registr
ation[11]=
$_POST['tx
tFax'];
echo "</p>";
$registration[12]=$_POST['
txtPasswor
d'];
if($_POST['txtEmail']==$_P
OST['txtEm
ail2'])
{
$frmvalidate = true;
}
else
{
$frmvalidate = false;
$EmailValidate ="<span style=\"font-size:9px\">Em
ails Do Not Match</span>";
}
if($_POST['txtPassword']==
$_POST['tx
tPassword2
'])
{
$frmvalidate = true;
}
else
{
$frmvalidate = false;
$PasswordValidate ="<span style=\"font-size:9px\">Pa
sswords Do Not Match</span>";
}
if($frmvalidate==true)
{
$eb->$ebtron_registration(
$registrat
ion);
}
What am I doing wrong?
Start Free Trial