php-general Digest 9 Jun 2008 09:09:20 -0000 Issue 5504

Topics (messages 275122 through 275130):

Bulk Email Problems
        275122 by: celtic.aolohr.com

Re: How to structure code for forms
        275123 by: Manuel Lemos
        275124 by: Roland Häder

Choosing PHP or ? for building an automatic photo web.
        275125 by: Peter Sorensen
        275126 by: Stut
        275127 by: Stut
        275128 by: Dan

NuSOAP assistance.
        275129 by: Dan Joseph
        275130 by: Thijs Lensselink

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

I coded a bulk emailer for our newsletter that worked fine for the last few 
years resulting in many requests for forgotten passwords and renewed site 
activity. 

Last year, we sent it again, after a few minor code changes, and had no 
response whatsoever. Unfortunately, I no longer have the backup copy of the 
original code. So, I assume that the code has an error that I can't see.

Perhaps someone might see an obvious error in the code (I'm just too close to 
it to see it objectively. The code page loads from a secured authorized 
connection, and iterates through a postgresql db table for names and email 
addresses. I've broken the email packets to 50, and verify that each has been 
sent. Any help greatly appreciated -- I'm afraid to check it live with actual 
names/email addresses, though it works fine for a few duds that I have salted 
in the sponsor table.


Code snippet:

<?php

if ($_POST['submit'] == "Next Batch?"){

        $run = $_SESSION['run'];

        /* DEBUG PRINT STATEMENTS */
                
                print "<h4>POST submit value is {$_POST['submit']}</h4><br<br>";
                print "<h4>RUN value is $run</h4><br<br>";
                print "<h4>RUN SESSION value is 
{$_SESSION['run']}</h4><br><br>";
        
        include("dbc.php");
                        
        switch ($run) :
                
                case "1" :
                /* sid to 100-149 */

                        $current = "(SID 100-149)";
                        $query = "SELECT sid,sfname,ssname,smail FROM sponsor 
WHERE sid > 99 AND        
sid < 150
                        AND sid != 100 AND sid != 105 AND sid != 107 AND sid != 
109 AND sid != 111 
AND sid != 113
                        AND sid != 114 AND sid != 119 AND sid != 130 AND sid != 
131 AND sid != 148 
AND sid != 165 AND sid != 166
                        ORDER BY sid ASC";
                        $run = 2;
                        $_SESSION['run'] = 2;
                        session_write_close();
                        break;


                case "2" :
                /* sid to 150-199 */

                        $current = "(SID 150-199)";
                        $query = "SELECT sid,sfname,ssname,smail FROM sponsor 
WHERE sid > 149 AND 
sid < 200
                        AND sid != 100 AND sid != 105 AND sid != 107 AND sid != 
109 AND sid != 111 
AND sid != 113
                        AND sid != 114 AND sid != 119 AND sid != 130 AND sid != 
131 AND sid != 148 
AND sid != 165 AND sid != 166
                        ORDER BY sid ASC";
                        $run = 3;
                        $_SESSION['run'] = 3;
                        session_write_close();
                        break;

                        . . . .

                case "11" :
                /* sid 500 + */

                        $current = "(SID 600+)";
                        $query = "SELECT sid,sfname,ssname,smail FROM sponsor 
WHERE sid > 599
                        ORDER BY sid ASC";
                        $run = 12;
                        $_SESSION['run'] = 12;
                        session_write_close();
                        break;


                case "12" :

                        $run = "'s complete!";
                        header("location: newsletter.php");
                        break;


                case "TEST RUN";
        
                        print "TEST RUN: NO further processing<br>Check 
incoming email!";
                        break;

        endswitch;


        /* Text and headers for email */

        $message = "Dear $fname,

                        ...... admin";


        $sender = "[EMAIL PROTECTED]";
        $subject = "Newsletter June 2008";
        
        $recipient_fullname = "$fname $sname";
        $recipient = "$recipient_fullname <$smail>";
        
        // call mail function
        
        $headers = "From: $sender";
        $response = mail($recipient, $subject, $message, $headers);

                if ($response[0] == 0) { 
                        print "<h4><br><br>Run #$run-$current Newsletter email 
processed for 
($sid) - $fname $sname<br>$smail<br><br></h4>";
                }
                else {
                        print "<h4><br><br>Run #$run-$current ERROR processing 
for ($sid) - $fname 
$sname<br>$smail<br><br></h4>";
                }

        }

}

