News:

Support the VirtueMart project and become a member

Main Menu

Set user field via form

Started by Kuubs, February 17, 2020, 13:21:29 PM

Previous topic - Next topic

Kuubs

Hello,

How can i set a field of an user with php? I made a form but I cannot seem to actually save the data edited:

<?php

$userModel 
VmModel::getModel('user');
$userDetails $userModel->getUser();

$userData array_keys($userDetails->userInfo);


$userDetails->userInfo[$userData[0]]->imagepath '/images/virtuemart/'.$form->data['file'];

$userDetails->userInfo[$userData[0]]->first_name $form->data['name'];


echo 
"Uploaded logo: <img src='".$userDetails->userInfo[$userData[0]]->imagepath."' 
 style='width:200px; height:auto' /><br />"
// shows the uploaded logo

echo $userDetails->userInfo[$userData[0]]->first_name//shows the input name


?>


How can I store the data so it gets actually saved in the db?