Re: [PHP-DB] saving details problem (big)

2002-04-05 Thread Bob

?php
session_register( pcdata );

//Figure out what they want to do
if( !$command ) main();
if( $command == postcodeLookup ) postcodeLookup();
exit;

function main()
{
global $pcdata, $othervar1, $othervar2;

echo( form name=postCode
action=\$PHP_SELF?command=postcodeLookup\\n );
echo( input type=text name=firstName
value=\$pcdata[firstName]\\n );
echo( input type=text name=lastName
value=\$pcdata[lastName]\brbr\n );
echo( input type=text name=phone value=\$pcdata[phone]\br\n );
echo( input type=text name=emailAddress
value=\$pcdata[emailAddress]\br\n );
echo( input type=submit value=\Submit\\n );
}

function postcodeLookup()
{
global $pcdata, $youknowit, $maybe;

$result = $database-query( INSERT INTO victims( idNumber, firstName,
lastName, phone, emailAddress, whateverElse ) VALUES( '',
\$pcdata[firstName]\, \$pcdata[lastName]\, \$pcdata[phone]\,
\$pcdata[emailAddress]\, \$pcdata[whateverElse]\ ) );
if( !$result ) echo( Whoa.. Something's not working right here.. );

//put code here to go do the postcode lookup

showResults();
}

?

Just an idea.. Hope it will help or jog something..

Bob Weaver

 I am making use of AFD postcode lookup application.
 What it dose is ask for your postcode and returns your address.
 You may have seen this around the web..
 Well my problem is that I have added 3 extra fields
 Name, email, phone number
 And I need to save this info.
 I have tried sessions and cookies but have just noticed

 That the form action is a cgi file on the afd server. Thus this is
 stopping me Saving info.
 Any ideas on how I can save the info.
 I am in a back to the wall situation so any pointer and guidance is

 Most appreciated.

 P.S Had it work all fine and dandy when I added the extra info after
 postcode lookup but customer insisted he wants it this way round.
 Customers...
 (cant live with them, cant live without them...)
 Dave Carrera

 Php Developer

 http://davecarrera.freelancers.net

 http://www.davecarrera.com



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] saving details problem (big)

2002-04-04 Thread Beau Lebens

Dave,
would it be possible (not ideal, but might work) to do something like this;

 - user fills out form
 - user clicks submit
 - submit fires off 2 events, one submits to AFD server, the other opens a
new window, behind the current, submits certain values (the 3 new ones) and
saves them into the database. this window then automatically closes iteself
once finished
 - whatever happens at AFD then comes back to your next page where you pull
out the last values again and continue working with them

is that feasible for you?

HTH

Beau

// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 5 April 2002 3:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] saving details problem (big)
// 
// 
// Hi all
// 
// I am making use of AFD postcode lookup application.
// 
//  
// 
// What it dose is ask for your postcode and returns your address.
// 
// You may have seen this around the web..
// 
//  
// 
// Well my problem is that I have added 3 extra fields 
// 
//  
// 
// Name, email, phone number
// 
//  
// 
// And I need to save this info.
// 
//  
// 
// I have tried sessions and cookies but have just noticed
// 
// That the form action is a cgi file on the afd server. Thus this is
// stopping me
// 
// Saving info.
// 
//  
// 
// Any ideas on how I can save the info.
// 
//  
// 
// I am in a back to the wall situation so any pointer and guidance is
// 
// Most appreciated.
// 
//  
// 
// P.S Had it work all fine and dandy when I added the extra info after
// postcode lookup but customer insisted he wants it this way round.
// Customers...
// 
// (cant live with them, cant live without them...)
// 
//  
// 
// Dave Carrera
// 
// Php Developer
// 
// http://davecarrera.freelancers.net
// 
// http://www.davecarrera.com
// 
//  
// 
//  
// 
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php