?>

Tia,
Andre
(celtic)

--- End Message ---
--- Begin Message ---
Hello,

on 06/08/2008 08:01 AM Ethan Whitt said the following:
> I am new to PHP and have been researching ways to structure code for forms.
> I have found a
> few basic tutorials that present, validate & present errors, and then
> process form data.  I was
> wondering if anyone could share their approach on how they structure these
> actions?  Ideally,
> I would like to separate each action in separate functions.  Thanks in
> advance...

I recommend a couple of things as crucial points to do proper forms
processing without inconviniences:

1. Present and process the forms with the same script. If the user
submits the form with invalid fields, you just use the same code in the
script to present the form again marking invalid fields.

2. Never output anything before presenting, validating and processing
the forms. If you start outputting any page data or even issue response
headers, you may not change the course of your script action later in
case there were validation errors or unexpected form processing errors
(like for instance database access failures).

Personally I use this popular forms validation class.

http://www.phpclasses.org/formsgeneration

It separates the forms handling in several steps like you want:

1. Define the input field types, initial values and validation rules
2. Load and filter any form submitted field values
3. Validate the loaded field values
4. Retrieve filtered and validated field values for form processing by
the application
5. Output the form if it is being presented for the first time or if it
has validation errors. It can use either HTML mixed with PHP, or Smarty
templates, or automatic layout plug-ins also available for this forms class.

Here you may watch a tutorial video that explains this approach with a
step by step fluxogram that makes it very clear:

http://www.phpclasses.org/browse/video/1/package/1/section/usage.html

This class is very mature. It is being developed since 1999 and is very
popular. Actually you could call it a framework because it comes with
many plug-ins for implementing sophisticated features such as AJAX form
submission, paged layouts, interconnected inputs, form page animation, etc..

Here you may find some demonstrative examples that you may try live:

http://www.meta-language.net/forms-examples.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hi,

On Sunday, 8. June 2008, Manuel Lemos wrote:
> Hello,
>
> on 06/08/2008 08:01 AM Ethan Whitt said the following:
> > I am new to PHP and have been researching ways to structure code for
> > forms. I have found a
> > few basic tutorials that present, validate & present errors, and then
> > process form data.  I was
> > wondering if anyone could share their approach on how they structure
> > these actions?  Ideally,
> > I would like to separate each action in separate functions.  Thanks in
> > advance...
Maybe this gives you an idea:
http://www.ship-simu.org/repos/ship-simu/trunk/application/ship-simu/templates/de/code/register.ctp

Please keep in mind that my software is GNU GPL 3. :)

Roland

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---
--- Begin Message ---
Hi everyone

I want to make my own web with my familie photos.
At the same time I get a remote backup for our photos.
I am new to web prgramming including HTML, but as an electronic engineer I have some fundamental understanding of programming.
I use windows XP or Vista but that properly does not matter in web design?
I have invested in a web service on surftown (only starter) for 5 years.
So before I spend a lot time learning webprogramming, I would like some experience web programmers to tell me if my project is doable within a reasonable effort.

I want 2 thinks that are a little uncommon:
1. User login protected by password (don't won't free access to all my photos). I have found some PHP code that does this and seems readable to me, so I guess this is trivial and on to the main problem.

2. I want the web source to automatic create a new tab or link or ?, when ever I upload a new set of photo's via FTP. I want the photos arranged in subfolders when I upload (preferreable two levels of subfolders). If I upload more photos in an existing folder with photos, they must appear automatickly.

So the question is: is this doable for a newbie within a limited amount of hours?
Is PHP the choice?
Do I need to use mySQL for this?
What features must the webhotel suport and do you know if Surftown does?
Is there anywhere I get template source code for this, free or at a low price?

best regards
Peter Sørensen








--- End Message ---
--- Begin Message ---
On 8 Jun 2008, at 21:44, Peter Sorensen wrote:
I want to make my own web with my familie photos.
At the same time I get a remote backup for our photos.
I am new to web prgramming including HTML, but as an electronic engineer I have some fundamental understanding of programming. I use windows XP or Vista but that properly does not matter in web design? I have invested in a web service on surftown (only starter) for 5 years. So before I spend a lot time learning webprogramming, I would like some experience web programmers to tell me if my project is doable within a reasonable effort.

I want 2 thinks that are a little uncommon:
1. User login protected by password (don't won't free access to all my photos). I have found some PHP code that does this and seems readable to me, so I guess this is trivial and on to the main problem.

2. I want the web source to automatic create a new tab or link or ?, when ever I upload a new set of photo's via FTP. I want the photos arranged in subfolders when I upload (preferreable two levels of subfolders). If I upload more photos in an existing folder with photos, they must appear automatickly.

So the question is: is this doable for a newbie within a limited amount of hours?
Is PHP the choice?
Do I need to use mySQL for this?
What features must the webhotel suport and do you know if Surftown does? Is there anywhere I get template source code for this, free or at a low price?

This wheel has been invented a hundred times already.

I would suggest http://gallery.menalto.com/ which I think does everything you're after.

-Stut

--
http://stut.net/

--- End Message ---
--- Begin Message ---
Please copy replies to the list.

On 8 Jun 2008, at 22:47, Nordstjernealle 10 wrote:
Thanks Stut

I have looked at Gallery and I think your are right, just what I need.
Onfortunately I have found that Gallery musthave PHP safe mode off, which Surftown does not allow. Using Gallery means write of my Surftown account and get another web hotel.
Any other ideers?

Use a better web host. Any system that can do what you're after will want to do things like generate thumbnails and other different sizes. This can get difficult with safe mode enabled.

I try not to recommend web hosts because they all suck, but I do know a few people on this list provide hosting services and I'm sure they'll get in contact if they can help.

-Stut

--
http://stut.net/

----- Original Message ----- From: "Stut" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "Peter Sorensen" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2008 11:27 PM
Subject: Re: [PHP] Choosing PHP or ? for building an automatic photo web.


On 8 Jun 2008, at 21:44, Peter Sorensen wrote:
I want to make my own web with my familie photos.
At the same time I get a remote backup for our photos.
I am new to web prgramming including HTML, but as an electronic engineer I have some fundamental understanding of programming. I use windows XP or Vista but that properly does not matter in web design? I have invested in a web service on surftown (only starter) for 5 years. So before I spend a lot time learning webprogramming, I would like some experience web programmers to tell me if my project is doable within a reasonable effort.

I want 2 thinks that are a little uncommon:
1. User login protected by password (don't won't free access to all my photos). I have found some PHP code that does this and seems readable to me, so I guess this is trivial and on to the main problem.

2. I want the web source to automatic create a new tab or link or ?, when ever I upload a new set of photo's via FTP. I want the photos arranged in subfolders when I upload (preferreable two levels of subfolders). If I upload more photos in an existing folder with photos, they must appear automatickly.

So the question is: is this doable for a newbie within a limited amount of hours?
Is PHP the choice?
Do I need to use mySQL for this?
What features must the webhotel suport and do you know if Surftown does? Is there anywhere I get template source code for this, free or at a low price?

This wheel has been invented a hundred times already.

I would suggest http://gallery.menalto.com/ which I think does everything you're after.

-Stut

--
http://stut.net/



--- End Message ---
--- Begin Message --- To answer your question peter, yes. This is exactly the type of thing that PHP will work for.

Password protection is a very common feature, you can implement it either using PHP, or with htaccess, I recomend the ladder just because there's a standard simple way to do it (assuming your host lets you, most do).

You don't really have to create a new tab each time you upload a new set of photos, PHP will build the tabs on the fly as you access the page. You might benifit from reading a simple php intro, because it sounds like you want to create the html using php, rather than just go to mygallery.php or something, and have php build the thing on the fly.

- Dan
--- End Message ---
--- Begin Message ---
Hi Everyone,

This is kind of a follow up to my SOAP question on Friday.

I have decided that NuSOAP is my quickest solution.  I am having some issues
though.  Everything looks like I have it in place, but I must be doing
something wrong since the WSDL won't work right.

Wondering if someone could shed a light on this.

http://new.vehicletransportusa.com/v2/services/URSQuoteServices.php
http://new.vehicletransportusa.com/v2/services/URSQuoteServices.php?wsdl

Here is the code:

<?php

require_once( "lib/nusoap.php" );
$NAMESPACE = 'Quotes';

