// some other ifs and elseifs that seem to work okay elseif ($CH_address_same != 1) { if ($PayMethod == "credit" && empty($CH_Address1) || $PayMethod == "credit" && empty($CH_City) || $PayMethod == "credit" && empty($CH_Zip) || $PayMethod == "credit" && empty($CH_Country)) { $err = 1; } } The CH_address_same variable is being posted to the server using a checkbox with a checked value of '1'. For some reason if the first clause returns true the second clause chokes? I can't see why. But I am a beginner! B [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Bert [ip] => no@spam.com [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> // some other ifs and elseifs that seem to work okay elseif ($CH_address_same != 1) { if ($PayMethod == "credit" && empty($CH_Address1) || $PayMethod == "credit" && empty($CH_City) || $PayMethod == "credit" && empty($CH_Zip) || $PayMethod == "credit" && empty($CH_Country)) { $err = 1; } } The CH_address_same variable is being posted to the server using a checkbox with a checked value of '1'. For some reason if the first clause returns true the second clause chokes? I can't see why. But I am a beginner! B [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Bert [ip] => no@spam.com [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> > // some other ifs and elseifs that seem to work okay > > elseif ($CH_address_same != 1) > { > if ($PayMethod == "credit" && empty($CH_Address1) > || $PayMethod == "credit" && empty($CH_City) > || $PayMethod == "credit" && empty($CH_Zip) > || $PayMethod == "credit" && empty($CH_Country)) > { > $err = 1; > } > } > > The CH_address_same variable is being posted to the server using a[/quote] checkbox[quote] > with a checked value of '1'. > > For some reason if the first clause returns true the second clause chokes? > I can't see why. But I am a beginner! > > B > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => point [ip] => point@caannNOSP [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 3 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> > // some other ifs and elseifs that seem to work okay > > elseif ($CH_address_same != 1) > { > if ($PayMethod == "credit" && empty($CH_Address1) > || $PayMethod == "credit" && empty($CH_City) > || $PayMethod == "credit" && empty($CH_Zip) > || $PayMethod == "credit" && empty($CH_Country)) > { > $err = 1; > } > } > > The CH_address_same variable is being posted to the server using a[/quote] checkbox[quote] > with a checked value of '1'. > > For some reason if the first clause returns true the second clause chokes? > I can't see why. But I am a beginner! > > B > >[/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => point [ip] => point@caannNOSP [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> failing elseif construct - PHP Development

failing elseif construct - PHP Development

