forms

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
pbeckermann
Posts: 4
Joined: Wed 17. Dec 2003, 13:23
Location: Burlington
Contact:

forms

Post by pbeckermann »

I created the following contact form

IT|fname|1|First Name: |40,100||300
IT|lname|1|Last Name: |40,100||300
IT|company|1|Company: |40,100||300
IT|address|0|Address: |40,100||300
IT|city|0|City: |40,100||300
IT|state|0|State: |40,100||300
SC|country|0|Country: |10,100|US|300
IT|tel|0|Telephone: |40,100||300
IT|fax|0|Fax: |40,100||300
IT|website|0|Website: |40,100||300
IT|email|1|Email: |40,100||300
TA|msg|0|Message: |20,3||300
IH|send_copy|0||10,100|1|0

When i send the form i get this error

Error Description
[500] Fill in field ADDRESS.
[510] Fill in field CITY.
[520] Fill in field STATE.
[530] Fill in field TEL.
[540] Fill in field FAX.
[550] Fill in field WEBSITE.
[560] Fill in field MSG.

even though these fields should not have to be filled in

Thanks
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

as you can see

IT|fname|1|First Name... -> the 1 in third argument says: needed


IT|fname|0|First Name... -> set third argument = 0

That's it!


Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
pbeckermann
Posts: 4
Joined: Wed 17. Dec 2003, 13:23
Location: Burlington
Contact:

Post by pbeckermann »

Well i want that field to be filled in the problem is the other field that i dont want "NEEDED" are returning an error if i leave them blank
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

Hm.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
waggis
Posts: 18
Joined: Wed 31. Dec 2003, 13:59

Post by waggis »

Hi oliver,

Sorry boring you again with this. i have this bug too.

My form settings:
IT|fname|1|First Name: |40,100||300
IT|lname|1|Last Name: |40,100||300
IT|company|0|Company: |40,100||300
IT|address|0|Address: |40,100||300
IT|city|0|City: |40,100||300
IT|state|0|State: |40,100||300
SC|country|0|Country: |10,100|US|300
IT|tel|0|Telephone: |40,100||300
IT|fax|0|Fax: |40,100||300
IT|website|0|Website: |40,100||300
IT|email|1|Email: |40,100||300
TA|msg|0|Message: |20,3||300
IH|send_copy|0||10,100|1|0

If i leave the fields that are NOT required empty i get:
[500] Fill in field COMPANY.
[510] Fill in field ADDRESS.
[520] Fill in field CITY.
[530] Fill in field TEL.
[540] Fill in field FAX.
[550] Fill in field WEBSITE.

If every field is filled in, it works fine. Maybe there is an error with the required
not required check in formmailer.

Could you have a look at it ?

thanks
waggis
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

I really don't know what's wrong with your installation:

I have created a new form field with exact same content:

Code: Select all

IT|fname|1|First Name: |40,100||300 
IT|lname|1|Last Name: |40,100||300 
IT|company|0|Company: |40,100||300 
IT|address|0|Address: |40,100||300 
IT|city|0|City: |40,100||300 
IT|state|0|State: |40,100||300 
SC|country|0|Country: |10,100|US|300 
IT|tel|0|Telephone: |40,100||300 
IT|fax|0|Fax: |40,100||300 
IT|website|0|Website: |40,100||300 
IT|email|1|Email: |40,100||300 
TA|msg|0|Message: |20,3||300 
IH|send_copy|0||10,100|1|0 
And this is how it looks in frontend:
Image
and this is the result when I click send if nothing is filled in:
Image

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

Hello Oliver!

As I detected, if got the same problem, too.
This ist the Form "Code"

Code: Select all

IH|send_copy|0||10,100|1|0
IT|ansprechpartner|1|Ansprechpartner, Name: |40,100||300
IT|email|1|E-Mail: |40,255||300
IT|firma|0|Firma: |40,255||300
IT|straße|0|Straße, Hausnummer: |40,255||300
IT|plz|0|PLZ: |40,5||60
IT|stadt|0|Stadt: |40,255||300
IT|telefon|0|Telefon: |40,35||300
SC|country|1|Land: |10,100|DE|300
TA|info|1|Ihre Anfrage: |100,10||300

So the Form looks like this:
Image

The Result is this:
Image


Any proposals? I've checked the formail.php and everything looks fine.
So what can cause the error? Please help... :?
BTW: It makes no sense, if there is a hidden error/success redirect field is set, or not.

Cheers,
Florian

P.S.: Linux, PHP 4.3.4, safemode_restrictions ON, phpwcms 1.1-RC2 2004-01-11c
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

As I see the source of the HTML File after the Form gets rendered looks well, too:

Code: Select all

<input type="hidden" name="required" value="ansprechpartner,email,country,info">

Thats the act_formmailer.php lines, where the required fields are checked:

Code: Select all

if(isset($_POST["required"])) {
	$req_key = explode(",", trim($_POST["required"]));
	if(count($req_key)) {
		$err_num=0;
		foreach($req_key as $value) {
			$required[$value] = 1;
			if(!isset($_POST[$value])) {
				$form_error[400+$err_num] = str_replace("###value###", strtoupper($value), $translate[$lang]["error400"]);
				$err_num+=10;
			}
		}
	}
	unset($_POST["required"]);
}

//SNIPP - SNAPP //

		if($required[$key] && isEmpty($value)) {
			if(isset($form_label[$key])) {
				$form_error[500+$err_num] = str_replace("###value###", $form_label[$key], $translate[$lang]["error400"]);
			} else {
				$form_error[500+$err_num] = str_replace("###value###", strtoupper($key), $translate[$lang]["error400"]);
			}			
			$err_num+=10;
		}

As I also regonized, when you've checked the reply in the backend als "HTML" you'll get also "TEXT".

Cheers,
Florian
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

That's right - not implemented (as I can remember)
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

I have an idea - is register_globals = On?

only this would make sense because then:

$_POST["required"] = $required = $required[$key]

and -> "if" will always be TRUE

I will rename the $required[$key] to handle this.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post by Florian »

Hello again!

That's the solution. After turning off the register_globals (don't ask why they were on), the error disappers.
I'll kick my a** why I don't found out the solution by myself...

But, well thats things are going,
Florian
Sarah
Posts: 7
Joined: Sun 1. Feb 2004, 21:19
Location: USA

Post by Sarah »

Please don't laugh to hard at this question, but where do I find register_globals so that I might turn them off?

I am having the same problem, and while I have it temporarily fixed by making all fields required, I'd like to solve it for good.

PTI - pardon the ignorance.
adriano
Posts: 165
Joined: Sun 16. Nov 2003, 15:24
Location: Bremerhaven
Contact:

Post by adriano »

I found the same problem for me too. But as I tried some ways, I found, that when I put the value "send copy" out of my form, all works fine.
Fotos von Norddeutschland und der Nordseeküste
Photos of Northern Germany and the North Sea Coast:
http://www.wackernah.net
User avatar
Oliver Georgi
Site Admin
Posts: 9900
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

@Sarah

please check here:
- http://de.php.net/manual/en/configurati ... er-globals
- http://martin.f2o.org/php/portable

You can setup this in PHP.INI or in Apache host setting or in .htaccess file.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply