22, November 2008

wrong order of the error messages - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Validate_fields Class (Moderator: Olaf)
Topic: wrong order of the error messages
« previous next »
Pages: [1] Print

Author Topic: wrong order of the error messages  (Read 891 times)
Total Zero
*
Gender: Male
Posts: 5
38 credits
Members referred : 0



« on: Jun 08, 2006, 11:27:11 PM »

i've translated the msg's to polish (thx olaf for appreciate it) and if I set the language to pl the error mesages are in wrong order - the $msg[0] = "Please correct the following error(s):"; is at the end, what can it be? maybe somebaody have the same problem?
« Last Edit: Jun 09, 2006, 12:12:19 AM by olaf »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


Re: showing the error messages
« Reply #1 on: Jun 08, 2006, 11:34:05 PM »

what is the code you are using together with the form?

Please show us only the php part and do you tried the original example? is there a live version?

EDIT
I think I found the problem:
Code:
<?php
function 
create_msg($break_elem "<br />") {
$the_msg "";
krsort($this->messages); // new in 1.35
reset($this->messages); 
foreach ($this->messages as $value) {
$the_msg .= $value.$break_elem."\n";
}
return $the_msg;
}

It looks like that asort isn't the right function Wink

about your translations, this text is OK together with iso-8859-2 encoding, is there a possebility to have them working for utf-8 (will say all polish special characters with unicode values)? After the sesond polish website I learned that utf-8 is the best way to handle this characters.
« Last Edit: Jun 08, 2006, 11:53:11 PM by olaf »


Last blog : Just a better Internet portal provided by Google
Total Zero
*
Gender: Male
Posts: 5
38 credits
Members referred : 0



« Reply #2 on: Jun 09, 2006, 12:09:53 AM »

Code:
    include("includes/class/validation_class.php");
$example = new Validate_fields;
$example->check_4html = true;

$example->add_link_field("Kontakt_::_E-mail", $email, "email");
$example->add_link_field("Kontakt_::_Strona WWW", $_POST['www'], "url", "n");
if ($example->validation()) {
$this->output.= "<center><br />Dane poprawne!<br />Profil został zapisany.</center>"; // replace this text if you like...
} else {
$this->output.= $example->create_msg();
}
the code is somehting like that

about the translaton i wil look for it Wink
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jun 09, 2006, 12:11:27 AM »

It have to work if you modify this row:

krsort($this->messages); // new in 1.35

check the new version on my site there is also some other new functionallity...


Last blog : Just a better Internet portal provided by Google
Total Zero
*
Gender: Male
Posts: 5
38 credits
Members referred : 0



« Reply #4 on: Jun 09, 2006, 12:17:42 AM »

with the new wersion it works perfectly. Thanks!

the utf-8
Code:
            case "pl":
            $msg[0] = "Wystąpiły następujące błędy w formularzu:";
$msg[1] = "Pole <b>".$fieldname."</b> jest puste.";
$msg[10] = "Data w polu <b>".$fieldname."</b> nie jest poprawna.";
$msg[11] = "Adres e-mail w polu <b>".$fieldname."</b> nie jest poprawny.";
$msg[12] = "Wartość w polu <b>".$fieldname."</b> nie jest poprawna.";
$msg[13] = "Text w polu <b>".$fieldname."</b> jest za długi.";
$msg[14] = "Adres strony w polu <b>".$fieldname."</b> nie jest poprawny.";
$msg[15] = "W polu <b>".$fieldname."</b> znaleziono kod HTML, nie jest to dozwolone.";
break;
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6441
39470 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Jun 09, 2006, 12:22:45 AM »

thank you for the translations...


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2797
Tags : php html Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Validate_fields Class (Moderator: Olaf)
Topic: wrong order of the error messages
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 10:31:12 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.741
Total Topics: 7.651
Total Members: 4.398
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: egseopro

41 Guests, 4 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.