Gaz 007 Posted August 30, 2006 Posted August 30, 2006 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?
Gaz 007 Posted August 30, 2006 Author Posted August 30, 2006 that was a copy and paste error, i have spent a day at this and it wont work
andygaunt Posted August 31, 2006 Posted August 31, 2006 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 }
Gaz 007 Posted August 31, 2006 Author Posted August 31, 2006 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.
Gaz 007 Posted August 31, 2006 Author Posted August 31, 2006 (edited) stunum firstname surname Edited August 31, 2006 by Guest
mlindal Posted August 31, 2006 Posted August 31, 2006 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).
mlindal Posted August 31, 2006 Posted August 31, 2006 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.
Gaz 007 Posted August 31, 2006 Author Posted August 31, 2006 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.
mlindal Posted August 31, 2006 Posted August 31, 2006 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
Recommended Posts
This topic is 6728 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