$server = new soap_server;
$server->configureWSDL('Quotes', $NAMESPACE);
$server->wsdl->schemaTargetNamespace = $NAMESPACE;
$server->wsdl->addComplexType(
    'VehiclesArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(

array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Vehicles[]')
    ),
    'tns:Vehicles'
);
$server->wsdl->addComplexType(
    'VehicleQuote',
    'complexType',
    'struct',
    'all',
    '',
    array('id'=> array( 'name'=>'id', 'type'=>'xsd:string' ),
           'key'=> array( 'name'=>'key', 'type'=>'xsd:string' ),
           'firstname'=> array( 'name'=>'firstname', 'type'=>'xsd:string' ),
           'companyname'=> array( 'name'=>'lastname', 'type'=>'xsd:string'
),
           'dealername'=> array( 'name'=>'companyname', 'type'=>'xsd:string'
),
           'contact_address1'=> array( 'name'=>'dealername',
'type'=>'xsd:string' ),
           'contact_address1'=> array( 'name'=>'contact_address1',
'type'=>'xsd:string' ),
           'contact_address2'=> array( 'name'=>'contact_address2',
'type'=>'xsd:string' ),
           'contact_city'=> array( 'name'=>'contact_city',
'type'=>'xsd:string' ),
           'contact_state'=> array( 'name'=>'contact_state',
'type'=>'xsd:string' ),
           'contact_zip'=> array( 'name'=>'contact_zip',
'type'=>'xsd:string' ),
           'emailaddress'=> array( 'name'=>'emailaddress',
'type'=>'xsd:string' ),
           'phone'=> array( 'name'=>'phone', 'type'=>'xsd:string' ),
           'cellphone'=> array( 'name'=>'cellphone', 'type'=>'xsd:string' ),
           'fax'=> array( 'name'=>'fax', 'type'=>'xsd:string' ),
           'contactpref'=> array( 'name'=>'contactpref',
'type'=>'xsd:string' ),
           'referral'=> array( 'name'=>'referral', 'type'=>'xsd:string' ),
           'origin_contactname'=> array( 'name'=>'origin_contactname',
'type'=>'xsd:string' ),
           'origin_contactphone1'=> array( 'name'=>'origin_contactphone1',
'type'=>'xsd:string' ),
           'origin_contactphone2'=> array( 'name'=>'origin_contactphone2',
'type'=>'xsd:string' ),
           'origin_address1'=> array( 'name'=>'origin_address1',
'type'=>'xsd:string' ),
           'origin_address2'=> array( 'name'=>'origin_address2',
'type'=>'xsd:string' ),
           'origin_city'=> array( 'name'=>'origin_city',
'type'=>'xsd:string' ),
           'origin_state'=> array( 'name'=>'origin_state',
'type'=>'xsd:string' ),
           'origin_zip'=> array( 'name'=>'origin_zip', 'type'=>'xsd:string'
),
           'dest_contactname'=> array( 'name'=>'dest_contactname',
'type'=>'xsd:string' ),
           'dest_contactphone1'=> array( 'name'=>'dest_contactphone1',
'type'=>'xsd:string' ),
           'dest_contactphone2'=> array( 'name'=>'dest_contactphone2',
'type'=>'xsd:string' ),
           'dest_address1'=> array( 'name'=>'dest_address1',
'type'=>'xsd:string' ),
           'dest_address2'=> array( 'name'=>'dest_address2',
'type'=>'xsd:string' ),
           'dest_city'=> array( 'name'=>'dest_city', 'type'=>'xsd:string' ),
           'dest_state'=> array( 'name'=>'dest_state', 'type'=>'xsd:string'
),
           'dest_zip'=> array( 'name'=>'dest_zip', 'type'=>'xsd:string' ),
           'vin'=> array( 'name'=>'vin', 'type'=>'xsd:string' ),
           'year'=> array( 'name'=>'year', 'type'=>'xsd:string' ),
           'make'=> array( 'name'=>'make', 'type'=>'xsd:string' ),
           'model'=> array( 'name'=>'model', 'type'=>'xsd:string' ),
           'color'=> array( 'name'=>'color', 'type'=>'xsd:string' ),
           'vehicletype'=> array( 'name'=>'vehicletype',
'type'=>'xsd:string' ),
           'inop'=> array( 'name'=>'inop', 'type'=>'xsd:string' ),
           'buyer_id'=> array( 'name'=>'buyer_id', 'type'=>'xsd:string' ),
           'item_id'=> array( 'name'=>'item_id', 'type'=>'xsd:string' ),
           'engine_size'=> array( 'name'=>'engine_size',
'type'=>'xsd:string' ),
           'modified'=> array( 'name'=>'modified', 'type'=>'xsd:string' ),
           'enclosed_carrier'=> array( 'name'=>'enclosed_carrier',
'type'=>'xsd:string' ),
           'pickupdate'=> array( 'name'=>'pickupdate', 'type'=>'xsd:string'
),
           'latestpickupdate'=> array( 'name'=>'latestpickupdate',
'type'=>'xsd:string' ),
           'quote_type'=> array( 'name'=>'quote_type', 'type'=>'xsd:string'
),
           'savequote'=> array( 'name'=>'savequote', 'type'=>'xsd:string' ),
    )
);

