April 19, 200520 yr Newbies Does anyone have an example of login into filemaker Server advanced 7 with a php session or cookie that records the username and password typed into a form and so that it passes to each pages. using fx.php
April 20, 200520 yr Author Newbies Here is what I have so Far. It is not working right. I have not found an example for what I am trying to accomplish. Hoping someone can look at this code and tell me what I am doing wrong. Login.php <?php include_once('FX/FX.php'); include_once('FX/FMErrors.php'); include_once('FX/server_data.php'); ?> <html> <head> </head> <body> <br><form method='post' action='authentication.php'> User Name<input type='text' name='uname' value=''><br> Password<input type='text' name='pname' value=''><br> <input type='submit' name='submit' value='Submit'> </form> </body> </html> authentication.php <?php $uname=$_REQUEST['uname']; $pname=$_REQUEST['pname']; session_start(); $_SESSION[uname] = $uname; $_SESSION[pname] = $pname; echo "you have logged in successfully"; ?> <br> <a href="findeng.php">Click Here to proceed</a> find.php <?php include_once('FX/FX.php'); include_once('FX/FMErrors.php'); include_once('FX/server_data.php'); session_start(); $groupSize='50'; $results=new FX($serverIP,$webCompanionPort,'FMPro7'); $results->SetDBData('bidsengr.fp7','Table View',$groupSize); $results->SetDBPassword($_SESSION[uname],$_SESSION[pname]); $resultsResult=$results->FMView(); foreach($resultsResult['data'] as $key=>$resultsData); ?>
April 20, 200520 yr Your "login.php" does not need the php code. However the "authentication.php" page needs this code: <?php include_once('FX/FX.php'); include_once('FX/FMErrors.php'); include_once('FX/server_data.php'); ?> Good Luck. Garry
April 20, 200520 yr Author Newbies Thanks guys for all the help. The code above actually does work. I had some priveledge set issues in filemaker. Does anyone know how to encrypt the password so it doesn't show up in plain text. I will probably figure it out but if anyone could point me in the right direction I would appreciate it. Thanks again.
April 21, 200520 yr Password field On your form use field type 'password' and you should be good to go. Also use 'Post' rather than 'Get' when sending your form.
Create an account or sign in to comment