[FX.php List] Newbie: Making a form

Edward L. Ford elford at cs.bu.edu
Sat Jul 29 11:20:29 MDT 2006


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


More information about the FX.php_List mailing list