Re: [PHP] strtoupper and HTML entities

2001-12-23 Thread mweb

It works!

thanks a lot, Michael!!

mweb

On Sunday 23 December 2001 00:41, Michael Sims wrote:
> At 11:32 PM 12/22/2001 +0100, mweb wrote:
> >Hello,
> >
> >I know I can convert a string to all uppercases with the strtoupper()
> >function. However, what if the original string contains HTML entities?
> >
> >EXAMPLE:
> >
> >original string = "funkstörung"
>
> Try this:
>
>  function htmltoupper($str) {
>  $trans = get_html_translation_table (HTML_ENTITIES);
>  $trans = array_flip ($trans);
>  $str = strtr ($str, $trans);
>  $str = strtoupper($str);
>  $str = htmlentities($str);
>  return $str;
> }
>
> $string = "funkstörung";
>
> $string = htmltoupper($string);
>
> echo $string;
> ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to parse an XML document

2001-12-23 Thread PHP Rules

Hi fellas.

I would like to know the way to parse an XML document.

I come from Java world, and you can handle an XML document,
and 
then show it as an HTML page.

I suppose that it's also possible by using PHP, isn't it?

I would like also to know if it's available in the 'standard
installation' of PHP. I mean, I want to develop this on a
remote
server. It uses PHP, and I suppose that it's not installated
any
extra module, so I wonder if the XML parsing needs any extra
module
or not.

Best regards.
___
¿Sabes que puedes redireccionar tu correo de HispaVista a donde tú quieras?
http://www.hispavista.com/altascorreo/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: PHP called recursively?

2001-12-23 Thread Thomas Karcher

Hi Chris,

> if he wants to burn a cd why dont you just copy the php dir onto a cd? why
> do you have to parse everything? as an admin I would rather the entire dir
> then the content of the executed script. plus on your side parseing every
> url recursivly and getting all the images etc, what a hasle, just copy the
> dir ..

But the PHP scripts generate HTML content out of a database - and as far as
I know it is not very easy to run a database and a webserver on a CD   ;->
Yes, it is possible, I know, but these CD's are given to his customers, so
it must be easy to use ...
And yes, at this time, I am parsing the content for substituting image
paths, CSS paths and so on ...

