I have my form in J RC1.
It works pretty fine.
I wanna set up RC4.
I copy the form (via database)
and simply NO DATA are stored.
If I generate a new one, it will work but no uploading file!!!
No file uploaded, and as well no filename stored in the table.
Other fields are ok.
Here's the code I copied from the original.
<?php
$database =& JFactory::getDBO();
$database->setQuery( "INSERT INTO #__chronoforms_5 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['name']."' , '".$_POST['email']."' , '".$_POST['ricetta']."' , '".$_POST['ingredienti']."' , '".$_POST['preparazione']."' , '".$_POST['consigli']."' , '".$_POST['origine']."' , '".$_FILES['allegato']['name']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
and this is the form<h2>Ricette per palati Multi Culturali</h2>
<p><fieldset class="orange"><legend class="orange"><strong>Benintegra il palato!!</strong></legend>
Inviaci una ricetta tipica dei tuoi luoghi di origine.
Benintegrati preparerà per tutta la comunità la
scheda della tua ricetta, da stampare, conservare, preparare e....
gustare!!<br>
<strong>Fai sentire come si mangia a casa tua!</strong></fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Lo Chef</strong>
</legend>
<dl class="ccform">
<dt class="ccform"> <label for="name">Il tuo nome:<b>*</b></label>
</dt>
<dd class="ccform"><input name="name" id="name" type="text">
</dd>
<dt class="ccform"> <label for="email">La tua e-mail:<b>*</b></label>
</dt>
<dd class="ccform"><input name="email" id="email" type="text">
</dd>
<dt class="ccform"><label for="ricetta">La ricetta:<b>*</b></label>
</dt>
<dd class="ccform"><input name="ricetta" id="ricetta" type="text"> </dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Ingredienti</strong>
</legend>
<dl class="ccform">
<b>Campo obbligatorio*</b>
<dt></dt>
<dd><textarea cols="30" name="ingredienti" id="ingredienti" style="height: 63px; width: 612px;" rows="3"></textarea>
<span class="hint">Se usate dei preparati non
comuni, dite in linea di massima cosa sono o
come sono fatti.<span class="hint-pointer"> </span></span>
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Come si fa?</strong>
</legend>
<dl class="ccform">
<b>Campo obbligatorio*</b>
<dt></dt><dd><textarea cols="30" name="preparazione" id="preparazione" style="height: 63px; width: 612px;" rows="3"></textarea>
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Consigli in Cucina</strong>
</legend>
<dl class="ccform">
<dt></dt>
<dd class="ccform"><textarea cols="30" name="consigli" id="consigli" style="height: 63px; width: 612px;" rows="3"></textarea>
<span class="hint">Qualche dritta per fare diventare il tutto più buono e appetitoso?!<span class="hint-pointer"> </span></span>
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Origine</strong>
</legend>
<dl class="ccform">
<label for="origine">Indica la Regione, il
Paese o
l'Area Geografica di provenienza del tuo piatto.<b>*</b></label><br>
<dt></dt>
<dd class="ccform"> <input name="origine" id="origine" type="text">
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Come si presenta?</strong></legend>
<dl class="ccform">
<label for="allegato">Allega una foto del tuo
piatto!
Servirà a distinguerlo. Puoi provare ad inviare anche le
foto del tuo cellulare.</label><br>
<dt></dt>
<dd class="ccform"> <input name="allegato" id="allegato" type="file">
<br>
<small>*.jpg, *.png, *.gif, *.tif
</small><span class="hint">Dimensioni Max 3072
Megabyte<span class="hint-pointer"> </span></span></dd>
<br>
</dl>
</fieldset>
<p><input value="Invia" name="submit" type="submit"><input value="Cancella" name="reset" type="reset">
Any idea of that?
Edited to add code tags and remove some empty lines<br><br>Post edited by: GreyHead, at: 2007/12/26 19:47
There was a bug in the J1.5 release that prevented file uploads. It's just one line that has to be corrected. The bug is fixed in the current download and there was an amended version of chronocontact.php posted to the forums recently.
Bob
well, I remember there was a bug, cant remember if in RC1, in joomla I mean, or in CC...
Maybe I've fixed it in RC1 version I have, that' s why maybe my form uploading works.
I can't remebmber that fix...
Could you give me the reference of that post please?
I can't find it... chronocontact.php is a slightly too generic search key...
Thank you so much!!!:cheer:
I even try to overwrite the one I use in RC1 in RC4, no results as well..
But the form does upload in the RC1... That's why I cannot understand why not in RC4...
:sick:
Edited to add url tag<br><br>Post edited by: GreyHead, at: 2007/12/27 13:17
Sorry, I've no idea what might have changed in Joomla 1.5RC4, I expect that Max will release a new beta version of ChronoForms in the next week or two.
Bob
If the upload is working at the Joomla RC1 site you had then please copy chronocontact.php to the new Joomla Rc4 website you have and it should work!! if not then assure all directories permissions are good, like the upload directoy is set to 775 or 777 if needed!
Cheers
Max
Cheers
Max
so RC4, with CC version 2.51a
copyed chronocontact.php from old 2.51 working fine in RC1, copied onto RC4
checked ID: there is ID 1 for table_1
(UI copyed the old RC1 database onto RC4)
no file is uploaded.
Please not that there is the name of the file in recorded data, but no file into the directory upload...
Notice: Undefined offset: 1 in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 231
Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 232
Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 233
Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297
Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 300
Notice: Undefined index: reset in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297
Notice: Undefined index: reset in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 300
Notice: Undefined index: Ricette Benintegrate! in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 454
Maybe this could help:
"allegato stands for the uploaded file.
Notice msgs after sending form.
code:
<?php
$database =& JFactory::getDBO();
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['name']."' , '".$_POST['email']."' , '".$_POST['ricetta']."' , '".$_POST['ingredienti']."' , '".$_POST['preparazione']."' , '".$_POST['consigli']."' , '".$_POST['origine']."' , '".$_POST['colore']."' , '".$_FILES['allegato']['name']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
and the form:<h2>Ricette per palati Multi Culturali</h2>
<p></p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Benintegra il palato!!</strong></legend>
Inviaci una ricetta tipica dei tuoi luoghi di origine.
Benintegrati preparerà per tutta la comunità la
scheda della tua ricetta, da stampare, conservare, preparare e....
gustare!!<br>
<strong>Fai sentire come si mangia a casa tua!</strong></fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Lo Chef</strong>
</legend>
<dl class="ccform">
<dt class="ccform"> <label for="name">Il tuo nome:<b>*</b></label>
</dt>
<dd class="ccform"><input name="name" class="required" id="name" type="text">
</dd>
<dt class="ccform"> <label for="email">La tua e-mail:<b>*</b></label>
</dt>
<dd class="ccform"><input name="email" class="required validate-email" id="email" type="text">
</dd>
<dt class="ccform"><label for="ricetta">La ricetta:<b>*</b></label>
</dt>
<dd class="ccform"><input name="ricetta" class="required" id="ricetta" type="text"> </dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Ingredienti</strong>
</legend>
<dl class="ccform">
<b>Campo obbligatorio*</b>
<dt></dt>
<dd><textarea cols="30" name="ingredienti" class="required" id="ingredienti" style="height: 63px; width: 612px;" rows="3"></textarea>
<span class="hint">Se usate dei preparati non
comuni, dite in linea di massima cosa sono o
come sono fatti.<span class="hint-pointer"> </span></span>
</dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Come si fa?</strong>
</legend>
<dl class="ccform">
<b>Campo obbligatorio*</b>
<dt></dt><dd><textarea cols="30" name="preparazione" class="required" id="preparazione" style="height: 63px; width: 612px;" rows="3"></textarea>
</dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Consigli in Cucina</strong>
</legend>
<dl class="ccform">
<dt></dt>
<dd class="ccform">
<input name="consigli" type="text" id="consigli" style="height: 63px; width: 612px;" value="" size="30" maxlength="314">
<span class="hint">Qualche dritta per fare diventare il tutto più buono e appetitoso?!<span class="hint-pointer"> </span></span>
</dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Origine</strong>
</legend>
<dl class="ccform">
<label for="origine">Indica la Regione, il
Paese o
l'Area Geografica di provenienza del tuo piatto.<b>*</b></label><br>
<dt></dt>
<dd class="ccform"> <input name="origine" class="required" id="origine" type="text"> </dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Come si presenta?</strong></legend>
<dl class="ccform">
<label for="allegato">Allega una foto del tuo
piatto!
Servirà a distinguerlo. Puoi provare ad inviare anche le
foto del tuo cellulare.</label><br>
<dt></dt>
<dd class="ccform"> <input name="allegato" id="allegato" type="file">
<br>
<small>*.jpg, *.png, *.gif, *.tif
</small><span class="hint">Dimensioni Max 3072
Megabyte<span class="hint-pointer"> </span></span></dd>
<p>
<label for="colore">Infine, dà i un colore alla tua ricetta...:</label>
<dt></dt>
<dd class="ccform">
<select name="colore" id="colore" size="1" title="colore">
<option value="rosso" id="col_rosso">rosso</option>
<option value="arancione" id="col_arancione">arancione</option>
<option value="giallo" id="col_giallo">giallo</option>
<option value="verde" id="col_verde">verde</option>
<option value="azzurro" id="col_azzurro">azzurro</option>
<option value="rosa" id="col_rosa">rosa</option>
<option value="viola" id="col_viola">viola</option></select>
</dd>
</p>
</br>
</dl>
</fieldset>
<p>
<br>
<input value="Invia" name="submit" type="submit"><input value="Cancella" name="reset" type="reset">
Edited to clean up tags<br><br>Post edited by: GreyHead, at: 2007/12/29 18:53
Hei guys,
I checked now the "fiel uploads" section,
and I found that here:
Field names & allowed Extensions for each:
E.g: field_name_1:jpg|gif|doc|zip, field_name_2:rar|avi , * = all are ok
the value already showned is "array".
I tryed to change it with:
allegato:jpg|gif|...
(allegato is my input name)
saved, but if you check again, you'll find that there will be still "array" instead of the "allefato:..."
That's make sens for:
Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 232
Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 233
Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297
Don't you think?
I just posted in the 'Bugs' thread that there seems to have been a coding change in RC3/4 that breaks the way that ChronoForms stores these parameters. Hopefully Max will be able to work out a fix for it soon.
Bob
I will try to release a new fixed version ASAP, as Bob mentioned there is some code change in Joomla core which resulted into this!
Cheers
Max