Forums

Illegal variable _files or _env or...

Steppo 19 Nov, 2007
Hi!

I have made a form which is supposed to "POST", and when i hit "Submit" I recieve following string:
"Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script."

I have searched this forum but did not found anything that explain this.

I don't think it's the register globals which is turned off, but I do think it have to do with the "POST".
I'm running Joomla 1.5 RC3.

I would appreciate if someone have a soluiton on this!🙂

/Steppo
GreyHead 19 Nov, 2007
Hi Steppo,

This usually occurs when 'GLOBALS' is included in a script as it's a sign of hacking. Is there something like this in your form code anywhere?

Bob
Steppo 19 Nov, 2007
Hi!

This is the form-code:

<script src="components/com_chronocontact/js/prototype.js" type="text/javascript"></script>
			<script src="components/com_chronocontact/js/effects.js" type="text/javascript"></script>
			<script src="components/com_chronocontact/js/validation.js" type="text/javascript"></script>
				
<form name="ChronoContact_fragelek" id="ChronoContact_fragelek" method="post" action="index.php?option=com_chronocontact&task=send&chronoformname=fragelek" onsubmit=return validateForm()>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
			<tr>
				<td>
				<p>Välkommen till TFs frågelek med fina priser!</p>
<p>Svaren på frågorna hittar du i de olika dokumenten på TF: s nya webbplats.</p>
<p> </p>
<p><strong>Fråga 1</strong><br />
Vilket datum ( år/ månad) blev förarprovsverksamheten officiellt överförd från TSV till Vägverket?<br />
</p>Svar:<br />
  <input type="text" name="1" class="required" id="1" />
<p><strong>Fråga 2</strong><br />
  Vilket år bildades TF: s kamratförening?<br />
</p>Svar:<br />
  <input name="2" class="required" type="text" id="2" size="4" maxlength="4" />
<p><strong>Fråga 3</strong><br />
  På vilken ort i Sverige firar TF jubileum vart femte och tionde år?<br />
</p>
Svar:<br />
  <input type="text" name="3" class="required" id="3" />
<p><strong>Fråga 4</strong><br />
  Vilket år utfärdades förmodligen det första körkortet i Sverige enligt körkortshistoriken?<br />
</p>
Svar:<br />
  <input name="4" class="required" type="text" id="4" size="4" maxlength="4" />
<p><strong>Fråga 5</strong><br />
  När blev det obligatoriskt att använda bilbälte i baksätet på personbil?<br />
</p>Svar:<br />
  <input type="text" name="5" class="required" id="5" />
<p><strong>Fråga 6</strong><br />
  Vilket år anställdes Christer Simonsson (styrelsesuppleant i TF)? <br />
</p>Svar:<br />
  <input name="6" class="required" type="text" id="6" size="4" maxlength="4" />
<p><strong>Fråga 7</strong><br />
  Vilket datum invigdes Förarenhetens kontor på Hisingen i Göteborg?<br />
</p>Svar:<br />
  <input type="text" name="7" class="required" id="7" />
<p><strong>Fråga 8</strong><br />
  Vilken funktion i Förarenhetens verksamhet har Stefan Johansson (styrelseledamot)  <br />
</p>Svar:<br />
  <textarea name="8" class="required" cols="40" rows="3" id="8"></textarea>
<p><strong>Fråga 9</strong><br />
  På vilken ort i Sverige hölls TF: s årsmöte 2007?<br />
</p>Svar:<br />
  <input name="9" class="required" type="text" id="9" value="" />
<p><strong>Fråga 10 </strong><br />
  Vilken f.d. styrelseledamot i TF är ordförande sedan årsmötet 2007?<br />
</p>Svar:<br />
  <input type="text" name="10" class="required" id="10" />
<p><strong>Fråga 11</strong><br />
    <strong>Om grupplivförsäkringen! ??? Frågan är inte klar…….</strong><br />
</p>Svar:<br />
  <input type="text" name="11" class="required" id="11" />
<p><strong>Fråga 12</strong><br />
  UTSLAGSFRÃ…GA!<br />
  Studera bilden nedan! Hur många prydnadsstenar finns på bilden?<br />
</p>Svar:<br />
  <input name="12" class="required" type="text" id="12" size="10" maxlength="10" />
<p><img src="images/stenar.jpg" border="0"  width="640" height="360" /></p>Ditt namn:<br />
  <input name="namn" class="required" type="text" id="namn" size="30" /><br />
Din e-postadress:<br />
  <input name="mail" class="required validate-email" type="text" id="mail" size="30" />
