Re: [PHP] mail() question

2004-04-02 Thread Aidan Lister
It's quite easy to remove access to the mail function, simply put mail in
your php.ini under disable_functions


"Hernan Marino" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
sorry. lazy me.
there is auto_prepend_file in php.ini
I'll see if it works.
Thanks!


On Fri, 2 Apr 2004 03:51:18 -0300, Hernan Marino wrote:
Thanks for your answer.
Don't you know if there is a way to redefine the mail() function in
the php.ini file without touching the source code. Something like
prepending a file for every script parsed in the server and redefine
there several functions or something like that.

Thanks!



On Fri, 2 Apr 2004 07:46:48 +0100, Duncan Hill wrote:
On Friday 02 April 2004 07:39, Hernan Marino wrote:
> Hello.
> My users can send email from their web pages using mail().
> But the email is sent from [EMAIL PROTECTED], I dont want them to
> attempt to send bulk, so I wonder if there is any way to identify
the

Consider removing the mail() function, and requiring they they use
SMTP
connections.  I believe one of the external mail classes supports
authenticated SMTP, so with that you could tell who was sending the
mail.

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

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



[PHP] Re: parsing xml the right way

2004-04-02 Thread Aidan Lister
Wait until you have installed PHP5, then use the simplexml library.

You have not showed us any code, how are we to tell you if you are doing it
the right or wrong way?

"Merlin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there,
>
> I think I am parsing xml documents the wrong way.
> There must be a better way to access the results laterone like objects.
>
> For example I would like to search in a free form for a city name
> inside an xml document and php should return the country name
> and continent.
>
> This is the xml structure:
> 
> Andorra
> AD
> Europe
> 
> Encamp
> Escaldes-Engordany
> Ordino
> Soldeu
> 
> 
>
> Has anybody a good hint for me?
>
> Thanx in advance,
>
> Merlin

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



[PHP] Configuration Variable user_agent

2004-04-02 Thread Bernhard Kraft
Hallo !

I run PHP 4.1.2.

I want to set the user_agent which gets sent
along when fetching file via the fopen(...) call.
Normally this is "PHP/VERISON" in my case "PHP/4.1.2"

I want to set a different user_agent.

I tried to set the variable "user_agent" in the
php.ini file. But the variable doesn't show up when
I view a phpinfo(...) page.
I also tried to set "user_agent" using the function
ini_set(varname, value) during runtime but this
didn't work either 
Was this directive removed ? I didn't find anything
in the archives.
Any suggestions ?

greets,
Bernhard
--
-
Bernhard Kraft
<[EMAIL PROTECTED]>
MOKKA MEDIENAGENTUR GMBH
Mariahilferstrasse 170
1150 Wien
T: 01 895 33 33 50
M: 0676 560 14 14
F: 01 895 33 33 20
www.mokka.at
-
--
-
Bernhard Kraft
<[EMAIL PROTECTED]>
MOKKA MEDIENAGENTUR GMBH
Mariahilferstrasse 170
1150 Wien
T: 01 895 33 33 50
M: 0676 560 14 14
F: 01 895 33 33 20
www.mokka.at
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] any way to dio_close(0) without opening it before?

2004-04-02 Thread Bernard Fouché
Hi.

I want to close fd 0 & 1, like I would do in C under Linux to close a socket with a 
remote end. However
php refuses that I simply do:

dio_close(0);
dio_close(1);

How can I close these 2 fds?

Thanks!

Bernard

[PHP] tiff to pdf conversion

2004-04-02 Thread Brent Clark
Hi all

anyone know of a quick way to convert a tiff file to a pdf format file.
I was thinking of a shell script.

Kind Regards
Brent Clark

[PHP] Ncurses

2004-04-02 Thread Brent Clark
Hi all

I was browsing the list of functions for PHP and I saw a whole range of 
ncurses functions.
I was wondering if anyone knows of a site that has any demos or examples and or where 
it can be used

Kind Regards
Brent Clark


[PHP] hi

2004-04-02 Thread shane
Here is it!


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

[PHP] Image output (Newb question)

2004-04-02 Thread Fidencio Monroy
Hi, I need to display some PNG pictures in a script; from help I got
 
$im = imagecreatefrompng("images/map.png");
imagepng($im);
 
It outputs the binary data as a string, kind of trash; what do I need to set
to tell the browser how to interpret it?
 
 Thanks.
 
 
Fidencio Monroy.


RE: [PHP] Image output (Newb question)

2004-04-02 Thread Dave Avent
Header ("Content-type: image/png");

$im = imagecreatefrompng("images/map.png");
imagepng($im);

ImageDestroy ($im);

-Original Message-
From: Fidencio Monroy [mailto:[EMAIL PROTECTED]
Sent: 02 April 2004 10:55 AM
To: (PHP General List)
Subject: [PHP] Image output (Newb question)


Hi, I need to display some PNG pictures in a script; from help I got

$im = imagecreatefrompng("images/map.png");
imagepng($im);

It outputs the binary data as a string, kind of trash; what do I need to set
to tell the browser how to interpret it?

 Thanks.


Fidencio Monroy.

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



[PHP] Forcing Mac's to show download box, rather than inline

2004-04-02 Thread Mark C
Hi,

I'm trying to server an image(s) up from a php script, this script, checks
for the image and then outputs the required header types, I'm trying to
get the browsers to download the requested image (when they click the
link), rather than display inline.

I've got it working on both Mozilla and IE, perfectly, but on the mac's on
both Safari and IE it displays the image inline.

I'm pretty sure it has to do with the: Content-Disposition: or Content-type:

I'm currenntly using:

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0
header('Content-type: application/octet-stream');
header( "Content-Disposition: attachment; filename=somefile.jpg" );
header("Content-Length: ".filesize("somefile.jpg"));

Coulod anyone advise me on what I would need to add/edit to get the mac to
do this,
I have no problem, outputting different header details, for differnt OS or
brower from the user agent string..

This as mentioned works ok for Mozilla and IE
(not yet tested in in konqueror or Opera)

Thanks in advance

-- 
Ever mind The Rule of Three
Three times what thou givest returns to thee.
This lesson well, thou must learn,
Thee only gets what thou dost earn!

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



Re: [PHP] tiff to pdf conversion

2004-04-02 Thread Jason Wong
On Friday 02 April 2004 16:39, Brent Clark wrote:

> anyone know of a quick way to convert a tiff file to a pdf format file.
> I was thinking of a shell script.

It would have to be a pretty clever shell script.

I don't know of a tiff > pdf convertor but you can use tiff2ps then ps2pdf, 
google for urls.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Non-sequiturs make me eat lampshades.
*/

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



Re: [PHP] Forcing Mac's to show download box, rather than inline

2004-04-02 Thread Mark C

Once upon a time Mark C was quoted as saying:
> Hi,
>
> I'm trying to server an image(s) up from a php script, this script,
> checks for the image and then outputs the required header types, I'm
> trying to get the browsers to download the requested image (when they
> click the link), rather than display inline.
>
> I've got it working on both Mozilla and IE, perfectly, but on the mac's
> on both Safari and IE it displays the image inline.

ok, a little update, using the headers below, it opens a download as for
all the browsers on both Mac/Linux/win

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-type: image/jpg');
header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".$imageName);
header("Content-Length: ".filesize($imageName));
readfile($imageName);


except (there had to be one), as usuall IE fails to do what it is told, on
the Mac only using the code it tries to download an unkown filefile, of
extension application/force-download.

I've tried moving the headers around, removing the
application/force-download, but these headers are the only ones that will
for IE on both win and Mac to download rather than display it inline.

Also on IE in Mac, it's ignoring the filename being sent and saves it as
the script name (again all other browsers do as required).

The file once downloaded can be renamed, and works fine. whilst this is
fine for me, the avaerage person who will be using the site once finished,
probally will not even know how to rename files, so it has to save it
correctly.

Mark

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



[PHP] XSLT bug?

2004-04-02 Thread Vincent Jansen
Don't know if this is the best place to post.
I'm also not shure if this is a problem with the PHP implementation or
it's something a bug in libxslt.
But here's the deal.

(I use php5.0.0RC1 for testing on winXP)

This works:





And this doesn't:





Seems to me the < gets interpreted as an opening tag

Vincent

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



[PHP] Re: Wrong IP address

2004-04-02 Thread K.Bogac Bokeer
I'm using this one:

function FetchIP() {

 $client_ip   = $_SERVER['HTTP_CLIENT_IP'];
 $x_forwarded_for = $_SERVER['HTTP_X_FORWARDED_FOR'];
 $remote_addr = $_SERVER['REMOTE_ADDR'];
 if ( !empty ($client_ip) ) {
  $ip_expl = explode('.',$client_ip);
  $referer = explode('.',$remote_addr);
  if($referer[0] != $ip_expl[0]) {
   $ip=array_reverse($ip_expl);
   $return=implode('.',$ip);
  } else {
   $return = $client_ip;
  };
 } elseif ( !empty($x_forwarded_for) ) {
  if(strstr($x_forwarded_for,',')) {
   $ip_expl = explode(',',$x_forwarded_for);
   $return = end($ip_expl);
  } else {
   $return = $x_forwarded_for;
  };
 } else {
  $return = $remote_addr;
 };
 unset ($client_ip, $x_forwarded_for, $remote_addr, $ip_expl);
 return $return;
}
Ascll wrote:
Greetings,

I make use of these: -


to get the web IP address for my machine once my PC is connected to
Internet..
Anyway, sometime I get the correct IP address, but sometime NOT.

Does anyone know why?

Thanks in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Relative Url

2004-04-02 Thread Chris Thomas
What im trying to do is this.

I working on creating a poll script, and right now it consists of 3 main
files:
poll.php   - Which does the server-side processing
pollFunctions.php   - Which draws the poll and does some client side stuff
poll.css- stylesheet
These files reside in the /poll directory (for now)

pollFunctions.php is included in the file that wants the poll, which may
reside in any folder.
So what im trying to figure out is the relative url of where the
pollfunctions.php file resides.

--  Now that i think about it i could just include the stylesheet from the
calling file (ie index.php)

I probally should have thought of this a little more before i posted...oh
well

Chris

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> --- Chris Thomas <[EMAIL PROTECTED]> wrote:
> > Is there anyway that i can get a url relative to my server for a
> > script that is being run??
>
> $relative_url = '/';
>
> That's a relative URL to your document root. What are you wanting,
> exactly?
>
> Chris
>
> =
> Chris Shiflett - http://shiflett.org/
>
> PHP Security - O'Reilly
>  Coming Fall 2004
> HTTP Developer's Handbook - Sams
>  http://httphandbook.org/
> PHP Community Site
>  http://phpcommunity.org/


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



Re: [PHP] tiff to pdf conversion

2004-04-02 Thread Mark C

Once upon a time Jason Wong was quoted as saying:
> On Friday 02 April 2004 16:39, Brent Clark wrote:
>
>> anyone know of a quick way to convert a tiff file to a pdf format
>> file. I was thinking of a shell script.

you could give ImageMagick a try,
i.e

convert somefile.tif somefile.pdf

http://www.imagemagick.org/

Mark

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



[PHP] PHP + XSL-FO

2004-04-02 Thread Juan Torres
Hello,

can PHP parser a XML file with a XSL-FO file to generate a PDF file?

Greetings.

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



[PHP] Re: XSLT bug?

2004-04-02 Thread Juan Torres
Try this:



Good Luck.

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



RE: [PHP] Re: XSLT bug?

2004-04-02 Thread Vincent Jansen
That works, but shouldn't this behave the way I thought it should

-Original Message-
From: Juan Torres [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 2 april 2004 15:59
To: [EMAIL PROTECTED]
Subject: [PHP] Re: XSLT bug?


Try this:



Good Luck.

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

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



Re: [PHP] Relative Url

2004-04-02 Thread Red Wingate
Hi chris,

Haven't much time now but maybe you can find a way with those ideas:

in pollFunctions.php do :

$pollFunctions_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ );

in foo.php do :

$foo_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ );

Now you just have to compute the diff between $foo_path and 
$pollFunctions_path.

Hope this helps :-)

 -- red

Chris Thomas wrote:

What im trying to do is this.

I working on creating a poll script, and right now it consists of 3 main
files:
poll.php   - Which does the server-side processing
pollFunctions.php   - Which draws the poll and does some client side stuff
poll.css- stylesheet
These files reside in the /poll directory (for now)
pollFunctions.php is included in the file that wants the poll, which may
reside in any folder.
So what im trying to figure out is the relative url of where the
pollfunctions.php file resides.
--  Now that i think about it i could just include the stylesheet from the
calling file (ie index.php)
I probally should have thought of this a little more before i posted...oh
well
Chris

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
--- Chris Thomas <[EMAIL PROTECTED]> wrote:

Is there anyway that i can get a url relative to my server for a
script that is being run??
$relative_url = '/';

That's a relative URL to your document root. What are you wanting,
exactly?
Chris

=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/



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


Re: [PHP] Ncurses

2004-04-02 Thread Ray Hunter
On Fri, 2004-04-02 at 01:46, Brent Clark wrote:
> I was browsing the list of functions for PHP and I saw a whole range of 
> ncurses functions.
> I was wondering if anyone knows of a site that has any demos or examples and or 
> where it can be used

Used on *nix flavors and you need to compile ncurses into PHP. This will
allow you to do some cool things with shell scripting in php. Try
searching google for some tutorials.

--
Ray

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



Re: [PHP] PHP + XSL-FO

2004-04-02 Thread Ray Hunter
On Fri, 2004-04-02 at 06:57, Juan Torres wrote:
> can PHP parser a XML file with a XSL-FO file to generate a PDF file?

sure if you set it up properly!

/ray

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



[PHP] Re: session/mysql problems

2004-04-02 Thread Tom Dangler
>From php manual http://us3.php.net/variables.external
Note: Superglobal arrays, like $_POST and $_GET, became available in PHP 4.1.0 

>>> "Andy B" <[EMAIL PROTECTED]> 04/01/04 12:55PM >>>
hi
I created a login script and originally was using php4.3.3 to write the script with. 
Then I found out that it had to be rewritten for php4.0.4pl1. I think when rewriting 
it for the older version it got messed up somehow and cant quite spot the 
error/problem in it. can anybody help here??

the query runs right for some reason (i.e. connection works) and query when echoed on 
the screen is right but for some reason the query comes back NULL?? even though there 
are valid users in the usertable?? 
here is the whole login script code: i have the actuall lines commented out and 
echo/print_r lines in place for debugging reasons:
[code]



tnx...

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



Re: [PHP] Relative Url

2004-04-02 Thread Red Wingate
Ok found his one on some old libs of mine, guess this should work but i 
am not sure :



function find_relativ_path( $origin , $target ){
$append = '';
$string = '';
$origin = explode('/',$origin); 
$target = explode('/',$target);
unset($origin[(count($origin)-1)]);
unset($target[(count($target)-1)]);
for ( $i = 0 ; TRUE ; $i++ ){
if ( !isset($target[$i]) AND !isset($origin[$i]) )
break;
if ( strlen($string) == 0 AND $origin[$i] == $target[$i] ){;
continue;
}else if ( isset($target[$i]) AND $origin[$i] != $target[$i] ){
$append .= $target[$i].'/';
if ( isset($origin[$i]) ){
$string .= '../';
}
}else{
$string .= '../';
}
}
return $string.$append;
}
?>

Use this with $pollFunctions_path and $foo_path

Red Wingate wrote:

Hi chris,

Haven't much time now but maybe you can find a way with those ideas:

in pollFunctions.php do :

$pollFunctions_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ );

in foo.php do :

$foo_path = str_replace( basename ( _FILE_ ) , '' , _FILE_ );

Now you just have to compute the diff between $foo_path and 
$pollFunctions_path.

Hope this helps :-)

 -- red

Chris Thomas wrote:

What im trying to do is this.

I working on creating a poll script, and right now it consists of 3 main
files:
poll.php   - Which does the server-side processing
pollFunctions.php   - Which draws the poll and does some client side 
stuff
poll.css- stylesheet
These files reside in the /poll directory (for now)

pollFunctions.php is included in the file that wants the poll, which may
reside in any folder.
So what im trying to figure out is the relative url of where the
pollfunctions.php file resides.
--  Now that i think about it i could just include the stylesheet from 
the
calling file (ie index.php)

I probally should have thought of this a little more before i posted...oh
well
Chris

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
--- Chris Thomas <[EMAIL PROTECTED]> wrote:

Is there anyway that i can get a url relative to my server for a
script that is being run??


$relative_url = '/';

That's a relative URL to your document root. What are you wanting,
exactly?
Chris

=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/





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


[PHP] Re: session/mysql problems

2004-04-02 Thread Andy B
"Note: Superglobal arrays, like $_POST and $_GET, became available in PHP
4.1.0"

so i remembered... had to try and port it backwards to fit the $HTTP_POST
and $HTTP_SESSION vars but still didnt work... for some reason they arent
going from page to page but got something else worked out for now in any
case...

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



RE: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Brian Duke
Yes, in fact to be sure I copied free into my /var/www/html/swap directory
and used that path. It still says.

[EMAIL PROTECTED] swap]# php swap.php
sh: line 1: /usr/local/php/bin/free: No such file or directory

even though I explicitly said 

exec ("/var/www/html/swap/free -b", $data, $result);


-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 12:51 AM
To: 'Brian Duke'; 'Jay Blanchard'; 'William Lovaton';
[EMAIL PROTECTED]
Subject: RE: [PHP] I think this is a bug...cant use exec commands.

This may seem obvious, but did you try the FULL path to 'free'?
As in  exec("/usr/local/bin/free -b", $data, $result);

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



Re: [PHP] Re: session/mysql problems

2004-04-02 Thread Jason Wong
On Friday 02 April 2004 22:45, Andy B wrote:
> "Note: Superglobal arrays, like $_POST and $_GET, became available in PHP
> 4.1.0"
>
> so i remembered... had to try and port it backwards to fit the $HTTP_POST
> and $HTTP_SESSION vars but still didnt work... for some reason they arent
> going from page to page but got something else worked out for now in any
> case...

$HTTP_* aren't superglobals and are not available inside functions, so you 
have to adjust your code accordingly.

Also it would help to make good use of mysql_error() after *each* call to the 
mysql_*() functions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
What fools these mortals be.
-- Lucius Annaeus Seneca
*/

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



RE: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Brian Duke
Forgive the top-post.

I tried the php -I found php was looking for the php.ini in /var/www/conf.
I copied php.ini from /etc/ to /var/www/conf. Now the shell_exec works fine.

Thanks Jason. 

If I wanted to use exec() for this project in the future, is:

(shell_exec ("free -b")) = (exec("free -b", $data ,$result_code)) 

I tried using exec as 
exec("free -b", $data ,$result_code)); 
but I didn't get the $data I was expecting. Are my variables mixed up?

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



[PHP] ADOdb installation

2004-04-02 Thread Gabe
For those of you that are using ADOdb, hopefully you can help me out.  I'm
evaluating PHP on IIS and I was curious if I had to have a directory with
the ADOdb scripts for every virtual host?

For example, if I had three virtual hosts at three different IP's:

210.210.210.200
210.210.210.201
210.210.210.202

Would each virtual host need to have a directory with the ADOdb scripts?  Or
would it be possible to setup a virtual directory in each virtual host that
points to one folder that has the scripts?  It seems a little wasteful and
inefficient to have to copy the scripts for each virtual host.  Or does
someone know of a good way to do this?

Thanks!

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



[PHP] php email functionality

2004-04-02 Thread Shawn Beard
I just upgraded to PHP 4.3.5 and now my email functionality does not work.  I do have 
the SMTP setting in the php.ini set up and did restart Apache. We are running a 
Windows 2000 server and Apache 2.0.49.   Any ideas?


Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

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



Re: [PHP] ADOdb installation

2004-04-02 Thread Matt Matijevich
Would each virtual host need to have a directory with the ADOdb scripts?

No

Just put the adodb scripts in the include_path, or just have a
designdated place on your windows bow for adodb, then in you include
statement just use something like 

include('c:\adodb\adodb.php'); //not exactly sure what the include is
called

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



RE: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Jay Blanchard
[snip]
I tried the php -I found php was looking for the php.ini in
/var/www/conf.
I copied php.ini from /etc/ to /var/www/conf. Now the shell_exec works
fine.

(shell_exec ("free -b")) = (exec("free -b", $data ,$result_code)) 

I tried using exec as 
exec("free -b", $data ,$result_code)); 
but I didn't get the $data I was expecting. Are my variables mixed up?
[/snip]

So there WAS more than one copy of the php.ini! :)

Have you tried $data = exec("free -b"); ?

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



[PHP] Re: session/mysql problems

2004-04-02 Thread Andy B
"$HTTP_* aren't superglobals and are not available inside functions"

that i know of i didnt use them inside functions unless checking them with
if(!empty($HTTP_SESSION['username'])){. is illegal...? if that is so
then no wonder why it didnt work

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



Re: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Jason Wong
On Friday 02 April 2004 23:09, Brian Duke wrote:

> If I wanted to use exec() for this project in the future, is:
>
> (shell_exec ("free -b")) = (exec("free -b", $data ,$result_code))

They're different, see manual for details.

> I tried using exec as
> exec("free -b", $data ,$result_code));
> but I didn't get the $data I was expecting. Are my variables mixed up?

  exec("free -b", $data ,$result_code);
  print_r($data);

Array
(
[0] =>  total   used   free sharedbuffers 
cached
[1] => Mem: 256917504  2494013447516160  0   29487104   
80941056
[2] => -/+ buffers/cache:  138973184  117944320
[3] => Swap:271392768  150523904  120868864
)

Works fine for me.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
In the strict scientific sense we all feed on death -- even vegetarians.
-- Spock, "Wolf in the Fold", stardate 3615.4
*/

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



Re: [PHP] Re: session/mysql problems

2004-04-02 Thread Jason Wong
On Friday 02 April 2004 23:21, Andy B wrote:
> "$HTTP_* aren't superglobals and are not available inside functions"
>
> that i know of i didnt use them inside functions unless checking them with
> if(!empty($HTTP_SESSION['username'])){. is illegal...? if that is so
> then no wonder why it didnt work

The real reason is probably because it's $HTTP_SESSION_VARS.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Why is it that when you're driving and looking for an address, you turn down 
the volume on the radio? 
-- Why Why Why n42
*/

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



[PHP] [Stats] PHP Net List: March 2004

2004-04-02 Thread Bill Doerrfeld
--
Searchable archives for this list are available at

--
==
PHP Net List Stats
March, 2004
==
Note: Up/Down % as compared with February, 2004

Posts:   2840 (Up 7%)
Authors:  569 (Up 7%)
Threads:  796 (Up 8%)
Top 20 Contributors by Number of Posts
--
Richard Davey  145
Chris W. Parker 88
Chris Shiflett  65
John W. Holmes  63
Raditha Dissanayake 57
Jason Wong  55
Jay Blanchard   53
Andy B  49
Ben Ramsey  47
trlists 44
Ryan A  43
Justin Patrin   43
Tom Rogers  37
Marek Kilimajer 35
Jason Barnett   32
Alex Hogan  30
Brian V Bonini  27
Jason Davidson  25
Firman Wandayandi   25
Red Wingate 25
Top 20 Threads by Number of Posts
--
[PHP] Namespaces in PHP 26
[PHP] resubmitting $POST data to another script 21
[PHP] Get "nice"  variables from POST   21
[PHP] Simple: Whats wrong with this?20
[PHP]  ASP to PHP language problems 19
[PHP] SQL Injection check (mysql)   19
[PHP] UK Bank Holidays 217
[PHP] Thank you, Microsoft! Now I need an alternate login method17
[PHP] gd for windows not working15
[PHP] STrange Problem   15
[PHP] 
Top 20 Search Terms by Number of Requests
--
sort 2
country  2
date 2
last 2
41
progress 1
alphabetical 1
digit1
itext1
four 1
columns  1
digits   1
region   1
safari   1
format   1
stuffit  1
upload   1
.sit 1
--
-
Bill Doerrfeld[EMAIL PROTECTED]
Blue World Communications, Inc.   http://www.blueworld.com/
-
 Build and serve powerful data-driven Web sites
  with Lasso Studio and Lasso Professional.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Jason Wong
On Friday 02 April 2004 23:16, Jay Blanchard wrote:

> So there WAS more than one copy of the php.ini! :)

No, the php binary (ie not the webserver php module) was *expecting* its 
php.ini to be located at /var/www/conf. As it wasn't there, the existing copy 
at /etc/php.ini was copied over.

> Have you tried $data = exec("free -b"); ?

That will only give the *last* line of output, which I believe, is not what 
the OP wanted.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A wise man can see more from the bottom of a well than a fool can from a
mountain top.
*/

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



RE: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Brian Duke

> They're different, see manual for details.

The Manual is brilliant. 

>   exec("free -b", $data ,$result_code);
>   print_r($data);
> 
> Array
> (
> [0] =>  total   used   free sharedbuffers
> cached
> [1] => Mem: 256917504  2494013447516160  0   29487104
> 80941056
> [2] => -/+ buffers/cache:  138973184  117944320
> [3] => Swap:271392768  150523904  120868864
> )

But an example is worth 5000 pages of a manual. That's 2 I owe you Jason.
Thank you Sir.

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



RE: [PHP] php email functionality

2004-04-02 Thread Sam Masiello

What sorts of errors are you seeing in your log?

--Sam
 

-Original Message-
From: Shawn Beard [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 8:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php email functionality

I just upgraded to PHP 4.3.5 and now my email functionality does not
work.  I do have the SMTP setting in the php.ini set up and did restart
Apache. We are running a Windows 2000 server and Apache 2.0.49.   Any
ideas?


Shawn Beard
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

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

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



Re: [PHP] Re: parsing xml the right way

2004-04-02 Thread trlists
On 2 Apr 2004 Aidan Lister wrote:

> Wait until you have installed PHP5, then use the simplexml library.

I will shortly have the same questions about ways to parse XML, and I 
can't use PHP 5 -- it's a production environment and the PTB are not 
going to move to something that is that recently released.  ANy other 
suggestions?

--
Tom

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



RE: [PHP] php email functionality

2004-04-02 Thread Shawn Beard
There are no errors generated in the log.  It just flat out doesnt work anymore.

Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

>>> "Sam Masiello" <[EMAIL PROTECTED]> 04/02/04 10:14AM >>>

What sorts of errors are you seeing in your log?

--Sam
 

-Original Message-
From: Shawn Beard [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 8:11 AM
To: [EMAIL PROTECTED] 
Subject: [PHP] php email functionality

I just upgraded to PHP 4.3.5 and now my email functionality does not
work.  I do have the SMTP setting in the php.ini set up and did restart
Apache. We are running a Windows 2000 server and Apache 2.0.49.   Any
ideas?


Shawn Beard
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED] 
Office: 515-440-8581
Pager: 515-208-5907

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

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

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



Re: [PHP] php email functionality

2004-04-02 Thread Jason Wong
On Saturday 03 April 2004 00:30, Shawn Beard wrote:

> There are no errors generated in the log.  It just flat out doesnt work
> anymore.

Are the smtp settings in php.ini identical to the previous version?

Are you positive you have made no other changes to your setup whilst upgrading 
php?

If so, does downgrading back to the previous version work?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Stenderup's Law:
The sooner you fall behind, the more time you will have to catch up.
*/

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



Re: [PHP] Relative Url

2004-04-02 Thread Chris Shiflett
--- Chris Thomas <[EMAIL PROTECTED]> wrote:
> I working on creating a poll script, and right now it consists of 3
> main files:
> poll.php
> pollFunctions.php
> poll.css
> These files reside in the /poll directory (for now)

[snip]

> So what im trying to figure out is the relative url of where the
> pollfunctions.php file resides.

$url = '/poll/pollfunctions.php';

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] php email functionality

2004-04-02 Thread Shawn Beard
I havent tried downgrading yet but yes the SMTP settings in the php.ini are identical 
to what they were before.  I even tried deleting the php folder and starting from 
scratch rather than using the upgrade path.  Still the same problem.

Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

>>> Jason Wong <[EMAIL PROTECTED]> 04/02/04 10:35AM >>>
On Saturday 03 April 2004 00:30, Shawn Beard wrote:

> There are no errors generated in the log.  It just flat out doesnt work
> anymore.

Are the smtp settings in php.ini identical to the previous version?

Are you positive you have made no other changes to your setup whilst upgrading 
php?

If so, does downgrading back to the previous version work?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz 
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general 
--
/*
Stenderup's Law:
The sooner you fall behind, the more time you will have to catch up.
*/

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

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



[PHP] control panel--graphic question

2004-04-02 Thread Leonard B Burton
Greetings,

This is more of a graphic question

For a program I am writting I need to have a control panel to display anything that 
may be wrong.  I would like to use something like a stoplight so that it would be 
easily understood by a lay person.  Does anyone have any comments as to what they have 
used?  Also does anyone have a function/graphic that would be a stop light and 
changing the var would make it either show red, green, or yellow?

Thanks,

Leonard.

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



Re: [PHP] php email functionality

2004-04-02 Thread Shawn Beard
I just tried downgrading to version 4.3.4 and it still does not work.

Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

>>> Jason Wong <[EMAIL PROTECTED]> 04/02/04 10:35AM >>>
On Saturday 03 April 2004 00:30, Shawn Beard wrote:

> There are no errors generated in the log.  It just flat out doesnt work
> anymore.

Are the smtp settings in php.ini identical to the previous version?

Are you positive you have made no other changes to your setup whilst upgrading 
php?

If so, does downgrading back to the previous version work?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz 
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general 
--
/*
Stenderup's Law:
The sooner you fall behind, the more time you will have to catch up.
*/

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

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



RE: [PHP] control panel--graphic question

2004-04-02 Thread Jay Blanchard
[snip]
For a program I am writting I need to have a control panel to display
anything that may be wrong.  I would like to use something like a
stoplight so that it would be easily understood by a lay person.  Does
anyone have any comments as to what they have used?  Also does anyone
have a function/graphic that would be a stop light and changing the var
would make it either show red, green, or yellow?
[/snip]

you will need three graphics

if("good" == $condition){
   echo "\n";
} elseif("marginal" == $condition){
   echo "\n";
} elseif("bad" == $condition){
   echo "\n";
}

HTH!

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



[PHP] Apache version... 1.3.29 vs 2.0.

2004-04-02 Thread Frano ILICIC
Hello,

I just wonder what is the best apache version to run PHP 4.35?
Just wondering if there is an obvious choice? 

Thanks for any reply.


Have a nice day


 
Frano ILICIC
Transcribe>WORLD Limited
 
Mail  : [EMAIL PROTECTED] 
Web   : http://file-saveas.com

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



Re: [PHP] determining number of rows in a mysql table

2004-04-02 Thread Leung WC
-{ Rene Brehmer }- wrote:

Thought it looked fishy  hehe ...

My only problem is: Sometimes you actually need the data from that table 
later in the same script, so instead of doing another data pull, I have 
alot of cases where this is alot more useful (not actual code from any 
of my work, but I've used this structure in the past):

$query = mysql_query("SELECT $fields FROM $table WHERE $crit") or 
die('fetch error'.mysql_error());

if (mysql_num_rows($query) > 0) {
  $result = mysql_fecth_array($query);
  // and so on ...
}
Use this code instead:
if ($result = mysql_fetch_array($query))
{
// do something
}
BTW, pls remember that an array of nothing (array()) is FALSE when it is 
casted into boolean. The comparison '!== FALSE' is not necessary just 
because mysql_fetch_array does not return empty arrays.

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


Re: [PHP] Apache version... 1.3.29 vs 2.0.

2004-04-02 Thread Chris Shiflett
--- Frano ILICIC <[EMAIL PROTECTED]> wrote:
> I just wonder what is the best apache version to run PHP 4.35?
> Just wondering if there is an obvious choice? 

Maybe not obvious, but I think the best choice is the latest Apache 1.3.x.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] Zend Optimizer 2.5.1 + PHP5 RC1 + WinXP + Apache 2 not happy together?

2004-04-02 Thread Elisamuel Resto
I've installed Apache and PHP5 RC1 fine, added my needed modules fine, then
I installed Zend Optimizer 2.5.1 and it doesn't load? phpinfo() doesn't show
it as loaded. php.ini is in the correct place and PHP is reading it. php.ini
has the Zend Optimizer lines at the bottom as added by the installer.

What to do?

Regards,
Samuel

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



Re: [PHP] PHP charset encoding

2004-04-02 Thread Leung WC

if the page that the input form is on sets utf-8 as the content type,
then most (?) browsers will send utf-8. you can use a meta tag like:
  

utf-8 characters are 8 bit clean, so they can be stored and retrieved
in mysql 3.x ok, but proper utf-8 sorting etc. doesn't work. for many
purposes though it seems to be ok.
single characters in utf-8 encoding do look like multiple characters
as far as 8 bit text handling programs are concerned (so yes, 15 characters
in iso-8859-1 or ascii isn't the same length as 15 characters in utf-8).
fonts that support utf-8 are required for properly displaying utf-8,
and you have to specify utf-8 on the display page (either via a content-type
header or with content-type meta tag as above) to get the browser
to use the right fonts.
- rob
Always use Content-type header, because the meta is overrided by the 
ISO-8859-1 default in php.ini. Also, use *DOS* as the encoding in MySQL 
to work w/ UTF-8 characters.

Also, remove the default encoding in Apache server (if you're using one) 
because it also overrides meta tags in html files.

After the proper header is sent, it is the duty of the client (browser) 
to find relevant fonts. However, make sure you use the lang and xml:lang 
attribute in your html/xhtml to select your locale. (different locale 
use a different set of fonts)

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


Re: [PHP] Apache version... 1.3.29 vs 2.0.

2004-04-02 Thread Jason Giangrande
Frano ILICIC wrote:
Hello,

I just wonder what is the best apache version to run PHP 4.35?
Just wondering if there is an obvious choice? 
I'm running both 1.3.x and 2.0.x (both currently running PHP 4.3.4) and 
both seem to work equally well.  I would say that if the your server is 
running Linux  and you don't need any of the new fancy modules that can 
be used with Apache 2.0.x use 1.3.x.  If your server is running Windows 
you will probably want to run Apache 2.0.x since that is supposed to run 
much better under Windows than 1.3.x.

--
Jason Giangrande <[EMAIL PROTECTED]>
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Session help please?

2004-04-02 Thread Justin Patrin
Paul wrote:

Probably a stupid question.

I figured I could do something like $_SESSION['test'] = 5 and refer to $test
on other pages however I cannot. The reason I thought I could do this is
because I can do $_SESSION['test'] = $_POST['test'] and be able to refer to
just $test on other pages.
Is the correct way to do this to make sure that I have somewhere
session_register['test']
Thanks!
It is true that you should be able to use $test to access the session 
var in other pages, but only if you have register_globals on and you 
have called session_start().

$_SESSION['var'] = 1;
is the same as
$var = 1;
session_register('var');
However, it's never a good idea to rely on globals because:
  1) The variable could come from the session, POST, or GET and you 
don't know which one it comes from. Sure, you know the order of 
precedence (you can even set it yourself in the php.ini), but you still 
don't know which one was used.
  2) Within functions, you don't have direct access to global 
variables. You can use global $var; but that's *VERY* prone to errors. 
You can use $GLOBALS['var'] but that's nearly as much typing as 
$_SESSION['var'] and is far less reliable and secure.

My suggestion is to turn off register_globals (as many others will tell 
you) and use $_POST, $_GET, $_SESSION, and maybe even $_REQUEST.

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


[PHP] Re: parsing xml the right way

2004-04-02 Thread Justin Patrin
Merlin wrote:

Hi there,

I think I am parsing xml documents the wrong way.
There must be a better way to access the results laterone like objects.
For example I would like to search in a free form for a city name
inside an xml document and php should return the country name
and continent.
This is the xml structure:

Andorra
AD
Europe

Encamp
Escaldes-Engordany
Ordino
Soldeu


Has anybody a good hint for me?

Thanx in advance,

Merlin
I created this class a short while ago that parses all of your XML into 
an easily usable Associative array structure. It extends 
PEAR::XML_Parse, so you need that as well.

http://reversefold.com/~papercrane/XML_Parser_Assoc/Assoc.phps
http://pear.php.net/package/XML_Parser
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] I think this is a bug...cant use exec commands.

2004-04-02 Thread Brian Duke
Thank you all for your collective help. I was very frustrated. This list
helped me find the answer quickly and once again PHP is slowly all beginning
to make sense. The default values enable safe-mode and that is what Jason
was trying to get me to check. Thus when the php.ini wasn't where php
thought it was then the engine just used the default values.

 

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



[PHP] asigning an array of variables to $_SESSION

2004-04-02 Thread Andy B
hi...

i need to assign an array to $_SESSION. the reason for this is that i have a page that 
gets data from 2 different tables from the same mysql db all at the same time... there 
is guestbook (for the guestbook) and events (for the events section). i guess i would 
need to know 2 things:
1. can only 1 call to mysql_connect deal with 2 different table calls at the same time?
2. since "guestbook" and "events" have the same exact field names i need to have 
$guestbook array and $events array assigned to $_SESSION so they dont get mixed up. i 
have something like this to start with:
$query=mysql_query("select * from guestbook order by Number ASC")||die(mysql_error());
while($guestbook=mysql_fetch_array($query)){
//this is as far as i got so far
//how and where would i  assign $guestbook to 
//$_SESSION so i would have something like $_SESSION
//['guestbook']['Number']?  
}

tnx for the help (never had to deal with multi dim arrays yet)


[PHP] Re: asigning an array of variables to $_SESSION

2004-04-02 Thread Justin Patrin
Andy B wrote:

hi...

i need to assign an array to $_SESSION. the reason for this is that i have a page that 
gets data from 2 different tables from the same mysql db all at the same time... there 
is guestbook (for the guestbook) and events (for the events section). i guess i would 
need to know 2 things:
1. can only 1 call to mysql_connect deal with 2 different table calls at the same time?
Yes, just use different statement handles

2. since "guestbook" and "events" have the same exact field names i need to have $guestbook array and $events array assigned to $_SESSION so they dont get mixed up. i have something like this to start with:
$query=mysql_query("select * from guestbook order by Number ASC")||die(mysql_error());
while($guestbook=mysql_fetch_array($query)){
//this is as far as i got so far
//how and where would i  assign $guestbook to 
//$_SESSION so i would have something like $_SESSION
//['guestbook']['Number']?  
}

$arr = array(1, 2, 3, 4, 5);
$_SESSION['guesbook'] = $arr;
or

$_SESSION['guestbook']['Number'] = $value;

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


Re: [PHP] Re: XSLT bug?

2004-04-02 Thread Leung WC
No. '<' is always for the opening tag.
So you have to enter the entity < whenever you mean '<' in XML data.
Vincent Jansen wrote:

That works, but shouldn't this behave the way I thought it should

-Original Message-
From: Juan Torres [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 2 april 2004 15:59
To: [EMAIL PROTECTED]
Subject: [PHP] Re: XSLT bug?

Try this:



Good Luck.

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


[PHP] Re: PHP as module, also as suexec, in Apache?

2004-04-02 Thread James Butler
Running PHP Version 4.2.2

I would also like to run PHP both as an Apache module and in CGI mode.

My Red Hat 9 installation includes a nice Apache with PHP compiled in.

I would like to run the "ARSC" PHP/MySQL chat application (from
sourceforge.net) on this server. I could run it as-is, however the
authors recommend using its server sockets feature to cut down on
CPU/RAM useage. This requires that PHP be compiled as a CGI version
with --enable-sockets.

Can I add a PHP CGI installation to my system without its interfering
with the Apache module's performance?

The suggested PHP CGI compilation instruction for ARSC is:

./configure --prefix=/usr/local/php-cgi/4.2.3 \
--with-mysql=/your/mysql/sources \
--enable-sockets

followed by "make" and "make install", of course.

My guess is that this will NOT impact the Apache installation, as the
CGI version of PHP would need to be invoked by the application, which
is not the same as the server module that parses every file with an
extension identified in the .conf files. (In Red Hat 9/Apache 2.0,
that's the php.conf file included in httpd.conf. In earlier versions
of Apache it's right in httpd.conf itself.)

Maybe? Thanks!
James

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



[PHP] Re: asigning an array of variables to $_SESSION

2004-04-02 Thread Andy B
"$_SESSION['guesbook'] = $arr;"

is it safe to say that i can do this:
while($_SESSION['guestbook']=mysql_fetch_array($query)) to get the same
thing as $_SESSION[guestbook]=$R??

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



Re: [PHP] Flash MX

2004-04-02 Thread drisner
On Thu, 1 Apr 2004, Nadim Attari wrote:

> I have to send data to flash. Should i use the "urlencode()" or the
> "rawurlencode()" function to encode the data?

If you are going to be doing this a lot, you should take a look at AMFPHP,
Flash Remoting for PHP, at http://sourceforge.net/projects/amfphp/

This seems to be a fast, reliable way to send data back and forth between
your server and your Flash client.

-- 
David G. Risner
Software Engineer -- California State University, Los Angeles
http://www.risner.org/david/

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



[PHP] Re: asigning an array of variables to $_SESSION

2004-04-02 Thread Justin Patrin
Andy B wrote:

"$_SESSION['guesbook'] = $arr;"

is it safe to say that i can do this:
while($_SESSION['guestbook']=mysql_fetch_array($query)) to get the same
thing as $_SESSION[guestbook]=$R??
No, that will se $_SESSION['guestbook'] to one thing after another, not 
an array. I would suggest:

while($rec = mysql_fetch_array($query)) {
  $_SESSION['guestbook'][] = $rec;
  //do something else with $rec?
}
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP charset encoding

2004-04-02 Thread Ammar Ibrahim
Hello Nabil,
	Good to see you here :) I hope you solved the problem. anyway, i would 
like to make a comment about something:
The Charset is defined in many places,
If you are using HTML in the  Tag
Apache, PHP, Header(). you can use all these methods to specify the 
charset, what i suggest to use, is to get a network sniffer, or to get 
the "Live HTTP Headers" Plugin for firefox. Try to find out what is 
"EXACTLY being sent to the browser.

Wish you best of Luck ,
Ammar
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Passing variables from Flash to PHP

2004-04-02 Thread drisner
On Thu, 1 Apr 2004, Edward Tilley wrote:

> Hi - I am an IIS, PHP 4.3 new user running on Win2k server. I need to
> pass a variable ( $flash = 1 ) back out to my PHP script and can't find
> any examples of this working after 2 days of looking. I can't get a
> urldecode to work and I don't want a WDDX because I don't see pertinent
> WinOS examples on the .org website.
>
> Other methods I've tried included running a
> "getURL("change_flash_value.php") "  script in Flash - the PHP script
> didn't execute and the value of $flash didn't change in keeping.

It think you will want getURL("change_flash_value.php?flash=1") and then
grab the flash variable from the $_REQUEST array.

There is a great book called "Macromedia Flash MX Professional 2004 for
Server Geeks" by Nate Weiss (ISBN: 0735713820) that, while it doesn't have
PHP examples, does a great job of discussing Flash/server communication.

-- 
David G. Risner
Software Engineer -- California State University, Los Angeles
http://www.risner.org/david/

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



[PHP] php + mysql + japanese???

2004-04-02 Thread Luis Mirabal
hi! i have developed a web site in php using mysql 3.x and have to
implement it in japanese, it seems that i have to use unicode/UTF-8,
but i am having problems with mysql... anyone could help or anyone knows of any 
resource
that helps in doing this?

thanx in advance,
luis

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



[PHP] I can't view files uploaded with PHP

2004-04-02 Thread Linux Zero
Hi everybody!

I write some PHP scripts for a system's module that allows the user to upload a file 
from his computer to the host. It works fine in a server with Linux   Apache   MySQL   
PHP (LAMP) environment. I based on the examples of this page:

http://www.php.net/manual/en/features.file-upload.php

Las week we transfer the whole system to another server with the same environment, but 
now the uploaded files can't be viewed in the browser. That's because the file is 
uploaded with 640 permissions and can't be opened by the browser with a wwwrun user.

We check in the old server and find that these uploaded files with 644 permissions. I 
check the httpd.conf and php.ini files looking for something like a umask option, but 
I find nothing like that.

Can anyone tell me what can I do to solve this problem in the new server? We can't 
return to the old server anymore!

Thanks a lot for your help!


http://www.latinmail.com - La forma más cómoda de enviar y recibir tus e-mails
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Passing variables from Flash to PHP

2004-04-02 Thread Miles Thompson
At 10:44 AM 4/2/2004 -0800, [EMAIL PROTECTED] wrote:
On Thu, 1 Apr 2004, Edward Tilley wrote:

> Hi - I am an IIS, PHP 4.3 new user running on Win2k server. I need to
> pass a variable ( $flash = 1 ) back out to my PHP script and can't find
> any examples of this working after 2 days of looking. I can't get a
> urldecode to work and I don't want a WDDX because I don't see pertinent
> WinOS examples on the .org website.
>
> Other methods I've tried included running a
> "getURL("change_flash_value.php") "  script in Flash - the PHP script
> didn't execute and the value of $flash didn't change in keeping.
It think you will want getURL("change_flash_value.php?flash=1") and then
grab the flash variable from the $_REQUEST array.
There is a great book called "Macromedia Flash MX Professional 2004 for
Server Geeks" by Nate Weiss (ISBN: 0735713820) that, while it doesn't have
PHP examples, does a great job of discussing Flash/server communication.
--
David G. Risner
Software Engineer -- California State University, Los Angeles
http://www.risner.org/david/
Use SendandLoad as was done here to pass vars to a php login script:

varSender = new LoadVars();
varReceiver = new LoadVars();
varSender.first_name = first_txt.text;
varSender.last_name = last_txt.text;
varSender.password = pass_txt.text;
varSender.action = 'login';
varSender.sendAndLoad("http://"+ host + "user_logon.php", 
varReceiver, 'GET');

A copy of ActionScript for Flash MX, The Definitive Guide is really 
helpful. I don't know if Colin Moock has a MX2004 version out yet.

Hope this has been helpful - Miles 

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


[PHP] [solved] assigning array to $_SESSION

2004-04-02 Thread Andy B
figured out how to do the $_SESSION multi dim arry thing...



Re: [PHP] Zend Optimizer 2.5.1 + PHP5 RC1 + WinXP + Apache 2 not happy together?

2004-04-02 Thread William Lovaton
I don't think Zend Optimizer can work with PHP 5 by the moment.


El vie, 02-04-2004 a las 01:28, Elisamuel Resto escribió:
> I've installed Apache and PHP5 RC1 fine, added my needed modules fine, then
> I installed Zend Optimizer 2.5.1 and it doesn't load? phpinfo() doesn't show
> it as loaded. php.ini is in the correct place and PHP is reading it. php.ini
> has the Zend Optimizer lines at the bottom as added by the installer.
> 
> What to do?
> 
> Regards,
> Samuel

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



RE: [PHP] php + mysql + japanese???

2004-04-02 Thread Jay Blanchard
[snip]
hi! i have developed a web site in php using mysql 3.x and have to
implement it in japanese, it seems that i have to use unicode/UTF-8,
but i am having problems with mysql... anyone could help or anyone knows
of any resource
that helps in doing this?
[/snip]

If you are having problems with MySQL then perhaps a mailing list at
http://www.mysql.com can help.

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



[PHP] Problem sending with mail()

2004-04-02 Thread Matt MacLeod
Hi,

I'm stumped. I have a script to send a simple email using the mail() 
function in PHP.

For some reason I can only receive the email if I send it to my hotmail 
account. If I send to my regular email ([EMAIL PROTECTED]) I can't get 
it. I've also tried sending to other non-hotmail addresses with no 
luck.

any ideas?

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


[PHP] code design? modular?

2004-04-02 Thread Andy B
is it ok practice to put code like the code to put results from an mysql query into a 
combo box into an include file and then just include it wherever its needed? the code 
i can see would have to be used at least 5 times in the same page



RE: [PHP] Displaying a money datatype from mssql - Solution

2004-04-02 Thread Alex Hogan
Recap:
In the query I had;
SELECT totalamount

And it was returning;
Total Amount
5.41108926696E-309

I tried to modify the query to;
SELECT cast(totalamount as decimal(10,2)) as totalamount

And php gave me an error;
Undefined Index at line (x);

When I tried to use 'number_format($totalamount,2)' it returned;
Total Amount
0.00

Solution:
The solution was in the query;
SELECT cast(totalamount as numeric(10,2)) as totalamount

This returns the proper formatting;
Total Amount
123.50



alex hogan


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Passing variables from Flash to PHP

2004-04-02 Thread motorpsychkill
O'Reilly's "Flash Remoting" discusses php examples fairly well although not
all the source files are available on their website like they claim.

www.flash-remoting.com



> -Original Message-
> From: Miles Thompson [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 02, 2004 11:14 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Passing variables from Flash to PHP
>
>
> At 10:44 AM 4/2/2004 -0800, [EMAIL PROTECTED] wrote:
> >On Thu, 1 Apr 2004, Edward Tilley wrote:
> >
> > > Hi - I am an IIS, PHP 4.3 new user running on Win2k server. I need to
> > > pass a variable ( $flash = 1 ) back out to my PHP script and
> can't find
> > > any examples of this working after 2 days of looking. I can't get a
> > > urldecode to work and I don't want a WDDX because I don't see
> pertinent
> > > WinOS examples on the .org website.
> > >
> > > Other methods I've tried included running a
> > > "getURL("change_flash_value.php") "  script in Flash - the PHP script
> > > didn't execute and the value of $flash didn't change in keeping.
> >
> >It think you will want getURL("change_flash_value.php?flash=1") and then
> >grab the flash variable from the $_REQUEST array.
> >
> >There is a great book called "Macromedia Flash MX Professional 2004 for
> >Server Geeks" by Nate Weiss (ISBN: 0735713820) that, while it
> doesn't have
> >PHP examples, does a great job of discussing Flash/server communication.
> >
> >--
> >David G. Risner
> >Software Engineer -- California State University, Los Angeles
> >http://www.risner.org/david/
>
> Use SendandLoad as was done here to pass vars to a php login script:
>
>  varSender = new LoadVars();
>  varReceiver = new LoadVars();
>  varSender.first_name = first_txt.text;
>  varSender.last_name = last_txt.text;
>  varSender.password = pass_txt.text;
>  varSender.action = 'login';
>  varSender.sendAndLoad("http://"+ host +
> "user_logon.php",
> varReceiver, 'GET');
>
> A copy of ActionScript for Flash MX, The Definitive Guide is really
> helpful. I don't know if Colin Moock has a MX2004 version out yet.
>
> Hope this has been helpful - Miles
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] code design? modular?

2004-04-02 Thread Red Wingate
http://php.net/function

:-)

Andy B wrote:
is it ok practice to put code like the code to put results from an mysql query into a combo box into an include file and then just include it wherever its needed? the code i can see would have to be used at least 5 times in the same page


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


Re: [PHP] code design? modular?

2004-04-02 Thread Red Wingate
hmmm was wrong there ... it's

http://php.net/manual/en/functions.php

Red Wingate wrote:

http://php.net/function

:-)

Andy B wrote:

is it ok practice to put code like the code to put results from an 
mysql query into a combo box into an include file and then just 
include it wherever its needed? the code i can see would have to be 
used at least 5 times in the same page



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


[PHP] problem about php

2004-04-02 Thread Lu Wang
Dear Sir/Madam,

 These days I am studying php, however, there are always problems 
of configuration with php under windows 98. Could you tell me how to 
configurate it in detail.
 
 In perticurly,when I deal with some codes about domxml function, 
the browser always shows like this: Fatal error:  Call to 
undefined function:  domxml_open_mem() in 
c:\apache\htdocs\svg_dom_xml_php_bsp.php on line 76. What is wrong 
here?
 
 I also looked through the web site www.php.net.  But I was 
confused with so much information.Should I download GNOME XML library? Should 
domxml run only under linux, not windows?Should domxml run above 
the version php4.0.x?
 If possible under windows, how can I get the GNOME XML library and 
then how to install it? At last,how can I configurate php again after 
installing it?
 
 Do you know the software phptraid-2.2.1? After installing it, I 
can do nothing about the configuration? And, which version of php is in 
this phptraid? 
 
   Thanks for your reading my mail. 
 
Best regards,
 
Lu Wang



-
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today

Re: [PHP] Zend Optimizer 2.5.1 + PHP5 RC1 + WinXP + Apache 2 nothappy together?

2004-04-02 Thread Elisamuel Resto
Strange, it was working on a beta version...

I guess I'll just wait for a bit and see what's up...

"William Lovaton" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I don't think Zend Optimizer can work with PHP 5 by the moment.
>
>
> El vie, 02-04-2004 a las 01:28, Elisamuel Resto escribió:
> > I've installed Apache and PHP5 RC1 fine, added my needed modules fine,
then
> > I installed Zend Optimizer 2.5.1 and it doesn't load? phpinfo() doesn't
show
> > it as loaded. php.ini is in the correct place and PHP is reading it.
php.ini
> > has the Zend Optimizer lines at the bottom as added by the installer.
> >
> > What to do?
> >
> > Regards,
> > Samuel

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



RE: [PHP] Image output (Newb question)

2004-04-02 Thread Fidencio Monroy
Ok, this warning is generated and the same output

Warning: Cannot modify header information - headers already sent by (output
started at C:\Program Files\Apache Group\Apache\htdocs\map.php:9)

Thanks.

-Original Message-
From: Dave Avent [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 1:58 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Image output (Newb question)

Header ("Content-type: image/png");

$im = imagecreatefrompng("images/map.png");
imagepng($im);

ImageDestroy ($im);

-Original Message-
From: Fidencio Monroy [mailto:[EMAIL PROTECTED]
Sent: 02 April 2004 10:55 AM
To: (PHP General List)
Subject: [PHP] Image output (Newb question)


Hi, I need to display some PNG pictures in a script; from help I got

$im = imagecreatefrompng("images/map.png");
imagepng($im);

It outputs the binary data as a string, kind of trash; what do I need to set
to tell the browser how to interpret it?

 Thanks.


Fidencio Monroy.

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

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



[PHP] Re: Problem sending with mail()

2004-04-02 Thread Manuel Lemos
Hello,

On 04/02/2004 04:35 PM, Matt Macleod wrote:
I'm stumped. I have a script to send a simple email using the mail() 
function in PHP.

For some reason I can only receive the email if I send it to my hotmail 
account. If I send to my regular email ([EMAIL PROTECTED]) I can't get 
it. I've also tried sending to other non-hotmail addresses with no luck.

any ideas?
Without further information it is hard to help you.

Anyway, the PHP mail() function has problems in some circunstances.

You may want to try this class that provides workarounds to some of the 
mail function problems. It comes with a wrapper function named 
smtp_mail() that emulates the mail() function except that it always 
sends the message via STMP independently of your platform.

You can enable debugging to see the SMTP dialog and so you can have a 
clue if the message is reject or accepted by the SMTP server you are 
using. If you do not have SMTP server to relay the message, you can 
always try to use the class direct delivery mode.

http://www.phpclasses.org/mimemessage

You will also need this other class:

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Image output (Newb question)

2004-04-02 Thread Matt Matijevich
could you post all of your script?

Is there any white space before your http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php email functionality

2004-04-02 Thread Manuel Lemos
Hello,

On 04/02/2004 12:10 PM, Shawn Beard wrote:
I just upgraded to PHP 4.3.5 and now my email functionality does not
work.  I do have the SMTP setting in the php.ini set up and did
restart Apache. We are running a Windows 2000 server and Apache
2.0.49.   Any ideas?
It can be a problem with many things including something not to due with 
PHP.

Anyway, to figure if the problem is with PHP or not, you may want to try 
this class that comes with wrapper function named smtp_mail() that 
emulates the mail() function but sends the message directly to SMTP 
server of your choice:

http://www.phpclasses.org/mimemessage

You also need this to send messages via SMTP.

http://www.phpclasses.org/smtpclass



--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php email functionality

2004-04-02 Thread Shawn Beard
I figured it out.  I needed the send_mail_from in the php.ini set up with a valid 
email.  This is a requirement on a windows server.

Shawn Beard 
Web Administrator
Iowa Foundation for Medical Care
Information Systems
[EMAIL PROTECTED]
Office: 515-440-8581
Pager: 515-208-5907

>>> Manuel Lemos <[EMAIL PROTECTED]> 04/02/04 02:55PM >>>
Hello,

On 04/02/2004 12:10 PM, Shawn Beard wrote:
> I just upgraded to PHP 4.3.5 and now my email functionality does not
> work.  I do have the SMTP setting in the php.ini set up and did
> restart Apache. We are running a Windows 2000 server and Apache
> 2.0.49.   Any ideas?

It can be a problem with many things including something not to due with 
PHP.

Anyway, to figure if the problem is with PHP or not, you may want to try 
this class that comes with wrapper function named smtp_mail() that 
emulates the mail() function but sends the message directly to SMTP 
server of your choice:

http://www.phpclasses.org/mimemessage 

You also need this to send messages via SMTP.

http://www.phpclasses.org/smtpclass 



-- 

Regards,
Manuel Lemos

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

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/ 

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html 

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

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



RE: [PHP] Image output (Newb question)

2004-04-02 Thread Fidencio Monroy
This is the entire html doc

http://www.w3.org/TR/html4/loose.dtd";>


Untitled Document











-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 12:49 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Image output (Newb question)

could you post all of your script?

Is there any white space before your http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Displaying a money datatype from mssql - Solution

2004-04-02 Thread Frank M. Kromann
This is a bug in php 4.3.5 and it's fixed in the upcomming 4.3.6 release.

- Frank

> Recap:
> In the query I had;
> SELECT totalamount
> 
> And it was returning;
> Total Amount
> 5.41108926696E-309
> 
> I tried to modify the query to;
> SELECT cast(totalamount as decimal(10,2)) as totalamount
> 
> And php gave me an error;
> Undefined Index at line (x);
> 
> When I tried to use 'number_format($totalamount,2)' it returned;
> Total Amount
> 0.00
> 
> Solution:
> The solution was in the query;
> SELECT cast(totalamount as numeric(10,2)) as totalamount
> 
> This returns the proper formatting;
> Total Amount
> 123.50
> 
> 
> 
> alex hogan
> 
> 
> ** 
> The contents of this e-mail and any files transmitted with it are 
> confidential and intended solely for the use of the individual or 
> entity to whom it is addressed.  The views stated herein do not 
> necessarily represent the view of the company.  If you are not the 
> intended recipient of this e-mail you may not copy, forward, 
> disclose, or otherwise use it or any part of it in any form 
> whatsoever.  If you have received this e-mail in error please 
> e-mail the sender. 
> ** 
> 
> 
> 

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



Re: [PHP] control panel--graphic question

2004-04-02 Thread Don Read

On 02-Apr-2004 Leonard B Burton wrote:
> Greetings,
> 
> This is more of a graphic question
> 
> For a program I am writting I need to have a control panel to display
> anything that may be wrong.  I would like to use something like a
> stoplight so that it would be easily understood by a lay person. 
> Does anyone have any comments as to what they have used?  Also does
> anyone have a function/graphic that would be a stop light and
> changing the var would make it either show red, green, or yellow?
>
 
function stoplight($val) {

$light = array(
  'ok'=> 'images/green.jpg',
  'iffy'  => 'images/yellow.jpg',
  'bad'   => 'images/red.jpg'
);

echo '';
}

 ...

stoplight( $foo < 10 ? 'ok' : $foo > 25 ? 'bad' : 'iffy' );


Regards,
-- 
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] Strange Numeric Conversion...

2004-04-02 Thread Monty
Why is this happening???

$id = 11;
echo $id;   // Displays: 9

$id = 11;
echo $id;   // Displays: 11

How do I make the first number (00011) display as 11? Why is it showing 9?

Thanks.

Monty

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



[PHP] Why does session ID sometimes show appeneded to url and sometimes not?

2004-04-02 Thread BOOT
Thanks to those who helped with my last post on session vars.

My question now is why does my server seem to randomly choose whether or not
to show the session ID appended to the browser URL? Sometimes it is there,
sometimes not. All pages session_start();.

Thanks!

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



RE: [PHP] Image output (Newb question)

2004-04-02 Thread Matt Matijevich
change your script to just this:




Don't have any white space before http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Image output (Newb question)

2004-04-02 Thread Matt Matijevich

Sorry for responding to myself but I also need to ad that you should
not echo or print anything out in your php code before your header
function or the text/html header will be sent.

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



Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread John W. Holmes
From: "Monty" <[EMAIL PROTECTED]>

> $id = 11;
> echo $id;   // Displays: 9
>
> $id = 11;
> echo $id;   // Displays: 11
>
> How do I make the first number (00011) display as 11? Why is it showing 9?

Number values starting with a leading zero are assumed to be octal values.

Octal 11 = Decimal 9

---John Holmes...

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



RE: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Jay Blanchard
[snip]
Why is this happening???

$id = 11;
echo $id;   // Displays: 9

$id = 11;
echo $id;   // Displays: 11

How do I make the first number (00011) display as 11? Why is it showing
9?
[/snip]

First of all you have "naked" numbers. The first one, 11, looks like
a binary number (which actually should be 3). You are going to have to
trim the leading zero's from the number to have it display as 11.

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



RE: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Jay Blanchard
[snip]
"naked"
[/snip]

Dang John, I guess I don't think octally any more!

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



Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Daniel Clark
Wow, thanks John !

> Number values starting with a leading zero are assumed to be octal values.
>
> Octal 11 = Decimal 9
>
> ---John Holmes...

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



RE: [PHP] Image output (Newb question)

2004-04-02 Thread Fidencio Monroy
Np, but I do not understand: Do should I remove all the html tags before the
script?

(I used your format in last script with the same result)

Thanks


-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 1:35 PM
To: Matt Matijevich; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Image output (Newb question)


Sorry for responding to myself but I also need to ad that you should
not echo or print anything out in your php code before your header
function or the text/html header will be sent.

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



[PHP] Global $_FILEs

2004-04-02 Thread Bruno Santos
Hello all.

I'm developing a script that requires the user to upload 2 files.

i want to put all the lines that takes care of the uploading of the file 
in a function.

i've tried to pass the global array $_FILES to a function, but still no 
sucess...

can someone help me ??

regards

Bruno

--
-
   .-'-.
 .' `.
: :
   :   :
   :  _/|  :   Bruno Santos
:   =/_/  : [EMAIL PROTECTED]
 `._/ | .'
  (   /  ,|...-'Pagina Pessoal
   \_/^\/||__   http://feiticeir0.no-ip.org
_/~  `""~`"` \_
 __/  -'/  `-._ `\_\__
   /jgs  /-'`  `\   \  \-.\
   "Written very small on the back poket of a girl's jeans
   - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Strange Numeric Conversion...

2004-04-02 Thread Monty
I tried removing the zeros, but, I get the same result:

$id = 11;
$id = ltrim($id, '0');
echo $id;   // Displays: 9 instead of 11 ???

This didn't work either:

$id = 11;
settype($id, 'string');
$id = ltrim($id, '0');
echo $id;   // Displays: 9 instead of 11 ???

No matter what I do, $id=11 is seen as "9". Only way is to pass the
number without the zeros ($id=11), but, because this data is being read from
a database, I can't change the format because PHP seems to be converting it
immediately to a 9 instead of reading it as 11 or even 11.

If PHP sees this as an octal, then why does gettype(11) = INTEGER? This
makes no sense.

Monty.

> From: [EMAIL PROTECTED] (Jay Blanchard)
> Newsgroups: php.general
> Date: Fri, 2 Apr 2004 15:38:03 -0600
> To: "Monty" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Strange Numeric Conversion...
> 
> [snip]
> Why is this happening???
> 
> $id = 11;
> echo $id;   // Displays: 9
> 
> $id = 11;
> echo $id;   // Displays: 11
> 
> How do I make the first number (00011) display as 11? Why is it showing
> 9?
> [/snip]
> 
> First of all you have "naked" numbers. The first one, 11, looks like
> a binary number (which actually should be 3). You are going to have to
> trim the leading zero's from the number to have it display as 11.

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



Re: [PHP] Image output (Newb question)

2004-04-02 Thread Red Wingate
use the output-buffer functions ( ob_start() ... etc.. )
but if you want to display an image you need to only display a image by 
your image or save it to a file and view it using the html  tag.

Fidencio Monroy wrote:

Np, but I do not understand: Do should I remove all the html tags before the
script?
(I used your format in last script with the same result)

Thanks

-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 02, 2004 1:35 PM
To: Matt Matijevich; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Image output (Newb question)

Sorry for responding to myself but I also need to ad that you should
not echo or print anything out in your php code before your header
function or the text/html header will be sent.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Global $_FILEs

2004-04-02 Thread Red Wingate
give us some more info how do you 'pass' the array to your function, 
remeber $_FILES is a super-global array in is available in the functions 
scoope as well.

 -- red

Bruno Santos wrote:

Hello all.

I'm developing a script that requires the user to upload 2 files.

i want to put all the lines that takes care of the uploading of the file 
in a function.

i've tried to pass the global array $_FILES to a function, but still no 
sucess...

can someone help me ??

regards

Bruno


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


  1   2   >