This topic is locked

need help modified the add function field

6/6/2008 2:52:40 PM
PHPRunner General questions
M
Moriya author

I know when u add record to a table
it will list the drop down if u have relationship with other table
but if there's a way to not get drop box from that field and have default input when u login
Here's the generate code for UserID
// processing UserID - start

$value = postvalue("value_UserID");

$type=postvalue("type_UserID");

if (in_assoc_array("type_UserID",$_POST) || in_assoc_array("value_UserID",$_POST) || in_assoc_array("value_UserID",$_FILES))

{

$value=prepare_for_db("UserID",$value,$type);

}

else

$value=false;

if(!($value===false))

{
$avalues["UserID"]=$value;

}
example: user1@email.com login and he going to add a record, for the UserID can only display user1@email.com, no one else
or
don't display that input in the add.php but auto fill in you Userid as you adding new record to that table if that's possible...
i'm a pure noob about php, so need help on this if anyone can give me this solution, thanks

J
Jane 6/7/2008

Hi,
just use $_SESSION["UserID"] as default value for Userid field and set up this field as readonly on the "Edit as" settings dialog on the Visual Editor tab.

M
Moriya author 6/9/2008

thx Jane.