<p>Skriv in säkerhetskoden:<br /><input name="chrono_verification" type="text" id="chrono_verification" value="">
              <img src="http://www.tfkamratforening.se/components/com_chronocontact/chrono_verification.php?imtype=1"></p>
<p> </p>
  <input type="submit" name="send" id="send" value="Skicka svar" />
<p> </p>				</td>
			</tr>
		</table>
</form>
					<script type="text/javascript">
				function formCallback(result, form) {
					window.status = "valiation callback for form '" + form.id + "': result = " + result;
				}
				var valid = new Validation('ChronoContact_fragelek', {immediate : true, onFormValidate : formCallback});
			</script>
		<!-- You are not allowed to remove or edit the following 3 lines anyway if you didnt buy a license --> 
<div class="chronoform">
<a href="http://www.chronoengine.com">Joomla Professional Work</a>
</div>
<!-- You are not allowed to remove or edit the above 3 lines anyway if you didnt buy a license -->


And this is 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['form1']."' , '".$_POST['1']."' , '".$_POST['form2']."' , '".$_POST['2']."' , '".$_POST['form3']."' , '".$_POST['3']."' , '".$_POST['form4']."' , '".$_POST['4']."' , '".$_POST['form5']."' , '".$_POST['5']."' , '".$_POST['form6']."' , '".$_POST['6']."' , '".$_POST['form7']."' , '".$_POST['7']."' , '".$_POST['form8']."' , '".$_POST['8']."' , '".$_POST['form9']."' , '".$_POST['9']."' , '".$_POST['form10']."' , '".$_POST['10']."' , '".$_POST['form11']."' , '".$_POST['11']."' , '".$_POST['form12']."' , '".$_POST['12']."' , '".$_POST['form14']."' , '".$_POST['namn']."' , '".$_POST['form15']."' , '".$_POST['mail']."' , '".$_POST['form13']."' , '".$_POST['send']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>



I'm some kind of novice on forms so I will be very happy if someone could help me out with this.

/Steppo<br><br>Post edited by: Steppo, at: 2007/11/18 21:29
GreyHead 19 Nov, 2007
Hi Steppo,

From a quick scan that all looks good. If you turn off form validation does the problem go away? Does it occur in all browsers or just one?

Bob
Max_admin 19 Nov, 2007
Hi Steppo,

Please make a new very small form at the same server and put only 2 fields and name them :name,email then make a table and choose them both to be saved then run your form and submit it, do you get the same problem ?

I guess something like :$_POST['1'] isn't good at your server!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Steppo 20 Nov, 2007
Ok, the simple form works.

I changed my forms names from "1", "2"... to "ett", "tva"... and something happend.
Now I got following:
"Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /tmp) in /home/tfkamrat/public_html/components/com_chronocontact/chronocontact.php on line 199"
and I'm still lost.

/Stefan

Edit:
I deactivated the image verification and now the form runs like a charm! :woohoo:
I still want to use the image verification so a solution on the above error would be nice!😛<br><br>Post edited by: Steppo, at: 2007/11/19 22:39
GreyHead 20 Nov, 2007
Hi Steppo,

I see you're on Joomla 1.5 I think that for the sessions to work you have to have set the Session Handler to 'None' on the Global Configuration | System tab. Please will you check this.

Bob
Steppo 20 Nov, 2007
Hi again!

Thanks a lot!
That works!
What is the consequence to not use the session handler?

/Stefan
Max_admin 20 Nov, 2007
Hi Stefan,

You still use sessions but Joomla won't save it to database by default, will deal with it normally!!🙂

If you like ChronoForms please vote for us at the link in my signature, this will help it!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Kirkydu 14 Apr, 2008
Hi, just loaded chronoforms and it was much easier than I thought, making me very happy. But, I got the same error this guy did. I'm using 1.0.15 at <!-- w --><a class="postlink" href="http://www.baseballmilwaukee.com">www.baseballmilwaukee.com</a><!-- w -->

The form is the New Player form. I guess my first question is if where is the session handler in this version of Joomla (if there is) for me to change? I can not find it in Global Config (which might be my newberiffic screen vision).

