Tryed CC with J1.5 RC3 and RC1 test in local, it worked out.
With both RC,
following problems:
Notice: Undefined variable: fileperms in ..\components\com_chronocontact\chronocontact.php on line 539
Notice: Undefined index: allegato in ..\components\com_chronocontact\chronocontact.php(504) : eval()'d code on line 5
After posting.
With both RC, it doesnt write the name of the to-say-"field_name1" of uploaded file in the record, in the table of the db.
Other fields work fine.
Have tryed to change the generated code for sql query, by putting
'$file_name1' or '$file_name1_name'
nothing happened.
File seems to be posted anyway, but no record of it in the sql table.
With RC1 following bug:
Clicking in FormManagemen, in tha Admin, it doesnt load the list of item in general, you have to click on "general" link to display.
The two 'Notices' are just info about some code that could cause problems - but doesn't here. If you set your Joomla PHP Error Reporting to 'System Default' (on the Server tab in Global Configuration) then I think they will not be shown any more.
Max has posted somewhere else about a bug in the file upload path.
Bob
I check "Global Configuration> Server >Reporting Error"
it was already on System Default. thus same notice reporting.
Tryed even to set "none".
Same notice reporting.
:sick:
I check only on local side: easyphp 1.8, Apache, if matters...
Is there any way to hack the notice error?
Which kind of error they could cause?
OK - you should be able to set the error reporting in your php.ini file too I think.
I'll check the code later and post a fix for the first error, the second 'allegato' one is in your code somewhere.
There are no real problems from these errors.
Bob
- error_reporting = E_ALL [Code Cleanliness, Security(?)]
; By default, PHP surpresses errors of type E_NOTICE. These error messages
; are emitted for non-critical errors, but that could be a symptom of a bigger
; problem. Most notably, this will cause error messages about the use
; of uninitialized variables to be displayed.
for the 'allegato'field name I didn't understand: is somewhere in the code.. hwat d you mean?
HEY THANK YOU FOR QUICK ANSWERING!! YOU FOLKS ROCK!!:side:
For error reporting see the PHP Manual for the settings and what they do.
The 'Notice: Undefined index: allegato' is coming from some of the code you have in your form. Is 'allegato' one of your field names? Post your html here if you like.
Bob
The error after I sent the form:
Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\benintegrati\components\com_chronocontact\chronocontact.php(504) : eval()'d code on line 5
PLEASE NOT THAT NO NAME_FILE OR FILE PATH IS RECORDED IN THE FIELD "ALLEGATO", EVEN IF THE FILE "ALLEGATO" IS CORRECTLY UPLOADED IN DIRECTORY
The error before I sent the form (on loading the web page):
Notice: Undefined variable: imver in c:\programmi\easyphp1-8\www\benintegrati\components\com_chronocontact\chronocontact.php on line 154
(CANT FIND IMVER....)
<style type="text/css">
<!--
legend
{
color:#000000;
background:#E77300;
border: 1px solid #DDDDDD;
padding: 2px 6px;
}
fieldset
{
border: 1px solid #DDDDDD;
width: 90%;
background-color:#EDE7D9;
}
-->
</style>
<fieldset><legend><strong>Benintegra
il palato!!</strong> </legend><br>
Inviaci una ricetta tipica dei tuoi
luoghi di origine. <br>
Benintegrati preparerà per tutta la
comunità la scheda della tua ricetta, da stampare,
conservare, preparare e.... gustare!!<br>
<em><strong>Fai
sentire come si mangia a casa tua!<img
style="width: 132px; height: 100px; float: right;"
alt="ricettario cucina multietnica"
src="../../../images/stories/schede_cucina.png">
</strong></em>
</fieldset>
<br>
<fieldset>
<legend><strong>Lo chef</strong></legend>
<p>Il tuo nome: <input name="name" size="40"></p>
<p>E-mail:
<input name="email"
size="40" type="text"></p>
</fieldset>
<br>
<fieldset>
<legend><strong>Ingredienti</strong></legend>
<p><textarea cols="30" name="ingredienti"
style="height: 63px; width: 612px;" rows="3"></textarea></p>
</fieldset>
<br>
<fieldset>
<legend><strong>Come si prepara?</strong></legend>
<p><textarea cols="30" name="preparazione"
style="height: 63px; width: 612px;" rows="3"></textarea></p>
</fieldset>
<br>
<fieldset>
<legend><strong>Consigli in cucina</strong></legend>
<p><textarea style="height: 63px; width: 612px;"
cols="30" name="consigli" rows="3"></textarea></p>
</fieldset>
<br>
<fieldset>
<legend><strong>Origine</strong></legend>Indica
il paese, la regione, o l'area geografica di
provenienza
<p><input name="origine" size="40"></p>
</fieldset>
<br>
<br>
<fieldset>
<legend><strong>Come si presenta?</strong></legend>Allega
una foto del tuo piatto! Servirà a distinguerlo. Puoi
provare ad inviare anche le foto del tuo cellulare.
<p><input accept="pdf, jpg" name="allegato"
type="file"></p>
</fieldset>
<br>
<br>
<input value="Invia" name="Submit" type="submit">
<input value="Cancella" name="reset" type="reset">
The reference to $allegato is coming from the name you've given your file input
<input accept="pdf, jpg" name="allegato"
type="file">
and the reference to "eval()'d code on line 5" suggests that that is showing up in one of the code snippets that you have put into your ChronoForms form. Please have a look at those and post anything with 'allegato' in it here for us to look at.
Bob
PS As Max said elsewhere 'accept="pdf, jpg"' may not work with all browsers - and, if you do use it, then it takes a MIME-type as a value, not a suffix string.<br><br>Post edited by: GreyHead, at: 2007/11/04 10:39
"eval()'d code on line 5" suggests that that is showing up in one of the code snippets that you have put into your ChronoForms form. Please have a look at those and post anything with 'allegato' in it here for us to look at.
allegato stands for "uploadfile" or "attachment" in english. So I use allegato as field name in a line such:<input name="allegato" type="file">
(is this the snippet you mean?)
and set parameters in CC upload settings:
upload: yes
field_name1:jpg,... : allegato:jpg,etc.
It works:silly: : actually the file is uploaded, but there's no track in the record field "allegato" of the db table, type LONGTEXT (standard type in CC creating table)
I want to make it...!
Maybe the record keeps empty because of the MIME-type Max reports here below?
PS As Max said elsewhere 'accept="pdf, jpg"' may not work with all browsers - and, if you do use it, then it takes a MIME-type as a value, not a suffix string.
I don't know what a MIME-type is, how to declare it, and if it matches somehow with what Max say and the record empty I have..<br><br>Post edited by: GreyHead, at: 2007/11/04 17:42no notice messages are reported,
thus I think that php is set properly on my server (I don't undersand why I have notices in local machine..):whistle:
Anyway, the record in the db table for the
<input name="allegato" type="file"> keeps empty.., as I stated before..:huh:
No the $allegato isn't coming from the html code (at least I don't think so). Do you have 'allegato' in an e-mail template or in JavaScript?
Ah, maybe the problem comes from the MySQL . . . please post the code from the AutoGenerate tab here.
Thanks
Bob
by attaching this line in
On Submit code - after sending email:
<?php echo $_POST['allegato'] ?>
<?php echo $_POST['email'] ?>
I discovered that email field is passed (the result after sending is displayed).Not for allegato (from an input of type="file")
Maybe the solution is here around?
Here's the autogenerated 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['allegato']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
And thanks!
Edited to fix code tags<br><br>Post edited by: GreyHead, at: 2007/11/04 19:08
I think the only problem now is why the file name not being recorded ?
at the code above in the auto generated, please replace :
$_POST['allegato']
with :
$_FILES['allegato']['name']
Fixes it for you ?
The notices are being reported on your local machine because I guess you have XAMPP or whatever dev package which gets installed with best settings to help your development while your live server will ignore those things😉
Cheers
Max