In the meantime, I had to solve the problem, so I did it via
fopen(http://server/php-script.php4), but I am interested why it doesn't
work with an "embedded" PHP script.

Thanks!
Thomas



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Accessing a php file in a frame

2001-12-23 Thread artfakt


I have a file.html with a frame which target file.php
I can access to file.php : localhost/file.php : ok
I can access to file.html but the frame which target file.php display 
"forbidden ...

?   thanks  [EMAIL PROTECTED]


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Build questions

2001-12-23 Thread Andrey Hristov

Hi,

I've some questions about building PHP on Win platform.
I use VC++6.0 and load workspace from the win32 directory. After loading I looked at 
the configurations and found that there many.
Which one to choose? I want to make some experiments on win32 platform using Apache as 
a webserver(so no thread enviroment). I
suppose that I've to build php4ts because my current Apache/php config uses this dll 
in company of php4ts.lib.
Last question : Why the compile time is bigger in times compared to linux?

TIA

Andrey Hristov



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to parse an XML document

2001-12-23 Thread James Cox

http://www.php.net/manual/en/ref.xml.php

HTH.

James Cox


> -Original Message-
> From: PHP Rules [mailto:[EMAIL PROTECTED]]
> Sent: 23 December 2001 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to parse an XML document
>
>
> Hi fellas.
>
> I would like to know the way to parse an XML document.
>
> I come from Java world, and you can handle an XML document,
> and
> then show it as an HTML page.
>
> I suppose that it's also possible by using PHP, isn't it?
>
> I would like also to know if it's available in the 'standard
> installation' of PHP. I mean, I want to develop this on a
> remote
> server. It uses PHP, and I suppose that it's not installated
> any
> extra module, so I wonder if the XML parsing needs any extra
> module
> or not.
>
> Best regards.
> ___
> ¿Sabes que puedes redireccionar tu correo de HispaVista a donde
> tú quieras?
> http://www.hispavista.com/altascorreo/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to compile Apache/PHP

2001-12-23 Thread Todd Cary

I am quite new to the Linux environment and do not have experience with
"make" files.  The platform is RH Linux 7.2 with the included Apache and
the PHP rpm, "php-devel-4.0.4pl1-9.i386.rpm".  I need someone to give me
the step by step process of creating a version of Apache that will
process PHP extensions.

Many thanks..

Todd

--
Todd Cary
Ariste Software
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Prev ... Next

2001-12-23 Thread Rambo Amadeus

Hi,
I have about 100 names in mysql. How can i display them in groups of 10, and
have next and previous links.

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 23 Dec 2001 16:04:34 -0000 Issue 1069

2001-12-23 Thread php-general-digest-help


php-general Digest 23 Dec 2001 16:04:34 - Issue 1069

Topics (messages 78607 through 78616):

Help with permissions/ownership
78607 by: Gaylen Fraley

mail function not support in php 4.1.0 with compiled with IMAP ???
78608 by: Martin Fienkeng

Re: strtoupper and HTML entities
78609 by: mweb

How to parse an XML document
78610 by: PHP Rules
78614 by: James Cox

Re: PHP called recursively?
78611 by: Thomas Karcher

Accessing a php file in a frame
78612 by: artfakt

Build questions
78613 by: Andrey Hristov

How to compile Apache/PHP
78615 by: Todd Cary

Prev ... Next
78616 by: Rambo Amadeus

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 ---

I'll try to be both concise and precise with this.

I have some PHP code like this:

 if (!rename($path_to_file,$path_to_file_BACKUP))
die("$unable_to_access_file_msg $path_to_file_BACKUP");
 $buffersize = round(filesize($path_to_file_BACKUP)*1.5);
 $fp_in = fopen("$path_to_file_BACKUP","r") or
die("$unable_to_access_file_msg $path_to_file_BACKUP");
 $fp = fopen("$path_to_file",'a') or die("$unable_to_access_file_msg
$path_to_file");
 set_file_buffer($fp,$buffersize);
 fwrite($fp,"hello") or die("HELP!");
 fclose($fp);

This works, sort of.  It dies with HELP!  The rename happens exactly as
required.  However, when PHP creates the $fp file, the owner and permissions
are different.  I can chmod the permissions, through PHP
(chmod($path_to_file,0777) , but I can't seem to change the owner, using
chown (it says it is not allowed).  The original file, before being renamed
and the directory are 0777.  After the rename, the old file is still 0777,
but the new file ($fp) is 0644.  It appears that the new owner is the root
directory for the server document (in this case 1792=www), instead of the
group.  As an example, before the rename, the owner is 1444 as is the group.
When $fp is created, the owner is now 1792 but the group is still 1444 (user
name of the ftp account).

On most systems, this seems to work ok. But on some linux systems, it fails
due to the ownership.  The PHP program cannot write to the new file.  I'm
hoping that I'm overlooking some minor/major factor here, that someone
will/can point out.  How does PHP, or is it the server, get ownership?

I hope this make sense.

Thanks!

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/




--- End Message ---
--- Begin Message ---

I just finished installing php 4.1.0 with the following options
with-imap, with-expat, with-mysql and with-apxs
my system is Mandrake 8.1

I tried using the mail function to send mail out and this is the error I get 
"Warning: mail() is not supported in this PHP build in content on line 26"

Is it that in compiling with imap I loose the mail function? or is there 
another switch to activate this

Any help in resolving this will be greatly appreciated

Martin Fienkeng
"Just searching for more knowledge"


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--- End Message ---
--- Begin Message ---

It works!

thanks a lot, Michael!!

mweb

On Sunday 23 December 2001 00:41, Michael Sims wrote:
> At 11:32 PM 12/22/2001 +0100, mweb wrote:
> >Hello,
> >
> >I know I can convert a string to all uppercases with the strtoupper()
> >function. However, what if the original string contains HTML entities?
> >
> >EXAMPLE:
> >
> >original string = "funkstörung"
>
> Try this:
>
>  function htmltoupper($str) {
>  $trans = get_html_translation_table (HTML_ENTITIES);
>  $trans = array_flip ($trans);
>  $str = strtr ($str, $trans);
>  $str = strtoupper($str);
>  $str = htmlentities($str);
>  return $str;
> }
>
> $string = "funkstörung";
>
> $string = htmltoupper($string);
>
> echo $string;
> ?>

--- End Message ---
--- Begin Message ---

Hi fellas.

I would like to know the way to parse an XML document.

I come from Java world, and you can handle an XML document,
and 
then show it as an HTML page.

I suppose that it's also possible by using PHP, isn't it?

I would like also to know if it's available in the 'standard
installation' of PHP. I mean, I want to develop this on a
remote
server. It uses PHP, and I suppose that it's not installated
any
extra module, so I wonder if the XML parsing needs any extra
module
or not.

Best regards.
___
¿Sabes que puedes redireccionar tu correo de HispaVista a donde tú quieras?
http://www.hispavista.com/altascorreo/

--- End Message ---
--- Begin Message ---

Re: [PHP] Prev ... Next

2001-12-23 Thread Andrey Hristov

The sql is
select name from  members limit offset,10;

you have to generate offet which _must_ be an integer.

Regards,
Andrey  Hristov


- Original Message - 
From: "Rambo Amadeus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 23, 2001 6:06 PM
Subject: [PHP] Prev ... Next


> Hi,
> I have about 100 names in mysql. How can i display them in groups of 10, and
> have next and previous links.
> 
> Thanks
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: How to parse an XML document

2001-12-23 Thread Manuel Lemos

Hello,

Php Rules wrote:
> 
> Hi fellas.
> 
> I would like to know the way to parse an XML document.
> 
> I come from Java world, and you can handle an XML document,
> and
> then show it as an HTML page.
> 
> I suppose that it's also possible by using PHP, isn't it?
> 
> I would like also to know if it's available in the 'standard
> installation' of PHP. I mean, I want to develop this on a
> remote
> server. It uses PHP, and I suppose that it's not installated
> any
> extra module, so I wonder if the XML parsing needs any extra
> module
> or not.

PHP comes built in support for parsing XML documents with James Clark
Expat parser and also GNOME DOM XML parser.

I used Expat support for bulding this generic parser class that puts all
tags and data in a single associative array indexed by they path name
encoded in a single string.

http://phpclasses.upperdesign.com/browse.html/package/4

In the same site you may also find many other classes for processing and
generating XML:

http://phpclasses.upperdesign.com/browse.html/class/4

If you came from the Java world, you will appreciate the whole site
because it is a repository from OOP classes of objects written in PHP:

http://phpclasses.upperdesign.com/browse.html

And also this mailing list that is meant for discussing OOP in PHP. It
was started just a few days ago, but it already has almost 200
subscribers. Here you may find answers for you OOP with PHP questions.

http://groups.yahoo.com/group/php-objects/


Regards,
Manuel Lemos

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP software tool

2001-12-23 Thread Dasmeet Singh Arora

Check ConTEXT at http://www.fixedsys.com/context
It not only supports PHP but many other.Got good Syntax Highlighting and
other features.


On Sun, 2001-12-23 at 00:16, LaserJetter wrote:
> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting etc
> and of a similar footprint to notepad would be useful.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 





http://www.pluginjokes.com
Add FREE Dynamic Jokes To Your Site!
-- 





http://www.pluginjokes.com
Add FREE Dynamic Jokes To Your Site!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] If/else conditional statement ...

2001-12-23 Thread Robert Dyke

Hello:

In ASP I can write a Conditional statement like this:

<% If $varA == True Then %>
Straight HTML in here that only displays if $varA == True
<% Else %>
Straight HTML in here that only displays if $varA != True
<% End if %>

Translating this to PHP doesn't work:

   // error is generated here ...


Is there some way to do it this way in PHP?  I'd rather not create a huge
variable and then echo that.

Thanks in advance.


Robert Dyke
Montana Software
http://www.montanasoft.com/
[EMAIL PROTECTED]

* For the best results please include the text of this message (cut and
paste if necessary) in your reply *






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Why Can't I Get PHP to Work with MySQL??

2001-12-23 Thread Ben Ocean

Hi;
I get this error when I try to restart Apache:

Syntax error on line 236 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/libexec/libphp4.so into server: 
/etc/httpd/libexec/libphp4.so

The above file does, of course, exist. I'm running RH71 i386 with MySQL and 
PHP installed from source files. Here's my config script:

./configure --with-apxs=/etc/httpd/bin/apxs --with-mysql=/usr/local/mysql 
--with-kerberos=/usr/kerberos --with-ldap=/usr/local/openldap

So, what gives? I've googled this one and it appears there's a lot of folks 
with this question unanswered!
TIA,
BenO



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Bogdan Stancescu

Make sure you close the accolade afterwords in PHP -- other than that, yes,
it works just fine!

For example this should work just fine:
-

  Found a multiple of three!

--

Bogdan

Robert Dyke wrote:

> Hello:
>
> In ASP I can write a Conditional statement like this:
>
> <% If $varA == True Then %>
> Straight HTML in here that only displays if $varA == True
> <% Else %>
> Straight HTML in here that only displays if $varA != True
> <% End if %>
>
> Translating this to PHP doesn't work:
>
>// error is generated here ...
>
> Is there some way to do it this way in PHP?  I'd rather not create a huge
> variable and then echo that.
>
> Thanks in advance.
>
> Robert Dyke
> Montana Software
> http://www.montanasoft.com/
> [EMAIL PROTECTED]
>
> * For the best results please include the text of this message (cut and
> paste if necessary) in your reply *
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Miles Thompson

What's the error, just a parse error on line xx?
O tend to do a lot of echo 'ing, so this suggestion may not be much help.
How about adding a semicolon?


Miles

At 01:11 PM 12/23/2001 -0700, Robert Dyke wrote:
>Hello:
>
>In ASP I can write a Conditional statement like this:
>
><% If $varA == True Then %>
>Straight HTML in here that only displays if $varA == True
><% Else %>
>Straight HTML in here that only displays if $varA != True
><% End if %>
>
>Translating this to PHP doesn't work:
>
>   // error is generated here ...
>
>
>Is there some way to do it this way in PHP?  I'd rather not create a huge
>variable and then echo that.
>
>Thanks in advance.
>
>
>Robert Dyke
>Montana Software
>http://www.montanasoft.com/
>[EMAIL PROTECTED]
>
>* For the best results please include the text of this message (cut and
>paste if necessary) in your reply *
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Bogdan Stancescu

Took a better look at your code -- you've capitalized "true" -- that may be
it.

Bogdan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why Can't I Get PHP to Work with MySQL??

2001-12-23 Thread Michael Sims

At 12:16 PM 12/23/2001 -0800, Ben Ocean wrote:
>Hi;
>I get this error when I try to restart Apache:
>
>Syntax error on line 236 of /etc/httpd/conf/httpd.conf:
>Cannot load /etc/httpd/libexec/libphp4.so into server: 
>/etc/httpd/libexec/libphp4.so
>
>The above file does, of course, exist. I'm running RH71 i386 with MySQL 
>and PHP installed from source files. Here's my config script:
>
>./configure --with-apxs=/etc/httpd/bin/apxs --with-mysql=/usr/local/mysql 
>--with-kerberos=/usr/kerberos --with-ldap=/usr/local/openldap
>
>So, what gives? I've googled this one and it appears there's a lot of 
>folks with this question unanswered!

 From the PHP INSTALL file:


Note 3!  If you are on Linux and have installed shared libraries, make
sure the location of these shared libraries are listed in your
/etc/ld.so.conf file.  For example, if you have:

   /usr/local/lib/mysql/libmysqlclient.so

Make sure /etc/ld.so.conf contains:

   /usr/local/lib/mysql

Then run ldconfig.


Do the above and this should take care of it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Table Problem

2001-12-23 Thread Phillip B. Bruce

Hi,

   Look at the code below first:

";
21  print "";
22  print "";
23  print "$pages[description]";
24  print $story[headline];
25  print "";
26  print "";
27  print " ";
28  print "";
29  print "";
30  print "";
31}
32  }
33
34  include "footer_news.php";
35  ?>

