implode argument

sailsmart 08 May, 2008
My form looks pretty good now but I get an implode argument on send. I do have css at the top but the form fields in pics may be the cause. Do you see anything wrong in it? :dry: Thanks.

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 5

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 6

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 7

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 8

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 9

Warning: implode() [function.implode]: Bad arguments. in {path}components/com_chronocontact/chronocontact.php(571) : eval()'d code on line 10



 <legend><strong><br>
  TSCC Sailing School Online Registration Form 2008</strong></legend>
</h2>
<fieldset>
<p align="justify">  We welcome receipt of your online
registration prior to meeting with staff and instructors 
of sailing school. This will give us more opportunity to 
spend time answering questions and getting to know your 
children while you have more  to review and reflect on 
the selections which best suit your child. Payment may 
be made after the interview.<br>
</p>
</br></fieldset><br/>
<fieldset>
<legend><strong>Applicant's Information</strong></legend>
<p>
  <label1 for="name">Applicant Name :</label1>
  <input type="text" name="name" size="40">
</p>
<p>
  <label1 for="age">Age </label1>
  <input type="text" name="Age" size="5">
</p>

<p>
  <label1 for="gender">Male </label1>
  <input type="text" name="Male" size="5">
  <label1 for="Male">Female</label1>
  <input type="text" name="Male" size="5">
</p>
<p>
  <label1 for="address">Address :</label1>
  <input name="address" type="text" size="80">
<p>
  <label1 for="birth_date">Birth Date </label1>
  <input type="text" name="birth_date" size="25">
  <label1 for="swimming_ability">Swimming Ability </label1>
  <input type="text" name="swimming_ability" size="30">
</p>
</fieldset><br />
<fieldset>
Max_admin 10 May, 2008
look at line 571 of your file version and see which implode statement it has, you are not using the latest version ?

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 10 May, 2008
Hi Sailsmart,

You're getting these warnings for three reasons.

1) You have your error reporting set a bit high so it's showing warnings.

2) I think they come from your Autogenerated code tab where ChronoForms automatically converts array results into strings. This error shows up when the result submitted isn't an array. I've written a little function that is a little 'cleverer' and avoids these errors. But it does mean hacking your Autogenerated code. The function is
function preSave($var) {
    if ( isset( $var ) ) {
        if ( is_array( $var ) ) {
            $var = implode( ',', $var );
        }
    } else {
        $var = "";
    }
    return $var;
}
and the hack is to replace the implode lines with calls to preSave().

3) The arrays are empty because - as far as I can see - there are no arrays returned from your form so I guess that you've simplified the form without editing the Autogenerated code to match - or maybe the html isn't the whole form.

If you've simplified the form then the best approach is to drop the current table (assuming that is has no important data), delete the old Autogenerated code and click the 'Create data table' link again.

Bob
sailsmart 11 May, 2008
I think I read somewhere that you can just add something into the form once it's been processed. I've been trying to get a drop down menu to show items in the database with no success. So I copied one line of code from the example about how to do drop downs as states and that's what resulted in an implode. - I think. Once that line was removed the formed looked fine again. Here's the video. http://www.twharton.com/chrono3/chrono3/chrono3.html
The sound goes out - but it shows how the form looks ok in dreamweaver, then the text goes off to centre in chronoforms. The css styling is there. Then I show how one line of code put in results in the implode argument.
I must say that chronoforms makes the job of retrieving results from a form so much easier than databases through myphp. I must not be doing something right though.
GreyHead 11 May, 2008
Hi sailsmart,

A bit of junk has crept into your code. In the image you can see that you have a php tag <?php opened to set a value but it isn't closed again - there is no ?> before you go back into plain html again. Actually this whole line is doing nothing useful so could just be deleted.

implode argument image 1

Bob

PS The 'label1' tags are meaningless afaik, I think they should be just <label. . .>

PPS I think I spotted a <body> tag in your form html - that should come out too. Joomla creates these.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger