Re: [PHP] ADSI PHP

2003-10-26 Thread Pc Technics, Inc.
 Hello Evan,

I imagined that the PHP LDAP functions would work, however, this would
only work on LDAP compliant directory servers, such as Microsoft and Novell.
This would not work however for a local NT machine which is not joined to a
domain. ADSI has a 'WinNT:// provider for this, where as the 'LDAP://;
provider is meant for the domain (directory) environment.

  To make a long story short, the PHP LDAP library is not really ADSI  PHP,
but rather an LDAP library which works with LDAP compliant directory
servers. I was looking for a way to use ADSI with PHP.

  I appreciate your response, Evan.

- Jeremy
  Pc Technics, Inc.
  www.pc-technics.com
  100% FREE Internet Hosting!




Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Okay I'm no expert for windows- I had to look up ADSI and found

http://www.microsoft.com/windows2000/techinfo/howitworks/activedirectory/adsilinks.asp
 which mentions LDAP.  Take a look at php.net/ldap and see if it does what
you
 need.



 On Saturday 25 October 2003 09:24 am, Pc Technics, Inc. wrote:
  Anyone know if its possible to use ADSI with PHP? I can not seem to find
  any good articles which explain how to convert ASP to PHP using the COM
  properties of PHP. I would really like to write this in PHP, rather than
  ASP.
 
  Thanks in advance 
 
  - Jeremy
   Pc Technics, Inc.
   www.pc-technics.com
   100% FREE Internet Hosting!

 -- 
 Evan Nemerson
 [EMAIL PROTECTED]

 --
 ...the whole idea of revenge and punishment is a childish daydream.
Properly
 speaking, there is no such thing as revenge. Revenge is an act which you
want
 to commit when you are powerless and because you are powerless: as soon as
 the sense of impotence is removed, the desire evaporates also. 

 -George Orwell

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



[PHP] Session problem

2003-10-26 Thread Manisha Sathe
I am trying to use session but it seems it does not work on win2k server,
the same runs on linux.

following is my first php
---
?
session_start();
$_SESSION[name]= Manisha;
?
--
following is the second php

?
session_start();
echo $_SESSION[name];
?

-

but it is always giving me following error msg

Notice: Undefined index: name in C:\Project Codes\www\testPHP\second.php on
line 6



The same thing works well on live Linux server. I checked php.ini options
such as session enable / register global etc - both r same. Please help  me.
Is it a problem with win2k server or did i miss out any thing in php.ini ?

Regards
Manisha

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



Re: [PHP] Session problem

2003-10-26 Thread Evan Nemerson
Your Linux server probably has error_reporting set to 0, which is usually a 
good idea for production environments. To supress the error messages without 
modifying your php.ini, do error_reporting(0). Take a look in your php.ini 
file- the error_reporting directive will have lots of comments around it 
explaining the concept thoroughly.


On Sunday 26 October 2003 01:06 am, Manisha Sathe wrote:
 I am trying to use session but it seems it does not work on win2k server,
 the same runs on linux.

 following is my first php
 ---
 ?
 session_start();
 $_SESSION[name]= Manisha;
 ?
 --
 following is the second php

 ?
 session_start();
 echo $_SESSION[name];
 ?

 -

 but it is always giving me following error msg

 Notice: Undefined index: name in C:\Project Codes\www\testPHP\second.php on
 line 6

 

 The same thing works well on live Linux server. I checked php.ini options
 such as session enable / register global etc - both r same. Please help 
 me. Is it a problem with win2k server or did i miss out any thing in
 php.ini ?

 Regards
 Manisha

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
The people are the only sure reliance for preservation of our liberty.

-Thomas Jefferson

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



Re: [PHP] Session problem

2003-10-26 Thread Manisha Sathe
It works well on linux means it shows me o/p as 'Manisha' but on local
Win2kserver, it gives error.

I tried to make use of error_reporting(0); in second.php but then screen
becomes blank, it does not show me the output as Manisha

manisha



Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Your Linux server probably has error_reporting set to 0, which is usually
a
 good idea for production environments. To supress the error messages
without
 modifying your php.ini, do error_reporting(0). Take a look in your php.ini
 file- the error_reporting directive will have lots of comments around it
 explaining the concept thoroughly.


 On Sunday 26 October 2003 01:06 am, Manisha Sathe wrote:
  I am trying to use session but it seems it does not work on win2k
server,
  the same runs on linux.
 
  following is my first php
  ---
  ?
  session_start();
  $_SESSION[name]= Manisha;
  ?
  --
  following is the second php
 
  ?
  session_start();
  echo $_SESSION[name];
  ?
 
  -
 
  but it is always giving me following error msg
 
  Notice: Undefined index: name in C:\Project Codes\www\testPHP\second.php
on
  line 6
 
  
 
  The same thing works well on live Linux server. I checked php.ini
options
  such as session enable / register global etc - both r same. Please help
  me. Is it a problem with win2k server or did i miss out any thing in
  php.ini ?
 
  Regards
  Manisha

 --
 Evan Nemerson
 [EMAIL PROTECTED]

 --
 The people are the only sure reliance for preservation of our liberty.

 -Thomas Jefferson

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



[PHP] help with mail() using smtp-auth

2003-10-26 Thread Trell
Hello, first time on the list, and I'm trying to learn PHP.

Here is my setup, 2 servers, 1 is the MTA and 1 is the Web Server.
The MTA is a qmail server with smtp-auth that needs to have a user
name and password supplied to it to accept the mail for delivery.

How do I tell php to send the a username/password in the mail()
function so that it will deliver the emails?

Thanks for your help.

Trell

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



Re: [PHP] help with mail() using smtp-auth

2003-10-26 Thread Marek Kilimajer
mail function cannot do stmp-auth, but there are classes that can, check 
out www.phpclasses.org/mimemessage

Trell wrote:
Hello, first time on the list, and I'm trying to learn PHP.

Here is my setup, 2 servers, 1 is the MTA and 1 is the Web Server.
The MTA is a qmail server with smtp-auth that needs to have a user
name and password supplied to it to accept the mail for delivery.
How do I tell php to send the a username/password in the mail()
function so that it will deliver the emails?
Thanks for your help.

Trell

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


Re: [PHP] Session problem

2003-10-26 Thread Manisha Sathe
Hi,

do u mean to say put this codes in php ?
I tried to put it in second.php following is the msg -
--
string(5) EGPCS bool(false)
Notice: Undefined variable: _SESSION in C:\Project
Codes\Vanderveer\www\testPHP\second.php on line 4
NULL
Warning: session_start(): Cannot send session cookie - headers already sent
by (output started at C:\Project Codes\Vanderveer\www\testPHP\second.php:2)
in C:\Project Codes\Vanderveer\www\testPHP\second.php on line 7

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at C:\Project
Codes\Vanderveer\www\testPHP\second.php:2) in C:\Project
Codes\Vanderveer\www\testPHP\second.php on line 7

Notice: Undefined index: name in C:\Project
Codes\Vanderveer\www\testPHP\second.php on line 10
-

I am not that expert in PHP, what all above means ? can u give me a hint
now, what is going wrong ?

regards
manisha

Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 var_dump(ini_get('variables_order'));
 var_dump(isset($_SESSION));
 var_dump($_SESSION);

 ?


 On Sunday 26 October 2003 01:43 am, Manisha Sathe wrote:
  It works well on linux means it shows me o/p as 'Manisha' but on local
  Win2kserver, it gives error.
 
  I tried to make use of error_reporting(0); in second.php but then screen
  becomes blank, it does not show me the output as Manisha
 
  manisha
 
 
 
  Evan Nemerson [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
   Your Linux server probably has error_reporting set to 0, which is
usually
 
  a
 
   good idea for production environments. To supress the error messages
 
  without
 
   modifying your php.ini, do error_reporting(0). Take a look in your
   php.ini file- the error_reporting directive will have lots of comments
   around it explaining the concept thoroughly.
  
   On Sunday 26 October 2003 01:06 am, Manisha Sathe wrote:
I am trying to use session but it seems it does not work on win2k
 
  server,
 
the same runs on linux.
   
following is my first php
---
?
session_start();
$_SESSION[name]= Manisha;
?
--
following is the second php
   
?
session_start();
echo $_SESSION[name];
?
   
-
   
but it is always giving me following error msg
   
Notice: Undefined index: name in C:\Project
Codes\www\testPHP\second.php
 
  on
 
line 6
   

   
The same thing works well on live Linux server. I checked php.ini
 
  options
 
such as session enable / register global etc - both r same. Please
help
me. Is it a problem with win2k server or did i miss out any thing in
php.ini ?
   
Regards
Manisha
  
   --
   Evan Nemerson
   [EMAIL PROTECTED]
  
   --
   The people are the only sure reliance for preservation of our
liberty.
  
   -Thomas Jefferson

 --
 Evan Nemerson
 [EMAIL PROTECTED]

 --
 A popular government, without popular information, or the means of
acquiring
 it, is but a Prologue to a Farce or a Tragedy - or perhaps both. Knowledge
 will forever govern ignorance, and a people who mean to be their own
 Governors must arm themselves with the power which knowledge gives.

 -James Madison

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



Re: [PHP] output

2003-10-26 Thread Shmuel
David Otton wrote:
On Sat, 25 Oct 2003 11:52:53 +0300, you wrote:


I'm getting output from program I run (exec) to the web page.
How can I avoid this ?


Did you even look at the manual?

http://uk.php.net/manual/en/ref.exec.php

escapeshellarg -- escape a string to be used as a shell argument
escapeshellcmd -- escape shell metacharacters
exec -- Execute an external program
passthru --  Execute an external program and display raw output 
proc_close --  Close a process opened by proc_open() and return the exit
code of that process. 
proc_get_status --  Get information about a process opened by proc_open() 
proc_nice --  Change the priority of the current process 
proc_open --  Execute a command and open file pointers for input/output 
proc_terminate --  kills a process opened by proc_open 
shell_exec --  Execute command via shell and return complete output as
string 
system -- Execute an external program and display output


These I've tried:

	error_reporting  =  E_ERROR

and even this:  
error_reporting  =  ~E_ALL
	display_errors = Off


Error reporting has nothing to do with it.


I was thinking it my self too that it is not exactly error
reporting. The problem was that I used passthru instead of exec.
Thanks.

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


Re: [PHP] Trying to organise an array

2003-10-26 Thread Burhan Khalid
David Otton wrote:

On Sat, 25 Oct 2003 08:55:15 -0700, you wrote:


my god man, do you know what indenting is?


Uhm... it's that thing I did with 4-space tabs, all the way down.
Allman-style, not KR, for what it's worth.

that confused the heck out of me.


Mailer problem?

Thisparagraph   has two
 tabsbetween
eachword.   Can you see them?

Saw those tabs.

no tabs in code

Mozilla Mail on Windows XP

fwiw

Please don't top-post.
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Post form variables to a frame

2003-10-26 Thread Burhan Khalid
Luis Lebron wrote:

Here is the frameset:

frameset rows=80,*,30 cols=* frameborder=NO border=0
framespacing=0
  frame src=header.php name=topFrame scrolling=NO noresize 
  frameset rows=* cols=250,* framespacing=0 frameborder=NO
border=0
frame src=browse.php name=leftFrame scrolling=AUTO noresize
frame src=info.php name=mainFrame
  /frameset
frame src=footer.php name=bottonFrame scrolling=NO noresize 
/frameset
and here is the form:

form action=frame.php method=POST target=leftFrame
select name=category
option value=1 label=11/option
option value=2 label=22/option
option value=3 label=33/option
option value=4 label=44/option
/select
input type=submit /
and here is the relevant lines of browse.php

$category=$_POST[category];
$query=Select username, age, height, eyeColor, haircolor, build, id from
users where category='$category';
Well your form is sending its data to frame.php -- but you are looking 
for it in browse.php

if you change name=category to name=category[] then you'll get your 
results in an array with $category[0] holding the value of the selected 
index.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Session problem

2003-10-26 Thread dark
Hi,

session_start has to be the first command this time.  try again and the result will 
look better, maybe explaining.
so it should look like:

?
session_start();
var_dump(ini_get('variables_order'));
var_dump(isset($_SESSION));
var_dump($_SESSION);
?

angel

On Sun, 26 Oct 2003 17:47:38 +0800
Manisha Sathe [EMAIL PROTECTED] wrote:

 Hi,
 
 do u mean to say put this codes in php ?
 I tried to put it in second.php following is the msg -
 --
 string(5) EGPCS bool(false)
 Notice: Undefined variable: _SESSION in C:\Project
 Codes\Vanderveer\www\testPHP\second.php on line 4
 NULL
 Warning: session_start(): Cannot send session cookie - headers already sent
 by (output started at C:\Project Codes\Vanderveer\www\testPHP\second.php:2)
 in C:\Project Codes\Vanderveer\www\testPHP\second.php on line 7
 
 Warning: session_start(): Cannot send session cache limiter - headers
 already sent (output started at C:\Project
 Codes\Vanderveer\www\testPHP\second.php:2) in C:\Project
 Codes\Vanderveer\www\testPHP\second.php on line 7
 
 Notice: Undefined index: name in C:\Project
 Codes\Vanderveer\www\testPHP\second.php on line 10
 -
 
 I am not that expert in PHP, what all above means ? can u give me a hint
 now, what is going wrong ?
 
 regards
 manisha
 
 Evan Nemerson [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  var_dump(ini_get('variables_order'));
  var_dump(isset($_SESSION));
  var_dump($_SESSION);
 
  ?
 
 
  On Sunday 26 October 2003 01:43 am, Manisha Sathe wrote:
   It works well on linux means it shows me o/p as 'Manisha' but on local
   Win2kserver, it gives error.
  
   I tried to make use of error_reporting(0); in second.php but then screen
   becomes blank, it does not show me the output as Manisha
  
   manisha
  
  
  
   Evan Nemerson [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
  
Your Linux server probably has error_reporting set to 0, which is
 usually
  
   a
  
good idea for production environments. To supress the error messages
  
   without
  
modifying your php.ini, do error_reporting(0). Take a look in your
php.ini file- the error_reporting directive will have lots of comments
around it explaining the concept thoroughly.
   
On Sunday 26 October 2003 01:06 am, Manisha Sathe wrote:
 I am trying to use session but it seems it does not work on win2k
  
   server,
  
 the same runs on linux.

 following is my first php
 ---
 ?
 session_start();
 $_SESSION[name]= Manisha;
 ?
 --
 following is the second php

 ?
 session_start();
 echo $_SESSION[name];
 ?

 -

 but it is always giving me following error msg

 Notice: Undefined index: name in C:\Project
 Codes\www\testPHP\second.php
  
   on
  
 line 6

 

 The same thing works well on live Linux server. I checked php.ini
  
   options
  
 such as session enable / register global etc - both r same. Please
 help
 me. Is it a problem with win2k server or did i miss out any thing in
 php.ini ?

 Regards
 Manisha
   
--
Evan Nemerson
[EMAIL PROTECTED]
   
--
The people are the only sure reliance for preservation of our
 liberty.
   
-Thomas Jefferson
 
  --
  Evan Nemerson
  [EMAIL PROTECTED]
 
  --
  A popular government, without popular information, or the means of
 acquiring
  it, is but a Prologue to a Farce or a Tragedy - or perhaps both. Knowledge
  will forever govern ignorance, and a people who mean to be their own
  Governors must arm themselves with the power which knowledge gives.
 
  -James Madison
 
 -- 
 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] w3c-compliant form-action parameters

2003-10-26 Thread Timo Boettcher
Hi Chris,

Nachricht vom Samstag, 25. Oktober 2003, 19:06:10:

 --- Timo Boettcher [EMAIL PROTECTED] wrote:
  http://shiflett.org/dev/php-general/ampersand.php

 can you put the source of that online, too?

 You can view the source in your browser to see the HTML, which is
 the relevant part.
I know that, but I wanted to see if you PHP-source gets the same
results on my server (testing if my server is misconfigured)
 If you see the HTML entity for an ampersand in your browser's
 location bar after submitting the form, then your browser has a bug.
 If you only see a plain ampersand, your browser is fine, and your
 code has a bug.
I guess its the latter... *g*

 I get the same result as you do.
 BUT: that page doesn't validate *g*

 Look again. Mine is not a full page, obviously, in order to focus
 your attention to the relevant markup.
Having the php-source of that part would make it easier to build a
full page out of it, to put it through the W3C Validator.
 What is there is XHTML-compliant.
 I'm not sure what validate means to you, but your earlier
 complaint about an ampersand not validating leads me to believe you
 were validating against XHTML transitional or strict. 
 You can let us know which, if you want, but it is irrelevant to your
 immediate problem.
That was in the post you ansered with this one.
I am trying to get
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
HEAD
  META http-equiv=Content-Type content=text/html; charset=ISO-8859-1

 I am trying to not let you distract yourself; this is what makes
 solving problems more difficult for many people.
I am trying to get that page to work AND validate as in the W3C HTML
Validator. I was able to get both, but not at the same time, so that
is one problem, and splitting it in two doesn't help me to solve it.


 Chris




 Timo

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



Re: [PHP] sockets - fine tunning

2003-10-26 Thread Raditha Dissanayake
are you getting any 1xx status codes from the web server?

Cosmin wrote:

I'm trying to make an application using XML-RPC, and I have the
following problem: I use fsockopen() to simulate a POST to my local
web-server. All goes very well except it's very very slow. Here is my
code maybe someone could tell me what I'm doing wrong:
=
$url= parse_url($this-serverURL);
$requestString= POST .$url['path']. HTTP/1.1\r\nHost:
.$url['host'].\r\nContent-type:
application/x-www.form-urlencoded\r\nContent-length:
.strlen($this-requestData).\r\n\r\n.$this-requestData;;
$fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5);
if ($fp)
{
//make the request to the xml-rpc server
fputs($fp, $requestString);
//gets the result
while (!feof($fp))
{
$response .= fgets($fp, 1024);
}
fclose($fp);
$this-rawResponse=$response;
$this-error=false;
}
else
{
$this-error=true;
$this-errorMessage=$err_msg;
}

This is the slowest part of my script(about 16 seconds). The server's
execution time is only 0.00064206123352051 seconds. I don't know why it
takes so much to write a string to the socket and then to read the
response. Here are the execution times:
Server StartServer Stop
1067090777.5339 1067090777.5346

Client StartClient Stop
1067090777.5303 1067090794.5286
If someone knows a way on how to speed this up please tell me how to do
it.
Thank you for your time

 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] CURL remote server get data back

2003-10-26 Thread Raditha Dissanayake
What kind of server?

Dan McCullough wrote:

I have an install script that verifies someones registration key and
information against my client database and installs or patches, or whatever
else.  I'm new with CURL but is there away to get back a response from the
server that your are querying back through CURL?
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] CURL remote server get data back

2003-10-26 Thread Dan McCullough
Linux box to Linux box.  Running PHP 4.1+  The script its connecting to
would reside on one of my servers.

-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 8:32 AM
To: Dan McCullough
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] CURL remote server get data back


What kind of server?

Dan McCullough wrote:

I have an install script that verifies someones registration key and
information against my client database and installs or patches, or whatever
else.  I'm new with CURL but is there away to get back a response from the
server that your are querying back through CURL?





--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.

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



Re: [PHP] CURL remote server get data back

2003-10-26 Thread Raditha Dissanayake
What i meant was
Web , ftp, ssh, telnet, jabber, imap, pop, smtp etc or proprietory? :-)
if you are talking about a web server, there were two threads on POST to 
a web serving using PHP this week. You might find them usefull. You 
might be interested to know that fopen can also work with urls



Dan McCullough wrote:

Linux box to Linux box.  Running PHP 4.1+  The script its connecting to
would reside on one of my servers.
-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 8:32 AM
To: Dan McCullough
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] CURL remote server get data back
What kind of server?

Dan McCullough wrote:

 

I have an install script that verifies someones registration key and
information against my client database and installs or patches, or whatever
else.  I'm new with CURL but is there away to get back a response from the
server that your are querying back through CURL?
   



--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Get image file size

2003-10-26 Thread Awlad Hussain
How can I get the file size of an image in KB, I know how to get the width
and height of an image using the getimagesize(); but not sure how to get the
image file size.

Many thanks in advance.

awlad

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



Re: [PHP] Get image file size

2003-10-26 Thread David Otton
On Sun, 26 Oct 2003 14:01:36 -, you wrote:

How can I get the file size of an image in KB, I know how to get the width
and height of an image using the getimagesize(); but not sure how to get the
image file size.

http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=php+filesize
http://www.php.net/stat

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



Re: [PHP] Importing data into MySql via PHP

2003-10-26 Thread John Nichel
Mark Roberts wrote:
snip
I have a client that maintains a MySql database on a webserver. They want to
import data into the database by uploading a Excel spreadsheet (most likely
saved in a .csv format). I want to import the data directly into the data
table via a php script. It appears that I should be using a LOAD DATA INFILE
command or a MYSQLIMPORT command.
From reading documentation, it would appear the the LOAD DATA INFILE is the
way I would have to go as MYSQLIMPORT appears to be a command line only
command.
I could use some pointers from someone who has used this beforesuch
as...
1. What is the default file format expected? (.csv?)
Doesn't really matter, as long as it's text/plain, and you know what the 
deliminter is (.csv usually is comma).  It's been a long time since I 
used Excel, but I think you can specify the deliminter when exporting, 
and if that is still the case, I would go with a pipe (|).  Commas are 
far to common in data to be used as a seperator IMHO.

2. Any quarks I would need to know about?
Not to my knowledge.

3. Etc...
No need to reinvent the wheel, check places like 
www.phpresourceindex.com to see if they already have a function / class 
to do what you need done.

Webmaster Services $29.50/mo
Do I get a cut of this? :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Runtime Optimization of a Parser

2003-10-26 Thread Dennis Krner
Hi,

I got a small question concerning a parser I'm working on.

While the parser goes through the text it hits different tokens, which are
the processed by functions.

There are global settings which set if a function should be called or not.
(For example one time I do not want to edit token A, the other time I only
want to edit token A).

I thought that it would be cool if the algorithm that sends the tokens to
the functions would be generated on the beginning of the script, only
putting in those functions which will be called on this specific run.

Now the main question is, is this really going to bring me a performance
tune up, or am I running for extra work that won't pay out?

Then I thought of how to implement this.
The only solution I know is creating a new script file which will be
included after it has been dynamically generated, but I guess that will be
to slow.
So is there a possibility of executing strings?
e.g. putting an if clause in a string and then executing it.

Thanks for any info...

D

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



Re: [PHP] where to set session.bug_compat_warn ?

2003-10-26 Thread Curt Zirzow
* Thus wrote Decapode Azur ([EMAIL PROTECTED]):
 hi, I have the warning message below.
 In which conf file can I set session.bug_compat_42 or 
 session.bug_compat_warn to off?
 And where can I find this conf file?

Just add the lines to the php.ini that is being used: 
session.bug_compat_42 = On
session.bug_compat_warn = Off

Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Find the last friday of each month.

2003-10-26 Thread Bob Hockney

 OrangeHairedBoy wrote:

 Basically, I just want to show what the last friday of the month is, and if
 that date has already passed, show the last friday of the next month.

 You can get the number of days in a month from date()
 
 Now you know that the last Friday of the month will be at most 7 days 
 from the end of the month,
 loop through the last 7 days of the month and determine what date it is 
 using  the date() function.
 Compare the date to determine if it is Friday or not.
 
 And then add in the check for if the date has passed or not.

The last friday of the following month will be the last friday of the current 
month + the number of day in the current month  28 ( date(t) - 28 ).

-Bob

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



Re: [PHP] Parsing colorcodes

2003-10-26 Thread Burhan Khalid
Simon Fredriksson wrote:
Hiya fellow PHP coders!

I have a problem. I need a function to parse mIRC-colorcodes with PHP. 
Unfortunaly, I'm not capable to do this myself (or I'm thinking too 
advanced or something).

The code is built like this; chr(3) starts the color formating. After 
that sign, a series of numbers will come. Can be one or two digits 
(1-15). 0-9 can have an additional zero before it, like 00-09. Each of 
these number represents a color.
[ snip ]

Now, to make it even worse, it's possible to use a background-color for 
the text. This is added with a coma. So, the syntax is X4,8String 
where X is really chr(3). Red (4) String with yellow (8) background.

I'm not a regex guru, but |[0-9]{2},[0-9]{2}(*.?)| should capture it. I 
forget how to ask the regex for optional items, but that should get you 
started.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Web Service in PHP/XML

2003-10-26 Thread Ray Hunter
if you want to use xml and php you can use soap and then you can
incorporate other languages as well...making soap the common protocol
via http.

most languages support soap implementations of one sort.  should be
worth your time to look into soap.

--
Ray



On Sun, 2003-10-26 at 12:44, Dan McCullough wrote:
 I started writting an install script that would talk to a PHP script on one
 server while being used on another.
 
 So you would have http://www.someserver.com/install.php --
 http://www.homesever.com/install.php via CURL without the users knowledge.
 The script would pass certain variables and if one didnt jive then the
 install would stop and a message would be sent back.  If everything was okay
 then the client would have the rest of the source ftp'd to the
 http://www.someserver.com server and the install would continue until
 everything was finished.  I have done very little with CURL, I'm not sure if
 there are any tutorials or anything else that I could see to get some good
 examples of both ends of the process anyone know of any?  Anyone know of a
 better way?  I'm also looking into XML or Java on the authorization end but
 not sure yet.
 
 thanks.
 
 dan
 
 
 __
 -- 
 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] Find the last friday of each month.

2003-10-26 Thread Greg Wiley
Evan Nemerson wrote:

Search for 'doomsday algorithm' on google. Once you grok it, you should be 
able to figure out the last friday quite easily.

On Sunday 26 October 2003 11:37 am, OrangeHairedBoy wrote:
 

Hi all,

I'm trying to write a script to get the next last friday of the month and I
am failing miserably. It keeps giving me October 10th. So, I scrapped it.
Basically, I just want to show what the last friday of the month is, and if
that date has already passed, show the last friday of the next month.
How can I do that?
   

 

Use strtotime(last Friday);

Cheers, Greg.

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


[PHP] Find the last friday of each month.

2003-10-26 Thread OrangeHairedBoy
Hi all,

I'm trying to write a script to get the next last friday of the month and I
am failing miserably. It keeps giving me October 10th. So, I scrapped it.

Basically, I just want to show what the last friday of the month is, and if
that date has already passed, show the last friday of the next month.

How can I do that?

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



[PHP] Strange error in PHP 4.3.4RC2

2003-10-26 Thread Fabio Rotondo
Hi,

I am experiencing a strange error while using PHP 4.3.4RC2.
In the apache2 log, I read:
fatal: cannot realloc() 1937201923 bytes.

I do NEVER try to allocate such memory.
I think the problem is related to some serialize/unserialize() code I am 
using (in fact, removing serialize/unserialize block makes the script 
work perfectly).
Is there anything I can do to test _exactly_ where the script bombs?

Ciao,

  Fabio

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


[PHP] How can i count time it taked to render the page?

2003-10-26 Thread Bas
Any help appreciated.

Regards,

Bas

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



php-general Digest 26 Oct 2003 16:50:32 -0000 Issue 2378

2003-10-26 Thread php-general-digest-help

php-general Digest 26 Oct 2003 16:50:32 - Issue 2378

Topics (messages 167605 through 167632):

Re: ADSI  PHP
167605 by: Evan Nemerson
167608 by: Pc Technics, Inc.

Re: reading/parsing file names
167606 by: Evan Nemerson
167627 by: Curt Zirzow

Re: limits on variable/classname length
167607 by: Evan Nemerson

Session problem
167609 by: Manisha Sathe
167610 by: Evan Nemerson
167611 by: Manisha Sathe
167612 by: Evan Nemerson
167615 by: Manisha Sathe
167619 by: dark

help with mail() using smtp-auth
167613 by: Trell
167614 by: Marek Kilimajer

Re: output
167616 by: Shmuel

Re: Trying to organise an array
167617 by: Burhan Khalid

Re: Post form variables to a frame
167618 by: Burhan Khalid

Re: w3c-compliant form-action parameters
167620 by: Timo Boettcher

Re: sockets - fine tunning
167621 by: Raditha Dissanayake

Re: CURL remote server get data back
167622 by: Raditha Dissanayake
167623 by: Dan McCullough
167624 by: Raditha Dissanayake

Get image file size
167625 by: Awlad Hussain
167626 by: David Otton

doc_root question.
167628 by: P M
167630 by: dark

where to set session.bug_compat_warn ?
167629 by: Decapode Azur
167631 by: Curt Zirzow

How can i count time it taked to render the page?
167632 by: Bas

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]


--
---BeginMessage---
Okay I'm no expert for windows- I had to look up ADSI and found 
http://www.microsoft.com/windows2000/techinfo/howitworks/activedirectory/adsilinks.asp
which mentions LDAP.  Take a look at php.net/ldap and see if it does what you 
need.



On Saturday 25 October 2003 09:24 am, Pc Technics, Inc. wrote:
 Anyone know if its possible to use ADSI with PHP? I can not seem to find
 any good articles which explain how to convert ASP to PHP using the COM
 properties of PHP. I would really like to write this in PHP, rather than
 ASP.

 Thanks in advance 

 - Jeremy
  Pc Technics, Inc.
  www.pc-technics.com
  100% FREE Internet Hosting!

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
...the whole idea of revenge and punishment is a childish daydream. Properly 
speaking, there is no such thing as revenge. Revenge is an act which you want 
to commit when you are powerless and because you are powerless: as soon as 
the sense of impotence is removed, the desire evaporates also. 

-George Orwell
---End Message---
---BeginMessage---
 Hello Evan,

I imagined that the PHP LDAP functions would work, however, this would
only work on LDAP compliant directory servers, such as Microsoft and Novell.
This would not work however for a local NT machine which is not joined to a
domain. ADSI has a 'WinNT:// provider for this, where as the 'LDAP://;
provider is meant for the domain (directory) environment.

  To make a long story short, the PHP LDAP library is not really ADSI  PHP,
but rather an LDAP library which works with LDAP compliant directory
servers. I was looking for a way to use ADSI with PHP.

  I appreciate your response, Evan.

- Jeremy
  Pc Technics, Inc.
  www.pc-technics.com
  100% FREE Internet Hosting!




Evan Nemerson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Okay I'm no expert for windows- I had to look up ADSI and found

http://www.microsoft.com/windows2000/techinfo/howitworks/activedirectory/adsilinks.asp
 which mentions LDAP.  Take a look at php.net/ldap and see if it does what
you
 need.



 On Saturday 25 October 2003 09:24 am, Pc Technics, Inc. wrote:
  Anyone know if its possible to use ADSI with PHP? I can not seem to find
  any good articles which explain how to convert ASP to PHP using the COM
  properties of PHP. I would really like to write this in PHP, rather than
  ASP.
 
  Thanks in advance 
 
  - Jeremy
   Pc Technics, Inc.
   www.pc-technics.com
   100% FREE Internet Hosting!

 -- 
 Evan Nemerson
 [EMAIL PROTECTED]

 --
 ...the whole idea of revenge and punishment is a childish daydream.
Properly
 speaking, there is no such thing as revenge. Revenge is an act which you
want
 to commit when you are powerless and because you are powerless: as soon as
 the sense of impotence is removed, the desire evaporates also. 

 -George Orwell
---End Message---
---BeginMessage---
A little something I whipped up to avoid my zoology homework (I /really/ don't 
care that the damn sperm of nematodes are unusual because they lack a 
flagellum and acrosome). Conclusion: substr is faster than preg_match

[tadpole tadpole]$ php -q ./bench.php
substr: 3.6424000263214
PCRE:   5.121386051178
substr: 3.2655299901962
PCRE:   3.8099709749222
substr: 3.2664449214935
PCRE:   3.7604590654373

Re: [PHP] baffled on error_reporting

2003-10-26 Thread Gerard Samuel
On Sunday 26 October 2003 06:45 pm, Gerard Samuel wrote:
 On Sunday 26 October 2003 12:19 pm, Gerard Samuel wrote:
  I have a common included file with error_reporting set to 0
  If I do a var_dump(error_reporting()) right after it it returns 0
  In a file that includes this common file, if I
  var_dump(error_reporting()) there it return 2047, which I believe is
  E_ALL
  It that the correct behaviour of error_reporting???
  Thanks

 Cant say why, but after doing a fresh pull from CVS, the problem seems to
 have gone away.
 Just another glitch in the Matrix...

Actually, I found the real problem.
The file that was including the common file was including it with a @ like -
@require('./common_file.php');

Once I remove the @, the error_reporting level, reported correctly, what was 
set in the included file, so it seems that while @ turns off error reporting, 
after that point, it goes back to php.ini's default of E_ALL (2047)

Is it a bug, I have no idea at the moment.
Im currently running php 4.3.3.  Please advise.

Thanks

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



Re: [PHP] baffled on error_reporting

2003-10-26 Thread Gerard Samuel
On Sunday 26 October 2003 12:19 pm, Gerard Samuel wrote:
 I have a common included file with error_reporting set to 0
 If I do a var_dump(error_reporting()) right after it it returns 0
 In a file that includes this common file, if I var_dump(error_reporting())
 there it return 2047, which I believe is E_ALL
 It that the correct behaviour of error_reporting???
 Thanks

Cant say why, but after doing a fresh pull from CVS, the problem seems to have 
gone away.
Just another glitch in the Matrix...

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



RE: [PHP] How can i count time it taked to render the page?

2003-10-26 Thread Mike Brum
Grab the time at the beginning of the page execution and then grab the time
at the very end. Subtract the two and you have the amount of time the page
took to execute.

-M

-Original Message-
From: Bas [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 26, 2003 11:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How can i count time it taked to render the page?


Any help appreciated.

Regards,

Bas

-- 
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: How can i count time it taked to render the page?

2003-10-26 Thread rush
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Any help appreciated.

here is one general article about it:
http://www.phpbuilder.com/columns/akent2926.php3

rush
--
http://www.templatetamer.com/

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



[PHP] XML/MySQL

2003-10-26 Thread Ian Williams
Apologies to anyone also subscribed to php.xml.dev, who will have read this
earlier, but it doesn't seem as frequently read as this news group... so I
am reposting...


Hi
I want to write a function that will take any SQL query as a parameter, and
generate XML that represents the recordset.

e.g. SELECT * FROM Customers

returns:

recordset
record id=1 name=Mr Smith purchases=2/
record id=2 name=Mr Jones purchases=25/
record id=3 name=Mr Davis purchases=7/
/recordset

There are two approaches I think. One is to use the XML DOM, the other is
simply to join lots of strings together. What is the best approach?

Thanks (and this is my first post to a newsgroup, and my first post to this
one, so excuse me if I've missed something vital!)

cheers
ian ;-)

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



RE: [PHP] baffled on error_reporting

2003-10-26 Thread Dan McCullough
No I believe that is a feature the ability to turn off error reporting.  You
can do the same with mysql functions.

@mysql_

-Original Message-
From: Gerard Samuel [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2003 7:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] baffled on error_reporting


On Sunday 26 October 2003 06:45 pm, Gerard Samuel wrote:
 On Sunday 26 October 2003 12:19 pm, Gerard Samuel wrote:
  I have a common included file with error_reporting set to 0
  If I do a var_dump(error_reporting()) right after it it returns 0
  In a file that includes this common file, if I
  var_dump(error_reporting()) there it return 2047, which I believe is
  E_ALL
  It that the correct behaviour of error_reporting???
  Thanks

 Cant say why, but after doing a fresh pull from CVS, the problem seems to
 have gone away.
 Just another glitch in the Matrix...

Actually, I found the real problem.
The file that was including the common file was including it with a @
like -
@require('./common_file.php');

Once I remove the @, the error_reporting level, reported correctly, what was
set in the included file, so it seems that while @ turns off error
reporting,
after that point, it goes back to php.ini's default of E_ALL (2047)

Is it a bug, I have no idea at the moment.
Im currently running php 4.3.3.  Please advise.

Thanks

--
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: XML/MySQL

2003-10-26 Thread Manuel Lemos
Hello,

On 10/26/2003 06:08 PM, Ian Williams wrote:
I want to write a function that will take any SQL query as a parameter, and
generate XML that represents the recordset.
e.g. SELECT * FROM Customers

returns:

recordset
record id=1 name=Mr Smith purchases=2/
record id=2 name=Mr Jones purchases=25/
record id=3 name=Mr Davis purchases=7/
/recordset
There are two approaches I think. One is to use the XML DOM, the other is
simply to join lots of strings together. What is the best approach?
Thank is a common problem with solutions from several people. You may 
find some here:

http://www.phpclasses.org/search.html?words=xml+mysqlrestrict=Cgo_search=1

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] doc_root question.

2003-10-26 Thread P M
Hello all!

I need to host several websites from the same server (physical computer), and thus 
require PHP to be configured for more than one directory with PHP files. Does anyone 
know how to specify several target directories for the doc_root directive in the 
configuration file?

Video Populares et Optimates


[PHP] baffled on error_reporting

2003-10-26 Thread Gerard Samuel
I have a common included file with error_reporting set to 0
If I do a var_dump(error_reporting()) right after it it returns 0
In a file that includes this common file, if I var_dump(error_reporting()) 
there it return 2047, which I believe is E_ALL
It that the correct behaviour of error_reporting???
Thanks

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



Re: [PHP] Find the last friday of each month.

2003-10-26 Thread Bob Hockney
Bob wrote:

 The last friday of the following month will be the last friday of the current 
 month + the number of day in the current month  28 ( date(t) - 28 ).

OOPS!  I meant the The last friday of the following month will be the *date* 
of the last friday of the current month MINUS the number of day in the current 
month  28 ( date(t) - 28 ), + 7 days if not in last 7 of month.

i.e.,

Last friday of October  is 31
Last friday of November is 31 - (31 - 28) = 28.
Last friday of December is 28 - (30 - 28) = 26.
Last friday of January  is 26 - (31 - 28) = 23 + 7 = 30
because 23rd is not in last 7.
Last friday of February is 30 - (31 - 28) = 27.
etc...

-Bob

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



Re: [PHP] baffled on error_reporting

2003-10-26 Thread Gerard Samuel
On Sunday 26 October 2003 07:12 pm, Dan McCullough wrote:
 No I believe that is a feature the ability to turn off error reporting. 
 You can do the same with mysql functions.

 @mysql_

Yes I know about turning off error reporting, but what happens after that 
point.
An example.

-- common.php --
?php

// php.ini error reporting is set to E_ALL

error_reporting( 0 );  // sets it to 0

var_dump(error_reporting());  // Returns 0

?

-- foo.php --
?php

@require('./common.php');  // Here is the problem

var_dump(error_reporting());  // Returns 2047

?

If I remove @ from require('./common.php'); in foo.php, 
the var_dump() then correctly reports it as 0 instead of 2047

Kinda goofy if you ask me...

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



[PHP] Parsing colorcodes

2003-10-26 Thread Simon Fredriksson
Hiya fellow PHP coders!

I have a problem. I need a function to parse mIRC-colorcodes with PHP. 
Unfortunaly, I'm not capable to do this myself (or I'm thinking too 
advanced or something).

The code is built like this; chr(3) starts the color formating. After 
that sign, a series of numbers will come. Can be one or two digits 
(1-15). 0-9 can have an additional zero before it, like 00-09. Each of 
these number represents a color.

00 = White
01 = Black
02 = Dark Blue
03 = Dark Green
04 = Red
05 = Marron
06 = Purple
07 = Orange
08 = Yellow
09 = Green
10 = Teal
11 = Cyan
12 = Blue
13 = Magenta
14 = Dark Gray
15 = Gray
Now, to make it even worse, it's possible to use a background-color for 
the text. This is added with a coma. So, the syntax is X4,8String 
where X is really chr(3). Red (4) String with yellow (8) background.

The colorparsing can stop when another occurance of chr(3) commes up. 
Also, the colorparsing ends at the end of line.

Please help me on this issue.

//Simon

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


[PHP] Importing data into MySql via PHP

2003-10-26 Thread Mark Roberts
I haven't tried this before, but I need to now and wanted to get a couple of
pointers.

I have a client that maintains a MySql database on a webserver. They want to
import data into the database by uploading a Excel spreadsheet (most likely
saved in a .csv format). I want to import the data directly into the data
table via a php script. It appears that I should be using a LOAD DATA INFILE
command or a MYSQLIMPORT command.

From reading documentation, it would appear the the LOAD DATA INFILE is the
way I would have to go as MYSQLIMPORT appears to be a command line only
command.

I could use some pointers from someone who has used this beforesuch
as...

1. What is the default file format expected? (.csv?)

2. Any quarks I would need to know about?

3. Etc...

Thanks.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo



mailto:[EMAIL PROTECTED]



Re: [PHP] XML/MySQL

2003-10-26 Thread Raditha Dissanayake
Hi,

As Ray has also mentioned sprintf() is the best approach. I would also 
like to point out that you would be doing three iteration over your data 
so please make sure that your queries are not just 'select * from 
customers' but 'select * from customers where something=something'

all the best

Ian Williams wrote:

Apologies to anyone also subscribed to php.xml.dev, who will have read this
earlier, but it doesn't seem as frequently read as this news group... so I
am reposting...
Hi
I want to write a function that will take any SQL query as a parameter, and
generate XML that represents the recordset.
e.g. SELECT * FROM Customers

returns:

recordset
   record id=1 name=Mr Smith purchases=2/
   record id=2 name=Mr Jones purchases=25/
   record id=3 name=Mr Davis purchases=7/
/recordset
There are two approaches I think. One is to use the XML DOM, the other is
simply to join lots of strings together. What is the best approach?
Thanks (and this is my first post to a newsgroup, and my first post to this
one, so excuse me if I've missed something vital!)
cheers
ian ;-)
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB  |  with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Find the last friday of each month.

2003-10-26 Thread Evan Nemerson
Search for 'doomsday algorithm' on google. Once you grok it, you should be 
able to figure out the last friday quite easily.


On Sunday 26 October 2003 11:37 am, OrangeHairedBoy wrote:
 Hi all,

 I'm trying to write a script to get the next last friday of the month and I
 am failing miserably. It keeps giving me October 10th. So, I scrapped it.

 Basically, I just want to show what the last friday of the month is, and if
 that date has already passed, show the last friday of the next month.

 How can I do that?

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
If you would be a real seeker after truth, you must at least once in your 
life doubt, as far as possible, all things.

-Rene Descartes

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



Re: [PHP] Strange error in PHP 4.3.4RC2

2003-10-26 Thread Evan Nemerson
You can try Xdebug. http://www.xdebug.org/

Can you send some code to reproduce the error?



On Sunday 26 October 2003 10:24 am, Fabio Rotondo wrote:
 Hi,

 I am experiencing a strange error while using PHP 4.3.4RC2.
 In the apache2 log, I read:

 fatal: cannot realloc() 1937201923 bytes.

 I do NEVER try to allocate such memory.
 I think the problem is related to some serialize/unserialize() code I am
 using (in fact, removing serialize/unserialize block makes the script
 work perfectly).
 Is there anything I can do to test _exactly_ where the script bombs?

 Ciao,

Fabio

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
A leader is the wave pushed ahead by the ship.

-Leo Nikolaevich Tolstoy

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



Re: [PHP] XML/MySQL

2003-10-26 Thread Evan Nemerson
If I were you I'd just join strings- it's much less resource intensive. Just 
make sure you're using valid XML.


On Sunday 26 October 2003 12:08 pm, Ian Williams wrote:
 Apologies to anyone also subscribed to php.xml.dev, who will have read this
 earlier, but it doesn't seem as frequently read as this news group... so I
 am reposting...


 Hi
 I want to write a function that will take any SQL query as a parameter, and
 generate XML that represents the recordset.

 e.g. SELECT * FROM Customers

 returns:

 recordset
 record id=1 name=Mr Smith purchases=2/
 record id=2 name=Mr Jones purchases=25/
 record id=3 name=Mr Davis purchases=7/
 /recordset

 There are two approaches I think. One is to use the XML DOM, the other is
 simply to join lots of strings together. What is the best approach?

 Thanks (and this is my first post to a newsgroup, and my first post to this
 one, so excuse me if I've missed something vital!)

 cheers
 ian ;-)

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
The people are the only sure reliance for preservation of our liberty.

-Thomas Jefferson

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



[PHP] where to set session.bug_compat_warn ?

2003-10-26 Thread Decapode Azur
hi, I have the warning message below.
In which conf file can I set session.bug_compat_42 or 
session.bug_compat_warn to off?
And where can I find this conf file?

(annexe question: Is it possible to get the warnings in a variable so I 
could print it in html comment, or write it in a log file?)

thanks
-- 
Warning: Unknown(): Your script possibly relies on a session side-effect 
which existed until PHP 4.2.3. Please be advised that the session extension 
does not consider global variables as a source of data, unless 
register_globals is enabled. You can disable this functionality and this 
warning by setting session.bug_compat_42 or session.bug_compat_warn to off, 
respectively.

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



Re: [PHP] Find the last friday of each month.

2003-10-26 Thread Tyler Lane
OrangeHairedBoy wrote:

Hi all,

I'm trying to write a script to get the next last friday of the month and I
am failing miserably. It keeps giving me October 10th. So, I scrapped it.
Basically, I just want to show what the last friday of the month is, and if
that date has already passed, show the last friday of the next month.
How can I do that?

 

You can get the number of days in a month from date()

Now you know that the last Friday of the month will be at most 7 days 
from the end of the month,
loop through the last 7 days of the month and determine what date it is 
using  the date() function.
Compare the date to determine if it is Friday or not.

And then add in the check for if the date has passed or not.

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


Re: [PHP] doc_root question.

2003-10-26 Thread dark
Hi!

I never knew that something like that is needed. It works fine without
any additional configuration. Does it work for your primary hosted
domain?

angel

On Sun, 26 Oct 2003 16:15:50 +0100
P M [EMAIL PROTECTED] wrote:

 Hello all!
 
 I need to host several websites from the same server (physical computer), and thus 
 require PHP to be configured for more than one directory with PHP files. Does anyone 
 know how to specify several target directories for the doc_root directive in the 
 configuration file?
 
 Video Populares et Optimates
 

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



Re: [PHP] doc_root question.

2003-10-26 Thread Burhan Khalid
P M wrote:

Hello all!

I need to host several websites from the same server (physical computer), and thus require PHP to be configured for more than one directory with PHP files. Does anyone know how to specify several target directories for the doc_root directive in the configuration file?

Try Apache's VirtualHost directive.



--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Web Service in PHP/XML

2003-10-26 Thread Dan McCullough
I started writting an install script that would talk to a PHP script on one
server while being used on another.

So you would have http://www.someserver.com/install.php --
http://www.homesever.com/install.php via CURL without the users knowledge.
The script would pass certain variables and if one didnt jive then the
install would stop and a message would be sent back.  If everything was okay
then the client would have the rest of the source ftp'd to the
http://www.someserver.com server and the install would continue until
everything was finished.  I have done very little with CURL, I'm not sure if
there are any tutorials or anything else that I could see to get some good
examples of both ends of the process anyone know of any?  Anyone know of a
better way?  I'm also looking into XML or Java on the authorization end but
not sure yet.

thanks.

dan

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

[PHP] if and like together?

2003-10-26 Thread Tim Thorburn
Hi,

Is there an IF LIKE statement in PHP?  I've got a MySQL database setup with 
headings and text (think a news article site) - headings in one field, text 
in another.  In some cases, I don't want the contents of the heading field 
to appear on the site - in these cases, the headings begin with 'noshow-'.

So I'm thinking the easiest way to handle this is if there is something 
similar to the MySQL 'LIKE' command in PHP ... is there such a beast?

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


RE: [PHP] if and like together?

2003-10-26 Thread Martin Towell
strstr()  and it's variants
ereg()  if you need more logic

Martin


-Original Message-
From: Tim Thorburn [mailto:[EMAIL PROTECTED]
Sent: Monday, 27 October 2003 12:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] if and like together?


Hi,

Is there an IF LIKE statement in PHP?  I've got a MySQL database setup with 
headings and text (think a news article site) - headings in one field, text 
in another.  In some cases, I don't want the contents of the heading field 
to appear on the site - in these cases, the headings begin with 'noshow-'.

So I'm thinking the easiest way to handle this is if there is something 
similar to the MySQL 'LIKE' command in PHP ... is there such a beast?

TIA
-Tim

-- 
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] if and like together?

2003-10-26 Thread Leif K-Brooks
Tim Thorburn wrote:

Is there an IF LIKE statement in PHP?  I've got a MySQL database setup 
with headings and text (think a news article site) - headings in one 
field, text in another.  In some cases, I don't want the contents of 
the heading field to appear on the site - in these cases, the headings 
begin with 'noshow-'.

So I'm thinking the easiest way to handle this is if there is 
something similar to the MySQL 'LIKE' command in PHP ... is there such 
a beast?
if(preg_match('/^noshow-/', $heading)){
//Don't show
}
--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How can i count time it taked to render the page?

2003-10-26 Thread Justin French
You can't find out how long the pages takes to RENDER at all -- 
rendering is something that happens client-side.

You can find out how long it takes to execute a script (on the server), 
which is what I assume you mean.

See Example 1 on http://www.php.net/microtime

Justin French

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


[PHP] Re: Recommendation for Unique URL

2003-10-26 Thread Al
 What is the best approach to the unique page ID? I thought I would store
the
 dept. mgrs. email address and the session ID in a db, and use the session
ID in
 the URL. Do I even need the mgr's email address? Is another approach
better?
 What have you used?

I'd concatenate the employee's email and manager's email, and then use an
MD5 hash of it as the unique string. i.e:

$unique_id = md5 ( $employee_email . $manager_email );

For more info on what MD5 is, see
http://us2.php.net/manual/en/function.md5.php

Cheers,

Al

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



[PHP] Idea for new operator

2003-10-26 Thread Al
Afternoon all,

Is it just me, or would everybody else like to see a case-insensitive string
comparison operator introduced into PHP? It is a type of comparison that I
use a lot, and having to strtolower() everything before comparison can
impact code readability, not to mention the angst, pain and trauma of having
to repeatedly type 'strtolower()'.

Assuming this new operator is something like '=*', the following two lines
of code would be functionally identical.

if (strtolower($a) == strtolower($b)) echo The same!;
if ($a =* $b) echo The same!;

Of course creating a new operator is only justified if the vast majority of
PHP users do these comparisons as much as I do, and are as averse to work as
I am ... :).

Thoughts?

Al

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



Re: [PHP] Re: reading/parsing file names

2003-10-26 Thread Curt Zirzow
* Thus wrote Evan Nemerson ([EMAIL PROTECTED]):
 
 [tadpole tadpole]$ php -q ./bench.php
 Averages:
 substr: 3.5071199059486
 pcre:   4.2237901210785

Averages:
substr: 5.1445327162743
pcre:   5.6803694009781
posix:   8.0486606121063

Interesing that my results of substr vs. pcre came in closer, then
I added the ereg function to test, which I expected to come in
last.

This was processed on a p233 processor with php4.3.3


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] XML/MySQL

2003-10-26 Thread Ray Hunter
 recordset
 record id=1 name=Mr Smith purchases=2/
 record id=2 name=Mr Jones purchases=25/
 record id=3 name=Mr Davis purchases=7/
 /recordset
 
 There are two approaches I think. One is to use the XML DOM, the other is
 simply to join lots of strings together. What is the best approach?


What i have done in the past is use the dbx extension in php to do my
queries. Then i have iterated over the multi-dimensional arrays and
created xml tags with the values for the dbx result set.

You can use this type of logic with any db functions and just create xml
data.

If you have an xml record that is very specific you can use sprintf to
create something like:

$record = 'record id=%d name=%s purchases=%d/';

while( $row = database logic here ) {
  $records[] = sprintf( 
$record, 
$row['id'],
$row['name'], 
$row['purchases'] 
  );

}

Then use the array functions to merge, sort or whatever you like...

That should get you started...

HTH

--
Ray

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



Re: [PHP] Idea for new operator

2003-10-26 Thread Larry E . Ullman
Is it just me, or would everybody else like to see a case-insensitive 
string
comparison operator introduced into PHP? It is a type of comparison 
that I
use a lot, and having to strtolower() everything before comparison can
impact code readability, not to mention the angst, pain and trauma of 
having
to repeatedly type 'strtolower()'.
I was feeling generous so I went back in time and added this 
functionality to PHP as of version 3. I call it the strcasecmp 
function. I placed the description and usage of the function in the PHP 
manual: http://www.php.net/strcasecmp

Hope you like it!
Larry
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] copying a directory

2003-10-26 Thread Shawn McKenzie
I need to copy a directory from one location to the other.  I didn't find a
function for this.  Is copy() supposed to work on directories as well as
files, or is there another?

TIA
-Shawn

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



[PHP] GD problem

2003-10-26 Thread mantas
Hey!
i did few upgrades on my server and i got into some weird problem.
what i did was:
Upgraded to: Apache2
Upgraded to: php 4.3.3

and after that GD stoped working...

i did check on phpinfo(); and it came up with:
gd
  GD Support  enabled
  GD Version  bundled (2.0.15 compatible)
  GIF Read Support  enabled
  PNG Support  enabled
  WBMP Support  enabled
  XBM Support  enabled


Was there any problems or anything that i missed after gd upgrade and php
upgrade? i tried to look at change log but didn't find anything that would
solve it, its just gd doesn't work and i can't fix it, php just doesn't
recognizes gd functions.
So does anybody know what problem could be? or any links that i should check
about new updates in versions?

Thanks!

mNTKz

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



RE: [PHP] Idea for new operator

2003-10-26 Thread Pablo Gosse
On Sunday, October 26, 2003 5:40 PM Al wrote:

 Is it just me, or would everybody else like to see a case-insensitive
 string comparison operator introduced into PHP?

You could use the strcasecmp() function as well:

http://ca3.php.net/manual/en/function.strcasecmp.php

?php
$var1 = Hello;
$var2 = hello;
if (strcasecmp($var1, $var2) == 0) {
echo '$var1 is equal to $var2 in a case-insensitive string
comparison';
}
?

Cheers,
Pablo

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



[PHP] Re: problem in 2 dimensional Array

2003-10-26 Thread Al
 i have 2 problems in 2 dimensional array

 1. how to declare global 2 dimensional array in php
 2. how to pass 2 dimensional array in function as an
 arrgument

In the context of your questions, 2-Dimensional arrays are no different to
1-dimensional arrays.

All global vairables in PHP are stored in the predefined $GLOBALS
associative array, which is automatically global in scope. Each key of the
$GLOBALS array is a name of a global variable. For example, the following
code will print Hello World:

?php

function setVarA ( $value ) {
$GLOBALS['varA'] = $value;
}

function echoVarA ( ) {
echo $GLOBALS['varA'];
}

$varA = Hello;
echoVarA( );

setVarA (  World);
echo $varA;

?

Passing an array to a function is no different passing a scalar variable:

?php
function countArray ( $arrayArgument ) {
return count ($arrayArgument);
}

$array = array ('a', 'b');
echo The array has . countArray($array) . items.;
?

Cheers,

Al

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



Re: [PHP] Re: Recommendation for Unique URL

2003-10-26 Thread David Otton
On Mon, 27 Oct 2003 13:29:47 +1100, you wrote:

 What is the best approach to the unique page ID? I thought I would store
the
 dept. mgrs. email address and the session ID in a db, and use the session
ID in
 the URL. Do I even need the mgr's email address? Is another approach
better?
 What have you used?

I'd concatenate the employee's email and manager's email, and then use an
MD5 hash of it as the unique string. i.e:

$unique_id = md5 ( $employee_email . $manager_email );

For more info on what MD5 is, see
http://us2.php.net/manual/en/function.md5.php

Remember that there's no guarantee that any two strings won't map to the
same md5 hash, and so they are bad candidates for unique ids.

Even allowing for that, concatenating only the email addresses makes the
hash extremely vulnerable.

Better to add a salt and a timestamp, so your unique string becomes
something like:

unique_id = unix_timestamp + md5 (employee_unique_token +
manager_unique_token + random_string)

(All this assumes that you want the unique id to be unguessable for some
reason. Personally, I'd just put the primary key associated with the job in
the URL, and password-protect the site. Much simpler.)

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



Re: [PHP] XML/MySQL

2003-10-26 Thread Burhan Khalid
Ian Williams wrote:

I want to write a function that will take any SQL query as a parameter, and
generate XML that represents the recordset.
If you are lucky enough to be using mysql ver 4.x+ -- it has this 
functionality built-in, using the --xml command line option.

Sample run :
$ mysql -u username -ppassword --xml
mysql create table test (name text, pass text);
Query OK, 0 rows affected (0.00 sec)
mysql insert into test (name,pass) values ('foo','secret');
Query OK, 1 row affected (0.00 sec)
mysql select * from test;
?xml version=1.0?
resultset statement=select * from test
  row
namefoo/name
passsecret/pass
  /row
/resultset
1 row in set (0.00 sec)
mysql
If your mysql version is  4.x -- then you have to resort of one of the 
many mysql-to-xml classes available (check phpclasses.org and PEAR).

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Idea for new operator

2003-10-26 Thread Leif K-Brooks
Larry E. Ullman wrote:

I was feeling generous so I went back in time and added this 
functionality to PHP as of version 3. I call it the strcasecmp 
function. I placed the description and usage of the function in the 
PHP manual: http://www.php.net/strcasecmp
That was nice of you, but he wanted an operator.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 27 Oct 2003 04:50:51 -0000 Issue 2379

2003-10-26 Thread php-general-digest-help

php-general Digest 27 Oct 2003 04:50:51 - Issue 2379

Topics (messages 167633 through 167674):

Re: How can i count time it taked to render the page?
167633 by: Mike Brum
167634 by: rush
167664 by: Justin French

baffled on error_reporting
167635 by: Gerard Samuel
167656 by: Gerard Samuel
167657 by: Gerard Samuel
167658 by: Dan McCullough
167659 by: Gerard Samuel

Parsing colorcodes
167636 by: Simon Fredriksson
167640 by: Burhan Khalid

Importing data into MySql via PHP
167637 by: Mark Roberts
167638 by: John Nichel

Strange error in PHP 4.3.4RC2
167639 by: Fabio Rotondo
167646 by: Evan Nemerson

Find the last friday of each month.
167641 by: OrangeHairedBoy
167645 by: Evan Nemerson
167648 by: Tyler Lane
167650 by: Bob Hockney
167654 by: Greg Wiley
167655 by: Bob Hockney

Re: doc_root question.
167642 by: Burhan Khalid

Web Service in PHP/XML
167643 by: Dan McCullough
167651 by: Ray Hunter

XML/MySQL
167644 by: Ian Williams
167647 by: Evan Nemerson
167652 by: Ray Hunter
167653 by: Manuel Lemos
167660 by: Raditha Dissanayake
167673 by: Burhan Khalid

Runtime Optimization of a Parser
167649 by: Dennis Körner

if and like together?
167661 by: Tim Thorburn
167662 by: Martin Towell
167663 by: Leif K-Brooks

Re: Recommendation for Unique URL
167665 by: Al
167672 by: David Otton

Idea for new operator
167666 by: Al
167667 by: Larry E. Ullman
167670 by: Pablo Gosse
167674 by: Leif K-Brooks

copying a directory
167668 by: Shawn McKenzie

GD problem
167669 by: mantas

Re: problem in 2 dimensional Array
167671 by: Al

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]


--
---BeginMessage---
Grab the time at the beginning of the page execution and then grab the time
at the very end. Subtract the two and you have the amount of time the page
took to execute.

-M

-Original Message-
From: Bas [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 26, 2003 11:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How can i count time it taked to render the page?


Any help appreciated.

Regards,

Bas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---End Message---
---BeginMessage---
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Any help appreciated.

here is one general article about it:
http://www.phpbuilder.com/columns/akent2926.php3

rush
--
http://www.templatetamer.com/
---End Message---
---BeginMessage---
You can't find out how long the pages takes to RENDER at all -- 
rendering is something that happens client-side.

You can find out how long it takes to execute a script (on the server), 
which is what I assume you mean.

See Example 1 on http://www.php.net/microtime

Justin French
---End Message---
---BeginMessage---
I have a common included file with error_reporting set to 0
If I do a var_dump(error_reporting()) right after it it returns 0
In a file that includes this common file, if I var_dump(error_reporting()) 
there it return 2047, which I believe is E_ALL
It that the correct behaviour of error_reporting???
Thanks
---End Message---
---BeginMessage---
On Sunday 26 October 2003 12:19 pm, Gerard Samuel wrote:
 I have a common included file with error_reporting set to 0
 If I do a var_dump(error_reporting()) right after it it returns 0
 In a file that includes this common file, if I var_dump(error_reporting())
 there it return 2047, which I believe is E_ALL
 It that the correct behaviour of error_reporting???
 Thanks

Cant say why, but after doing a fresh pull from CVS, the problem seems to have 
gone away.
Just another glitch in the Matrix...
---End Message---
---BeginMessage---
On Sunday 26 October 2003 06:45 pm, Gerard Samuel wrote:
 On Sunday 26 October 2003 12:19 pm, Gerard Samuel wrote:
  I have a common included file with error_reporting set to 0
  If I do a var_dump(error_reporting()) right after it it returns 0
  In a file that includes this common file, if I
  var_dump(error_reporting()) there it return 2047, which I believe is
  E_ALL
  It that the correct behaviour of error_reporting???
  Thanks

 Cant say why, but after doing a fresh pull from CVS, the problem seems to
 have gone away.
 Just another glitch in the Matrix...

Actually, I found the real problem.
The file that was including the common file was including it with a @ like -
@require('./common_file.php');

Once I remove the @, the error_reporting level, reported correctly, what was 
set in the included file, so it seems that 

Re: [PHP] copying a directory

2003-10-26 Thread Burhan Khalid
Shawn McKenzie wrote:

I need to copy a directory from one location to the other.  I didn't find a
function for this.  Is copy() supposed to work on directories as well as
files, or is there another?
Unix :

cp -r /old/dir /new/dir

Windows :

xcopy /E c:\old\dir c:\new\dir

Use those with :

http://www.php.net/manual/en/function.exec.php



--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Post variables getting lost

2003-10-26 Thread Joao Andrade

Hey people,

Something odd is happening :) I've this form on a page:

form method=post action=\basics\quotation-add

table
tr
 thAuthor
 tdinput type=text size=30 name=author_name
/tr
tr
 thNew Category
 tdinput type=text size=30 name=new
/tr
tr
 thCategory
 tdselect name=category
   ?php
   $categorias = mysql_query(SELECT DISTINCT category FROM quotations);
   $lincat = mysql_fetch_row ($categorias);
   while ($lincat != false){   //loop through the records enquanto ha linhas
  $cat = $lincat[0];
  echo option value=\.$cat.\.$cat ; //and place it in the select
  $lincat = mysql_fetch_row ($categorias);# pega uma linha
   }

   ?
   /select
/tr
tr
 thQuotation
 tdtextarea name=quote cols=50 rows=8/textarea
/tr
/table
center
input type=submit value=Add
/center
/form

And then I have in quotations-add:

  echo $_POST['category'];
  echo $_POST['new'];
  echo $_POST['author_name'];

  echo $_POST['quote'];

And what I get ist:

Notice: Undefined index: category in C:\Programme\Apache
Group\Apache2\htdocs\basics\quotation-add.php on line 85

Notice: Undefined index: new in C:\Programme\Apache
Group\Apache2\htdocs\basics\quotation-add.php on line 86
asdasdasdasd

Where the 'author_name' and 'quote' POST variables are ok, why aren't
'new' and 'category' coming?

Thanks again,

Joao Penna Andrade
Undergraduate, Mechanical Engineering
UNICAMP, Brazil

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



[PHP] Fairly simple array question

2003-10-26 Thread Terence Parker
I'm retrieving results from a MySQL database - they would be of the form 
 (form table 'usergroup'):

+--+--+
| username | group_id |
+--+--+
| tparker  |3 |
| tparker  |6 |
| tparker  |7 |
| tparker  |8 |
+--+--+
This SQL query is being carried out within another function that does a 
query of the 'groups' table, and thus lists all groups. While listing 
all groups, I want to check wither the current item to be listed is 
equal to ANY of the group_id's in the result above (in other words, i'm 
presenting the user with a list of group checkboxes, but with those 
previously selected to be 'checked').

How is the best way to do this?

By using mysql_fetch_assoc or object for the 'usergroup' table result, I 
have to check each item of the array for each item in the 'groups' list 
- very inefficient.

How can I transfer the results above into an array such that I only need 
to check $group_result-group_id against 
$usergroup[$group_result-group_id] ?   -- I know that won't work 
syntactically, it's an example only.

Or is there a better way of doing this? Is there a function that merely 
asks if an item (say, '6') exists in ALL the results above?

Thanks in advance!

Terence

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


Re: [PHP] Post variables getting lost

2003-10-26 Thread Binay
Change 'new' to something else say 'new1' as new is an operator so that
might be causing the problem which in turn affecting the category also ..

Hope this helps
cheers
Binay

- Original Message -
From: Joao Andrade [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 27, 2003 10:30 AM
Subject: [PHP] Post variables getting lost



 Hey people,

 Something odd is happening :) I've this form on a page:

 form method=post action=\basics\quotation-add

 table
 tr
  thAuthor
  tdinput type=text size=30 name=author_name
 /tr
 tr
  thNew Category
  tdinput type=text size=30 name=new
 /tr
 tr
  thCategory
  tdselect name=category
?php
$categorias = mysql_query(SELECT DISTINCT category FROM quotations);
$lincat = mysql_fetch_row ($categorias);
while ($lincat != false){   //loop through the records enquanto ha
linhas
   $cat = $lincat[0];
   echo option value=\.$cat.\.$cat ; //and place it in the
select
   $lincat = mysql_fetch_row ($categorias);# pega uma linha
}

?
/select
 /tr
 tr
  thQuotation
  tdtextarea name=quote cols=50 rows=8/textarea
 /tr
 /table
 center
 input type=submit value=Add
 /center
 /form

 And then I have in quotations-add:

   echo $_POST['category'];
   echo $_POST['new'];
   echo $_POST['author_name'];

   echo $_POST['quote'];

 And what I get ist:

 Notice: Undefined index: category in C:\Programme\Apache
 Group\Apache2\htdocs\basics\quotation-add.php on line 85

 Notice: Undefined index: new in C:\Programme\Apache
 Group\Apache2\htdocs\basics\quotation-add.php on line 86
 asdasdasdasd

 Where the 'author_name' and 'quote' POST variables are ok, why aren't
 'new' and 'category' coming?

 Thanks again,

 Joao Penna Andrade
 Undergraduate, Mechanical Engineering
 UNICAMP, Brazil

 --
 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] process forking?

2003-10-26 Thread Stephen Cronan
Hi All,
I've written a digital asset management system and my dilema is, to save a file from 
the sytem, i pass the files through a php script so i can change file names and keep 
the files out of the web tree. 

I use a little popup window so they can select what format they want to download the 
file as, but the problem is when downloading a file  it seems to halt the rest of the 
site from being able to do anything until the download is complete. 

so i'm just trying to get the rest of the site to function while the download is in 
process, thank in advance. S.



Re: [PHP] copying a directory

2003-10-26 Thread Shawn McKenzie
Thanks, but I was looking for a multi-platform way via a function.

I just bit the bullet and looped thru with readdir() and copied the files.

-Shawn

Burhan Khalid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Shawn McKenzie wrote:

  I need to copy a directory from one location to the other.  I didn't
find a
  function for this.  Is copy() supposed to work on directories as well as
  files, or is there another?

 Unix :

 cp -r /old/dir /new/dir

 Windows :

 xcopy /E c:\old\dir c:\new\dir

 Use those with :

 http://www.php.net/manual/en/function.exec.php



 -- 
 Burhan Khalid
 phplist[at]meidomus[dot]com
 http://www.meidomus.com

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



Re: [PHP] sockets - fine tunning

2003-10-26 Thread Cosmin
On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote:
 are you getting any 1xx status codes from the web server?

here are the full headers:
HTTP/1.1 200 OK
Date: Mon, 27 Oct 2003 06:15:30 GMT
Server: Apache/1.3.27 (Unix) PHP/4.3.3
X-Powered-By: PHP/4.3.3
Transfer-Encoding: chunked
Content-Type: text/xml

 Cosmin wrote:
 
 I'm trying to make an application using XML-RPC, and I have the
 following problem: I use fsockopen() to simulate a POST to my local
 web-server. All goes very well except it's very very slow. Here is my
 code maybe someone could tell me what I'm doing wrong:
 =
 $url= parse_url($this-serverURL);
 $requestString= POST .$url['path']. HTTP/1.1\r\nHost:
 .$url['host'].\r\nContent-type:
 application/x-www.form-urlencoded\r\nContent-length:
 .strlen($this-requestData).\r\n\r\n.$this-requestData;;
  $fp = fsockopen($url['host'], 80, $err_num, $err_msg, 5);
  if ($fp)
  {
  //make the request to the xml-rpc server
  fputs($fp, $requestString);
  //gets the result
  while (!feof($fp))
  {
  $response .= fgets($fp, 1024);
  }
  fclose($fp);
  $this-rawResponse=$response;
  $this-error=false;
  }
  else
  {
  $this-error=true;
  $this-errorMessage=$err_msg;
  }
 
 This is the slowest part of my script(about 16 seconds). The server's
 execution time is only 0.00064206123352051 seconds. I don't know why it
 takes so much to write a string to the socket and then to read the
 response. Here are the execution times:
  Server StartServer Stop
  1067090777.5339 1067090777.5346
  
  Client StartClient Stop
  1067090777.5303 1067090794.5286
 
 If someone knows a way on how to speed this up please tell me how to do
 it.
 
 
 Thank you for your time
 
   
 
 
 
 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
 Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB  |  with progress bar.

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



Re: [PHP] copying a directory

2003-10-26 Thread Gerard Samuel
On Monday 27 October 2003 12:58 am, Shawn McKenzie wrote:
 Thanks, but I was looking for a multi-platform way via a function.

rename()

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