My problem is that I want to do the following:

   ==

|
|
=
|
|  |
   ==
|
|   |
=

So I thought a neat trick would be to before line 22 the following:

if ( $pages[code]="intro")
print "";
   else
print "";

   The objective would be to have a whole row by like I describe above.
The thing is I don't want to write the same routine just for that
one row
 and by that I mean put in another mysql call to the database.

  Suggestion?


--

*** Phillip B. Bruce ***
*** http://pbbruce.home.mindspring.com   ***
*** [EMAIL PROTECTED]   ***
***  ***
*** "Have you ever noticed? Anybody going slower than***
*** you is an idiot, and anyone going faster than you***
*** is a maniac." - George Carlin***





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Michael Sims

At 01:11 PM 12/23/2001 -0700, Robert Dyke wrote:
>Hello:
>
>In ASP I can write a Conditional statement like this:
>
><% If $varA == True Then %>
>Straight HTML in here that only displays if $varA == True
><% Else %>
>Straight HTML in here that only displays if $varA != True
><% End if %>
>
>Translating this to PHP doesn't work:
>
>   // error is generated here ...
>
>
>Is there some way to do it this way in PHP?  I'd rather not create a huge
>variable and then echo that.

As others have pointed out, the above should work provided that you are 
terminating your curly braces properly.

Another (perhaps easier) option would be to use "alternate syntax" which is 
more similar to VBScript.  For example, the following works in PHP:


...html...

...html...


Note the colon's which are required.  The endif will need a semicolon if 
there are any other commands after it in the same code block.  Also, I 
don't believe you can mix alternate syntax and normal syntax in the same 
control structure.  For example, the following will probably give an error:



You'd have to use alternate syntax on the nested if statement as well...

I personally prefer alternate syntax when I'm breaking into and out of PHP 
a lot, like the example above.  For more info:

http://www.php.net/manual/en/control-structures.alternative-syntax.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ... in an include file ...

2001-12-23 Thread Robert Dyke

I apologize for not including all of the information.  I did this as an
include file, which explains why it isn't working:

< !--- beginning of myinclude.php  >



< ! --- end of myinclude.php --- >



< !  beginning of testfile.php --- >

Html here that should display only if $varA  == True

< ?
}  // generic parser error generated here
Else {
?>

HTML that only displays if $varA != True


< ! - End of testfile.php  >


In ASP this works, in PHP it doesn't ... any ideas?


"Michael Sims" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 01:11 PM 12/23/2001 -0700, Robert Dyke wrote:
> >Hello:
> >
> >In ASP I can write a Conditional statement like this:
> >
> ><% If $varA == True Then %>
> >Straight HTML in here that only displays if $varA == True
> ><% Else %>
> >Straight HTML in here that only displays if $varA != True
> ><% End if %>
> >
> >Translating this to PHP doesn't work:
> >
> >   // error is generated here ...
> >
> >
> >Is there some way to do it this way in PHP?  I'd rather not create a huge
> >variable and then echo that.
>
> As others have pointed out, the above should work provided that you are
> terminating your curly braces properly.
>
> Another (perhaps easier) option would be to use "alternate syntax" which
is
> more similar to VBScript.  For example, the following works in PHP:
>
> 
> ...html...
> 
> ...html...
> 
>
> Note the colon's which are required.  The endif will need a semicolon if
> there are any other commands after it in the same code block.  Also, I
> don't believe you can mix alternate syntax and normal syntax in the same
> control structure.  For example, the following will probably give an
error:
>
>  if (condition):
>  if (other condition) {
>  do stuff
>  }
> endif;
> ?>
>
> You'd have to use alternate syntax on the nested if statement as well...
>
> I personally prefer alternate syntax when I'm breaking into and out of PHP
> a lot, like the example above.  For more info:
>
> http://www.php.net/manual/en/control-structures.alternative-syntax.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why Can't I Get PHP to Work with MySQL??

2001-12-23 Thread Ben Ocean

At 02:32 PM 12/23/01 -0600, you wrote:
>At 12:16 PM 12/23/2001 -0800, Ben Ocean wrote:
>>Hi;
>>I get this error when I try to restart Apache:
>>
>>Syntax error on line 236 of /etc/httpd/conf/httpd.conf:
>>Cannot load /etc/httpd/libexec/libphp4.so into server: 
>>/etc/httpd/libexec/libphp4.so
>>
>>The above file does, of course, exist. I'm running RH71 i386 with MySQL 
>>and PHP installed from source files. Here's my config script:
>>
>>./configure --with-apxs=/etc/httpd/bin/apxs --with-mysql=/usr/local/mysql 
>>--with-kerberos=/usr/kerberos --with-ldap=/usr/local/openldap
>>
>>So, what gives? I've googled this one and it appears there's a lot of 
>>folks with this question unanswered!
>
> From the PHP INSTALL file:
>
>
>Note 3!  If you are on Linux and have installed shared libraries, make
>sure the location of these shared libraries are listed in your
>/etc/ld.so.conf file.  For example, if you have:
>
>   /usr/local/lib/mysql/libmysqlclient.so
>
>Make sure /etc/ld.so.conf contains:
>
>   /usr/local/lib/mysql
>
>Then run ldconfig.
>
>
>Do the above and this should take care of it.

Well, I'm afraid I've done all of that and the problem remains :(
I recalled I also had to hard-code something in the configure script that 
wasn't working properly:

# BENO'S CHANGE: LAST LINE BELOW COMMENT AS WELL...
#  for i in lib lib/mysql; do

#  str="$MYSQL_DIR/$i/libmysqlclient.*"
#  for j in `echo $str`; do
#if test -r $j; then
#  MYSQL_LIB_DIR=$MYSQL_DIR/$i
#  break 2
#fi
#  done
#
#  done
MYSQL_LIB_DIR=/usr/local/lib

(starts at around line 3350). I was getting this error:

configure: error: Cannot find mysqlclient library under /usr/local/mysql

whereas the library is actually found under /usr/local/lib/mysql. At any 
rate, made the edit and the error message disappeared, so I assume I did 
something right, but the fact that I had to make an edit makes me suspicious.
Any more ideas?
TIA,
BenO



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] 4.0.6 Vs. 4.1.0 ?

2001-12-23 Thread Robert Dyke

Hi ... I'm getting ready to do a custom install of PHP on a Pair Networks
server, and I'm wondering which version I should go with.  It seems like
version 4.1.0 has some major changes and new features, which can sometimes
create bugs in the world of software.

What are your thoughts?  Pros and Cons?

Thanks in advance.


Robert Dyke
Montana Software
http://www.montanasoft.com/
[EMAIL PROTECTED]

* For the best results please include the text of this message (cut and
paste if necessary) in your reply *






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Merry christmas!

2001-12-23 Thread Emile Bosch

Yeah i know it's offtopic =)

Anyway, i wish you all the best!

Cu in the next year!
Warm regards,
Emile



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] $GLOBALS array