$server->register( 'getQuote',
                   array( 'id'=>'xsd:string' ),
                   array( 'key'=>'xsd:string' ),
                   array( 'firstname'=>'xsd:string' ),
                   array( 'lastname'=>'xsd:string' ),
                   array( 'companyname'=>'xsd:string' ),
                   array( 'dealername'=>'xsd:string' ),
                   array( 'contact_address1'=>'xsd:string' ),
                   array( 'contact_address2'=>'xsd:string' ),
                   array( 'contact_city'=>'xsd:string' ),
                   array( 'contact_state'=>'xsd:string' ),
                   array( 'contact_zip'=>'xsd:string' ),
                   array( 'emailaddress'=>'xsd:string' ),
                   array( 'phone'=>'xsd:string' ),
                   array( 'cellphone'=>'xsd:string' ),
                   array( 'fax'=>'xsd:string' ),
                   array( 'contactpref'=>'xsd:string' ),
                   array( 'referral'=>'xsd:string' ),
                   array( 'origin_contactname'=>'xsd:string' ),
                   array( 'origin_contactphone1'=>'xsd:string' ),
                   array( 'origin_contactphone2'=>'xsd:string' ),
                   array( 'origin_address1'=>'xsd:string' ),
                   array( 'origin_address2'=>'xsd:string' ),
                   array( 'origin_city'=>'xsd:string' ),
                   array( 'origin_state'=>'xsd:string' ),
                   array( 'origin_zip'=>'xsd:string' ),
                   array( 'dest_contactname'=>'xsd:string' ),
                   array( 'dest_contactphone1'=>'xsd:string' ),
                   array( 'dest_contactphone2'=>'xsd:string' ),
                   array( 'dest_address1'=>'xsd:string' ),
                   array( 'dest_address2'=>'xsd:string' ),
                   array( 'dest_city'=>'xsd:string' ),
                   array( 'dest_state'=>'xsd:string' ),
                   array( 'dest_zip'=>'xsd:string' ),
                   array( 'vin'=>'xsd:string' ),
                   array( 'year'=>'xsd:string' ),
                   array( 'make'=>'xsd:string' ),
                   array( 'model'=>'xsd:string' ),
                   array( 'color'=>'xsd:string' ),
                   array( 'vehicletype'=>'xsd:string' ),
                   array( 'inop'=>'xsd:string' ),
                   array( 'buyer_id'=>'xsd:string' ),
                   array( 'item_id'=>'xsd:string' ),
                   array( 'engine_size'=>'xsd:string' ),
                   array( 'modified'=>'xsd:string' ),
                   array( 'enclosed_carrier'=>'xsd:string' ),
                   array( 'pickupdate'=>'xsd:string' ),
                   array( 'latestpickupdate'=>'xsd:string' ),
                   array( 'quote_type'=>'xsd:string' ),
                   array( 'savequote'=>'xsd:string' ),
                   array( 'return'=>'tns:VehiclesArray' ),
                   $NAMESPACE                             );
