[FX.php List] Newbie: Making a form
Andy Gaunt
andy at fmpug.com
Sat Jul 29 17:24:38 MDT 2006
Ed,
Add an
echo $ResultAll('errorCode'];
After your FMNew line.
This will at least show you if there is an error being generated when the
data is passed to the form.
Also, on your processing page you may want to use $_POST instead of
$_REQUEST.
$_REQUEST opens you up to people injecting content into the database
without using your actual form by passing the values through the URL.
Andy Gaunt
Office: 321.206.3658
Mobile: 407.810.4722
andy at fmpug.com
http://www.fmpug.com
Recipient of FileMaker's 2005 "Mad Dog" Public Relations Award
For chapter locations, dates & times please visit the website at
http://www.fmpug.com If you can make it to a meeting, please RSVP at
http://www.fmpug.com/rsvp.php
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Edward L. Ford
Sent: Saturday, July 29, 2006 7:18 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Newbie: Making a form
Actually, that much is correct. The SetDBPassword function has its
parameters as PW, UN, but SetDBUserPass is actually UN, PW. I'm using
that exact line in my other php pages to get the data without a problem.
Any other suggestions?
--Ed Ford
Jonathan Schwartz wrote:
> Edward,
>
> One thing I noticed...
>
> Swap the order for the User Name and Password. It's reversed. The
> proper format is:
> $Search->SetDBUserPass ($webPW, $webUN);
>
> HTH,
>
>
> Jonathan
>
> At 1:20 PM -0400 7/29/06, Edward L. Ford wrote:
>> OK, I used the following code, which does not appear to work:
>>
>> In make-entry.php:
>> <form name="form1" method="post" action="list.php">
>> <input type="hidden" name="ButtonPressed" value="New
>> Continue">
>> <p>First Name
>> <input type="text" name="FirstName">
>> </p>
>> <p>
>> <label>Last Name
>> <input type="text" name="LastName">
>> </label>
>> </p>
>> <p>
>> <label>Submit
>> <input type="submit" name="Submit" value="Continue">
>> </label>
>> </p>
>> </form>
>>
>> and in list.php, I have:
>> <?php
>> if($_REQUEST['ButtonPressed']=='New Continue'){
>> include_once($_SERVER['DOCUMENT_ROOT'] .
>> "bumo/cfa-mel/FX.php");
>> include_once($_SERVER['DOCUMENT_ROOT'] .
>> "bumo/cfa-mel/server_data.php"); $Search = new
>> FX($serverIP, $webCompanionPort, $dataSourceType);
>> $Search->SetDBData($databaseFile, "Musicians_Web");
>> $Search->SetDBUserPass ($webUN, $webPW);
>>
>> $Search->AddDBParam('FirstName',
>> stripslashes($_REQUEST['FirstName']));
>> $Search->AddDBParam('LastName', stripslashes($_REQUEST['LastName']));
>> $ResultAll = $Search -> FMNew();
>> }
>> ?>
>>
>> Can anyone suggest what I'm doing wrong? I have nothing else in
>> list.php at the moment -- I just want the new record created before I
>> start doing other manipulations on the data.
>> --Ed Ford
>>
>> AC wrote:
>>> I'm no expert but this works for me;
>>>
>>> new.php
>>> <FORM id="FormNew" ACTION="list.php" METHOD=POST>
>>> <input type="hidden" name="ButtonPressed" value="New Continue">
>>> <INPUT TYPE=text NAME="Subject" VALUE="" SIZE=108>
>>> <INPUT TYPE=submit NAME="Submit" VALUE="Continue">
>>> </FORM>
>>>
>>>
>>> list.php
>>> if($_REQUEST['ButtonPressed']=='New Continue'){
>>> $Search = new FX($ServerIP,$WebPort);
>>> $Search->SetDBPassword($ThePwd,$TheLogin);
>>> $Search->SetDBData(<<DBName>>,<<LayoutName>>);
>>> $Search->AddDBParam('Subject', stripslashes($_REQUEST['Subject']));
>>> $ResultAll = $Search -> FMNew();
>>> }
>>>
>>
>>>
>>>
>>> On Jul 28, 2006, at 3:47 PM, Edward L. Ford wrote:
>>>
>>>> Greetings,
>>>>
>>>> I'm just getting started with using FX.php. I've got the basics of
>>>> displaying records down, but I'm trying to figure out how to get
>>>> data from a user into the database. How do I make an HTML form
>>>> interact with PHP? For instance, if I have a form that has a field
>>>> for Last Name, how do I get the data from that field into a PHP
>>>> variable? When I get it into a variable, I'm sure I can handle the
>>>> rest.
>>>>
>>>> An additional consideration in my situation is, can I have the form
>>>> on a strictly HTML page, and then have the PHP parsing take place
>>>> on another page /after/ the user clicks a submit button? This would
>>>> be a great help because of certain specific circumstances of how I
>>>> need to use this.
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Thanks,
>>>> --Ed Ford
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list