August 30, 200619 yr this keeps printing to the screen above the page and the page is non functional SetDBData('Student','stureg',$groupSize); $register->SetDBPassword('','Admin'); $registerResult=$register->FMNew(); foreach($registerResult['data'] as $key=>$registerData); ?> im using server 8 adv, in the php fx folder the file server_data.php am i correct port is the port numbe rof the machine my wbe publishing egine is on and ip addy is the fm server machine?
August 30, 200619 yr Author that was a copy and paste error, i have spent a day at this and it wont work
August 31, 200619 yr Gaz, Can you post ALL your code for your request so we can give feedback. you could add the DEBUG to the top of your page to see more information (after your opening <?php tag) define("DEBUG",true); Your request should follow the lines of; include_once('FX/server_data.php'); include_once('FX/FX.php'); $query = new FX ($serverIP, $webCompanionPort); $query -> SetDBData($webDB,$layout); $query -> SetDBPassword($webPW,$webUN); // Additional information goes here depending on the type of request $query -> AddDBParam('fieldname','value'); $queryResult = $query -> FMNew(); if ($queryResult['errorCode'] !=0) { //ERROR MESSAGE GOES HERE } else { //Record created, continue with script }
August 31, 200619 yr Author the problem appears to be that everything is getting parsed as text and the code is being displayed in the browser everything from SetDBData onwards, I am running lots of other php scripts which are working fine like moodle phpbb etc, but i don't get this.
August 31, 200619 yr Are you saying you don't even get an errorCode? looking at your code, it appears fine unless there is something in your server_data.php or FX.php that is causing problems. From Andy's code it is better practice to have: $addstu->SetDBPassword($webPW,$webUN); where $webPW and $webUN are stored in server_data.php. Also check your FX.php code to make sure the scheme is set to FMPro7 (not FMPro5/6).
August 31, 200619 yr group size may not be an issue since you are just adding a student and not showing a list of students. Also no quotes required on groupsize - since it is a number.
August 31, 200619 yr Author it's set to FMPro 7 I jsyt don't get this it should be working. I have set up server_date.php ip addy is of filemaker server and the port is the port on the machien that the web publishing engine is on - that's correct isn't it.
August 31, 200619 yr I have been following your post on the fx list server as well. If you are getting blank pages - it is: a) fx is not configured properly : PHP is not configured properly on your webserver c) there is a coding error in you php code that doesn't produce an error. In FX.php make sure that 1) var $dataServerType = 'FMPro7'; //around line 56 2) var $DBUser = ''; var $DBPassword = 'Admin' ; // around line 109 (that is assuming this is your password In your server config file (apache?) make sure the Php is installed Probably most important: In your PHP code - you are trying to add a record - but you have no information to add. In other words this create new record be in the file you are posting to (thankyou.php) it should also include (around line 4): $studentnumber=$_REQUEST['stunum']; $firstname=$_REQUEST['firstname']; $surname=$_REQUEST['surnam']; Then in your FMNew(); $addstu=new FX($serverIP,$webCompanionPort,'FMPro7'); $addstu->SetDBData('Student','stureg',$groupSize); $addstu->SetDBPassword ($webPW,$webUN); $addstu->AddDBparam('stunum',$studentnumber); $addstu->AddDBparam('firstname',$firstname); $addstu->AddDBparam('surname',$surname); $addstuResult=$addstu->FMNew(); This will work if everything is turned on and you are listing the correct databases and layouts. Good luck
Create an account or sign in to comment