+ Reply to Thread
Results 1 to 18 of 18

Thread: Multiple selections in Combobox
      
   

  1. #1
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Multiple selections in Combobox

    Hi, my domain is www.4cyberbiz.com

    My previous thread seems to have been deleted for some reason.

    When using a Combobox and opting for 'multiple selections', this does not seem to work when the form comes through on email.

    If say four selections are made on the web page, only one selection comes through on the email form.

    Any ideas what I may be doing wrong. I have tried different options with no success.

    Regards

    Stuart

  2. #2
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    Yes it can be done. Could you please cut and paste the php code you are currently using in this thread. In order to get multiple variables from the form, it has to be modified. Once you paste that, we can write on for you and give you instructions on how to make it work.

    Andy
    PHP- is a blast!

  3. #3
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox


    Ref: www.4cyberbiz.com

    Hi, thanks for your response. The html code on the php page is as below.

    I also have other pages with the same problem, so if you could advise what to insert and how to action it would be helpful.

    Thank you.

    ================================================== ====
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>reader</title>
    <meta name="GENERATOR" content="Created by BlueVoda">
    </head>
    <body bgcolor="#000000" text="#FFFFFF">
    <?PHP
    $mailto = "wtrd@slingshot.co.nz";
    $email = $HTTP_POST_VARS['email'];
    if ($email == "") {
    $email = $mailto;
    }
    $mailsubj = "Desktop Reader Request for TDI";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form :\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    ?>
    <div id="bv_" style="position:absolute;left:174px;top:81px;width :483px;height:192px;z-index:0" align="center">
    <font style="font-size:21px;BACKGROUND-COLOR:#FFFF00" color="#000000" face="Arial">Thank you for requesting to be a subscriber to our Desktop Direct Offers service. Please 'click' on the 'Download Reader link below to enable you to the get the very latest of offers/requests which have passed our due diligence process, delivered DIRECT TO YOUR DESKTOP without needing to check your email. You will also be sent a back-up copy via email</font></div>
    <div id="bv_" style="position:absolute;left:75px;top:385px;width :710px;height:42px;z-index:1" align="left">
    <font style="font-size:24px" color="#0000FF" face="Arial"><u>&lt;<a href="http://downloads.desktopsubscriber.com//reader/win/763/1070" target="_self">http://downloads.desktopsubscriber.com//reader/win/763/1070</a>&gt;</font><font style="font-size:16px" color="#000000" face="Times New Roman"></u><br>
    </font></div>
    </body>
    </html>

  4. #4
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    My apologies.... I need the link to the form in question to get the form field names to do the script.

    Andy
    PHP- is a blast!

  5. #5
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Ref: www.4cyberbiz.com

    Dear Andy

    Here is the link below for the form in question

    http://www.tdi.4cyberbiz.com/directdesktopoffer.html

    I have six other similar type forms which I also need to do multiple selections, so maybe once you have done this one I can do the rest? Please advise on this point.

    Regards

    Stuart

  6. #6
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    Stuart-
    Yes, you could use my script and change it to suit your needs.

    So to begin. On your form you need to add two things. So open the page that the form is on with the BV web builder. Go to the "I want to receive OFFIERS on" field and open it. Next to the name I need you to put the square brackets [ ] So it should look like this when your done;

    Receive OFFERS on[]

    Do the same for the "I want to receive REQUESTS for" field
    Receive REQUESTS for[]

    Now- delete the php code you have placed in reader.php and then copy
    the code below and paste it in its place;

    <?php
    $First name $_POST['First name'];
    $Last name $_POST['Last name'];
    $Landline number $_POST['Landline number'];
    $Company name $_POST['Company name'];
    $Email $_POST['Email'];
    $Mobile $_POST['Mobile'];
    $Skype $_POST['Skype'];
    $Msn $_POST['Msn'];
    $Best time $_POST['Best time'];
    $Years in business $_POST['Years in business'];
    $non-circulation $_POST['non-circulation'];
    $Receive OFFERS on $_POST['Receive OFFERS on'];
    $Receive OFFERS on implode("," , $Receive OFFERS on);
    $Receive REQUESTS for $_POST['Receive REQUESTS for'];
    $Receive REQUESTS for implode("," , $Receive REQUESTS for);

    //------Organize data to mail-----------
    //
    $mailto = "wtrd@slingshot.co.nz";
    $Email = $_POST['Email'];
    if ($Email == "")
    {
    $Email = $mailto;
    }
    $mailsubj = "Desktop Reader Request for TDI";
    $mailhead = "From: $email\n";
    $mailbody = "Values submitted from web site form :\n"
    ."--------------------------------------------------\n"
    ."First Name: $First name\n"
    ."Last Name: $Last name\n"
    ."Land Line: $Landline number\n"
    ."Company: $Company name\n"
    ."Email: $Email\n"
    ."Mobile: $Mobile\n"
    ."Skype: $Skype\n"
    ."MSN: $Msn\n"
    ."---------------------------------------------------\n"
    ."Best time to call: $Best time\n"
    ."Years in Business: $Years in business\n"
    ."---------------------------------------------------\n"
    ."Non Circulation Agreement: $non-circulation\n"
    ."---------------------------------------------------\n"
    ."Recieve Offers on: $Receive OFFERS on\n"
    ."---------------------------------------------------\n"
    ."Recieve Requests For: $Receive REQUESTS for\n";
    //End of Data
    //
    //Now lets mail the info
    mail($mailto,$mailsubj,$mailbody,$mailhead);
    ?>

    Save and publish both pages. Give it a whirl.

    Cheers-

    Andy
    PHP- is a blast!

  7. #7
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Ref: www.4cyberbiz.com

    Dear Andy

    Thanks for your prompt response and I will give that a try!

    Regards

    Stuart

  8. #8
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Ref: www.4cyberbiz.com

    Hello Andy.

    The below error message is coming up when the form is submitted:

    Parse error: syntax error, unexpected T_STRING in /home/mdbnnbpw/public_html/tdi/reader.php on line 2

    Please advise. I noticed that I had the Name in First Name with a capital N in the edit box, however changed this on the site but with still same result.

    Regards


    Stuart

  9. #9
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    Let me take a quick look.......

    Yeah- I hadn't noticed the capital "N"........... Also I forgot the "=" sign to assign value to variables..DUH (late night prgraming) I feel like and idiot.

    so, copy/paste the code below in place of the other code and then SAVE/PUBLISH.

    Test and let me know.

    <?php
    $First Name =$_POST['First Name'];
    $Last name =$_POST['Last name'];
    $Landline number =$_POST['Landline number'];
    $Company name =$_POST['Company name'];
    $Email =$_POST['Email'];
    $Mobile =$_POST['Mobile'];
    $Skype =$_POST['Skype'];
    $Msn =$_POST['Msn'];
    $Best time =$_POST['Best time'];
    $Years in business =$_POST['Years in business'];
    $non-circulation =$_POST['non-circulation'];
    $Receive OFFERS on =$_POST['Receive OFFERS on'];
    $Receive OFFERS on =implode("," , $Receive OFFERS on);
    $Receive REQUESTS for =$_POST['Receive REQUESTS for'];
    $Receive REQUESTS for =implode("," , $Receive REQUESTS for);

    //------Organize data to mail-----------
    //
    $mailto = "wtrd@slingshot.co.nz";
    $Email = $_POST['Email'];
    if ($Email == "")
    {
    $Email = $mailto;
    }
    $mailsubj = "Desktop Reader Request for TDI";
    $mailhead = "From: $email\n";
    $mailbody = "Values submitted from web site form :\n"
    ."--------------------------------------------------\n"
    ."First Name: $First Name\n"
    ."Last Name: $Last name\n"
    ."Land Line: $Landline number\n"
    ."Company: $Company name\n"
    ."Email: $Email\n"
    ."Mobile: $Mobile\n"
    ."Skype: $Skype\n"
    ."MSN: $Msn\n"
    ."---------------------------------------------------\n"
    ."Best time to call: $Best time\n"
    ."Years in Business: $Years in business\n"
    ."---------------------------------------------------\n"
    ."Non Circulation Agreement: $non-circulation\n"
    ."---------------------------------------------------\n"
    ."Recieve Offers on: $Receive OFFERS on\n"
    ."---------------------------------------------------\n"
    ."Recieve Requests For: $Receive REQUESTS for\n";
    //End of Data
    //
    //Now lets mail the info
    mail($mailto,$mailsubj,$mailbody,$mailhead);
    ?>









    Andy
    PHP- is a blast!

  10. #10
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Ref: www.4cyberbiz.com

    Dear Andy

    Same error message has come up again. At the moment have changed it back to original code where I can only select one.

    I am not sure if we are thinking on the 'same page' though.

    From the 'Receive Offers from' combobox, all I want to do is choose say multiples of the ones listed in that specific box. The code you have done seems to encompass the whole form, however perhaps that is necessary to just get multiple selections in that one box.

    Originally I thought it was as simple as selecting 'multilple selections' when creating the combobox and then when selecting on the website to then highlight multiple selections from that one specific box (using Ctrl key) and then the multiple selections would come through on the Form to email.

    Please let me know your comments.

    Regards

    Stuart

  11. #11
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    Ok- I have copied your form. Tested it and the script and it works now.

    There were a couple errors on my part for which I apologize. But- on your form, you did not put the [ ] after the names I had showed.

    So.............first, go back up and look a the instructions for the [] after the specific field names I stated.

    Second- change the name fields so there are no spaces like below;
    FirstName
    Lastname
    Landlinenumber
    Companyname
    Email
    Mobile
    Skype
    Msn
    Besttime
    Yearsinbusiness
    noncirculation
    ReceiveOFFERSon
    ReceiveREQUESTSfor

    Then- copy and paste this code where the old one was.

    <?php
    $FirstName =$_POST['FirstName'];
    $Lastname =$_POST['Lastname'];
    $Landlinenumber =$_POST['Landlinenumber'];
    $Companyname =$_POST['Companyname'];
    $Email =$_POST['Email'];
    $Mobile =$_POST['Mobile'];
    $Skype =$_POST['Skype'];
    $Msn =$_POST['Msn'];
    $Besttime =$_POST['Besttime'];
    $Yearsinbusiness =$_POST['Yearsinbusiness'];
    $noncirculation =$_POST['noncirculation'];
    $ReceiveOFFERSon =$_POST['ReceiveOFFERSon'];
    $ReceiveOFFERSon =implode("," , $ReceiveOFFERSon);
    $ReceiveREQUESTSfor =$_POST['ReceiveREQUESTSfor'];
    $ReceiveREQUESTSfor =implode("," , $ReceiveREQUESTSfor);

    //------Organize data to mail-----------
    //
    $mailto = "wtrd@slingshot.co.nz";
    $Email = $_POST['Email'];
    if ($Email == "")
    {
    $Email = $mailto;
    }
    $mailsubj = "Desktop Reader Request for TDI";
    $mailhead = "From: $Email\n";
    $mailbody = "Values submitted from web site form :\n"
    ."--------------------------------------------------\n"
    ."First Name: $FirstName\n"
    ."Last Name: $Lastname\n"
    ."Land Line: $Landlinenumber\n"
    ."Company: $Companyname\n"
    ."Email: $Email\n"
    ."Mobile: $Mobile\n"
    ."Skype: $Skype\n"
    ."MSN: $Msn\n"
    ."---------------------------------------------------\n"
    ."Best time to call: $Besttime\n"
    ."Years in Business: $Yearsinbusiness\n"
    ."---------------------------------------------------\n"
    ."Non Circulation Agreement: $noncirculation\n"
    ."---------------------------------------------------\n"
    ."Recieve Offers on: $ReceiveOFFERSon\n"
    ."---------------------------------------------------\n"
    ."Recieve Requests For: $ReceiveREQUESTSfor\n";
    //End of Data
    //
    //Now lets mail the info
    mail($mailto,$mailsubj,$mailbody,$mailhead);
    ?>


    Then Save and Publish and then test.

    Andy
    PHP- is a blast!

  12. #12
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Ref: www.4cyberbiz.com

    Dear Andy

    Still no good!

    I was first getting the following error messages:

    Warning: implode() [function.implode]: Invalid arguments passed in /home/mdbnnbpw/public_html/tdi/reader.php on line 14

    Warning: implode() [function.implode]: Invalid arguments passed in /home/mdbnnbpw/public_html/tdi/reader.php on line 16


    ....Then I managed to get the scrip through ok but the message was saying 'array' in the Request Offers box, whatever was selected

    .....and now the form will not even come through to my email and I have not changed anything.

    If I change it back to original (as showing now)the form comes through fine with the selections.... just not the multiple ones which was the original intention.

    I think I may just have to use check boxes for each category as the scrip just does not want to seem to work properly and this is taking up too much time.

    Regards

    Stuart

  13. #13
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Multiple selections in Combobox

    Use Advanced BlueVoda Form Processor . It will take care automatically of everything.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  14. #14
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Thank you! I will take a look.

  15. #15
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Multiple selections in Combobox

    Please note that in order for the form to submit the multiple values, the relevant field MUST have at the end (attached, no whitespaces) [] (square brackets). Also, if this is a combobox, you must tick the "Allow multiple selections" tickbox.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  16. #16
    wtrd is offline Staff Sergeant
    Join Date
    Apr 2007
    Posts
    46

    Default Re: Multiple selections in Combobox

    Thanks...the idea on the brackets worked fine and I can now get multiple selections. Now trying on my other pages adjusting code accordingly.

    Once again, many thanks for the service.

  17. #17
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Multiple selections in Combobox

    Must have missed....

    So.............first, go back up and look a the instructions for the [] after the specific field names.....
    Thats ok as I have been there myself......LOL

    Glad everything is now working.

    Cheers-
    Andy
    PHP- is a blast!

  18. #18
    kiwijoe is offline Private
    Join Date
    Aug 2006
    Posts
    4

    Default Re: Multiple selections in Combobox

    Hi all, please can someone with PHP knowledge help me.

    I am posting this question here because this is the only thread that returns in the search for implode() or [function.implode]:, so I thought I would keep it together.

    In the back end of a script I have installed, when i click an a link to edit an article (which should display an article that is saved in *.txt format inside a textarea ofr editing) I get this warning message and the text area is blank:

    Warning: implode() [function.implode]: Invalid arguments passed in /home/jmash/public_html/beauty/admin/index.php on line 231

    the code on line 231 is:
    <br><TEXTAREA name="text" rows=20 cols=80>'.stripslashes(implode("",$text)).'</TEXTAREA>
    also line 265 has the same thing there.

    I have tryed changing various this things in the string glue area, but until yesterday had never heard of "implode" and I am less that a novice at PHP.

    I have saved the index.php into the body of an html file if you need to see it http://gcn.com.au/myproblemcode/index.html

    thanks in advance
    joe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49