thanks - that was it!

Christian


Am 03.01.2013 14:45, schrieb Demian Katz:
When you submit the form, all of the fields are sent in the $_POST array, even if they are blank -- so rather than being unset, a blank 'address' field will be set to '' (empty string).  So the count is really not very helpful, and all of the OR'ed conditions should be changed to something like:

(isset($_POST['firstname']) && !empty($_POST['firstname'])) OR ...

- Demian

From: Christian Dabrowski [dabrowski.christian@fh-swf.de]
Sent: Thursday, January 03, 2013 7:20 AM
To: vufind-general@lists.sourceforge.net
Subject: Re: [VuFind-General] userID in email template

Hi,

a further question ocurred:

i want the submit only send the mail when there is at least one field filled out. For this I added count() with the parameter of at least two (submit + a field), but it sends the email even if all fields are empty. What do I do wrong?

        if (count($_POST) > 2 AND
           (isset($_POST['submit']) AND
            isset($_POST['firstname']) OR
            isset($_POST['lastname']) OR
            isset($_POST['address']) OR
            isset($_POST['ZIP']) OR
            isset($_POST['phonenumber']) OR
            isset($_POST['mail']) OR
            isset($_POST['group'])
         ))



thanks,

Christian


Am 03.01.2013 08:03, schrieb Christian Dabrowski:
Hi Demian and Al,

thanks for the hint and
the explanation! Now it works like a charm!!

all best,

Christian


Am 02.01.2013 17:09, schrieb Alan Rykhus:
Hello Christian,

You are setting $userid to be a string.

When you assign 

  $recordList['userid'] = $userid['userid'];

you are referring to $userid as an array, so it takes the first letter,
a string is an array of characters.

Try:

  $recordList['userid'] = $userid;

al


On Wed, 2013-01-02 at 11:37 +0100, Christian Dabrowski wrote:
Hi all,

I tried to add the user ID into an email template and encountered a 
problem - namely, only the first charakter of the variable is passed to 
the email template. I did the following:

I added in the Aleph driver, in the function getMyProfile($user) these 
lines:

         $userid = (string) $xml->z304->{'z304-id'};   //here the user 
ID is stored

         // ID
         $recordList['userid'] = $userid['userid'];


In the email template I've changed the variable in the subject to this:

{translate text="This email was sent from"}: {$profile.userid}

Instead of getting the full ID (e.g. USP000090661) I only get "U"
What did I do wrong?

I'd be thankful for any hints!
Christian

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
VuFind-General mailing list
VuFind-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-general



------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712


_______________________________________________
VuFind-General mailing list
VuFind-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vufind-general