Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I have a reservation system in php and it works fine up until I get into the date areas. So, I figured that what I could do is when the student logs in, it would setfield with current timestamp. I gave a couple wacks at it but it is getting jumbled up. Could someone see where I went wrong?

<?php

session_start();

include_once('FX/FX.php');

include_once('FX/server_data.php');

$userid=$_POST['userid'];

$password = $_POST['password'];

$DateTimestamp = date("m/d/y",timestamp);

// UPDATE THE TIMESTAMP FIELD currentTimeStamp_g WITH CURENT TIMESTAMP

$edit=new FX($serverIP,$webCompanionPort);

$edit->SetDBData($dbname,'students');

$edit->SetDBPassword($pw,$un);

$edit->AddDBParam('kp_student_id',$userid);

$edit->AddDBParam('currentTimeStamp_g',$DateTimestamp);

$editResult=$edit->FMEdit();

$find=new FX($serverIP,$webCompanionPort);

$find->SetDBData($dbname,'students',1);

$find->SetDBPassword($pw,$un);

$find->AddDBParam('kp_student_id','=='.$userid);

$find->AddDBParam('password','=='.$password);

$findResult=$find->FMFind();

if ($findResult['errorCode']==0){

foreach($findResult['data'] as $key=>$findData);

$_SESSION['studentid'] = $findData['kp_student_id'][0];

$_SESSION['registrations_available'] = $findData['registrations_available'][0];

$_SESSION['name'] = $findData['name'][0];

include_once("course_list.php");

}else{

//include_once('login_error.htm');

}

?>

There is a log in page that collects the userid and pass.

Any help would be great.

  • Author

Ok.. I got it.. kind of.. but how do you format the $date to convert into a filemaker useable format?

$DateTimestamp = date("m/d/y",timestamp);

Try this instead:

$DateTimestamp = date("m/d/Y");

Filemaker simply expects a mm/dd/yyyy date format, though it may be happy with m/d/yy, i've never tried it like that.

  • Author

I got it by using this:

$DateTimestamp = date('Y/m/d H:i:s');

but it opened another can of worms. If the field it is going into is a text field, then it is ok. But if the field is a timestamp then it won't add it and gives a php error code 501. I also tried to take two fields, time and date and make a calc with the result being timestamp. That didn't work either... any ideas? or what is the technique to write from php to a timestamp field?

FileMaker doesn't accept YYYY/mm/dd format, it accepts mm/dd/YYYY

  • Author

oh, sorry... I thought it was how it was displayed... got it.

  • Author

but, just curious though, how would you add 57600 seconds to "date('m/d/Y H:i:s');"? to compensate for server time.

date( 'm/d/Y H:i:s' , time() + 57600 ) ;

  • Author

I ended up doing this

$now = time();

$newtime = $now+57600;

$Timestamp = date("m/d/Y H:i:s", $newtime);

Thanks a lot for your time. It really pointed me in the right direction.

No worries, but just so you know, those two statements are exactly the same.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.