Jump to content

bhamm

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bhamm

  • Rank
    member

Profile Information

  • Gender
    Male
  • Location
    Dallas
  1. Hello everyone. This is disturbing.. I have a function that creates an alphanumeric 'id'. This id becomes part of a URL taking an attendee to their record online, to register for an event (custom web publishing, php). So, the same series of id's is being generated in several databases. I can reproduce this problem at will. It's like FM is deciding on some kind of pattern ahead of time. That's not random. We're all on Mac OS X 10.5, FMPro 9.03. Any ideas? Let ( [ string = Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) & Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) & Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) & Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) & Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) & Middle("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; Int(Random* 46); 1) ] ; Lower (string) )
  2. thanks for the reply.. however, i made a calc (text) field called 'record_state': If ( Get ( RecordOpenState ) ≠ 0; "locked" ; "open" ) i put this field on my 'web' layout in filemaker.. but when i go into a field and start changing things, i can't get this value to say "locked", even if i hop to another field (prior to committing the record). Since i can't get a value of "locked", my PHP line: if ($attendee->getField('record_state') == 'locked') { echo 'record in use'; } ..will never be true. I've tested this by editing an attendee field and not committing it. When i access the record over the web, my "if" statement thinks the record is "open". not sure what i'm doing wrong yet.. :
  3. hello.. i've been looking now for 2 days on how to make a web form check to see if a record is 'in use' on the LAN (cursor in a field.. or uncommitted record). currently, if i'm accessing a record on the LAN with someone else on the web, there's nothing to prevent that form being submitted. The obvious problem being that any changes created online are simply ignored on submission. I need to be able to check for 'in use' prior to drawing/loading the form. I could do this manually (we have a 'locked' checkbox), but that's used along with a timestamp, and set AT THE TIME of submission. all i've found so far in the FM app is a function called "Get (RecordAccess)".. which doesn't seem to be giving me the desired behavior? Is there something i can do on the web side (PHP) that will check for 'in use'? many thanks!
  4. hey! thanks for getting back.. i ultimately handled this a different way on my form (without a script), but your reply looks like what i was after. I suspect i'll be needing this for something else later.. so, thank you brian
  5. is it possible to set a field with a URL.. alternately, if i could call a script with a URL, that'd be fine too. i used to include "&-script=scriptName" when i was doing this in CDML.. thanks in advance! brian
  6. thanks everyone for your help.. i wanted to mention something else (rather important) that i picked up while building my first filemaker > php solution. USE UNDERSCORES in your field names. A lot of my problems with $_POST had to do with "First Name" vs. "First_Name". I didn't know this ahead of time, of course, but i wanted to pass it along for those who might visit this thread in the future. spaces are bad. :)
  7. got it.. i had to use an "isset" if (isset($_POST['Nite_1_Check'])) { $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); } else { $edit->setField('Nite_1_Check', NULL); } works great.. hooray for trial/error :
  8. hello.. i have a form with several checkboxes available for each hotel room night: Nite_1_Check Nite_2_Check ... if i submit the form WITH a box checked, no problem. If i don't select the box and submit, it errors out "Notice: Undefined index: Nite_1_Check... Here's what i started with: $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); when that didn't work (if unchecked), i tried several variations of: if ($_POST['Nite_1_Check'] != NULL) { $edit->setField('Nite_1_Check', $_POST['Nite_1_Check']); } else { $edit->setField('Nite_1_Check', NULL); } but that doesn't work. Since all of my other (non- checkbox) fields work fine, i have a feeling this has something to do with PHP not being able to send/POST a NULL value(?). Am i approaching this right? thanks..
  9. thank you!! : the books i have indicated i should pass 'recid' in a hidden field in the form, and then call it with a POST: $edit = $fm->newEditCommand('a', $_POST['recid']); and actually, getting the record this way worked fine.. but none of the 'setField' functions worked with POST then. They only worked if i hard coded the values. I thought i was making a mistake with regard to POST, but it sounds like my problem was with the way i was getting/assigning recid. This way (your way) works fine: $edit = $fm->newEditCommand('a', $attendee->getRecordId() ); so, to follow up.. newEditCommand takes only the 'recid' as it's second parameter? It couldn't take something like my own random/alphanumeric 'id' field, right? appreciate your help.
  10. hello.. need a little help with editing a record. I have the Stark book, and the Olm book and still can't seem to make the "newEditCommand" work with $_POST. If i hardcode the the second parameter in "setField", things work fine. If i try setField('Name', $_POST['Name'].. i get an 'Undefined Index: Name' error. here's my FIND and EDIT: // FIND ATTENDEE RECORD $request = $fm->newFindCommand('a'); $request->addFindCriterion('id', $_GET['id'] ); // 'id' is a random, alphanumeric field $result = $request->execute(); if (FileMaker::isError($result)) { echo 'Error: (' . $result->getCode() . ') ' . $result->getMessage() . "n"; exit; } $attendees = $result->getRecords(); $attendee = $attendees[0]; // EDIT ATTENDEE RECORD $message = '' ; if (isset($_POST['submit']) && $_POST['action'] == 'edit' ) { $edit = $fm->newEditCommand('a', 6); // does this HAVE to be 'recid'? $edit->setField('Name', 'Brian'); // doesn't work with $_POST['Name']? $edit->execute(); $message = ' thank you'; } ?> here's the beginning of my FORM code:
  11. got it! : so, after this: $records = $result->getRecords(); i needed to add THIS to isolate 'attendee' $attendee = $records[0]; works great now.. i can pass whatever field i like in the URL. Thanks for getting me 99% of the way : A rather large door just opened in my head. Excellent. many thanks!
  12. sorry, the proverbial light bulb hasn't gone off yet. I follow (i think) your code. But how does $records (from your example) coincide with: $attendee = $fm->FUNCTION('layout', $_GET['Attendee_ID']); in other words, all of my attendee fields on the form are being pulled with: echo $attendee->getField('First Name'); so everything's based on $attendee, correct? How do i get $records involved? I feel like i'm close, but haven't connected this just yet. thank you
  13. thank you, i thought it'd be something straightforward like that.. i didn't realize i would use the "date" function to parse a "time" though. appreciate it :
  14. forgive me if this has been answered elsewhere on the forum, but i didn't see anything mentioned.. i'm pulling a 'meeting time' field like so: echo $meeting->getField('meeting time') and the filemaker api is showing me "hh:mm:ss", regardless of how the time is stored in the database. Meaning, i can type in "3:00 PM" into filemaker.. there's no formatting on it in the database. But online, all i can get out of it is "15:00:00". now, i could make them text fields - we're not calculating anything against them (at this point), but i'd prefer to leave them as 'time' if there's an easy way to adjust how they appear online. I could also make a extra 'calc' field for each time in question, and use /that/ on the web.. but that seems very, um.. non-elegant. : .. suggestions? thank you!
  15. sorry.. here's what i'd started with, based on jon starks' book: $attendee = $fm->getRecordById('table', $_GET['recid']); in filemaker.. the calc for the URL becomes: "http://server/form.php?recid=" & recid this works.. but what i want is to use my "Attendee_ID" field instead of "recid". But then i can't use 'getRecordByID'. I imagine there is some function like: $attendee = $fm->FUNCTION('table', $_GET['Attendee_ID'] "FUNCTION" is what i'm looking for..
×
×
  • Create New...

Important Information

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