28, May 2012

Warning: mktime() expects parameter 5 to be long - 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: Warning: mktime() expects parameter 5 to be long
« previous next »
Pages: [1] Print

Author Topic: Warning: mktime() expects parameter 5 to be long  (Read 2762 times)
Google dot what?
*
Gender: Male
Posts: 2
16 credits
Members referred : 0



« on: Jul 02, 2006, 01:54:53 pm »

I have this error when i try to update user profile.

Notice: Undefined offset: 1 in C:\WEB\classes\access_user\access_user_class.php on line 286

Notice: Undefined offset: 2 in C:\WEB\classes\access_user\access_user_class.php on line 286

Warning: mktime() expects parameter 5 to be long, string given in C:\WEB\classes\access_user\access_user_class.php on line 286

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql.users_profile SET language='en', address='', postcode='', city='', country' at line 1

I use WinXp with apache 2.2,Mysql 5,PhP 5.  Cry Help!
« Last Edit: Jul 02, 2006, 01:58:28 pm by zeus074 »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Jul 02, 2006, 10:46:19 pm »

what is the dateformat you're using? maybe you can show us the form?

Google dot what?
*
Gender: Male
Posts: 2
16 credits
Members referred : 0



« Reply #2 on: Jul 03, 2006, 02:11:44 am »

This is the form before save(profile) [1.jpg] then after [2.jpg]

I have made the 2 bugfix

ext_user_profile @ row 110

    function create_form_field($formelement, $label, $length = 25, $required = 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;
        } else {
            $form_field .= "";
        }
        $form_field .= ($required) ? "\">*<br>\n" : "\"><br>\n";
        return $form_field;     
    }

update user_profile @ row 14

if (isset($_POST['profile_data'])) {
    $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.

* 1.jpg (80.61 KB - downloaded 5 times.)
* 2.jpg (70.51 KB - downloaded 4 times.)
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jul 03, 2006, 08:46:56 am »

I see the example file wasn'r really clear (nothing wrong in the class)

replace the this line to update the profile information:
Code:
<?php
if (isset($_POST['profile_data'])) {

$eu_date_field = (!empty($_POST['field_two'])) ? $_POST['field_two']."##eu_date" $_POST['field_two']; 
// add the eu date field information ONLY if the field is not empty

$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'], $eu_date_field$_POST['field_three']); 
}  



I added also an example for the us date to make it more clear:

Code:
<?php
  
echo "<div>".$update_profile->create_form_field("field_two""Euro Date dd/mm/yyyy: "10falsefalsetrue)."</div>";
  echo 
"<div>".$update_profile->create_form_field("field_three""US Date yyyy-mm-dd: "10)."</div>";


at last this features (dyn. form fields) are additional features, the main function in this class is to protect pages and manage members...Wink
« Last Edit: Jul 03, 2006, 08:49:00 am by olaf »

Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3115
Tags : php mysql apache 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: Warning: mktime() expects parameter 5 to be long
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 01:46:11 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!






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.