function getQuote( $quoterequest )
{
    $vehicle = array();

    // Create book (hardcoded author)
    $vehicle[] = array( 'author' => "Jack London",
                        'title' => "blah",
                        'numpages' => "pages",
                        'toc' => "toc" );
    return $vehicle;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

--- End Message ---
--- Begin Message ---
Quoting Dan Joseph <[EMAIL PROTECTED]>:

Hi Everyone,

This is kind of a follow up to my SOAP question on Friday.

I have decided that NuSOAP is my quickest solution.  I am having some issues
though.  Everything looks like I have it in place, but I must be doing
something wrong since the WSDL won't work right.

Wondering if someone could shed a light on this.

http://new.vehicletransportusa.com/v2/services/URSQuoteServices.php
http://new.vehicletransportusa.com/v2/services/URSQuoteServices.php?wsdl

Here is the code:

<?php

require_once( "lib/nusoap.php" );
$NAMESPACE = 'Quotes';

$server = new soap_server;
$server->configureWSDL('Quotes', $NAMESPACE);
$server->wsdl->schemaTargetNamespace = $NAMESPACE;
$server->wsdl->addComplexType(
    'VehiclesArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(

array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Vehicles[]')
    ),
    'tns:Vehicles'
);
$server->wsdl->addComplexType(
    'VehicleQuote',
    'complexType',
    'struct',
    'all',
    '',
    array('id'=> array( 'name'=>'id', 'type'=>'xsd:string' ),
           'key'=> array( 'name'=>'key', 'type'=>'xsd:string' ),
           'firstname'=> array( 'name'=>'firstname', 'type'=>'xsd:string' ),
           'companyname'=> array( 'name'=>'lastname', 'type'=>'xsd:string'
),
           'dealername'=> array( 'name'=>'companyname', 'type'=>'xsd:string'
),
           'contact_address1'=> array( 'name'=>'dealername',
'type'=>'xsd:string' ),
           'contact_address1'=> array( 'name'=>'contact_address1',
'type'=>'xsd:string' ),
           'contact_address2'=> array( 'name'=>'contact_address2',
'type'=>'xsd:string' ),
           'contact_city'=> array( 'name'=>'contact_city',
'type'=>'xsd:string' ),
           'contact_state'=> array( 'name'=>'contact_state',
'type'=>'xsd:string' ),
           'contact_zip'=> array( 'name'=>'contact_zip',
'type'=>'xsd:string' ),
           'emailaddress'=> array( 'name'=>'emailaddress',
'type'=>'xsd:string' ),
           'phone'=> array( 'name'=>'phone', 'type'=>'xsd:string' ),
           'cellphone'=> array( 'name'=>'cellphone', 'type'=>'xsd:string' ),
           'fax'=> array( 'name'=>'fax', 'type'=>'xsd:string' ),
           'contactpref'=> array( 'name'=>'contactpref',
'type'=>'xsd:string' ),
           'referral'=> array( 'name'=>'referral', 'type'=>'xsd:string' ),
           'origin_contactname'=> array( 'name'=>'origin_contactname',
'type'=>'xsd:string' ),
           'origin_contactphone1'=> array( 'name'=>'origin_contactphone1',
'type'=>'xsd:string' ),
           'origin_contactphone2'=> array( 'name'=>'origin_contactphone2',
'type'=>'xsd:string' ),
           'origin_address1'=> array( 'name'=>'origin_address1',
'type'=>'xsd:string' ),
           'origin_address2'=> array( 'name'=>'origin_address2',
'type'=>'xsd:string' ),
           'origin_city'=> array( 'name'=>'origin_city',
'type'=>'xsd:string' ),
           'origin_state'=> array( 'name'=>'origin_state',
'type'=>'xsd:string' ),
           'origin_zip'=> array( 'name'=>'origin_zip', 'type'=>'xsd:string'
),
           'dest_contactname'=> array( 'name'=>'dest_contactname',
'type'=>'xsd:string' ),
           'dest_contactphone1'=> array( 'name'=>'dest_contactphone1',
'type'=>'xsd:string' ),
           'dest_contactphone2'=> array( 'name'=>'dest_contactphone2',
'type'=>'xsd:string' ),
           'dest_address1'=> array( 'name'=>'dest_address1',
'type'=>'xsd:string' ),
           'dest_address2'=> array( 'name'=>'dest_address2',
'type'=>'xsd:string' ),
           'dest_city'=> array( 'name'=>'dest_city', 'type'=>'xsd:string' ),
           'dest_state'=> array( 'name'=>'dest_state', 'type'=>'xsd:string'
),
           'dest_zip'=> array( 'name'=>'dest_zip', 'type'=>'xsd:string' ),
           'vin'=> array( 'name'=>'vin', 'type'=>'xsd:string' ),
           'year'=> array( 'name'=>'year', 'type'=>'xsd:string' ),
           'make'=> array( 'name'=>'make', 'type'=>'xsd:string' ),
           'model'=> array( 'name'=>'model', 'type'=>'xsd:string' ),
           'color'=> array( 'name'=>'color', 'type'=>'xsd:string' ),
           'vehicletype'=> array( 'name'=>'vehicletype',
'type'=>'xsd:string' ),
           'inop'=> array( 'name'=>'inop', 'type'=>'xsd:string' ),
           'buyer_id'=> array( 'name'=>'buyer_id', 'type'=>'xsd:string' ),
           'item_id'=> array( 'name'=>'item_id', 'type'=>'xsd:string' ),
           'engine_size'=> array( 'name'=>'engine_size',
'type'=>'xsd:string' ),
           'modified'=> array( 'name'=>'modified', 'type'=>'xsd:string' ),
           'enclosed_carrier'=> array( 'name'=>'enclosed_carrier',
'type'=>'xsd:string' ),
           'pickupdate'=> array( 'name'=>'pickupdate', 'type'=>'xsd:string'
),
           'latestpickupdate'=> array( 'name'=>'latestpickupdate',
'type'=>'xsd:string' ),
           'quote_type'=> array( 'name'=>'quote_type', 'type'=>'xsd:string'
),
           'savequote'=> array( 'name'=>'savequote', 'type'=>'xsd:string' ),
    )
);