Would appreciate the help. We had a pretty high traffic site and expect this one to be the same once we get it up. Will certainly recommend this software.
Kirkydu 14 Apr, 2008
my auto generated code if it helps. Can view source for form html.
<?php 
	global $database;
	
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES  (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'296700','')."' , '".mosGetParam($_POST,'UpdateData_296700','')."' , '".mosGetParam($_POST,'296701','')."' , '".mosGetParam($_POST,'UpdateData_296701','')."' , '".mosGetParam($_POST,'296702','')."' , '".mosGetParam($_POST,'UpdateData_296702','')."' , '".mosGetParam($_POST,'296703','')."' , '".mosGetParam($_POST,'UpdateData_296703','')."' , '".mosGetParam($_POST,'296704','')."' , '".mosGetParam($_POST,'UpdateData_296704','')."' , '".mosGetParam($_POST,'296705','')."' , '".mosGetParam($_POST,'UpdateData_296705','')."' , '".mosGetParam($_POST,'296730','')."' , '".mosGetParam($_POST,'UpdateData_296730','')."' , '".mosGetParam($_POST,'296708','')."' , '".mosGetParam($_POST,'UpdateData_296708','')."' , '".mosGetParam($_POST,'296729','')."' , '".mosGetParam($_POST,'UpdateData_296729','')."' , '".mosGetParam($_POST,'296737','')."' , '".mosGetParam($_POST,'UpdateData_296737','')."' , '".mosGetParam($_POST,'296792','')."' , '".mosGetParam($_POST,'UpdateData_296792','')."' , '".mosGetParam($_POST,'296793','')."' , '".mosGetParam($_POST,'UpdateData_296793','')."' , '".mosGetParam($_POST,'296847','')."' , '".mosGetParam($_POST,'UpdateData_296847','')."' , '".mosGetParam($_POST,'296848','')."' , '".mosGetParam($_POST,'UpdateData_296848','')."' , '".mosGetParam($_POST,'296849','')."' , '".mosGetParam($_POST,'UpdateData_296849','')."' , '".mosGetParam($_POST,'296854','')."' , '".mosGetParam($_POST,'UpdateData_296854','')."' , '".mosGetParam($_POST,'296794','')."' , '".mosGetParam($_POST,'UpdateData_296794','')."' , '".mosGetParam($_POST,'296797','')."' , '".mosGetParam($_POST,'UpdateData_296797','')."' , '".mosGetParam($_POST,'296798','')."' , '".mosGetParam($_POST,'UpdateData_296798','')."' , '".mosGetParam($_POST,'296799','')."' , '".mosGetParam($_POST,'UpdateData_296799','')."' , '".mosGetParam($_POST,'296800','')."' , '".mosGetParam($_POST,'UpdateData_296800','')."' , '".mosGetParam($_POST,'296801','')."' , '".mosGetParam($_POST,'UpdateData_296801','')."' , '".mosGetParam($_POST,'296841','')."' , '".mosGetParam($_POST,'UpdateData_296841','')."' , '".mosGetParam($_POST,'330926','')."' , '".mosGetParam($_POST,'UpdateData_330926','')."' , '".mosGetParam($_POST,'Engage','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
<br><br>Post edited by: GreyHead, at: 2008/04/14 10:04
GreyHead 14 Apr, 2008
Hi Kirkydu,

Please tell us exactly what error messages you are getting and when they show up.

As the previous user was on Joomla 1.5 and you are using 1.0.x it may not be the same problem.

Bob
Kirkydu 14 Apr, 2008
Hi, thanks for the quick reply.

Here's the error:

Illegal variable _files or _env or _get or _post or _cookie or _server or _session or globals passed to script.

It occurs when I try to submit the form "New Players" at <!-- w --><a class="postlink" href="http://www.baseballmilwaukee.com">www.baseballmilwaukee.com</a><!-- w --> located half way down the main page (if you'd like to try it).

I'm guessing it's a setting issue. Just not sure which/what setting to change. Could be wrong, could be something in the form's html. But I took the html from another form from a similar website and deleted all their site specific info and put ours in, which yields a nice looking form. Just can't send it without the error message. Also, I'm not seeing the info go to the table either.

Thanks.
Max_admin 15 Apr, 2008
Hi Kirkydu,

The solution is posted, please don't use fields names with pure digits, like '987797' or so, include some characters, like 'aaa9898998'.

Cheers

Max

P.S: you will need to regenerate the Auto generated code!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 15 Apr, 2008
Hi Kirkydu,

IIRC the specification for html 'name' & 'id' fields requires that they begin with a letter.

Bob
Kirkydu 15 Apr, 2008
Thanks guys. Read some forums and missed that. Works fine now.

Next sites will be mine at <!-- w --><a class="postlink" href="http://www.KirkSpano.com">www.KirkSpano.com</a><!-- w --> and <!-- w --><a class="postlink" href="http://www.Investorideals.com">www.Investorideals.com</a><!-- w -->

If I can be of some service to you let me know.

Kirk
Max_admin 16 Apr, 2008
Thanks Kirk, have you purchased a license ? It seems that we can't email it because there is something wrong with the email address, could you please send another one with the payment details to us through the contact us page ?

Best regards,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.