Newbies Andy2500 Posted November 10, 2007 Newbies Posted November 10, 2007 Dear Sirs, I'm learning API for FMP with some examples, then I have always the problem with function getRecordById, particularity the variable " recid ", it returns always error Undefined index: recid when I used $record = $fm-> getRecordById ('Layout1', $_GET['recid']); or empty($_REQUEST['recid'] = TRUE ! Here are the examples <?php define( 'FM_HOST', '127.0.0.1' ); define( 'FM_FILE', 'Test' ); define( 'FM_USER', 'php' ); define( 'FM_PASS', 'php' ); require_once ('FileMaker.php'); $fm = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS); $record = $fm-> getRecordById ('Layout1', $_GET['recid']); $id = $record->getField('ID'); .............. or $fm = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS); if (empty($_REQUEST['recid'])) { die('The record id is missing.'); } ................ Would you like to tell me where is the value of "recid" and how do I define it ? Thanks in advance for the help! Andy
Genx Posted November 10, 2007 Posted November 10, 2007 (edited) 1) does it return an error or a notice? 2) You should probably use $_POST or $_GET rather than $_REQUEST. Given that you are using $_REQUEST though, you can either tack the record id onto the end of your url e.g. myPHPpage.php?recid=12 OR you can construct an HTML form: Edited November 10, 2007 by Guest
Recommended Posts
This topic is 6485 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now