php-general Digest 13 Jan 2006 02:25:04 -0000 Issue 3902

Topics (messages 228524 through 228550):

Informix webdtablade and php functions
        228524 by: HENCHOZ Daniel
        228525 by: Jochem Maas
        228535 by: HENCHOZ Daniel

Re: private, public, protected in 4.3.11
        228526 by: Zareef Ahmed

preg_replace - I don't have a clue
        228527 by: Frank Bax

input validation?
        228528 by: William Stokes
        228529 by: Jay Blanchard
        228530 by: Silvio Porcellana
        228531 by: Larry E. Ullman
        228533 by: Austin Denyer
        228536 by: tg-php.gryffyndevelopment.com
        228538 by: Stut
        228539 by: Stut
        228540 by: John Meyer

Low-Cost TPMS And A Exciting Giant Market
        228532 by: new_car_part

Re: text size
        228534 by: tedd

Re: Sending mail with php-
        228537 by: Dotan Cohen

Suggestions for the PHP team?
        228541 by: tatsudoshi
        228542 by: Jay Blanchard

Help for ISPs rolling out PHP
        228543 by: Ben Rockwood
        228544 by: Timothy Brier

question about compositing objects
        228545 by: jonathan
        228546 by: Tim Boring
        228547 by: Mark
        228549 by: comex
        228550 by: Aaron Koning

XML-Request
        228548 by: Ron Eggler (Paykiosks)

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:
        php-general@lists.php.net


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

I've installed a SUN server under Solaris 9 with Apache 2.0.55, PHP 5.1.1, Informix 9.40.UC6, Informix Client SDK 2.90.UC3, Informix Webdatablade 4.13.UC3. Now I try to get information from the Informix database via a PHP ifx_connect function and on the same apache server using the Informix webdatablade tool (old pages not yet migrated ...).

The php and informix modules are loaded in the apache httpd.conf :

#IBM Informix Web DataBlade DSO Module Added
LoadModule informix_module /d3/apache2/wwwdbdev/ifmx-bin/drvapch2.so

# Load the necessary PHP modules
LoadModule php5_module        modules/libphp5.so

I'm not able to have php and webdatablade connections to informix work together ...


Case 1:
-------

If I load the informix module first in the httpd.conf file the php ifx functions doesn't work and I get the following incomplete error message :