$server->register( 'getQuote',
                   array( 'id'=>'xsd:string' ),
                   array( 'key'=>'xsd:string' ),
                   array( 'firstname'=>'xsd:string' ),
                   array( 'lastname'=>'xsd:string' ),
                   array( 'companyname'=>'xsd:string' ),
                   array( 'dealername'=>'xsd:string' ),
                   array( 'contact_address1'=>'xsd:string' ),
                   array( 'contact_address2'=>'xsd:string' ),
                   array( 'contact_city'=>'xsd:string' ),
                   array( 'contact_state'=>'xsd:string' ),
                   array( 'contact_zip'=>'xsd:string' ),
                   array( 'emailaddress'=>'xsd:string' ),
                   array( 'phone'=>'xsd:string' ),
                   array( 'cellphone'=>'xsd:string' ),
                   array( 'fax'=>'xsd:string' ),
                   array( 'contactpref'=>'xsd:string' ),
                   array( 'referral'=>'xsd:string' ),
                   array( 'origin_contactname'=>'xsd:string' ),
                   array( 'origin_contactphone1'=>'xsd:string' ),
                   array( 'origin_contactphone2'=>'xsd:string' ),
                   array( 'origin_address1'=>'xsd:string' ),
                   array( 'origin_address2'=>'xsd:string' ),
                   array( 'origin_city'=>'xsd:string' ),
                   array( 'origin_state'=>'xsd:string' ),
                   array( 'origin_zip'=>'xsd:string' ),
                   array( 'dest_contactname'=>'xsd:string' ),
                   array( 'dest_contactphone1'=>'xsd:string' ),
                   array( 'dest_contactphone2'=>'xsd:string' ),
                   array( 'dest_address1'=>'xsd:string' ),
                   array( 'dest_address2'=>'xsd:string' ),
                   array( 'dest_city'=>'xsd:string' ),
                   array( 'dest_state'=>'xsd:string' ),
                   array( 'dest_zip'=>'xsd:string' ),
                   array( 'vin'=>'xsd:string' ),
                   array( 'year'=>'xsd:string' ),
                   array( 'make'=>'xsd:string' ),
                   array( 'model'=>'xsd:string' ),
                   array( 'color'=>'xsd:string' ),
                   array( 'vehicletype'=>'xsd:string' ),
                   array( 'inop'=>'xsd:string' ),
                   array( 'buyer_id'=>'xsd:string' ),
                   array( 'item_id'=>'xsd:string' ),
                   array( 'engine_size'=>'xsd:string' ),
                   array( 'modified'=>'xsd:string' ),
                   array( 'enclosed_carrier'=>'xsd:string' ),
                   array( 'pickupdate'=>'xsd:string' ),
                   array( 'latestpickupdate'=>'xsd:string' ),
                   array( 'quote_type'=>'xsd:string' ),
                   array( 'savequote'=>'xsd:string' ),
                   array( 'return'=>'tns:VehiclesArray' ),
                   $NAMESPACE                             );
function getQuote( $quoterequest )
{
    $vehicle = array();

    // Create book (hardcoded author)
    $vehicle[] = array( 'author' => "Jack London",
                        'title' => "blah",
                        'numpages' => "pages",
                        'toc' => "toc" );
    return $vehicle;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>

--
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."


The WSDL throws an error when the page is loaded. I don't think the SOAP client can parse the WSDL like this. Open the direct link to your WSDL and check the error. "htmlspecialchars() expects parameter 1 to be string, array given".
--- End Message ---

Reply via email to