2001-12-23 Thread Philip MacIver

Does anyone know if it is possible to use the 

'global $varName'

function with the '$GLOBALS' array itself.

I have been having some trouble with this. I have decieded to switch of 
register_globals in the php.ini file (seeing as
it is now deprecated in version 4.1.0)
I know that register_globals is still supported, but I would like to get used to not 
using it.
But anyway, the problem I am having is that when I post data from a form to another 
page the data is not available
globally, so I wrote a method to register them globally, it looks like this

function globaliseVars($varArray) {
global $GLOBALS;

while (list($varName,$var) = each($varArray)) {
$GLOBALS[trim($varName)] = trim($var);
}
}

But doing 'global $GLOBALS' doesn't seem to make it refer to the actual '$GLOBALS' 
array, the only time it did work was
when I place something into the '$GLOBALS' array on the page that calls the function. 
So

/**
* This doesn't work
*/
globaliseVars($HTTP_POST_VARS);


/**
* But this does
*/
$GLOBALS["ANYTHING"] = "anything";
globaliseVars($HTTP_POST_VARS);

If anyone could help me with this problem please could they get in touch, because its 
driving me crazy.

Thanks!

==
Philip MacIver   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to compile Apache/PHP

2001-12-23 Thread Brian Clark

* Todd Cary ([EMAIL PROTECTED]) [Dec 23. 2001 10:42]:

> I am quite new to the Linux environment and do not have experience with
> "make" files.  The platform is RH Linux 7.2 with the included Apache and
> the PHP rpm, "php-devel-4.0.4pl1-9.i386.rpm".  I need someone to give me
> the step by step process of creating a version of Apache that will
> process PHP extensions.

That's a tall order without knowing exactly what's what with your 
system. :-)

> Many thanks..



Which isn't exactly what you want..

And see the comments here:



I can tell you that you will have problems. It's all a part of the
learning process. No two systems are likely to be the same when it comes
to installing this stuff.

The RPMs with -devel aren't the precompiled "Ready made" executables.

These may also help:




I would suggest learning to install all of this stuff from source
archives, rather than depending on RPMs, for the first time.

I know all of the above is kinda spotty, but I hope it gets you started.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
All you will ever be you are now becoming.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: $GLOBALS array

2001-12-23 Thread Gaylen Fraley

Why aren't you using the $_POST or $HTTP_POST_VARS array?

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/

"Philip Maciver" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone know if it is possible to use the
>
> 'global $varName'
>
> function with the '$GLOBALS' array itself.
>
> I have been having some trouble with this. I have decieded to switch of
register_globals in the php.ini file (seeing as
> it is now deprecated in version 4.1.0)
> I know that register_globals is still supported, but I would like to get
used to not using it.
> But anyway, the problem I am having is that when I post data from a form
to another page the data is not available
> globally, so I wrote a method to register them globally, it looks like
this
>
> function globaliseVars($varArray) {
> global $GLOBALS;
>
> while (list($varName,$var) = each($varArray)) {
> $GLOBALS[trim($varName)] = trim($var);
> }
> }
>
> But doing 'global $GLOBALS' doesn't seem to make it refer to the actual
'$GLOBALS' array, the only time it did work was
> when I place something into the '$GLOBALS' array on the page that calls
the function. So
>
> /**
> * This doesn't work
> */
> globaliseVars($HTTP_POST_VARS);
>
>
> /**
> * But this does
> */
> $GLOBALS["ANYTHING"] = "anything";
> globaliseVars($HTTP_POST_VARS);
>
> If anyone could help me with this problem please could they get in touch,
because its driving me crazy.
>
> Thanks!
>
> ==
> Philip MacIver



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Why Can't I Get PHP to Work with MySQL??

2001-12-23 Thread Brian Clark

* Ben Ocean ([EMAIL PROTECTED]) [Dec 23. 2001 16:45]:

> >>./configure --with-apxs=/etc/httpd/bin/apxs --with-mysql=/usr/local/mysql 
> >>--with-kerberos=/usr/kerberos --with-ldap=/usr/local/openldap

> >>So, what gives? I've googled this one and it appears there's a lot of 
> >>folks with this question unanswered!

[...]

> Well, I'm afraid I've done all of that and the problem remains :(
> I recalled I also had to hard-code something in the configure script that 
> wasn't working properly:

> # BENO'S CHANGE: LAST LINE BELOW COMMENT AS WELL...
> #  for i in lib lib/mysql; do

> #  str="$MYSQL_DIR/$i/libmysqlclient.*"
> #  for j in `echo $str`; do
> #if test -r $j; then
> #  MYSQL_LIB_DIR=$MYSQL_DIR/$i
> #  break 2
> #fi
> #  done
> #
> #  done
> MYSQL_LIB_DIR=/usr/local/lib

> (starts at around line 3350). I was getting this error:

> configure: error: Cannot find mysqlclient library under /usr/local/mysql

> whereas the library is actually found under /usr/local/lib/mysql. At any 

Didn't we just go over this yesterday? You needed to pass
--with-mysql=/usr/local instead of --with-mysql=/usr/local/mysql

In the configure you edited, it's going to be looking for [Whatever you
passed configure for --with-mysql] plus a) lib or b) lib/mysql plus
libmysqlclient.*

So when you pass configure --with-mysql=/usr/local/mysql and the path is
actually /usr/local/lib/mysql, you're making it look in a)
/usr/local/mysql/lib or b) /usr/local/mysql/lib/mysql

It doesn't find what it's looking for, so it tells you " Cannot find
mysqlclient library under /usr/local/mysql", which is the path you gave
it. The error is sort of misleading because it doesn't report *exactly*
where it looked, but it's correct nonetheless.

You need to pass it /usr/local because that is the correct *base* path. 
Now, after that, if it doesn't configure correctly, that's another story.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Shin: A device for finding furniture in the dark.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] is_dir and cache problem ...

2001-12-23 Thread Daniel Urstöger

Hiya !

I am working on a download script right now,
and I have a question about a part of my code:

do
{
 $random_ID = rand(10,99);
 $download_dir = "$today $random_ID";
 if (!@is_dir($download_dir))
 mkdir("$download_dir",0777);
}while(@!is_dir($download_dir));

So, I do this loop till the rand command generates a
ID which isn´t already in use ...
So I have now 2 calls of is_dir onto the same directory
in one loop. What do you think:
Do I need to use clearstatcache() or not ?

thx for any comments !

And Merry XMas !!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu

I do the same with is_file() in several scripts and it works just fine
without clearing the cache. Don't know about dirs but I can't see why it may
be different - should use the exact same functions internally.

On a side note, I'd rather recommend using a loop like


This way you have better control over the number of temp directories
created, use the "official" temp directory and may use the same temp
directory for several projects and still know which dir is used by what
project.

HTH

Bogdan

"Daniel Urstöger" wrote:

> Hiya !
>
> I am working on a download script right now,
> and I have a question about a part of my code:
>
> do
> {
>  $random_ID = rand(10,99);
>  $download_dir = "$today $random_ID";
>  if (!@is_dir($download_dir))
>  mkdir("$download_dir",0777);
> }while(@!is_dir($download_dir));
>
> So, I do this loop till the rand command generates a
> ID which isn´t already in use ...
> So I have now 2 calls of is_dir onto the same directory
> in one loop. What do you think:
> Do I need to use clearstatcache() or not ?
>
> thx for any comments !
>
> And Merry XMas !!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu

Forgot a couple of double quotes and the mode for mkdir. Perfectionist, you
see... :-)

Bogdan





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Daniel Urstöger

thx for your help !
Since I am the only one who works on the whole server, it´s all my stuff :)
Yeah, but the increasing of the random_ID is surely a good way ..
Will check on that !

thx again ! :))



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Casey Allen Shobe

On Sunday 23 December 2001 03:11 pm, Robert Dyke wrote:
> <% If $varA == True Then %>
> Straight HTML in here that only displays if $varA == True
> <% Else %>
> Straight HTML in here that only displays if $varA != True
> <% End if %>


$varA was true.

$varA was false.


I heavily dislike this coding style, however, and personally would use 
something like this:

$varA was ');
if ($varA == true) {
print ('true');
} else {
print ('false');
}
print ('.'."\n");
?>

-- 
Casey Allen Shobe
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GD: how to show different types of images?

2001-12-23 Thread Boulgakov Andrei

Hi!
I have 2 types of images :PNG and Jpeg. They are w/o extension (its name 
generated by tempnam and it is exported from DB). How can i show the both 
in one script?
I tryed like this, but it doesn't work(i see one type, and error on 
another):
$im = ImageCreateFromJpeg($picname);
$text="Some text";
if($im)
{
  $nsi= ImageColorAllocate($im,255,190,0);
  ImageString($im,3,0,0,$text,$nsi);
  Header("Content-type: image/jpeg");
  ImageJpeg($im);
  ImageDestroy($im);
}
else
{
  $im = ImageCreateFromPNG($picname);
  $nsi= ImageColorAllocate($im,255,190,0);
  ImageString($im,3,0,0,$text,$nsi);
  Header("Content-type: image/png");
  ImagePng($im);
  ImageDestroy($im);
}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 24 Dec 2001 07:34:02 -0000 Issue 1070

2001-12-23 Thread php-general-digest-help


php-general Digest 24 Dec 2001 07:34:02 - Issue 1070

Topics (messages 78617 through 78641):

Re: Prev ... Next
78617 by: Andrey Hristov

Re: How to parse an XML document
78618 by: Manuel Lemos

Re: PHP software tool
78619 by: Dasmeet Singh Arora

If/else conditional statement ...
78620 by: Robert Dyke
78622 by: Bogdan Stancescu
78623 by: Miles Thompson
78624 by: Bogdan Stancescu
78627 by: Michael Sims
78640 by: Casey Allen Shobe

Why Can't I Get PHP to Work with MySQL??
78621 by: Ben Ocean
78625 by: Michael Sims
78629 by: Ben Ocean
78635 by: Brian Clark

Table Problem
78626 by: Phillip B. Bruce

Re: If/else conditional statement ... in an include file ...
78628 by: Robert Dyke

4.0.6  Vs.  4.1.0 ?
78630 by: Robert Dyke

Merry christmas!
78631 by: Emile Bosch

$GLOBALS array
78632 by: Philip MacIver
78634 by: Gaylen Fraley

Re: How to compile Apache/PHP
78633 by: Brian Clark

is_dir and cache problem ...
78636 by: Daniel Urstöger
78637 by: Bogdan Stancescu
78638 by: Bogdan Stancescu
78639 by: Daniel Urstöger

Re: how to show different types of images?
78641 by: Boulgakov Andrei

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 ---

The sql is
select name from  members limit offset,10;

you have to generate offet which _must_ be an integer.

Regards,
Andrey  Hristov


- Original Message - 
From: "Rambo Amadeus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 23, 2001 6:06 PM
Subject: [PHP] Prev ... Next


> Hi,
> I have about 100 names in mysql. How can i display them in groups of 10, and
> have next and previous links.
> 
> Thanks
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


--- End Message ---
--- Begin Message ---

Hello,

Php Rules wrote:
> 
> Hi fellas.
> 
> I would like to know the way to parse an XML document.
> 
> I come from Java world, and you can handle an XML document,
> and
> then show it as an HTML page.
> 
> I suppose that it's also possible by using PHP, isn't it?
> 
> I would like also to know if it's available in the 'standard
> installation' of PHP. I mean, I want to develop this on a
> remote
> server. It uses PHP, and I suppose that it's not installated
> any
> extra module, so I wonder if the XML parsing needs any extra
> module
> or not.

PHP comes built in support for parsing XML documents with James Clark
Expat parser and also GNOME DOM XML parser.

I used Expat support for bulding this generic parser class that puts all
tags and data in a single associative array indexed by they path name
encoded in a single string.

http://phpclasses.upperdesign.com/browse.html/package/4

In the same site you may also find many other classes for processing and
generating XML:

http://phpclasses.upperdesign.com/browse.html/class/4

If you came from the Java world, you will appreciate the whole site
because it is a repository from OOP classes of objects written in PHP:

http://phpclasses.upperdesign.com/browse.html

And also this mailing list that is meant for discussing OOP in PHP. It
was started just a few days ago, but it already has almost 200
subscribers. Here you may find answers for you OOP with PHP questions.

http://groups.yahoo.com/group/php-objects/


Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---

Check ConTEXT at http://www.fixedsys.com/context
It not only supports PHP but many other.Got good Syntax Highlighting and
other features.


On Sun, 2001-12-23 at 00:16, LaserJetter wrote:
> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting etc
> and of a similar footprint to notepad would be useful.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 





http://www.pluginjokes.com
Add FREE Dynamic Jokes To Your Site!
-- 





http://www.pluginjokes.com
Add FREE Dynamic Jokes To Your Site!

--- End Message ---
--- Begin Message ---

Hello:

In ASP I can write a Conditional statement like this:

<% If $varA == True Then %>
Straight HTML in here that only displays if $varA == True
<% Else %>
Straight HTML in here that only displays if $varA != True
<% End if %>

Translating this to PHP doesn't work:

   // error is generated here .

Re: [PHP] Re: $GLOBALS array

2001-12-23 Thread Philip MacIver

Basically I use the MVC (Model View Controller) architecture  when building my php 
scripts. So all of my logic is
handled by a controller which calls methods on functions,
that way the php scritps that are used to display forms, tables etc. have little to no 
business logic to them at all.
Now in the controller I woul find it pretty annoying 
if I had to reference either the $HTTP_POST_VARS or $HTTP_GET_VARS aarry, so to add to 
the fact that it would make the
code look more messy than it needs to be. 
So all I wanted to know was is it possible to use 'global $GLOBAL' within a function?

On Sun, 23 Dec 2001 18:35:33 -0600


"Gaylen Fraley" <[EMAIL PROTECTED]> wrote:

> Why aren't you using the $_POST or $HTTP_POST_VARS array?
> 
> --
> Gaylen
> [EMAIL PROTECTED]
> Home http://www.gaylenandmargie.com/
> PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/
> 
> "Philip Maciver" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Does anyone know if it is possible to use the
> >
> > 'global $varName'
> >
> > function with the '$GLOBALS' array itself.
> >
> > I have been having some trouble with this. I have decieded to switch of
> register_globals in the php.ini file (seeing as
> > it is now deprecated in version 4.1.0)
> > I know that register_globals is still supported, but I would like to get
> used to not using it.
> > But anyway, the problem I am having is that when I post data from a form
> to another page the data is not available
> > globally, so I wrote a method to register them globally, it looks like
> this
> >
> > function globaliseVars($varArray) {
> > global $GLOBALS;
> >
> > while (list($varName,$var) = each($varArray)) {
> > $GLOBALS[trim($varName)] = trim($var);
> > }
> > }
> >
> > But doing 'global $GLOBALS' doesn't seem to make it refer to the actual
> '$GLOBALS' array, the only time it did work was
> > when I place something into the '$GLOBALS' array on the page that calls
> the function. So
> >
> > /**
> > * This doesn't work
> > */
> > globaliseVars($HTTP_POST_VARS);
> >
> >
> > /**
> > * But this does
> > */
> > $GLOBALS["ANYTHING"] = "anything";
> > globaliseVars($HTTP_POST_VARS);
> >
> > If anyone could help me with this problem please could they get in touch,
> because its driving me crazy.
> >
> > Thanks!
> >
> > ==
> > Philip MacIver
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


==
Philip MacIver   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]