28, May 2012

Undefined variable: euro_date - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Undefined variable: euro_date
« previous next »
Pages: [1] Print

Author Topic: Undefined variable: euro_date  (Read 1754 times)
Bill Cosby is my Father
*
Posts: 4
32 credits
Members referred : 0


« on: May 04, 2006, 06:40:55 pm »

Hi Everyone,
I just installed the latest version of Access_User_class and when I go to update User profile I get an "Undefined variable: euro_date in ext_user_profile.php on line 110" error. 
Has anyone had this error?

I also get this error:
Notice: Undefined offset: 1 in access_user_class.php on line 285



Mike
« Last Edit: May 04, 2006, 06:44:12 pm by mglassic »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: May 04, 2006, 09:26:35 pm »

Hello,

actually its not possible to have this error if the user profile extension is unchanged:

Code:
<?php
function 
create_form_field($formelement$label$length 25$required false$disabled false$euro_date false) {
$form_field "<label for=\"".$formelement."\">".$label."</label>\n";
$form_field .= "  <input name=\"".$formelement."\" type=\"text\" size=\"".$length."\" value=\"";
if (isset($_REQUEST[$formelement])) {
$form_field .= $_REQUEST[$formelement];
} elseif (isset($this->$formelement) && !isset($_REQUEST[$formelement])) {
$form_field .= ($euro_date) ? strftime("%d/%m/%Y"strtotime($this->$formelement)) : $this->$formelement// this is row 110
} else {
$form_field .= "";
}
$form_field .= ($disabled) ? "\" disabled>" "\">";
$form_field .= ($required) ? "*<br>\n" "<br>\n";
return $form_field;
}

the boolean euro_date is default = false because its defined inside the properties from the method.

The other thing is indeed a bug inside the example file, check row 14:
Code:
<?php
$update_profile->save_profile_date($_POST['id'], $_POST['language'], $_POST['address'], $_POST['postcode'], $_POST['city'], $_POST['country'], $_POST['phone'], $_POST['fax'], $_POST['homepage'], $_POST['notes'], $_POST['field_one'], $_POST['field_one'], $_POST['field_two']."##eu_date"); // note the last trailing string, this used to optimize the value as a euro date.
Thank you for reporting this.

Bill Cosby is my Father
*
Posts: 4
32 credits
Members referred : 0


« Reply #2 on: May 04, 2006, 10:02:13 pm »

Hi,
Thanks for the code, I copy and pasted the first piece of code in your reply and I don't get the euro_date error anymore.  However, I still get the following error when I save user profile:

Notice: Undefined offset: 1 in access_user_class.php on line 285

Notice: Undefined offset: 2 in access_user_class.php on line 285

Thanks again
Mike
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: May 04, 2006, 11:12:13 pm »

Hi,
Thanks for the code, I copy and pasted the first piece of code in your reply and I don't get the euro_date error anymore.  However, I still get the following error when I save user profile:

Notice: Undefined offset: 1 in access_user_class.php on line 285

Notice: Undefined offset: 2 in access_user_class.php on line 285

Thanks again
Mike

thats because the missing paramter for the function inside profile example check the second code line I posted before...

Bill Cosby is my Father
*
Posts: 4
32 credits
Members referred : 0


« Reply #4 on: May 05, 2006, 12:09:04 am »

Thanks.

Works nice now...
Mike
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2423
Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Undefined variable: euro_date
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:51:36 am





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!






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