Already having a recommend which automatically pulled the email address and username from the database for logged in users would be cool!
I tried to figure it out to no avail! Disclaimer: I have never done anything like this before. Literally my first time ever with PHP, but I figured out some things from the file...
Okay, we can hide those fields, we have to declare the values for those hidden fields in the form as:
1) for the "recommend from name"
<input name="recommend_from_name" type="hidden" value="<?php echo $my->name; ?>" />
2) for the "recommend from email"
<input name="recommend_from_email" type="hidden" value="<?php echo $my->email; ?>" />
Okay to get the values to "echo" we need to declare a global for $my, like in the cz_submit component (which I'm using as an example)...
So in the recommendvalidate function we have to do something like this:
function recommendvalidate(){
global $my;
if ($my->name) {
$recommend_from_name = $my->name;
} else {
$recommend_from_name = "";
}
if ($my->email) {
$recommend_from_email = $my->email;
} else {
$recommend_from_email = "";
}
Is that right?
However -- when I try this out, the form doesn't work...
I am only learning right now and have no experience! Could someone -- who has a little time, please help us out in this thread?
I'll buy ya a beer!