*Warning*: ifx_connect() [function.ifx-connect <https://furio.unil.ch/php-dhz/function.ifx-connect>]: E [SQLSTATE= in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *3*

*Warning*: ifx_query(): supplied argument is not a valid Informix link resource in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *4*

*Warning*: printf() [function.printf <https://furio.unil.ch/php-dhz/function.printf>]: Too few arguments in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *7*

The php script is below :

<?php

$ConnId = ifx_connect ("[EMAIL PROTECTED]","xxxxxx","xxxxxx");
$ResId = ifx_query ("SELECT * FROM dhtable", $ConnId);

if (! $ResId) {
   printf("Can't select names : %s\n<br />%s<br />\n", ifx_error());
   ifx_errormsg();
   die;
}
ifx_htmltbl_result($ResId, "border=\"1\"");
ifx_free_result($ResId);

ifx_close($ConnId);
?>

On the other hand the webdatablade connection works normally ...


Case 2:
-------

If I load the php module before the informix module in the httpd.conf file, the php ifx_connect function works correctly, but now the wedatablade connection fails (never answer) ....



I need the two ways to connect to the database, since we actually still use both .... I've asked IBM for a solution, but they propose me to submit this problem to PHP people since IBM didn't develop the ifx functions to connect to the informix database via PHP.


Any help would be appreciated !

Best regards

Daniel

--

###########################################################################
Daniel HENCHOZ             ///  WEB       : http://www.danielhenchoz.ch
Computer center           ///   EMAIL     : [EMAIL PROTECTED]
University of Lausanne   ///    MOBILE/SMS: ++41 79 206.51.81
Amphimax                ///     FAX       : ++41 21 692.22.49
1015 LAUSANNE          ///      PHONE     : ++41 21 692.22.20
SWITZERLAND           ///
###########################################################################



--- End Message ---
--- Begin Message ---
is it possible that you are only allowing a single connection (or a number of
them) and that when apache comes up it's child processes eat up all the
[persistent?] connections so that there are none left for any other process?

HENCHOZ Daniel wrote:
Hello,

I've installed a SUN server under Solaris 9 with Apache 2.0.55, PHP 5.1.1, Informix 9.40.UC6, Informix Client SDK 2.90.UC3, Informix Webdatablade 4.13.UC3. Now I try to get information from the Informix database via a PHP ifx_connect function and on the same apache server using the Informix webdatablade tool (old pages not yet migrated ...).

The php and informix modules are loaded in the apache httpd.conf :

#IBM Informix Web DataBlade DSO Module Added
LoadModule informix_module /d3/apache2/wwwdbdev/ifmx-bin/drvapch2.so

# Load the necessary PHP modules
LoadModule php5_module        modules/libphp5.so

I'm not able to have php and webdatablade connections to informix work together ...


Case 1:
-------

If I load the informix module first in the httpd.conf file the php ifx functions doesn't work and I get the following incomplete error message :

*Warning*: ifx_connect() [function.ifx-connect <https://furio.unil.ch/php-dhz/function.ifx-connect>]: E [SQLSTATE= in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *3*

*Warning*: ifx_query(): supplied argument is not a valid Informix link resource in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *4*

*Warning*: printf() [function.printf <https://furio.unil.ch/php-dhz/function.printf>]: Too few arguments in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *7*

The php script is below :

<?php

$ConnId = ifx_connect ("[EMAIL PROTECTED]","xxxxxx","xxxxxx");
$ResId = ifx_query ("SELECT * FROM dhtable", $ConnId);

if (! $ResId) {
   printf("Can't select names : %s\n<br />%s<br />\n", ifx_error());
   ifx_errormsg();
   die;
}
ifx_htmltbl_result($ResId, "border=\"1\"");
ifx_free_result($ResId);

ifx_close($ConnId);
?>

On the other hand the webdatablade connection works normally ...


Case 2:
-------

If I load the php module before the informix module in the httpd.conf file, the php ifx_connect function works correctly, but now the wedatablade connection fails (never answer) ....



I need the two ways to connect to the database, since we actually still use both .... I've asked IBM for a solution, but they propose me to submit this problem to PHP people since IBM didn't develop the ifx functions to connect to the informix database via PHP.


Any help would be appreciated !

Best regards

Daniel


--- End Message ---
--- Begin Message --- No, actually there is no limitation for the number of connection to the database ...

Thanks

Daniel

Jochem Maas wrote:

is it possible that you are only allowing a single connection (or a number of
them) and that when apache comes up it's child processes eat up all the
[persistent?] connections so that there are none left for any other process?

HENCHOZ Daniel wrote:

Hello,

I've installed a SUN server under Solaris 9 with Apache 2.0.55, PHP 5.1.1, Informix 9.40.UC6, Informix Client SDK 2.90.UC3, Informix Webdatablade 4.13.UC3. Now I try to get information from the Informix database via a PHP ifx_connect function and on the same apache server using the Informix webdatablade tool (old pages not yet migrated ...).

The php and informix modules are loaded in the apache httpd.conf :

#IBM Informix Web DataBlade DSO Module Added
LoadModule informix_module /d3/apache2/wwwdbdev/ifmx-bin/drvapch2.so

# Load the necessary PHP modules
LoadModule php5_module        modules/libphp5.so

I'm not able to have php and webdatablade connections to informix work together ...


Case 1:
-------

If I load the informix module first in the httpd.conf file the php ifx functions doesn't work and I get the following incomplete error message :

*Warning*: ifx_connect() [function.ifx-connect <https://furio.unil.ch/php-dhz/function.ifx-connect>]: E [SQLSTATE= in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *3*

*Warning*: ifx_query(): supplied argument is not a valid Informix link resource in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *4*

*Warning*: printf() [function.printf <https://furio.unil.ch/php-dhz/function.printf>]: Too few arguments in */d3/apache2/wwwdbdev/php-dhz/testifmx.php* on line *7*

The php script is below :

<?php

$ConnId = ifx_connect ("[EMAIL PROTECTED]","xxxxxx","xxxxxx");
$ResId = ifx_query ("SELECT * FROM dhtable", $ConnId);

if (! $ResId) {
   printf("Can't select names : %s\n<br />%s<br />\n", ifx_error());
   ifx_errormsg();
   die;
}
ifx_htmltbl_result($ResId, "border=\"1\"");
ifx_free_result($ResId);

ifx_close($ConnId);
?>

On the other hand the webdatablade connection works normally ...


Case 2:
-------

If I load the php module before the informix module in the httpd.conf file, the php ifx_connect function works correctly, but now the wedatablade connection fails (never answer) ....



I need the two ways to connect to the database, since we actually still use both .... I've asked IBM for a solution, but they propose me to submit this problem to PHP people since IBM didn't develop the ifx functions to connect to the informix database via PHP.


Any help would be appreciated !

Best regards

Daniel





--

###########################################################################
Daniel HENCHOZ             ///  WEB       : http://www.danielhenchoz.ch
Computer center           ///   EMAIL     : [EMAIL PROTECTED]
University of Lausanne   ///    MOBILE/SMS: ++41 79 206.51.81
Amphimax                ///     FAX       : ++41 21 692.22.49
1015 LAUSANNE          ///      PHONE     : ++41 21 692.22.20
SWITZERLAND           ///
###########################################################################

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

       Code you are using is for php version 5. That is one in only reason.
You need to install PHP version 5 to run this code or just do it as simple
$var type declaration.

Zareef Ahmed

----- Original Message ----- 
From: "Peter Lauri" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Thursday, January 12, 2006 1:28 AM
Subject: [PHP] private, public, protected in 4.3.11


> Hi,
>
>
>
> Example code that I try to run in version 4.3.11:
>
>
>
> Class Page {
>
>             private $myID;
>
>
>
>             function Page() {
>
>                         $this->myID=1;
>
> }
>
>
>
>             function getID() {
>
>                         return $this->myID;
>
>             }
>
>
>
> }
>
>
>
> But I get error message:
>
>
>
> Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or
> `T_VAR' or `'}'' in C:\Documents and Settings\Peter Lauri\My Documents\DWS
> Asia\webserver\ework\classes\page.class.php on line 8
>
>
>
> If I change to
>
>             var $myID;
>
> it works.
>
>
>
> What is wrong?
>
>
>
> /Peter
>
>
>
>
>



====================================================
PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>
>
>

--- End Message ---
--- Begin Message --- As I understand the docs for preg_replace(), I can enclose an PCRE expression in parenthesis and use a backreference in the replace string; but it's not working!

Data coming from another system contains a lot of data in one text record which I must parse. Individual elements in the record are separated by $. I want to "fix" elements that contain
        dollar-alpha-space-space-digits-dollar
and replace the second space (between word and number) with a plus character to end up with
        dollar-alpha-space-plus-digits-dollar

An example of input string:
$prop = '$Fencing 11$Lumber 17$Weight: 317 Stones$Energy Resist 2%$';
Notice that Fencing and Lumber have two spaces.  I want to end up with:
$prop = '$Fencing +11$Lumber +17$Weight: 317 Stones$Energy Resist 2%$';
Notice that original and final strings are the same length.

reg_replace( ' (\d+\$)', '+$1', $prop ); /* results in dollar-alpha-space-space-plus, why have digits-dollar have disappeared? */
$Fencing  +Lumber  +Weight: 317 Stones$Energy Resist 2%$


Although the docs say that $0 should backreference the whole pattern, instead it seems to match the pattern in parenthesis, but this code : reg_replace( ' (\d+\$)', '+$0', $prop ); /* results in dollar-alpha-space-space-plus-digits-dollar */
$Fencing  +11$Lumber  +17$Weight: 317 Stones$Energy Resist 2%$

Still contains the two blanks!!

In neither of my test cases is the result string the same length as original.

I'm running PHP 4.4.0 on OpenBSD 3.7
--- End Message ---
--- Begin Message ---
Hello,

I need to check that user input text is less than 300 characters long. How?

Thanks
-Will 

--- End Message ---
--- Begin Message ---
[snip]
I need to check that user input text is less than 300 characters long. How?
[/snip]

string length, it's in the manual.

--- End Message ---
--- Begin Message ---
William Stokes wrote:
> Hello,
> 
> I need to check that user input text is less than 300 characters long. How?
> 
> Thanks
> -Will 
> 

Try with strlen:
http://php.net/strlen

Silvio

--- End Message ---
--- Begin Message ---
I need to check that user input text is less than 300 characters long. How?

if (strlen($_POST['input']) < 300) { ...

You may want to also apply trim() to the input text to get rid of extraneous white space at the beginning and end of the input.

Larry

--- End Message ---
--- Begin Message ---
On Thu, 12 Jan 2006 16:56:43 +0200
"William Stokes" <[EMAIL PROTECTED]> wrote:
>
> Hello,
> 
> I need to check that user input text is less than 300 characters
> long. How?

if(strlen($UserInputText) > 300){
        echo("Too long");
}

See http://www.php.net/manual/en/print/function.strlen.php

Regards,
Ozz.

Attachment: pgpFMI3DzRcc8.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
Hmm.. I didn't see anyone ask "before or after the user clicks SUBMIT"?

If it's before, then you should use javascript to check the form element prior 
to submitting (you can check realtime with the onkeydown, onkeyup events...  
check after a user moves off of the form element with onchange or even 
onfocus/onblur... or when the user clicks 'submit' with the onsubmit event).

Whenever you check it... it's going to be something like 
forms[formnameornumber].formelementname.length   or something like that in JS.


If it's after the user submits the form, then yeah, what everyone else said..  
strlen($data) (where $data contains the information submitted).

-TG

= = = Original message = = =

Hello,

I need to check that user input text is less than 300 characters long. How?

Thanks
-Will 


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

Hmm.. I didn't see anyone ask "before or after the user clicks SUBMIT"?

Probably because this is a PHP list and nothing that happens on the client side is a) controllable by PHP or b) guaranteed. Whatever you do on the client side you should always validate anything coming from the client on the serverside.

-Stut

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

I disagree...  PHP frequently involves interacting with or outright using 
alternative technologies to accomplish your goal.  This includes HTML, XML, 
databases, etc.  To effectively use PHP you need to understand your options and 
the pros/cons in using the other technologies.

PHP isn't a total solution for most situations.  Suggesting that all problems 
be solved with PHP just because it's a PHP mailing list is shortsighted and I 
believe *that* can do more harm for novice developers than not suggesting 
alteratives.

Ok, you're clearly missing my point and while I don't want this to degrade into the usual pissing contest I do feel I need to clarify what I was saying.

I completely agree that in this case Javascript should be used to provide the user with feedback as to how close to the limit they are. However, in your post you described the solution as either Javascript *or* PHP when the best solution is both. What I was pointing out is that while Javascript is a better solution from a usability point of view, not doing the validation with PHP is dangerous regardless of whether the length is validated using Javascript or not.

I certainly don't believe that PHP is the "total solution for most situations", but when it comes to input validation you *need* to do validation on the server-side regardless of what validation you do with Javascript since you have no control over whether the Javascript gets executed.

Off to get more coffee ;)

-Stut

--- End Message ---
--- Begin Message ---
Stut wrote:
Ok, you're clearly missing my point and while I don't want this to degrade into the usual pissing contest I do feel I need to clarify what I was saying.

I completely agree that in this case Javascript should be used to provide the user with feedback as to how close to the limit they are. However, in your post you described the solution as either Javascript *or* PHP when the best solution is both. What I was pointing out is that while Javascript is a better solution from a usability point of view, not doing the validation with PHP is dangerous regardless of whether the length is validated using Javascript or not.

I certainly don't believe that PHP is the "total solution for most situations", but when it comes to input validation you *need* to do validation on the server-side regardless of what validation you do with Javascript since you have no control over whether the Javascript gets executed.

This sounds almost like the old DB vs. Application logic debate I see on several mailing lists; whether you should store more logic in the DB Server through triggers or through application logic. My point on this is that it boils down to how important that data is. If it's somebody's comments on their blog or on a post, I'd just leave it on the application _or_ trim it down to the 300 characters and input it in. bank transactions, I'd have so many triggers going it would be unreal.
--- End Message ---
--- Begin Message ---
Tire Pressure Monitoring System   



 To know leaking and bursting ahead of time, 
Prevent accidents before it's too late. 

  Low-Cost TPMS And A Exciting Giant Market


 
Dear Sir or Madam:
Thank you for reading this Email. In United States of America, all light 
vehicles are required to be equipped with the TPMS since Sept.1, 2005 by the 
act of Federal Motor Vehicle Safety Standards(49 CFR Parts 571 and 585).Our 
company is an Auto Technology Co., which manufactures TPMS(Tire Pressure 
Monitoring System) in China. I think our low-cost TPMS products will promote 
your products sales in market.
1. We can both provide the products for aftermarket and vehicles manufactures. 
As a new industry, TPMS market will become a giant market.
2. You could sell your products with our TPMS, or give it to your customers as 
a gift. Because not cost much, I think it will raise the competition ability of 
your products in market, and make additional profit.
3. While driving, TPMS will provide peace of mind with:
1) Secure Vehicle Safety
2) Improve Fuel Economy
3) Enhance Vehicle Performance
4) Increase Tire Life
4. With three years manufacture experience, now we have built a complete 
production and distribution system in China. We invite you to participate in 
the high double-digit revenue growth market. (Referring to another company's 
introduction: 
http://www.beru.com/english/aktuelles/presse/20050411.php) 
As one of the biggest TPMS supplier in China, we provide many special features 
and functions for customers, which are different with beru's products.
We are sure you will enjoy with our product and quality of our services. We 
hope to have strong, long term and fruitful business relationships 
with you!
Best Regards
Email: [EMAIL PROTECTED]
 

 

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

I have a variable called $text_size which can be "small", "medium" or
"large".

The value is submitted by a text link

 a href="<? $_SERVER['PHP_SELF'];  ?>?text_size=small" class="size1">A</a>
<a href="<? $_SERVER['PHP_SELF']; ?>?text_size=medium" class="size2">A</a>
<a href="<? $_SERVER['PHP_SELF']; ?>?text_size=large" class="size3">A


At the start of the page I initialise it to "small" if it hasn't been set

$text_size = isset($_GET['text_size'] ) ? $_GET['text_size'] : 'small'

What I want to do is store the most current value for $text_size in a
session $_SESSION['text_size'] and then if I move to the next page start a
session and use the strored value so the value is not reset on every page.

R.

R:

Use php to change your css.

I explain and provide an example here:

http://www.sperling.com/examples/styleswitch/

tedd

--
--------------------------------------------------------------------------------
http://sperling.com/

--- End Message ---
--- Begin Message ---
On 1/12/06, Sameer N Ingole <[EMAIL PROTECTED]> wrote:
> James Benson wrote:
> Do you get this message for all the domains you send the mail to? or you
> get this message from some specific domains?
> Did mails went to thses domains without problems earlier?
> When you send mail to gmail.com address check if it is in buld or spam
> folder.
>
> Regards,
>
> Sameer N. Ingole
> Blog: http://weblogic.noroot.org/

Not all- Yahoo for instance gives me no problems. Gmail _sometimes_
accepts and sometimes doesn't. But I guess that inconsistent behaviour
is to be expected from a beta service. Both of them deliver to the
Inbox.

I think that I now have a solution in James Benson's advice. I just
haven't had the time to implement it (university). I'll get on it this
evening.

Thans, all!

Dotan Cohen
http://technology-sleuth.com/question/what_are_the_advantages_of_lcd_monitors.html
183

--- End Message ---
--- Begin Message ---
Hello newsgroup.

I was just woundering where do a php coder send his suggestions regarding 
PHP?

tatsudoshi 

--- End Message ---
--- Begin Message ---
[snip]
I was just woundering where do a php coder send his suggestions regarding 
PHP?
[/snip]

There is a PHP-DEV mailing list which would probably be the best place. See
http://www.php.net/mailinglists

--- End Message ---
--- Begin Message ---
I'm working with a medium sized ISP to start rolling out PHP and MySQL
services to customers.  I've been looking around for best practices or help
with such a roll out but not found anything.  I'm confident I can roll out
the services but with so many other ISPs currently running PHP it seems like
I could save my self a lot of mistakes and grief if I could learn from
admins that have already done it.

Is anyone aware of a resource specifically about rolling out PHP to a large
number of users in an ISP setting?  Specifically dealing with security
issues like a user doing an unlink(../otheruser/index.html); ?

Any pointers and experience are appreciated.  Thank You.

technikolor

--- End Message ---
--- Begin Message ---
Ben Rockwood wrote:
I'm working with a medium sized ISP to start rolling out PHP and MySQL
services to customers.  I've been looking around for best practices or help
with such a roll out but not found anything.  I'm confident I can roll out
the services but with so many other ISPs currently running PHP it seems like
I could save my self a lot of mistakes and grief if I could learn from
admins that have already done it.

Is anyone aware of a resource specifically about rolling out PHP to a large
number of users in an ISP setting?  Specifically dealing with security
issues like a user doing an unlink(../otheruser/index.html); ?

Any pointers and experience are appreciated.  Thank You.

technikolor

This link may be of some use:

http://www.webhostgear.com/166.html

Tim.

--- End Message ---
--- Begin Message ---
I have a class which creates another class within it such as:

class Loc{

public function outputInfo()
{
        

        $map=new Map();
        
        $map->setKey();
        

}

}

In my main page can I access the $map object like this:

$loc=new Loc();

$loc->map->publicMapFunction();

I thought I would be able to but it doesn't seem like it.

thanks in advance.

-jonathan

--- End Message ---
--- Begin Message ---
Hi, Jonathan!

On Thu, 2006-01-12 at 14:13 -0800, jonathan wrote:
> I have a class which creates another class within it such as:
> 
> class Loc{
> 
> public function outputInfo()
> {
>       
> 
>       $map=new Map();
>       
>       $map->setKey();
>       
> 
> }
> 
> }
> 
> In my main page can I access the $map object like this:
> 
> $loc=new Loc();
> 
> $loc->map->publicMapFunction();

Depending on what you're trying to accomplish, it looks like you're
running into a scope issue.  According to the code sample you provided,
the $map object is local to the Loc::outputInfo() method.  So, inside
this method, you can access the $map object like
$map->publicMapFunction() provided your Map class defines the
publicMapFunction() method.

If you want to access the $map object outside the outputInfo() method
defined in the Loc class, then you'll need to return the $map object or
provide some other interface to it within the Loc class.  

One way to do this would be something like this in the class definition:

class Loc{

public function outputInfo()
{
        $map = new Map();
        $map->setKey();
        return $map;
}

}

Next, in your main page you might do this:
$loc = new Loc();
$myMap = $loc->outputInfo();

Now, if you have the method publicMapFunction() defined in your Map
class, you should be able to access it like this:

$myMap->publicMapFunction();

I'm not sure the my example above is the best way to go about this...but
without knowing exactly what it is you're trying to accomplish I think
it at least should point you in the right direction.  

You'll also need to be aware of the difference between how PHP4 and PHP5
handle objects to know whether you're operating on a copy of an object
or a reference to the actual object itself.  

Hope that helps!

Tim 

-- 
Tim Boring
IT Manager
Automotive Distributors Warehouse
2981 Morse Road
Columbus, OH 43230
direct: 614-532-4240
toll free: 800-421-5556 x 4240
e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
jonathan wrote:

> I have a class which creates another class within it such as:
> 
> class Loc{
> 
> public function outputInfo()
> {
> 
> 
> $map=new Map();
> 
> $map->setKey();
> 
> 
> }
> 
> }
> 
> In my main page can I access the $map object like this:
> 
> $loc=new Loc();
> 
> $loc->map->publicMapFunction();
> 
> I thought I would be able to but it doesn't seem like it.
> 
> thanks in advance.
> 
> -jonathan


Try this:
class Loc
{
        public var      $map;
        function oputputInfo()
        {
                $this->map = new Map();
        }
};

$loc = new Loc();
$lock->outputInfo();

$loc->map->publicMapFunction();

--- End Message ---
--- Begin Message ---
>         $map=new Map();
$this->map = new Map();

--- End Message ---
--- Begin Message ---
$map is not a member variable of the Loc class in your code...
Instead do this:

class Loc {
  // Defines a member variable
  var $map;
  // Constructor
  function Loc() {
    $this->map = new Map(); // Create map object and save to Loc object
    $this->map->setKey();
  }
}

$loc = new Loc();
$loc->map->publicMapFunction();


Aaron
----------------------------------------------------------



On 1/12/06, jonathan <[EMAIL PROTECTED]> wrote:
>
> I have a class which creates another class within it such as:
>
> class Loc{
>
> public function outputInfo()
> {
>
>
>         $map=new Map();
>
>         $map->setKey();
>
>
> }
>
> }
>
> In my main page can I access the $map object like this:
>
> $loc=new Loc();
>
> $loc->map->publicMapFunction();
>
> I thought I would be able to but it doesn't seem like it.
>
> thanks in advance.
>
> -jonathan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hi, I gotta send an XML request to a server. In the doc it's defined as
follows:
[request]
<xs:request xmlns:xs='urn:pinXpressSchema' version='1.5' langCode='en'>

<DEALERinfo aspName=‘XXX’

dealerName=''

posName='1234'

posPassword='1234'

userName=''

userPassword='1234' />

<purchasePINs transID='1234567890' ticket='true' ticketWidth='32' />

</xs:request>
[/request]
and I tried to realize it that way:
[Code]
<?php
 $n = "\n\n";
$aspName="XXX";
$dealerName="paykiosks";
$posName="998745";
$posPasswords="998745";
$userName="";
$userPassword="";

 $inputdata = '<xs:request xmlns:xs=\'urn:pinXpressSchema\' version=\'1.5\' 
langCode=\'en\'>'.$n.'
 <DEALERinfo aspName='.$aspName.'
             dealerName='.$dealerName.'
             posName='.$posName.'
             posPassword='.$posPassword.'
             userName='.$userName.'
             userPassword='.$userPassword.'/>
   <purchasePINs transID=1234567890 ticket=true ticketWidth=32 />
</xs:request>';
$x = curl_init("https://xml.pinsprepaid.com/xml/xmlPinXpress.asp";);
curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($x, CURLOPT_HEADER, 0);
curl_setopt($x, CURLOPT_POST, 1);
curl_setopt($x, CURLOPT_POSTFIELDS, $inputdata);
curl_setopt($x, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($x, CURLOPT_REFERER, "http://localhost/test.php";);
curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($x);
curl_close($x);
echo $data;
?> 
[Code]
but I only got the Answer:
"invalid xml"

Why, what's going wrong? Thank you for your help!

--- End Message ---

Reply via email to