Hi, Can anybody see anything wrong with this: <-- snip --> // some other ifs and elseifs that seem to work okay elseif ($CH_address_same != 1) { if ($PayMethod == "credit" && empty($CH_Address1) || $PayMethod == "credit" && empty($CH_City) || $PayMethod == "credit" && empty($CH_Zip) || $PayMethod == "credit" && empty($CH_Country)) { $err = 1; } } The CH_address_same variable is being posted to the server using a checkbox with a checked value of '1'. For some reason if the first clause returns true the second clause chokes? I can't see why. But I am a beginner! B...

  1. #1

    Default failing elseif construct

    Hi,

    Can anybody see anything wrong with this:

    <-- snip -->
    // some other ifs and elseifs that seem to work okay

    elseif ($CH_address_same != 1)
    {
    if ($PayMethod == "credit" && empty($CH_Address1)
    || $PayMethod == "credit" && empty($CH_City)
    || $PayMethod == "credit" && empty($CH_Zip)
    || $PayMethod == "credit" && empty($CH_Country))
    {
    $err = 1;
    }
    }

    The CH_address_same variable is being posted to the server using a checkbox
    with a checked value of '1'.

    For some reason if the first clause returns true the second clause chokes?
    I can't see why. But I am a beginner!

    B


    Bert Guest

  2. #2

    Default failing elseif construct

    Hi,

    Can anybody see anything wrong with this:

    <-- snip -->
    // some other ifs and elseifs that seem to work okay

    elseif ($CH_address_same != 1)
    {
    if ($PayMethod == "credit" && empty($CH_Address1)
    || $PayMethod == "credit" && empty($CH_City)
    || $PayMethod == "credit" && empty($CH_Zip)
    || $PayMethod == "credit" && empty($CH_Country))
    {
    $err = 1;
    }
    }

    The CH_address_same variable is being posted to the server using a checkbox
    with a checked value of '1'.

    For some reason if the first clause returns true the second clause chokes?
    I can't see why. But I am a beginner!

    B


    Bert Guest

  3. #3

    Default Re: failing elseif construct

    Study the example....maybe it'll get to you.... :)

    just copy-paste and run....

    <?php

    If($_SERVER{'REQUEST_METHOD'}=="POST")
    {
    print("<u>These variables are posted:</u><br>\n");
    foreach($_POST as $name=>$value)
    print("Variable <b>$name</b> has value $value.<br>\n");
    }

    ?>
    <html>
    <head>
    <title>CheckBoxes</title>
    </head>
    <body>
    <form name="testForm" action="<?=$_SERVER{'PHP_SELF'} ?>" method="POST">
    <input type="checkbox" name="Check_1">Text_1
    <input type="checkbox" name="Check_2">Text_2
    <input type="submit" name="submit" value="Submit">
    </body>
    </html>

    hope this help...

    point


    "Bert" <nospam.com> wrote in message
    news:bhbanp$c9v$1$8300dec7news.demon.co.uk...
    > Hi,
    >
    > Can anybody see anything wrong with this:
    >
    > <-- snip -->
    > // some other ifs and elseifs that seem to work okay
    >
    > elseif ($CH_address_same != 1)
    > {
    > if ($PayMethod == "credit" && empty($CH_Address1)
    > || $PayMethod == "credit" && empty($CH_City)
    > || $PayMethod == "credit" && empty($CH_Zip)
    > || $PayMethod == "credit" && empty($CH_Country))
    > {
    > $err = 1;
    > }
    > }
    >
    > The CH_address_same variable is being posted to the server using a
    checkbox
    > with a checked value of '1'.
    >
    > For some reason if the first clause returns true the second clause chokes?
    > I can't see why. But I am a beginner!
    >
    > B
    >
    >

    point Guest

  4. #4

    Default Re: failing elseif construct

    Study the example....maybe it'll get to you.... :)

    just copy-paste and run....

    <?php

    If($_SERVER{'REQUEST_METHOD'}=="POST")
    {
    print("<u>These variables are posted:</u><br>\n");
    foreach($_POST as $name=>$value)
    print("Variable <b>$name</b> has value $value.<br>\n");
    }

    ?>
    <html>
    <head>
    <title>CheckBoxes</title>
    </head>
    <body>
    <form name="testForm" action="<?=$_SERVER{'PHP_SELF'} ?>" method="POST">
    <input type="checkbox" name="Check_1">Text_1
    <input type="checkbox" name="Check_2">Text_2
    <input type="submit" name="submit" value="Submit">
    </body>
    </html>

    hope this help...

    point


    "Bert" <nospam.com> wrote in message
    news:bhbanp$c9v$1$8300dec7news.demon.co.uk...
    > Hi,
    >
    > Can anybody see anything wrong with this:
    >
    > <-- snip -->
    > // some other ifs and elseifs that seem to work okay
    >
    > elseif ($CH_address_same != 1)
    > {
    > if ($PayMethod == "credit" && empty($CH_Address1)
    > || $PayMethod == "credit" && empty($CH_City)
    > || $PayMethod == "credit" && empty($CH_Zip)
    > || $PayMethod == "credit" && empty($CH_Country))
    > {
    > $err = 1;
    > }
    > }
    >
    > The CH_address_same variable is being posted to the server using a
    checkbox
    > with a checked value of '1'.
    >
    > For some reason if the first clause returns true the second clause chokes?
    > I can't see why. But I am a beginner!
    >
    > B
    >
    >

    point Guest

  5. #5

    Default Re: failing elseif construct

    On Tue, 12 Aug 2003 19:46:02 +0100, Andy Hassall wrote:
    ><snip!>
    >
    > Be a bit more specific. 'choke' isn't a Boolean value...
    > <snip!>
    It could be...

    if ($choke) {
    $cpr->heimlich($victim);
    }


    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Johns Hopkins University | Baltimore, MD
    Website | [url]http://www.wse.jhu.edu/newtnotes/[/url]

    Jeffrey Silverman Guest

  6. #6

    Default Re: failing elseif construct

    On Tue, 12 Aug 2003 19:46:02 +0100, Andy Hassall wrote:
    ><snip!>
    >
    > Be a bit more specific. 'choke' isn't a Boolean value...
    > <snip!>
    It could be...

    if ($choke) {
    $cpr->heimlich($victim);
    }


    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Johns Hopkins University | Baltimore, MD
    Website | [url]http://www.wse.jhu.edu/newtnotes/[/url]

    Jeffrey Silverman Guest

Similar Threads

  1. pl/pgsql trigger: syntax error at or near "ELSEIF"
    By Roman Neuhauser in forum PostgreSQL / PGSQL
    Replies: 3
    Last Post: January 14th, 04:24 PM
  2. tell me the best way to re-construct this menu!
    By jeffdoe webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: February 6th, 01:38 AM
  3. how to construct 2 consecutive if conditions?
    By Danield in forum PERL Beginners
    Replies: 1
    Last Post: January 25th, 05:43 AM
  4. SQL construct not supported in informix ?
    By Art S. Kagel in forum Informix
    Replies: 6
    Last Post: July 25th, 01:21 PM
  5. If - ElseIf - SQL Select... ASP YES.. PHP NO ???
    By James in forum PHP Development
    Replies: 3
    Last Post: June 26th, 08:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •