[PHP] Insert or update in Oracle database

2002-02-04 Thread SIM/HAOUHACH

Hello,
To these that use the PHP by integrating an Oracle database, I wanted to
know how made you your idea to be able to make the update or insert in your
database.
Thanks

LYNDA HAOUHACH
Ingénieur Systèmes
SONATRACH LTH
Émail: [EMAIL PROTECTED]




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




Re: [PHP] Can php Read contents from MS Word in Exactly sameformat

2002-02-04 Thread Jason G.

Not that I know of - which doesn't mean much.  I do know that the RTF 
format is a published spec, that you could read if you felt like taking the 
time to code a reader.

However, give google a try, and maybe you'll turn something up.

-Jason Garber


At 03:07 AM 2/4/2002 -0500, jtjohnston wrote:
Is there a function or class written to convert rtf reliably to html? :)
Let me know,
John
A post  reply would be helpful if you can.

Jason G. wrote:

  MS Word is a proprietary, binary (i think), format...  Have fun.
 
  There may be a solution out there.
 
  If you could convince her to save it in Rich Text Format (rtf) and then
  upload it, your life would be much easier...
 
  -Jason Garber
 
  At 01:51 PM 2/4/2002 +0800, Jack wrote:
  Dear all
  I had made  a news input page for one of the HR Manger to input the 
 news for
  the whole company to read, she is quick comfort with using MS word as a
  editor, so is there anyway that the php can read the contents from the MS
  Word and display as exactly same format to html?
  
  If there is so, could any one suggest a book to me?
  
  Thx a lot
  Jack
  [EMAIL PROTECTED]
  
  
  
  --
  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




[PHP] defining the dpi of an image while uploading -gdlibrary-

2002-02-04 Thread Andy

Hi there,

I would like to define the dpi to 72 for images users can upload on my
website. Is there a way to do this with gd2.0?

Thanx Andy



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




Re: [PHP] SAX + attributes

2002-02-04 Thread Jon Farmer

 can anyone tell me how I can retrieve attributes of a node using SAX
parser
 in PHP??

Yes use a Start Element Handler. The attribues are passed to it as a
associative array.

Regards

Jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969
PGP Key available, send email with subject: Send PGP Key





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




[PHP] eregi_replace HELP!!

2002-02-04 Thread Martin Cabrera Diaubalick

Hello all!


I would like to change all the links containing string microsite from 
$contenido1 to: a href=http://www.whatever.com;Link not available/a.

The rest of the links of  $contenido1 would have to be ontouched.

To do this, I tried


$contenido1=eregi_replace((a href=.*microsite.*/a),a 
href=\http://www.whatever.com\;Link not available/a,$contenido1);


It changes links with microsite in it but erases the ones without microsite.

How can I make this work?

TIA
Regards

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




[PHP] Re: Natively compiled classes

2002-02-04 Thread Lars Wilhelmsen

[EMAIL PROTECTED] (Stephano Mariani) wrote in news:004801c1ad03
$2d208e60$8000a8c0@sknet01:

 My question, is there any way of doing this with classes? I know I can
 write individual functions in C and build them into a module, but how
 can I do this with classes, if at all?
 
 TIA
 
 Stephano Mariani


Hi Stephano.

If I understand you correctly, what you mean is C++ Classes.

Take a look at the ext/qtdom sources in the PHP4 tree.

Regards,

Lars Wilhelmsen.

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




Re: [PHP] mail() function not sending to Yahoo address

2002-02-04 Thread Jason G.

Just a note...

Make sure your server's IP address is not black holed by some spam list...

-Jason Garber
IonZoft.com


At 08:22 AM 2/4/2002 +0100, TV Karthick Kumar wrote:
  Hi,

 I use a form on my website for the visitors to send me the feedback and
use the mail() to do this job for me. And I get mails without any
problems I am happy... :-)..

Karthick


  I've tried several PHP form processors, and all of
  them have trouble sending the form contents to a Yahoo
  address.  When I change the address to something other
  than a Yahoo account, it sends the form results with
  no problem.  Is there an issue with PHP's mail
  function and Yahoo email addresses?
 
  thanks,
  John
 
  __
  Do You Yahoo!?
  Great stuff seeking new owners in Yahoo! Auctions!
  http://auctions.yahoo.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php


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


--
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] PHP's include_path

2002-02-04 Thread Neil Freeman

Hi there,

Am I correct in thinking that you can specify the PHP include_path line
within an Apache .htaccess file? If so does anyone know the correct
syntax of doing this?

If you cannot specifiy PHP's include_path line from within this file -
how do you use different include paths for different web sites???

Hope someone can help :)

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] PHP 'via' JServ/servlets ?

2002-02-04 Thread Espen Lyngaas

Running a 3rd party developet servlet (Apache JServ) driven site, and 
desperately want to be able to execute PHP code within this system. 
Unfortunately the developer has virtually no knowledge of how PHP sits in 
the system.

Is it possible to somehow get PHP code executed if the code is read via a 
Java servlet? For instance, if I have a servlet that does nothing more than 
to read a file containing a PHP script, can the code in it be executed?


--
Espen Lyngaas, IT Consultant, Color Line AS
http://www.outta.org/
Phone: +47-95063143 +47-22944315 ICQ: 43241796
--
By the way, the egg came first! 


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




RE: [PHP] PHP and XML

2002-02-04 Thread Sandeep Murphy

If its parsing xml using PHP is what u r looking for, chk out:

http://www.phpbuilder.com/columns/joe2907.php3

http://www.zend.com/zend/art/parsing.php

http://www.melonfire.com/community/columns/trog/archives.php



-Original Message-
From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 4 de Fevereiro de 2002 3:24
To: [EMAIL PROTECTED]
Subject: [PHP] PHP and XML


Hi,

I'd appreciate any pointers you recommend to good sources of 
information on how to use PHP and XML. 

Thanks,

Peter

---
Reality is that which, when you stop believing in it, doesn't go
away.
-- Philip K. Dick

-- 
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] SAX + attributes

2002-02-04 Thread Sandeep Murphy

thnx.. had figured it out :)

thnx all the same..

sands

-Original Message-
From: Jon Farmer [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 4 de Fevereiro de 2002 9:26
To: Sandeep Murphy; [EMAIL PROTECTED]
Subject: Re: [PHP] SAX + attributes


 can anyone tell me how I can retrieve attributes of a node using SAX
parser
 in PHP??

Yes use a Start Element Handler. The attribues are passed to it as a
associative array.

Regards

Jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969
PGP Key available, send email with subject: Send PGP Key




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




[PHP] HTTP Header

2002-02-04 Thread Daniel Reichenbach

Hy list :-)

I need to manually send the HTTP header with PHP.

The following is an example what I have to send to the client:

HTTP/1.1 200 OK
Date: Mon, 04 Feb 2002 10:01:54 GMT
Server: Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6
Connection: Keep-alive, close
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Length: 1078
Content-Type: text/plain

How would I Do that with PHP?

Thx,
Daniel


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




Re: [PHP] PHP's include_path

2002-02-04 Thread Jason Wong

On Monday 04 February 2002 17:43, Neil Freeman wrote:
 Hi there,

 Am I correct in thinking that you can specify the PHP include_path line
 within an Apache .htaccess file? If so does anyone know the correct
 syntax of doing this?

 If you cannot specifiy PHP's include_path line from within this file -
 how do you use different include paths for different web sites???


I believe you can also use init_set() to set the include path.



hth
-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Please remain calm, it's no use both of us being hysterical at the same time.
*/

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




[PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Hi,

This is my first time attempting to use htaccess files. I am running Apache
1.3.20 with PHP v4.0.6 installed as a module. Within Apache's httpd.conf
file I have the following value set:

AccessFileName apache.htaccess

And within an 'Alias' directory I have a file entitled 'apache.htaccess'
which contains the following:

IfModule mod_php4.c
php_value include_path = .;C:/My/PHP/Dir
/IfModule

What I am attempting to do is alter PHP's include path 'on the fly' rather
than specifying an overall value within php.ini. The problem I have though
is that the 'include_path' value does not appear to be picked up. Am I
using htaccess files correctly or do I need to alter some other values
within Apache's httpd.conf file??

Any help much appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] PHP's include_path

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 01:43, Neil Freeman wrote:
 Hi there,
 
 Am I correct in thinking that you can specify the PHP include_path line
 within an Apache .htaccess file? If so does anyone know the correct
 syntax of doing this?

Something along the lines of:

IfModule mod_php4.c
   AddType application/x-httpd-php .html .inc .php
   php_value include_path .:/path/to/include/files/
/IfModule

Alter to suit your configuration.


Hope this helps,

Torben
 
 If you cannot specifiy PHP's include_path line from within this file -
 how do you use different include paths for different web sites???
 
 Hope someone can help :)
 
 Neil
 
  Email:  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




RE: [PHP] ereg_replace help

2002-02-04 Thread Lars Torben Wilson

On Sun, 2002-02-03 at 21:34, Martin Towell wrote:
 is that a direct copy from your code? - if it is, there's two errors
 1. you have a comma just before the closing backet
 2. the function is : implode(string glue, array pieces)
so that would be : $content = implode(\n, $lines);
ie. the two arguments are the wrong way around
 Martin

Actually, implode() will take its arguments in either order, so
there's really only one thing (the comma) which could be causing
the problem.

Also, for the original poster: if you only need to do simple 
string replacements, you should see whether str_replace() will
serve your purpose. It's much less expensive than ereg_replace().
If you feel that you require regular expressions, the preg_*()
functions are less expensive than the ereg_*() equivalents.


Torben

 -Original Message-
 From: John P. Donaldson [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 04, 2002 4:32 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] ereg_replace help
 
 
 I'm not actually replacing \n with br, I just used
 that as an example.  When I tried Martin's solution, I
 got a parse error on this line:
 
 $content = implode($lines, \n,); 
 
 I checked the manual and it's constructed properly ..
 I think.  What could be giving me the parse error on
 this line.  The previous line reads:
 
 $lines = file(log.txt);
 
 Thanks,
 John
 
 
 
 
 --- Mike Frazer [EMAIL PROTECTED] wrote:
  nl2br() would serve that purpose as well.  See the
  Strings section of the
  Functions Reference in the manual.
  
  Mike Frazer
  
  
  
  Martin Towell [EMAIL PROTECTED] wrote in
  message
 
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   $lines = file(filename_here.blah);  // read in
  file as an array
   $content = implode(\n, $lines); // join it
  all back together
   $new_cont = ereg_replace(from, to, $content);
   fopen(...);  fputs(..., $new_content); 
  fclose(...);
  
  
   if your intent is to replace all new lines with
  br's then use this
  instead
   ...
  
   $lines = file(filename_here.blah);  // read in
  file as an array
   $content = implode(br, $lines);   // join it
  all back together
   fopen(...);  fputs(..., $content);  fclose(...);
  
  
   hope this helps
  
   -Original Message-
   From: John P. Donaldson
  [mailto:[EMAIL PROTECTED]]
   Sent: Monday, February 04, 2002 3:39 PM
   To: php
   Subject: [PHP] ereg_replace help
  
  
   I have a file open and can successfully write to
  it,
   but I was to be able to search for a certain
  string of
   text and replace it with a string of text.  I
  can't
   figure out how to construct a proper ereg_replace
   statement to search through this file and do the
   replacing.  Examples I've seen are in the manner
  of:
  
   $text = line1\nline2\n;
   fputs(ereg_replace(\n, br, $text));
  
   But how do I set the value of $text to be the
  entire
   contents of the text file I've got open so it can
   search through the entire file to find matches and
   replace those matches?  Any help is greatly
   appreciated.
  
   Thanks,
   John
  
   __
   Do You Yahoo!?
   Great stuff seeking new owners in Yahoo! Auctions!
   http://auctions.yahoo.com
  
   --
   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
  
 
 
 __
 Do You Yahoo!?
 Great stuff seeking new owners in Yahoo! Auctions! 
 http://auctions.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] HTTP Header

2002-02-04 Thread Mike Maltese

Just use header().

header(HTTP/1.1 200);
header(Date: Mon, 04 Feb 2002 10:01:54 GMT);
etc., etc.

Just make sure that they are all sent before you start any output to the
browser.

Mike

- Original Message -
From: Daniel Reichenbach [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 2:06 AM
Subject: [PHP] HTTP Header


 Hy list :-)

 I need to manually send the HTTP header with PHP.

 The following is an example what I have to send to the client:

 HTTP/1.1 200 OK
 Date: Mon, 04 Feb 2002 10:01:54 GMT
 Server: Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6
 Connection: Keep-alive, close
 Expires: Thu, 01 Dec 1994 16:00:00 GMT
 Content-Length: 1078
 Content-Type: text/plain

 How would I Do that with PHP?

 Thx,
 Daniel


 --
 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's include_path

2002-02-04 Thread Neil Freeman

Thanks for the quick reply Jason. This looks like it'll achieve what I want but I
think that using a htaccess file is a better 'overall' method.

Cheers,

Neil

Jason Wong wrote:

 On Monday 04 February 2002 17:43, Neil Freeman wrote:
  Hi there,
 
  Am I correct in thinking that you can specify the PHP include_path line
  within an Apache .htaccess file? If so does anyone know the correct
  syntax of doing this?
 
  If you cannot specifiy PHP's include_path line from within this file -
  how do you use different include paths for different web sites???

 I believe you can also use init_set() to set the include path.

 hth
 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk

 /*
 Please remain calm, it's no use both of us being hysterical at the same time.
 */

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

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] PHP's include_path

2002-02-04 Thread Neil Freeman

Thanks for the syntax info Lars.

Neil

Lars Torben Wilson wrote:

 On Mon, 2002-02-04 at 01:43, Neil Freeman wrote:
  Hi there,
 
  Am I correct in thinking that you can specify the PHP include_path line
  within an Apache .htaccess file? If so does anyone know the correct
  syntax of doing this?

 Something along the lines of:

 IfModule mod_php4.c
AddType application/x-httpd-php .html .inc .php
php_value include_path .:/path/to/include/files/
 /IfModule

 Alter to suit your configuration.

 Hope this helps,

 Torben

  If you cannot specifiy PHP's include_path line from within this file -
  how do you use different include paths for different web sites???
 
  Hope someone can help :)
 
  Neil
  
   Email:  [EMAIL PROTECTED]
   [EMAIL PROTECTED]
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
  Torben Wilson [EMAIL PROTECTED]
  http://www.thebuttlesschaps.com
  http://www.hybrid17.com
  http://www.inflatableeye.com
  +1.604.709.0506

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Hi,

This is my first time attempting to use htaccess files. I am running
Apache
1.3.20 with PHP v4.0.6 installed as a module. Within Apache's httpd.conf

file I have the following value set:

AccessFileName apache.htaccess

And within an 'Alias' directory I have a file entitled 'apache.htaccess'

which contains the following:

IfModule mod_php4.c
php_value include_path = .;C:/My/PHP/Dir
/IfModule

What I am attempting to do is alter PHP's include path 'on the fly'
rather
than specifying an overall value within php.ini. The problem I have
though
is that the 'include_path' value does not appear to be picked up. Am I
using htaccess files correctly or do I need to alter some other values
within Apache's httpd.conf file??

Any help much appreciated.

Neil

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] using HTML objects into PHP code

2002-02-04 Thread Eduardo Melo

How can i accessa HTML object into a PHP code ?

as such as :

select name=~x~
   option A option
   option B option
   option C option
/select)

How can a access ~x~ content into a PHP variable ?

best regards,

eduardo melo
copmuter programmer

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] using HTML objects into PHP code

2002-02-04 Thread David Otton

On Mon, 04 Feb 2002 09:32:31 -0200, you wrote:

First, you need to fix those tags :

select name=~x~
 select name=x

   option A option
option A /option

How can a access ~x~ content into a PHP variable ?

It happens automatically. When you submit a form, PHP variables are
created for the receiving script that match the contents of the form.
Take a look at this example, which posts back to itself :

html
 headtitletest page/title/head
 body
?
if (isset($variable)) {
/* do page 2 */
echo(pYou chose : $variable/p);
} else {
/* do page 1 */
?
  form method=post action=? echo ($PHP_SELF); ?
   pChoose one : select name=variable
option value=1Red/option
option value=2Green/option
option value=3Blue/option
   /select/p
   pinput type=submit name=go value=go/p
  /form
?
}
?
 /body
/html

Also check here http://www.faqts.com/knowledge_base/index.phtml/fid/6
for more help with forms.

copmuter programmer

I wish you'd fix that...

djo


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




Re: [PHP] Insert or update in Oracle database

2002-02-04 Thread David Otton

On Mon, 4 Feb 2002 09:23:24 - , you wrote:

Hello,
To these that use the PHP by integrating an Oracle database, I wanted to
know how made you your idea to be able to make the update or insert in your
database.

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

or maybe

http://www.php.net/manual/en/function.odbc-execute.php

Should be pretty much the same as doing a select. If select is working
but update and insert aren't, perhaps the user you're connecting as
doesn't have permission to insert or update records?

djo


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




[PHP] Nothing to do with PHP, sorry

2002-02-04 Thread Liam MacKenzie

Hello everyone,

I have a problem that has nothing to do with PHP.  I know 
I shouldn't ask it here, but I need a response urgently as it's 
a major security hole.

I'm trying to set up a firewall, I've sucessfully got my portblocking 
working and all the ones I need open are open, but I can't get 
my masquerading to work when I turn on my firewall.
Here it is...

---
#!/bin/sh
/etc/rc.d/init.d/ipchains stop
/etc/rc.d/init.d/ipchains start
depmod -a
echo 1  /proc/sys/net/ipv4/ip_forward

ipchains -P forward DENY
ipchains -A forward -s 192.168.0.0/24 -d 192.168.0.0/24 -j ACCEPT
ipchains -A forward -s 203.45.222.39/32 -d 0/0 -j ACCEPT
ipchains -A forward -s 192.168.0.0/24 -d 0/0 -j MASQ
ipchains -A forward -s 192.168.0.0/24 -d 0/0 -j ACCEPT

ipchains -P input DENY
# If I comment out the above line, masquerading works
# but as soon as I uncomment it, my security goes up and
# my masquerading does down!  ARGH!

ipchains -A input -j ACCEPT -s 0/0 -d 0/0 25 -p tcp
ipchains -A input -j ACCEPT -s 0/0 -d 0/0 80 -p tcp
ipchains -A input -j ACCEPT -s 0/0 -d 0/0 53 -p tcp
ipchains -A input -j ACCEPT -s 0/0 -d 0/0 53 -p udp
ipchains -A input -j ACCEPT -s 0/0 -d 0/0 68 -p udp
ipchains -A input -j ACCEPT -s 0/0 -d 0/0 110 -p tcp
ipchains -A input -j ACCEPT -s 192.168.0.0/24
#ipchains -A input -j ACCEPT -p icmp
ipchains -A input -i lo -j ACCEPT
ipchains -A input -i eth1 -j ACCEPT
---

I've spent hours trying to work this out, and I'm sure it's
something REALLY basic that I've missed.

Major apologies for asking this here, if you have a suggestion
where I should ask such a question in the future, please tell me.

Thank you very much for your help!
Liam



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




Re: [PHP] using HTML objects into PHP code

2002-02-04 Thread bvr



best regards,

eduardo melo
copmuter programmer


Any cops on this list:
watch out for this guy!


bvr.



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




[PHP] tab inserting tab

2002-02-04 Thread val petruchek

Hello, list!

I have textarea in my page and want it to insert \tabs when clicking Tab
instead of focusing on the next control element. Any thoughts or
suggestions?

Thanks

Valentin Petruchek (aki Zliy Pes)
*** Cut the beginning ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]




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




Re: [PHP] Can php Read contents from MS Word in Exactly same format

2002-02-04 Thread Chip Wiegand

On Mon, 04 Feb 2002 01:29:11 -0500
Jason G. [EMAIL PROTECTED] wrote:

 MS Word is a proprietary, binary (i think), format...  Have fun.
 
 There may be a solution out there.
 
 If you could convince her to save it in Rich Text Format (rtf) and
 then upload it, your life would be much easier...
 
 -Jason Garber
 
Another option - have her save it as html in word. sure the code it creates is ugly 
and basically unedible rubbish, but it will display correctly. I have a similar 
situation where the marketing people post a once a month dealer newsletter, just a 
simple single-column 1 to 2 page affair. I just got in the habbit of having them email 
me the .doc and then I convert it to html myself. Takes all of 5 minutes or so and it 
clean code.

--
Chip
 
 At 01:51 PM 2/4/2002 +0800, Jack wrote:
 Dear all
 I had made  a news input page for one of the HR Manger to input the
 news for the whole company to read, she is quick comfort with using
 MS word as a editor, so is there anyway that the php can read the
 contents from the MS Word and display as exactly same format to html?
 
 If there is so, could any one suggest a book to me?
 
 Thx a lot
 Jack
 [EMAIL PROTECTED]
 
 
 
 --
 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] Variable problem

2002-02-04 Thread Randy Johnson

I heard before that you can store session variables in a database rather
than using the tmp directory etc  etc..Does anybody have any links on
this?

Thanks


Randy
- Original Message -
From: Yoel Benitez Fonseca [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 18, 2002 2:26 PM
Subject: RE: [PHP] Variable problem


   Use an array !?, I mean :

   $result[$i] = test;

  How do I combine the following so it is treated as one variable
 
  $i=10
 
  $result$i=test;
 
 
  I want this to be:
 
 
  $result10=test;
 
 
  $i changes so I cannot just put in 10 instead of I.
 
 
  anybody know how i can do that?
 --
 Yoel Benitez Fonseca



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


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




[PHP] sockets

2002-02-04 Thread Sandeep Murphy

Hi, 

I am trying to access a remote file by opening a socket on port 80 but keep
getting refused... 

The server does listen on port 80 as i can access it via browser... 

my code reads like this: 
?php 
$Destination =
http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Com
municator;
$Request = action=$actionusername=$unamepassword=$password; 
$cfgTimeOut = 20; 

$theURL = parse_url($Destination); 
$host = $theURL[host]; 
$path = $theURL[path]; 
$port = $theURL[port]; if ($port==) $port=80; 
$header = POST .$path. HTTP/1.0\r\n; 
$header .= Host: .$host.\r\n; 
$header .= Accept: */*\r\n; 
$header .= Accept-Language: en\r\n; 
$header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n; 
$header .= Content-Type: text/xml\r\n; 
$header .= Content-Length: .strlen($Request).\r\n; 
$header .= Content: \r\n\r\n; 
$msg = $header. $Request ; 
$Response = ; 

echo $port; 
//echo $host; 

// open a socket 
if(!$cfgTimeOut) 
// without timeout 
$fp = fsockopen($host,$port); 
else 
// with timeout 
$fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut); 


if ($fp) { 
if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D 

while (!feof($fp)) {$Response .= fgets($fp,32768);} 

fclose($fp); // R E C E I V E 

} else 
{ 
echo Unable to access (.$Destination.).br; 

echo a href=\javascript:history.go(-1)\Try another/a;} 

print $response\n; 

print hello; 
? 

any suggestions pl?? 

TIa, 
sands 
 

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




Re: [PHP] Re: Sending an e-mail to 1,000 people

2002-02-04 Thread Anas Mughal

What would be the easiest and more effective way to
check for bouncing email addresses?
Thank you.



--- Manuel Lemos [EMAIL PROTECTED] wrote:
 Hello,
 
 B Richards wrote:
  
  How many emails per hour can people generate on a
 typical dedicated server?
  on qmail? on smtp?
 
 It depends on many things. Anyway, queueing is one
 thing and delivering
 is another. Queuing and delivering from the same
 machine is usually slow
 because it requires the server to resolve the domain
 and connecting with
 each recipient MX to deliver the messages. If the
 connection is slow,
 everything is stalled.
 
 For very large recipient lists like large mailing
 lists sites like
 eGroups, the recommended setup is at least one
 server for queuing the
 messages in one or many others. The queuing is best
 achieved using QMQP.
 SMTP is too slow because it degrades queuing speed
 exponentially with
 the number of recipients.
 
 Anyway in a network with one server for queueing
 (where ezmlm was) and 8
 servers for delivery, it could queue 10.000 messages
 per minute using
 SMTP. With QMQP it would be much faster queueing
 because it would not
 expand VERP addresses and would only queue one
 message in the delivery
 servers.
 
 The actual delivery it depends a lot on the Internet
 link you have and
 the connectivity with the remote servers. Bouncing
 and hard to connect
 servers make it very slow. That is why it is
 important to prune the
 bouncing addresses from your mailing lists.
 
 ezmlm process is reasonably good handling bounces
 but I would not
 recommend starting a mailing list with a large
 number of subscribers
 without first pruning it because the last retry
 message that is sent to
 all bouncing addresses after 11 days (1.000.000
 seconds) may choke your
 queuing server because it send out individual
 messages and if there are
 many bouncing addresses that can make your machine
 and network choke
 with very high traffic.
 
 Trust me, I had to put up with the embarrassment of
 choking a newsletter
 server with 1/3 of near 300.000 subscribers of MTV
 Brasil newsletter!
 Can you imagine almost 100.000 subscribers being
 mailed and bouncing at
 the same time. (Gulp!) Living and learning. :-)
 
 
 Regards,
 Manuel Lemos
  
  - Original Message -
  From: Manuel Lemos [EMAIL PROTECTED]
  To: Ed Lazor [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED];
 [EMAIL PROTECTED]
  Sent: Saturday, February 02, 2002 9:09 PM
  Subject: Re: [PHP] Re: Sending an e-mail to 1,000
 people
  
   Hello,
  
   Ed Lazor wrote:
   
At 06:25 PM 2/2/2002 -0500, Chris Cocuzzo
 wrote:
Godamnit. Shut-up about this already for
 godsakes and answer the
original question!!
   
LOL  hehe good point Chris.
  
   Aleluia, somebody sensible! :-)
  
  
Ben Clumeck [EMAIL PROTECTED] wrote in
 message
  I would like to send an e-mail (the same
 e-mail) to 1,000 different
  people.  I want each persons name to be in
 the To: field.  Is
  there a
 way to
  customize it to where it can say Dear
 (having a different
  persons name
  corresponding to an e-mail address) so
 that it looks customized.
   
Ben, how you approach this will depend on how
 you have the data
stored.  Let's assume two things:  you have
 the e-mail addresses and
  names
in a database and know how to retrieve and
 store them into the variables
$email and $name.  That said, create the body
 of your text:
   
$body = 
Dear $name,
   
Here are recent developments on our web
 site... etc.
;
   
Then use the mail function
  (http://www.php.net/manual/en/function.mail.php)
to send the letter to the person like this:
   
mail($email, Site update, $body, From: 
 [EMAIL PROTECTED]);
   
The next thing you'll probably start wondering
 is how to send fancy
  e-mail
instead of those generic text based ones... 
 PHPBuilder has an article
you'll want to check out located here:
   

http://www.phpbuilder.com/columns/kartic2807.php3.
  
   I do not advice anybody to send personalized
 bulk mail, even less in
   PHP. It will take a lot of time to just queue
 the message in the local
   relay mail server and since each message has to
 be stored separately in
   the mail server queue disk consuming a lot of
 space.
  
   What I recommend is to just queue a single
 message with all recepients
   in Bcc:. This is better done with qmail using
 qmail-inject because you
   do not have to actually add Bcc: headers to the
 message, just the
   recipients addresses, one per line,  and then
 headers and the body of
   the message. You may want to try this class for
 composing and sending
   MIME messages. It has subclasses for queing with
 PHP mail function, SMTP
   server, sendmail and qmail.
  
  

http://phpclasses.upperdesign.com/browse.html/package/9
  
   If you can use it, I recommend to use qmail
 because it is much faster
   than the other alternatives to queue message to
 be sent to many
   recipients and also 

Re: [PHP] sockets

2002-02-04 Thread Evan Nemerson

This should help you. It is the fsockopen version of what I posed about 6 
hours ago.

function getdata ($host, $port, $data)
{
$fp = fsockopen ( $host, $port, $ec, $es, 5.0);
if ( !$fp )
{
exit (ERROR $ec: $es\n);
}
fputs ($fp, $data);
while ( !feof($fp) )
{
$buffer = fgets ($fp,128);
$string .= $buffer;
}
fclose ($fp);

return $string;
}


sends $data to $host:$port and returns the response, until the connection is 
severed. something like getdata (www.php.net, 80, GET / 
HTTP/1.0\r\n\r\n) should work out well for you



On Monday 04 February 2002 07:15, you wrote:
 Hi,

 I am trying to access a remote file by opening a socket on port 80 but keep
 getting refused...

 The server does listen on port 80 as i can access it via browser...

 my code reads like this:
 ?php
 $Destination =
 http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
m municator;
 $Request = action=$actionusername=$unamepassword=$password;
 $cfgTimeOut = 20;

 $theURL = parse_url($Destination);
 $host = $theURL[host];
 $path = $theURL[path];
 $port = $theURL[port]; if ($port==) $port=80;
 $header = POST .$path. HTTP/1.0\r\n;
 $header .= Host: .$host.\r\n;
 $header .= Accept: */*\r\n;
 $header .= Accept-Language: en\r\n;
 $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n;
 $header .= Content-Type: text/xml\r\n;
 $header .= Content-Length: .strlen($Request).\r\n;
 $header .= Content: \r\n\r\n;
 $msg = $header. $Request ;
 $Response = ;

 echo $port;
 //echo $host;

 // open a socket
 if(!$cfgTimeOut)
 // without timeout
 $fp = fsockopen($host,$port);
 else
 // with timeout
 $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut);


 if ($fp) {
 if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D

 while (!feof($fp)) {$Response .= fgets($fp,32768);}

 fclose($fp); // R E C E I V E

 } else
 {
 echo Unable to access (.$Destination.).br;

 echo a href=\javascript:history.go(-1)\Try another/a;}

 print $response\n;

 print hello;
 ?

 any suggestions pl??

 TIa,
 sands

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




Re: [PHP] using HTML objects into PHP code

2002-02-04 Thread Evan Nemerson

ereg() and eregi() should help. Maybe even explode().



On Monday 04 February 2002 03:32, you wrote:
 How can i accessa HTML object into a PHP code ?

 as such as :

 select name=~x~
option A option
option B option
option C option
 /select)

 How can a access ~x~ content into a PHP variable ?

 best regards,

 eduardo melo
 copmuter programmer

 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.com

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




RE: [PHP] sockets

2002-02-04 Thread Sandeep Murphy

Hi,

nope, its still not working.. Along with the Host and port, I Have to send 3
more fields, Action,Username and Password for authentification and it has to
be Post for the Servlet does not respond to Get requests..

any more ideas pl???

Thnx...

sands

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 4 de Fevereiro de 2002 15:25
To: Sandeep Murphy
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sockets


This should help you. It is the fsockopen version of what I posed about 6 
hours ago.

function getdata ($host, $port, $data)
{
$fp = fsockopen ( $host, $port, $ec, $es, 5.0);
if ( !$fp )
{
exit (ERROR $ec: $es\n);
}
fputs ($fp, $data);
while ( !feof($fp) )
{
$buffer = fgets ($fp,128);
$string .= $buffer;
}
fclose ($fp);

return $string;
}


sends $data to $host:$port and returns the response, until the connection is

severed. something like getdata (www.php.net, 80, GET / 
HTTP/1.0\r\n\r\n) should work out well for you



On Monday 04 February 2002 07:15, you wrote:
 Hi,

 I am trying to access a remote file by opening a socket on port 80 but
keep
 getting refused...

 The server does listen on port 80 as i can access it via browser...

 my code reads like this:
 ?php
 $Destination =

http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
m municator;
 $Request = action=$actionusername=$unamepassword=$password;
 $cfgTimeOut = 20;

 $theURL = parse_url($Destination);
 $host = $theURL[host];
 $path = $theURL[path];
 $port = $theURL[port]; if ($port==) $port=80;
 $header = POST .$path. HTTP/1.0\r\n;
 $header .= Host: .$host.\r\n;
 $header .= Accept: */*\r\n;
 $header .= Accept-Language: en\r\n;
 $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n;
 $header .= Content-Type: text/xml\r\n;
 $header .= Content-Length: .strlen($Request).\r\n;
 $header .= Content: \r\n\r\n;
 $msg = $header. $Request ;
 $Response = ;

 echo $port;
 //echo $host;

 // open a socket
 if(!$cfgTimeOut)
 // without timeout
 $fp = fsockopen($host,$port);
 else
 // with timeout
 $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut);


 if ($fp) {
 if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D

 while (!feof($fp)) {$Response .= fgets($fp,32768);}

 fclose($fp); // R E C E I V E

 } else
 {
 echo Unable to access (.$Destination.).br;

 echo a href=\javascript:history.go(-1)\Try another/a;}

 print $response\n;

 print hello;
 ?

 any suggestions pl??

 TIa,
 sands

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




[PHP] prev next links

2002-02-04 Thread Kunal Jhunjhunwala

Hey,
Does anyone know of a well written example of this? I have seen so many
examples, but the over head just seems to be too much... does anyone have a
smooth and well written routine?
Regards,
Kunal Jhunjhunwala


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




Re: [PHP] sockets

2002-02-04 Thread Bogdan Stancescu

 The server does listen on port 80 as i can access it via browser...
 http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
m municator;

Am I missing something here? What's srv157:7001? Why don't you first try 
http://www.google.com?

Bogdan

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




RE: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Mark Roedel

 -Original Message-
 From: Neil Freeman [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, February 04, 2002 4:45 AM
 To: PHP General
 Subject: [PHP] How do I get htaccess files to take effect?
 
 
 This is my first time attempting to use htaccess files. I am 
 running Apache 1.3.20 with PHP v4.0.6 installed as a module.
 Within Apache's httpd.conf file I have the following value set:
 
 [snip]
 
 What I am attempting to do is alter PHP's include path 'on 
 the fly' rather than specifying an overall value within php.ini.
 The problem I have though is that the 'include_path' value does
 not appear to be picked up. Am I using htaccess files correctly
 or do I need to alter some other values within Apache's
 httpd.conf file??

What you've got so far looks fine.

The other thing that you'll need, though, is an appropriate
AllowOverride value in your httpd.conf for the server or directories
in question.  

http://httpd.apache.org/docs/mod/core.html#allowoverride


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


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




Re: [PHP] prev next links

2002-02-04 Thread Joel Boonstra

 Does anyone know of a well written example of this? I have seen so many
 examples, but the over head just seems to be too much... does anyone have a
 smooth and well written routine?
 Regards,
 Kunal Jhunjhunwala

I think this may help out.  I wrote a site that has a daily devotional on
it, and contains links to previous and next days.  Here's the code:

?php
// assume that $month, $day, $year, contain the current month, day, year
// could also use direct calls to date() instead, if this is for today
list ($prev_year, $prev_month, $prev_day) =
  split ( , date(Y m d, mktime(0,0,0,$month,$day-1,$year)));
list ($next_year, $next_month, $next_day) =
  split ( , date(Y m d, mktime(0,0,0,$month,$day+1,$year)));

// build your links
// this will, of course, change with your dating schema
$prev_link = http://yourdomain.com/?$prev_year-$prev_month-$prev_day;
$next_link = http://yourdomain.com/?$next_year-$next_month-$next_day;

// display them
print a href=\$prev_link\yesterday/abr;
print a href=\$next_link\tomorrow/a;
?

This doesn't take into account whether or not yesterday or tomorrow's
objects or files or whatever actually exists.  Since that is
site-specific, you'll need to add that sort of logic yourself.

Hope that helps!

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


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




[PHP] str_replace problem

2002-02-04 Thread Tomy Wagner

hi, 

got a weird problem... what i am trying is this:
$str = str_replace(é, e, $str);
in a string containing a 'é' for sure...
but it doesn't replace it..
when i try this: 

echo str_replace(é, e, dfsdfsdfé);
it works !?

any suggestions?

Tomy Wagner



Re: [PHP] Check Boxes and updating records. (HELP ME....)

2002-02-04 Thread Erik Price


On Friday, February 1, 2002, at 06:05  PM, Georgie Casey wrote:

 OK, I've a page for my users to sign up on my website and in the form,
 there's a few checkboxes fields. So I set the name of the check boxes as
 name[] and PHP made an array of all the options choosen. All the check 
 boxes
 values are numbers, so I got all the numbers from the array, put a comma
 between them all and inserted them as one field in my database. Easy.

Sometimes, when working with RDBMS, you don't want to take shortcuts 
like this -- by entering disparate data into one field, that you wish to 
then pull from the database and use as separate entities (you want to 
populate each checkbox with a check for each number that is stored).  In 
the future, you may wish to plan your database so that it stores each 
checked value in a separate field, or some other more elegant scheme for 
data storage.  Just advice to keep in mind for the future.

 It worked well. But now I've a problem. I want to give users the option 
 of
 changing their details when they log into the site. So I get the form 
 and
 put ?php echo $variable_name; ? in every text box so the user sees 
 their
 record. I had a small problem with showing choosen values in dropdown 
 lists
 and radio options but i solved them both.

In order to pull that comma-delimited database record for that user from 
the database and use it to populate each checkbox that deserves a check, 
what you will need to do is this:

1) use a SQL query to extract the record for the user
2) use PHP function explode() to separate the record into an array with 
the numbers as separate elements.  Use the comma to delimit the 
explode() function, since you've stored your data with commas.
3) Now you've got an array full of values for the user's checked boxes.  
You probably want to run the array through a WHILE loop that prints the 
appropriate check box, and sets the attribute  checked=yes for each 
box within the loop that has a corresponding value in the record from 
the SQL query.

Hope this helps, and if not, post some code since we have to answer this 
question in the abstract.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] prev next links

2002-02-04 Thread Joel Boonstra

 // build your links
 // this will, of course, change with your dating schema
 $prev_link = http://yourdomain.com/?$prev_year-$prev_month-$prev_day;
 $next_link = http://yourdomain.com/?$next_year-$next_month-$next_day;

Sorry, I omitted the closing quote mark on these lines.  Here is a
non-syntax-error-ridden version:

?php
$prev_link = http://yourdomain.com/?$prev_year-$prev_month-$prev_day;;
$next_link = http://yourdomain.com/?$next_year-$next_month-$next_day;;
?

Sorry!

-- 
[ joel boonstra | [EMAIL PROTECTED] ]


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




RE: [PHP] sockets

2002-02-04 Thread Sandeep Murphy

srv157 Stands for the server same and 7001 is the port..

with www.google.com, get a request denied error...

sands

-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 4 de Fevereiro de 2002 16:01
To: Sandeep Murphy; [EMAIL PROTECTED]
Subject: Re: [PHP] sockets


 The server does listen on port 80 as i can access it via browser...

http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
m municator;

Am I missing something here? What's srv157:7001? Why don't you first try 
http://www.google.com?

Bogdan

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




Re: [PHP] Re: Sending an e-mail to 1,000 people

2002-02-04 Thread Erik Price


On Saturday, February 2, 2002, at 06:05  PM, Sterling Hughes wrote:

 I think you are confused...  Unsolicited e-mail is in fact the
 definition of spam!


Semantics war!

You're both right... although originally, it meant repetitive blasts of 
identical material (to newsgroups).  I'm pretty sure most people use it 
these days to describe any unsolicted email.


Let's see what the Jargon File says (one of the most venerable sources 
for answers to disputes like this)...

spam vt.,vi.,n.

[from Monty Python's Flying Circus] 1. To crash a program by 
overrunning a fixed-size buffer with excessively large input data. See 
also buffer overflow, overrun screw, smash the stack. 2. To cause a 
newsgroup to be flooded with irrelevant or inappropriate messages. You 
can spam a newsgroup with as little as one well- (or ill-) planned 
message (e.g. asking What do you think of abortion? on soc.women). 
This is often done with cross-posting (e.g. any message which is 
cross-posted to alt.rush-limbaugh and alt.politics.homosexuality will 
almost inevitably spam both groups). This overlaps with troll behavior; 
the latter more specific term has become more common. 3. To send many 
identical or nearly-identical messages separately to a large number of 
Usenet newsgroups. This is more specifically called `ECP', Excessive 
Cross-Posting. This is one sure way to infuriate nearly everyone on the 
Net. See also velveeta and jello. 4. To bombard a newsgroup with 
multiple copies of a message. This is more specifically called `EMP', 
Excessive Multi-Posting. 5. To mass-mail unrequested identical or 
nearly-identical email messages, particularly those containing 
advertising. Especially used when the mail addresses have been culled 
from network traffic or databases without the consent of the recipients. 
Synonyms include UCE, UBE. 6. Any large, annoying, quantity of output. 
For instance, someone on IRC who walks away from their screen and comes 
back to find 200 lines of text might say Oh no, spam.

The later definitions have become much more prevalent as the Internet 
has opened up to non-techies, and to most people senses 3 4 and 5 are 
now primary. All three behaviors are considered abuse of the net, and 
are almost universally grounds for termination of the originator's email 
account or network connection. In these senses the term `spam' has gone 
mainstream, though without its original sense or folkloric freight - 
there is apparently a widespread myth among lusers that spamming is 
what happens when you dump cans of Spam into a revolving fan. Hormel, 
the makers of Spam, have published a surprisingly enlightened position 
statement on the Internet usage.





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

Thanks for the reply Mark,

I am fairly new to this :) Here is a snippet of what I have set up so far
(httpd.conf):

DocumentRoot D:/Program Files/Apache Group/Apache/realdocs

Directory /
Options FollowSymLinks
AllowOverride None
/Directory

Directory D:/Program Files/Apache Group/Apache/realdocs
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
/Directory

AccessFileName apache.htaccess

Alias /sandbox P:/Projects/Sandboxes/storyboard
Directory P:/Projects/Sandboxes/storyboard
AllowOverride All
/Directory

Within P:\Projects\Sandboxes\storyboard I have my apache.htaccess file:

IfModule mod_php4.c
php_value include_path = .;P:/Projects/Sandboxes/Stratos/asa_php

/IfModule

When I access the URL http://localhost/sandbox though I receive the
message Internal Server Error

I imagine it's something simple but as I have not done this before
'simple' equates to unknown :) Any ideas???

Neil



Mark Roedel wrote:

  -Original Message-
  From: Neil Freeman [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 04, 2002 4:45 AM
  To: PHP General
  Subject: [PHP] How do I get htaccess files to take effect?
 
 
  This is my first time attempting to use htaccess files. I am
  running Apache 1.3.20 with PHP v4.0.6 installed as a module.
  Within Apache's httpd.conf file I have the following value set:
 
  [snip]
 
  What I am attempting to do is alter PHP's include path 'on
  the fly' rather than specifying an overall value within php.ini.
  The problem I have though is that the 'include_path' value does
  not appear to be picked up. Am I using htaccess files correctly
  or do I need to alter some other values within Apache's
  httpd.conf file??

 What you've got so far looks fine.

 The other thing that you'll need, though, is an appropriate
 AllowOverride value in your httpd.conf for the server or directories
 in question.

 http://httpd.apache.org/docs/mod/core.html#allowoverride

 ---
 Mark Roedel   | Blessed is he who has learned to laugh
 Systems Programmer|  at himself, for he shall never cease
 LeTourneau University |  to be entertained.
 Longview, Texas, USA  |  -- John Powell

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




[PHP] Oddity

2002-02-04 Thread Chris Boget

Ok, could someone tell me why this isn't working?
(note, I took out all my error checks.  This is just the
relevant code...

$query = Query that does return row(s);
$result = mysql( $dbname, $query );

$macroDataArray = mysql_fetch_array( $result );

for( reset( $macroDataArray ); $elementKey = key( $macroDataArray ); next( 
$macroDataArray )) {
echo Value for key $elementKey = $macroDataArray[$elementKey]br\n;

}
// this should spit out one line for every element.

That doesn't work but this does:

foreach( $macroDataArray as $elementKey = $elementValue ) {
echo Value for key $elementKey = $elementValuebr\n;

}
// this spits out 2 lines for every element.

Why?  What's going on?  I could use the second bit of code, but that returns
four pairs for each array element:

ELEMENT   VALUE
05000
KeyName  5000

for example, where the above is the same element.  I really don't need the
numerical key (the 0 above), just the name and that's why I need to find
out why the first FOR loop isn't working.

Any ideas?  I've tried everything... :(

Chris




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




[PHP] mysql backup function in php?

2002-02-04 Thread Wilbert Enserink

Hi all,

i searched the manual for a php backup function for a mysql DB.
I can't seem to find it, but i'm not sure whether it exists.


mysql_backup_db maybe??



thx. Wilbert

- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

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




Re: [PHP] Oddity

2002-02-04 Thread Mike Maltese

This could be the problem in your for loop: $elementKey = key(
$macroDataArray ) - you're using the = assignment operator. Try == or =.

Mike

- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 8:29 AM
Subject: [PHP] Oddity


 Ok, could someone tell me why this isn't working?
 (note, I took out all my error checks.  This is just the
 relevant code...

 $query = Query that does return row(s);
 $result = mysql( $dbname, $query );

 $macroDataArray = mysql_fetch_array( $result );

 for( reset( $macroDataArray ); $elementKey = key( $macroDataArray );
next( $macroDataArray )) {
 echo Value for key $elementKey = $macroDataArray[$elementKey]br\n;

 }
 // this should spit out one line for every element.

 That doesn't work but this does:

 foreach( $macroDataArray as $elementKey = $elementValue ) {
 echo Value for key $elementKey = $elementValuebr\n;

 }
 // this spits out 2 lines for every element.

 Why?  What's going on?  I could use the second bit of code, but that
returns
 four pairs for each array element:

 ELEMENT   VALUE
 05000
 KeyName  5000

 for example, where the above is the same element.  I really don't need the
 numerical key (the 0 above), just the name and that's why I need to find
 out why the first FOR loop isn't working.

 Any ideas?  I've tried everything... :(

 Chris




 --
 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] help with imagecopyresampled()

2002-02-04 Thread Nicki Handy

I have a question about the gd function imagecopyresampled- i get an error that i'm 
not sending it a valid image resourse. I believe it is the variable $new_im that is 
not valid- when printed, it is a resource id not an image path. but i'm not sure. this 
is all the code from a function. if anyone cares to look


 $filename=$thisimage;
 $imageInfo = getimagesize($filename); 
 $width = $imageInfo[0]; 
 $height = $imageInfo[1]; 
 $destpath=./imgs;
 echo width---$width;  ///works
 echo height---$height; ///works

 if($width = $height)
 {
  $factor = $sz/$width;
  $new_width = $sz;
  $new_height = $height * $factor;
 }
 else
 {
  $factor = $sz/$height;
  $new_height = $sz;
  $new_width = $width * $factor;
 }
 
///this here may not be necessary- i can't imagine why it is.
 $src_img = imagecreatefromjpeg($thisimage);
///same here
 $new_im = imagecreatetruecolor($new_width,$new_height);
THIS IS THE PROBLEM
 imagecopyresampled($new_im, $src_img, 0, 0, 0, 0, $new_width,$new_height, $width, 
$height);
 imagejpeg($new_im, $destpath/new_file.jpg,75);
 
 return $new_im;



Nicki Handy
--
http://www.idsociety.com
[EMAIL PROTECTED]




RE: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Mark Roedel

 -Original Message-
 From: Neil Freeman [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, February 04, 2002 10:36 AM
 To: Mark Roedel
 Cc: PHP General
 Subject: Re: [PHP] How do I get htaccess files to take effect?
 
 
 Thanks for the reply Mark,
 
 I am fairly new to this :) Here is a snippet of what I have 
 set up so far

 [snip]

  php_value include_path = .;P:/Projects/Sandboxes/Stratos/asa_php
 
 When I access the URL http://localhost/sandbox though I receive the
 message Internal Server Error

Yay!  That's progress.  *grin*  (At least now we can see that it's
attempting to use the htaccess file, not ignoring it.)

Internal Server Error almost always means See your error logs for
more information.
 
In this case, I think the first thing I'd try, unless the errorlog info
indicates otherwise, is losing the = sign.


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


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




Re: [PHP] mysql backup function in php?

2002-02-04 Thread Mike Maltese

Use PHPMyAdmin. You can dump to a CSV file or it can output all of the
INSERT statements to rebuild a table.


- Original Message -
From: Wilbert Enserink [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 8:22 AM
Subject: [PHP] mysql backup function in php?


 Hi all,

 i searched the manual for a php backup function for a mysql DB.
 I can't seem to find it, but i'm not sure whether it exists.


 mysql_backup_db maybe??



 thx. Wilbert

 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -

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

2002-02-04 Thread Chris Boget

 $macroDataArray = mysql_fetch_array( $result );

I'm still curious what is going wrong, but I've found a work arround.
One of the things I love about PHP is that you learn something new
just about every day.  Instead of fetch_array(), I can use fetch_assoc()
and it'll do just what I need. :)

Chris



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




Re: [PHP] Oddity

2002-02-04 Thread Mike Maltese

You may want to give mysql_fetch_object a try. I like it because you end up
typing less. You access elements like this: $row-data, instead of
$row['data']. Just my $0.02.

Mike
- Original Message -
From: Chris Boget [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 8:42 AM
Subject: Re: [PHP] Oddity


  $macroDataArray = mysql_fetch_array( $result );

 I'm still curious what is going wrong, but I've found a work arround.
 One of the things I love about PHP is that you learn something new
 just about every day.  Instead of fetch_array(), I can use fetch_assoc()
 and it'll do just what I need. :)

 Chris



 --
 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] Zend Studio

2002-02-04 Thread Alex Shi

Hi,

After a long time absent from Zend I came across to it today just for
any new articles. To my surprise they changed their home page and
it seems like they are promoting their Zend Studio 2.0. I have no idea
what it is. Is it like a Visual Studio? Does it support template? If any
out there has ever used it could you please give some comment.

Thanks!

Alex Shi


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




Re: [PHP] How do I get htaccess files to take effect?

2002-02-04 Thread Neil Freeman

I've taken out the '=' sign and.we have success!!! Thanks a lot for
your time Mark.

Neil :)

Mark Roedel wrote:

  -Original Message-
  From: Neil Freeman [mailto:[EMAIL PROTECTED]]
  Sent: Monday, February 04, 2002 10:36 AM
  To: Mark Roedel
  Cc: PHP General
  Subject: Re: [PHP] How do I get htaccess files to take effect?
 
 
  Thanks for the reply Mark,
 
  I am fairly new to this :) Here is a snippet of what I have
  set up so far
 
  [snip]
 
   php_value include_path = .;P:/Projects/Sandboxes/Stratos/asa_php
 
  When I access the URL http://localhost/sandbox though I receive the
  message Internal Server Error

 Yay!  That's progress.  *grin*  (At least now we can see that it's
 attempting to use the htaccess file, not ignoring it.)

 Internal Server Error almost always means See your error logs for
 more information.

 In this case, I think the first thing I'd try, unless the errorlog info
 indicates otherwise, is losing the = sign.

 ---
 Mark Roedel   | Blessed is he who has learned to laugh
 Systems Programmer|  at himself, for he shall never cease
 LeTourneau University |  to be entertained.
 Longview, Texas, USA  |  -- John Powell

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

 ***
  This message was virus checked with: SAVI 3.53 Jan 2002
  last updated 30th January 2002
 ***

--

 Email:  [EMAIL PROTECTED]
 [EMAIL PROTECTED]




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




Re: [PHP] How to get the URL into a var?

2002-02-04 Thread bvr


You can get the requested location from:

$_SERVER[QUERY_STRING]

and use the dirname() function on it.

bvr.


On Sat, 2 Mar 2002 10:29:09 +0100, Andy wrote:

Hi there,

I am trying to find out which dir the user is browsing. How can I get the
URL into a var? I tryed path_info, but it only returns the filename.

Here is an example:

URL: http://www.server.com/subapp/test.php

Should return :

subapp

Is this possible??

Thanx for any help

Cheers Andy



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






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




Re: [PHP] can't fint php.ini on OS X

2002-02-04 Thread Erik Price

I think that it depends on where you put it at compile time... but on my 
system it's /usr/local/lib/php.ini


Erik


On Monday, February 4, 2002, at 01:40  AM, Andy wrote:

 does anybody know where the php.ini is on Mac OS X?

 I would like to activate gdlibrary.

 Thanx for the hint Andy



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









Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] can't fint php.ini on OS X

2002-02-04 Thread Erik Price


On Monday, February 4, 2002, at 02:37  AM, Richard Baskett wrote:

 Actually there is not a php.ini in MacOS X.  When you run phpinfo() see
 where the php.ini file should be located and you can put your own there.

Oh yes, I should have realized you were talking about the built-in PHP.  
I recompiled my own.  Sorry, php.ini may not be at 
/usr/local/lib/php.ini after all!


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] allow_url_fopen, remote URLs and cookies

2002-02-04 Thread Chris Searle


OK.

I don't know if what I'm trying to do is going to work this way.

I have three servers that I need to fetch data from. To do this, I
have set allow_url_fopen to On, and I use fopen to retrieve the data
into a variable. This works on two servers.

The third server requires cookies (you get redirected to a login
server if no cookie is sent, and I get a warning URL - success on
the screen, followed by the if(!$file) test returning true) - and,
even if the user has the cookie set - I don't see how to send it with
an fopen call.

I've tried using the virtual() function - that works (sends the
cookie), but prints straight away - this is awkward because I'm
halfway thru building up a larger html buffer.

So - is it possible to send a cookie up with fopen, or, if not, how do
I go about getting a remote file that requires one?

Regards

-- 
Chris Searle

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




[PHP] Yet another regex question

2002-02-04 Thread Simon H

I'm trying to validate an input form, for database INSERT/UPDATE.  I'm
looking for a couple of Techniques and I cant seem to find examples
anywhere:

1.  Validate Alpha Text with spaces, such as NAME, CITY, STATE, but limit the
length of each one separately, and remove unwanted characters like
'@!£$%^*() etc that might mess with the SQL.

2.  As above but alphanumeric with spaces etc. for say ADDRESS1 ADDRESS2
POSTCODE, etc.

3.  Validate DATE/TIME input to DD-MM- HH:MM:SS or D-M- H:M:S, or any
combination, but only allow valid dates and times, or as close to it as
possible.

4.  Validate MONEY input...numeric with 2 decimal places only.

Also, what is the best way to allow some fields to be empty, like ADDRESS2,
but if they have data, then validate it.

I've tried several times to do these myself using eregi, but when I test it,
the validation fails in some way...I'm shooting in the dark tho, and don't
really understand regex just yet, or probably the majority of PHP for that
matter.

Thankfully I've got an email one... it was easy to find, since that's what
all examples are geared for.  My application is for updating a DB with SQL,
and I cant find anything suitable.

If there is any other advice for data input into DB's regarding security,
I'd really to hear it.

Thanks in advance for any help at all!

Simon H


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




Re: [PHP] Yet another regex question

2002-02-04 Thread bvr



Hi,

To prevent user input from messing with your query you just need to
escape the characters used to delimit query values.

MySQL for example uses ' (single quote) to delimit values so you should
use addslashes() on all values.

This will make inserting values containing the ' character work and prevent
user input from manipulating your script to run arbitrary queries on your DB server.

The practical thing about MySQL is that it accepts quote delimited values even for
integer fields. However, if you want to make a 'db safe' integer you can use $var = 
(int)$var;

For more advanced input validation, regular expressions can be very adequate but I'd 
recommend separating this from previous mentioned 'escaping' which is simply needed
for your DB to function properly and safe.

greets,
bvr.





On Mon, 4 Feb 2002 17:18:20 -, Simon H wrote:

I'm trying to validate an input form, for database INSERT/UPDATE.  I'm
looking for a couple of Techniques and I cant seem to find examples
anywhere:




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




RE: [PHP] Can this be done in PHP?

2002-02-04 Thread Andrew Chase

You might want to take a look at PhpAdsNew, a banner rotation/management
system using PHP and MySQL:

http://sourceforge.net/projects/phpadsnew

The system's admin tools assume that you're selling ad space, but there's no
reason you couldn't use it for a banner exchange instead.

-Andy

 On Fri, 1 Feb 2002, Lazor, Ed wrote:

  I'm trying to understand how this banner exchange works and
 whether it can
  be done in PHP.  Here's the HTML you put on your web page:
 
  a
 
 href=http://rpgx.rpgconsortium.com/xchange/engage.cgi?advert=NonS
 SIpage=XX
  img
 
 src=http://rpgx.rpgconsortium.com/xchange/engage.cgi?id=atfantasy
 page=01
  border=0 width=468 height=60/a
 
 
  It...
  - displays a random banner image
  - takes you to the site relating to the displayed image
 
  How does it do that?  Any ideas on how to do this in PHP?


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




[PHP] Why does heredoc fail in this instance?

2002-02-04 Thread Peter J. Schoenster

Hi

If I use $snippet = ; and escape the quotes in the block then it 
works. But if I use it as is below, it fails with no useful error 
message. Why?

Thanks,

Peter

  function GetAddCommentSnippet($args) {
  $topic_id = $args[id];
  $return_page  = $args[return_page];

$snippet = EOS
form action=$this-this_cgi method=post
brYour First Name: input type=text name=FirstName value=
brYour Last Name: input type=text name=LastName  value=
brYour Email Address: input type=text name=EmailAddress  value=
brYour Comments: 
br
textarea cols=40 rows=4 name=Comments/textarea
br
input type=submit value=submit now  
input type=hidden name=action value=AddComment
input type=hidden name=response_to_id value=$topic_id
input type=hidden name=r value=$return_page
/form
EOS;  

return $snippet;


  } // END GetAddCommentSnippet


---
Reality is that which, when you stop believing in it, doesn't go
away.
-- Philip K. Dick

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




Re: [PHP] mysql backup function in php?

2002-02-04 Thread Miles Thompson

Take that a little further and extract the code from phpMyAdmin for use in 
your own project.
Miles

At 08:36 AM 2/4/2002 -0800, Mike Maltese wrote:
Use PHPMyAdmin. You can dump to a CSV file or it can output all of the
INSERT statements to rebuild a table.


- Original Message -
From: Wilbert Enserink [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 8:22 AM
Subject: [PHP] mysql backup function in php?


  Hi all,
 
  i searched the manual for a php backup function for a mysql DB.
  I can't seem to find it, but i'm not sure whether it exists.
 
 
  mysql_backup_db maybe??
 
 
 
  thx. Wilbert
 
  -
  Pas de Deux
  Van Mierisstraat 25
  2526 NM Den Haag
  tel 070 4450855
  fax 070 4450852
  http://www.pdd.nl
  [EMAIL PROTECTED]
  -
 
  --
  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] Why does heredoc fail in this instance?

2002-02-04 Thread mike cullerton

on 2/4/02 11:32 AM, Peter J. Schoenster at [EMAIL PROTECTED] wrote:

 Hi
 
 If I use $snippet = ; and escape the quotes in the block then it
 works. But if I use it as is below, it fails with no useful error
 message. Why?

not sure if this is it or not, but from the manual

 http://www.php.net/manual/en/language.types.string.php

 Variables are expanded, but the same care must be taken when expressing
complex variables inside a here doc as with strings.


i wonder if $this-this_cgi is causing the problem

 
 Thanks,
 
 Peter
 
 function GetAddCommentSnippet($args) {
 $topic_id= $args[id];
 $return_page= $args[return_page];
 
 $snippet = EOS
 form action=$this-this_cgi method=post
 brYour First Name: input type=text name=FirstName value=
 brYour Last Name: input type=text name=LastName  value=
 brYour Email Address: input type=text name=EmailAddress  value=
 brYour Comments:
 br
 textarea cols=40 rows=4 name=Comments/textarea
 br
 input type=submit value=submit now
 input type=hidden name=action value=AddComment
 input type=hidden name=response_to_id value=$topic_id
 input type=hidden name=r value=$return_page
 /form
 EOS;  
 
 return $snippet;
 
 
 } // END GetAddCommentSnippet
 
 
 ---
 Reality is that which, when you stop believing in it, doesn't go
 away.
 -- Philip K. Dick


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




[PHP] Two SQL tables: asking data in chronological order??

2002-02-04 Thread Lauri Vain

Hi there, 

I have a somewhat urgent issue so I'll get right to the point. 

There are two tables and for simplicitys sake I stripped about 2/3 of
the tables structure. 

I need to order the data from two SQL tables by date. Basically a
chronological list from the two tables. Now, ordinarily I would do two
queries and put disbursements into one list and activities into another
one, just above it. But in this case they need to be mixed so that it
would be a TRUE chronological list. 

One way would be to do two queries and load all of the dates from the
two tables into a PHP array (and also define whether it's a disbursement
or activity) and then sort it in ascending order. Then I would have a
chronological list with information about ties of that table. Now I
could ask for the data by the name of the table and the date when I loop
through that PHP array and display it. 

That, however, is a bit around the edge. Do I have any simple
alternatives? 

CREATE TABLE activities (
   id int(11) DEFAULT '0' NOT NULL auto_increment,
   matterid int(11),
   costtype enum('unit','hour'),
   cost float(10,2),
   actcount float(10,2),
   fillin date,
   PRIMARY KEY (id)
);

CREATE TABLE disbursements (
   id int(11) DEFAULT '0' NOT NULL auto_increment,
   matterid int(11),
   disdesc varchar(30),
   discost float(10,2),
   fillin date,
   PRIMARY KEY (id)
);

Thanks in advance. 

Yours,
Lauri
--
Tharapita Creations
[dynamic web applications]
[EMAIL PROTECTED]
Mobile: +372 53 410 610



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




[PHP] HTTP Error 405 using POST method

2002-02-04 Thread Scott Adams

Hi. I'm learning PHP3 on an IIS 4.0 box and I started by trying out this
simple HTML form. The form lets the user input his/her name, email address,
and select whether he/she likes oranges or apples and sends the data to a
.php file that displays what the user input on the HTML form. The form
method is POST. When I submit the data I type, I receive an HTTP Error 405
message with the following text:
start of error message
HTTP Error 405
405 Method Not Allowed

The method specified in the Request Line is not allowed for the resource
identified by the request. Please ensure that you have the proper MIME type
set up for the resource you are requesting.

Please contact the server's administrator if this problem persists.
end of error message

Here is the HTML page with the form I am using:

HTML
HEAD
TITLERequest for more information/TITLE
BODY
CENTERWould you like more information about our company?
P
FORM ACTION=email.php3 METHOD=POST
Your name:BR
INPUT TYPE=text NAME=name SIZE=20 MAXLENGTH=30
P
Your email address:BR
INPUT TYPE=text NAME=email SIZE=20 MAXLENGTH=30
P
I prefer:
SELECT NAME=preference
OPTION value = ApplesApples
OPTION value = OrangesOranges
/SELECT
P
INPUT TYPE=submit VALUE=Send it!
/FORM
/CENTER
/BODY
/HTML

What am I doing wrong?



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




Re: [PHP] Two SQL tables: asking data in chronological order??

2002-02-04 Thread Miles Thompson


Well, w/o any where condition, etc., what does
select * from activities, disbursement order by activities.fillin, 
disbursements fillin;
give you? I'd suspect all the activities, followed by the disbursements.

How about creating a results table, with all the fields, and do an INSERT 
... SELECT on each of activities and disbursements,  then SELECT from 
results and order by fillin?

Regards - Miles Thompson

At 05:20 PM 2/4/2002 +0200, Lauri Vain wrote:
Hi there,

I have a somewhat urgent issue so I'll get right to the point.

There are two tables and for simplicitys sake I stripped about 2/3 of
the tables structure.

I need to order the data from two SQL tables by date. Basically a
chronological list from the two tables. Now, ordinarily I would do two
queries and put disbursements into one list and activities into another
one, just above it. But in this case they need to be mixed so that it
would be a TRUE chronological list.

One way would be to do two queries and load all of the dates from the
two tables into a PHP array (and also define whether it's a disbursement
or activity) and then sort it in ascending order. Then I would have a
chronological list with information about ties of that table. Now I
could ask for the data by the name of the table and the date when I loop
through that PHP array and display it.

That, however, is a bit around the edge. Do I have any simple
alternatives?

CREATE TABLE activities (
id int(11) DEFAULT '0' NOT NULL auto_increment,
matterid int(11),
costtype enum('unit','hour'),
cost float(10,2),
actcount float(10,2),
fillin date,
PRIMARY KEY (id)
);

CREATE TABLE disbursements (
id int(11) DEFAULT '0' NOT NULL auto_increment,
matterid int(11),
disdesc varchar(30),
discost float(10,2),
fillin date,
PRIMARY KEY (id)
);

Thanks in advance.

Yours,
Lauri
--
Tharapita Creations
[dynamic web applications]
[EMAIL PROTECTED]
Mobile: +372 53 410 610



--
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] Installing PHP 4.1.1 on Redhat w/ RPMs

2002-02-04 Thread Darren Gamble

Good day,

This isn't strictly a PHP question, but, I am hoping someone on this list
has gone through this already and can provide some assistance.

I'd like to upgrade to PHP 4.1.1 on our Redhat 7.2 servers, and so I've
downloaded all of the PHP RPMs from Rawhide.  I would really, really like to
do this with RPMs if at all possible.

When I go to install, I find out that:


error: failed dependencies:
libcrypto.so.3   is needed by php-4.1.1-1


OK, no problem so far.  I just need to get the new openssl packages.

But, after downloading them and adding them to the install list, I then find
that libcrypto.so.2 (which would be replaced by libcrypto.so.3) is needed by
dozens of packages on the system.  I really can't upgrade them all.

I am just going from openssl-0.9.6b-8 to openssl-0.9.6c-2 .  It appears to
me that openssl must have changed the API for their library between an
extremely minor version number (is that even supposed to happen?), which is
what I think is causing me the problem.

I'm not quite sure how to proceed.  Has anyone else on the list done this
yet?

Thanks to all who reply,


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948

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




[PHP] trouble passing variables through a URL

2002-02-04 Thread James Hallam

This is the URL in its A tag:

A
HREF=test_mediacoverage.php?locale=en_nasec=newssubsec=medianame=infowee
k1Media Coverage Test Page/A


Those variables are supposed to be used to populate this SQL statement:


-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 12:03 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Why does heredoc fail in this instance?


on 2/4/02 11:32 AM, Peter J. Schoenster at [EMAIL PROTECTED] wrote:

 Hi

 If I use $snippet = ; and escape the quotes in the block then it
 works. But if I use it as is below, it fails with no useful error
 message. Why?

not sure if this is it or not, but from the manual

 http://www.php.net/manual/en/language.types.string.php

 Variables are expanded, but the same care must be taken when expressing
complex variables inside a here doc as with strings.


i wonder if $this-this_cgi is causing the problem


 Thanks,

 Peter

 function GetAddCommentSnippet($args) {
 $topic_id= $args[id];
 $return_page= $args[return_page];

 $snippet = EOS
 form action=$this-this_cgi method=post
 brYour First Name: input type=text name=FirstName value=
 brYour Last Name: input type=text name=LastName  value=
 brYour Email Address: input type=text name=EmailAddress  value=
 brYour Comments:
 br
 textarea cols=40 rows=4 name=Comments/textarea
 br
 input type=submit value=submit now
 input type=hidden name=action value=AddComment
 input type=hidden name=response_to_id value=$topic_id
 input type=hidden name=r value=$return_page
 /form
 EOS;

 return $snippet;


 } // END GetAddCommentSnippet


 ---
 Reality is that which, when you stop believing in it, doesn't go
 away.
 -- Philip K. Dick


--
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] Parse error

2002-02-04 Thread Ron Clark

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello all,

 I am getting the following error trin to use the mysql_connect
command in a script:

Parse error: parse error in /usr/home/rclark/phptest/addrecord.php on
line 19

Here is line 19:
 $connection = mysql_connect(localhost,phpkid,d0wn) or die
(Could not connect to server);

Anyone have any ideas??  I am so stuck and running out of hair to
pull out!

Thanks in advance,
Ron Clark

-BEGIN PGP SIGNATURE-
Version: PGP 7.1

iQA/AwUBPF7Th0SpEYIqgLQzEQInoACeOGf5f1LhIowxzrkwlbQGbp9Vnj4AoKwA
XAnhNaQx7p4TqMbX/BHDc68h
=obAs
-END PGP SIGNATURE-




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




RE: [PHP] trouble passing variables through a URL

2002-02-04 Thread James Hallam

(try again - Sorry for the double)

my config: PHP 4.1.1/NT/iPlanet 6.1

This is the URL in its A tag:

A
HREF=test_mediacoverage.php?locale=en_nasec=newssubsec=medianame=infowee
k1Media Coverage Test Page/A


Those variables are supposed to be used to populate this SQL statement:

$sql = SELECT comp, content FROM $locale
WHERE sec = '$sec' AND
subsec = '$subsec' AND
name = '$name'
ORDER BY comp
;

If I hard code the variables in on the page it works, but if I leave it as
is, I get this:

You have an error in your SQL syntax near 'WHERE sec = '' AND subsec = ''
AND name = '' ORDER BY comp ' at line 2

Any idea why these aren't being passed?

James Hallam


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




[PHP] IMAP error from Linux

2002-02-04 Thread Chris Sim

I have made a simple IMAP mail checker. IT doesn't let you read the mail,
just lets you see the headers and delete messages.  I have it working great
running under Apache 1.3.22 and PHP 4.1.1 on Windows XP. All of the IMAP
functions work as expected.   The problem is when I take the same php files
and put the on a Linux machine with the same versions of Apache and PHP,
with IMAP enabled on RedHat 7.2, I get the following error.
**
Warning: Couldn't open stream {myserver:143}INBOX in
/usr/local/apache/htdocs/imap/connect.php on line 43
**

After that I get errors because the stream wasn't opened so other IMAP
functions don't have a valid pointer.  Those I can handle.  Does anyone know
what would be different between Linux and Windows?  I need this to work
under Linux more than Windows.  The machine is trying to connect to the IMAP
server because a TCP/IP dump shows traffic to that server when the page is
loaded.  I am able to verify that the machine will connect to the server,
because I can telnet in and get all of the same information manually. If
there is some way that the Linux version encrypts the username and or
password, that might cause it, but that is not documented anywhere.

If anyone has any suggestions, I would appreciate it.

-Chris Sim




[PHP] Server crashing?

2002-02-04 Thread Lazor, Ed

I'm starting to have a horrible time of pulling web pages from the server.
I checked and found the following entries in the MySQL database server log.

The error doesn't occur all the time, but it occurs a lot and only when
communicating to the server through PHP.  Any idea of what's going on?  Or
any idea of how to get more information about the problem?

020204  8:20:54  Aborted connection 22 to db: 'AtFantasy2' user: 'apache'
host: `localhost' (Got an error reading communication packets)
020204  8:20:54  Aborted connection 21 to db: 'sessions' user: 'afsessions'
host: `localhost' (Got an error reading communication packets)
020204  8:20:54  Aborted connection 30 to db: 'ads' user: 'banners' host:
`localhost' (Got an error reading communication packets)
020204  8:20:54  Aborted connection 18 to db: 'sessions' user: 'afsessions'
host: `localhost' (Got an error reading communication packets)
020204  8:20:54  Aborted connection 19 to db: 'AtFantasy2' user: 'apache'
host: `localhost' (Got an error reading communication packets)
020204  8:20:54  Aborted connection 31 to db: 'ads' user: 'banners' host:
`localhost' (Got an error reading communication packets)

MySQL version 3.32.33
Apache version 1.3.23
PHP version 4.1.1
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

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




RE: [PHP] Yet another regex question

2002-02-04 Thread Simon H

Thanks bvr

This is good to know, but I still need some validation with my particular
application, as below.  Thanks for your time.

Simon H


 -Original Message-
 From: bvr [mailto:[EMAIL PROTECTED]]
 Sent: 04 February 2002 17:44
 To: php-general; Simon H
 Subject: Re: [PHP] Yet another regex question




 Hi,

 To prevent user input from messing with your query you just need to
 escape the characters used to delimit query values.

 MySQL for example uses ' (single quote) to delimit values so you should
 use addslashes() on all values.

 This will make inserting values containing the ' character work
 and prevent
 user input from manipulating your script to run arbitrary queries
 on your DB server.

 The practical thing about MySQL is that it accepts quote
 delimited values even for
 integer fields. However, if you want to make a 'db safe' integer
 you can use $var = (int)$var;

 For more advanced input validation, regular expressions can be
 very adequate but I'd
 recommend separating this from previous mentioned 'escaping'
 which is simply needed
 for your DB to function properly and safe.

 greets,
 bvr.





 On Mon, 4 Feb 2002 17:18:20 -, Simon H wrote:

 I'm trying to validate an input form, for database INSERT/UPDATE.  I'm
 looking for a couple of Techniques and I cant seem to find examples
 anywhere:




 --
 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: help - config setting directives in Apache config files not working

2002-02-04 Thread Mike Frazer

The flexibility of the dynamic module is great.  I recommend it.  I haven't
discovered an major advantages of the static modul myself, although I know
they've got to exist (either that or it's just a remnant of previous
versions, there for those who are afraid of change :) ).  Compile Apache
alone and then do the dynamic module, there are also fewer steps in doing
so.

Mike Frazer


Ed Lazor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I found this on a web site...

  When using PHP as an Apache module, you can also change the
configuration
 settings using directives in Apache configuration files and .htaccess
files.

 What do you do if you compile apache and php together - ie. not a
 module?  I compiled using the static method and now the php_value commands
 in my httpd.conf don't work.  Do I have to compile as a dynamic module to
 get them to work again?

 -Ed




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




Re: [PHP] Re: help - config setting directives in Apache config files not working

2002-02-04 Thread Erik Price


On Monday, February 4, 2002, at 05:11  PM, Mike Frazer wrote:

 I haven't
 discovered an major advantages of the static modul myself, although I 
 know
 they've got to exist (either that or it's just a remnant of previous
 versions, there for those who are afraid of change :) ).  Compile Apache
 alone and then do the dynamic module, there are also fewer steps in 
 doing
 so.

Everyone's mileage will vary on this one, but I met compiling PHP as a 
DSO with a great deal of frustration in trying to get it to recognize 
MySQL's libraries, even though PHP provides its own.  Upon sharing this 
frustration, I took consolation with others who had been there, and we 
all found salvation in installing the static mod_php (and Apache is 
still welcome to accept any other DSO).


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Parse error

2002-02-04 Thread Johnson, Kirk

Check for a missing line or block terminator just above line 19.

Kirk

 -Original Message-
 From: Ron Clark [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 04, 2002 11:32 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Parse error
 
 
  I am getting the following error trin to use the mysql_connect
 command in a script:
 
 Parse error: parse error in /usr/home/rclark/phptest/addrecord.php on
 line 19
 
 Here is line 19:
  $connection = mysql_connect(localhost,phpkid,d0wn) or die
 (Could not connect to server);

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




Re: [PHP] Why does heredoc fail in this instance?

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 10:32, Peter J. Schoenster wrote:
 Hi
 
 If I use $snippet = ; and escape the quotes in the block then it 
 works. But if I use it as is below, it fails with no useful error 
 message. Why?
 
 Thanks,
 
 Peter

This function cut-and-pasted? If so, then you may have fallen prey
to one of the uglier little features of heredocs: you cannot have
anything except a newline following the semicolon after the closing
delimiter. In this case, you seem to have some spaces there:

   function GetAddCommentSnippet($args) {
 $topic_id = $args[id];
 $return_page  = $args[return_page];
 
   $snippet = EOS
 form action=$this-this_cgi method=post
 brYour First Name: input type=text name=FirstName value=
 brYour Last Name: input type=text name=LastName  value=
 brYour Email Address: input type=text name=EmailAddress  value=
 brYour Comments: 
 br
 textarea cols=40 rows=4 name=Comments/textarea
 br
 input type=submit value=submit now  
 input type=hidden name=action value=AddComment
 input type=hidden name=response_to_id value=$topic_id
 input type=hidden name=r value=$return_page
 /form
 EOS;
  

...here are the spaces. There is more information in the manual:

http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc


However, just so you know, you should quote 'id' and 'return_page' 
in the first two lines of the function. If you turn up 
error_reporting(), you'll get this:

  Notice:  Use of undefined constant id - assumed 'id' in 
  /path/to/script.html on line 19

  Notice:  Use of undefined constant return_page - assumed 
  'return_page' in /path/to/script.html on line 20

There is more information about this at:

http://www.php.net/manual/en/language.types.array.php#language.types.array.donts

(Sorry if the URLs wrap.)


Cheers,

Torben

   
   return $snippet;
 
 
   } // END GetAddCommentSnippet
 
 
 ---
 Reality is that which, when you stop believing in it, doesn't go
 away.
 -- Philip K. Dick

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




RE: [PHP] trouble passing variables through a URL

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 11:49, James Hallam wrote:
 (try again - Sorry for the double)
 
 my config: PHP 4.1.1/NT/iPlanet 6.1
 
 This is the URL in its A tag:
 
 A
 HREF=test_mediacoverage.php?locale=en_nasec=newssubsec=medianame=infowee
 k1Media Coverage Test Page/A
 
 
 Those variables are supposed to be used to populate this SQL statement:
 
 $sql = SELECT comp, content FROM $locale
   WHERE sec = '$sec' AND
   subsec = '$subsec' AND
   name = '$name'
   ORDER BY comp
   ;
 
 If I hard code the variables in on the page it works, but if I leave it as
 is, I get this:
 
 You have an error in your SQL syntax near 'WHERE sec = '' AND subsec = ''
 AND name = '' ORDER BY comp ' at line 2
 
 Any idea why these aren't being passed?
 
 James Hallam

Dollars to donuts you have register_globals turned off; that's the 
default in PHP 4.1.x+. It's safer not to use it. :)

Try this:

$sql = SELECT comp, content FROM $_REQUEST[locale]
WHERE sec = '$_REQUEST[sec]' AND
subsec = '$_REQUEST[subsec]' AND
name = '$_REQUEST[name]'
ORDER BY comp
;


Hope this helps,

Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Re: imagecopy or why men don't use maps.

2002-02-04 Thread Chris Williams

Hugh,

I experimented with JPEG when I started using the GD libraries and was not
satisfied with the results. Just too many image quality issues. Unless your
map is a image (vs a graphic) I wouldn't use Jpeg. The coloring you speak of
may be a result of jpeg compression. Using no compression will likely remove
this problem but you will pay a penalty in file size. If you have the option
convert your image to PNG or GIF (depending on what gd library you have)
using something like Photoshop. You'll probably like the results better.

Chris

Hugh Danaher [EMAIL PROTECTED] wrote in message
000701c1acec$71c3c800$017f@localhost">news:000701c1acec$71c3c800$017f@localhost...
 Chris,
 Thank you for your help.  I actually found an example on web monkey late
 last night for .gif and made the translation to .jpg.  However, whatever
 color text I use, it turns out gray.  Any help here would go down nicely.

 Hugh


 - Original Message -
 From: Chris Williams [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, February 03, 2002 8:29 AM
 Subject: [PHP] Re: imagecopy or why men don't use maps.


  I think you might need to use
 
  $source = ImageCreateFromJPEG('map1.jpg');
 
  I've created several maps using this method, although I am using PNG.
You
  could see them at our web site but unfortunatly it's not parsing PHP
  correctly. Something went wrong during migration, but might be fixed in
a
  couple of days.
 
  Hugh Danaher [EMAIL PROTECTED] wrote in message
  000801c1ac61$a1d858c0$017f@localhost">news:000801c1ac61$a1d858c0$017f@localhost...
  Help!
 
  I have an image file which is a map of the local area.  I want to put
  symbols on the map at various points, but I first need to get the php
 image
  function to work.
  My site has imaging enabled and I can create graphs from scratch, but
this
  has stumped me so far.
 
  Any help will be greatly appreciated.
 
  Hugh
 
  code? below:
 
  $image=imagecreate(400,400);  // created image
 
  // source image info
  $source=map1.jpg;
  $imageinfo = getimagesize($source);
  $source_00=0;   //  origin (0,0)
  $source_width=$imageinfo[0];
  $source_height-$imageinfo[1];
  $image_00=0;   //  origin (0,0)
 
 
  imagecopy($image,$source, $image_00, $image_00, $source_00, $source_00,
  $source_width, $source_height);  / / this is line 36.
 
 
 
  Warning: Supplied argument is not a valid Image resource in
  /www/site.com/somepage.php on line 36
 
 
 
 
 
  --
  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] file validation

2002-02-04 Thread Lars Torben Wilson

On Sun, 2002-02-03 at 14:06, Lars Torben Wilson wrote:
 On Sun, 2002-02-03 at 12:12, Mike Frazer wrote:
  Your reply piqued my curiosity so I whipped together a script that times the
  execution of a foreach(), a while() and a for() loop executing the same
  commands.  The results were rather surprising in some ways but not really
  overall.
  
  The while() loop is, as you stated, is quicker than a foreach() loop.
  However, the for() loop is the fastest of all three.  Below are the results
  of three tests:
 
 Odd.. I get the opposite result:

Oh for Pete's sake. Actually, if you look at my code below and find the
error, you'll see that foreach() actually wins, followed by while() and
then for(). My mistake.


Torben

 Running test_foreach() 5000 times...2.6176570653915 seconds
 Running test_for() 5000 times...3.0155370235443 seconds
 Running test_while() 5000 times...2.0656290054321 seconds
 
 Results: 
 test_foreach_1: 2.6176570653915
 test_for_2: 3.0155370235443
 test_while_3: 2.0656290054321
 
 Using the following code:
 
 ?php
 error_reporting(E_ALL);
 
 function test_while() {
 global $upload_file;
 reset($upload_file);
 foreach ($upload_file as $line) {
 $num_pipes = substr_count($line, '|');
 if ($num_pipes  2 || $num_pipes  4) {
 return false;
 }
 }
 return true;
 }
 
 
 function test_foreach() {
 global $upload_file;
 reset($upload_file);
 while (list(, $line) = each($upload_file)) {
 $num_pipes = substr_count($line, '|');
 if ($num_pipes  2 || $num_pipes  4) {
 return false;
 }
 }
 return true;
 }
 
 
 function test_for() {
 global $upload_file;
 for ($i = 0; $i  count($upload_file); $i++) {
 $num_pipes = substr_count($upload_file[$i], '|');
 if ($num_pipes  2 || $num_pipes  4) {
 return false;
 }
 }
 return true;
 }
 
 $filename = 'testpipes.txt';
 $upload_file = file($filename);
 
 speedtest(array('test_foreach', 
 'test_for',
 'test_while'), 5000);
 
 ?
 
 
 Curioser and curiouser
 
 
 Torben
 
 -- 
  Torben Wilson [EMAIL PROTECTED]
  http://www.thebuttlesschaps.com
  http://www.hybrid17.com
  http://www.inflatableeye.com
  +1.604.709.0506
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Sockets

2002-02-04 Thread Mike Frazer

I've found fsockopen to be very reliable.  I've done a few socket scripts
with PHP (WhoisPro, et al).

I believe the easiest way to check for a remotely closed socket is to do an
fgets() and check for EOF:

   while (!feof($connection)) {
$buffer .= fgets($connection, 4096);  // 4096 is the chunk size, you can
adjust it
   }

I *think* EOF on a socket deonotes a remote socket close but I could be
horribly wrong.

Mike Frazer



Evan Nemerson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am aware of cURL, but I want to just use the standard PHP stuff if I can
 because I plan on releasing this when I'm done, and want to KISS for other
 people.

 I know people have to compile PHP with sockets, but they will anyways for
 this project- I'm going to need socket_listen and socket_create_listen
too.

 This is for a proxy server which will work kinda like multiproxy, but
should
 be more powerful. It will support direct connections or going through
another
 proxy server. It seperates anonymous from non-anonymous proxy servers,
then
 sorts them by speed. Data is stored in tab seperated value text files (I'm
 even avoiding mySQL!!!)

 I just signed up for a page @ sourceforge. If anyone is interesting in
 helping out e-mail me.

 Thanks for the idea, though. I think right now my fall-back is fsockopen.
I
 would really love to get sockets working for this...





 On Sunday 03 February 2002 23:32, you wrote:
  A quick note...
 
  If you are not aware of cURL (curl.haxx.se), then you may want to look
into
  it.
 
  If you are, then please disregard this post.
 
  -Jason Garber
 
  At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote:
  Anyone know if there is a way yet to see if a socket is still connected
to
   a host? I want to use a socket to send GET / HTTP/1.0\r\n\r\n over a
   socket, and retrieve everything the server sends. That part works
great,
   but I can't figure out when the remote host disconnects.
  
  I have the CVS version of php.
  
  Here is the function so far. The problem is at the end.
  
  
  
  function getdata ($host, $port, $data)
  {
   /* well, the below comment would be true if i could get it
   working! */
  
   /* This function sends $data to $host:$port, then returns the
   response
   * until connection is severed. Great for HTTP, but won't
usually
   work * too well in protocols where data needs to be analyzed, and
replied
   * to appropriatly, such as POP v3 */
  
   // Create a socket
   $so = socket_create (AF_INET, SOCK_STREAM,
   getprotobyname(TCP)); if ( !$so )
   {
   exit(Could not create socket.\n);
   }
  
   // Connect...
   $ec = socket_connect ($so, $host, $port);
   if ( $ec  0 )
   {
   exit (ERROR $ec: .socket_strerror($ec));
   }
  
   /* Write $data to socket. The manual doesn't say what it
returns,
   but I'll
   * assume (even though it makes an ass out of you and me) that
it
   is the same
   * as socket_connect() because it wouldn't be logical to return
a
  descriptor. */
   $ec = socket_write ( $so, $data, ( strlen($data) ));
   if ( $ec  0 )
   {
   exit (ERROR $ec: .socket_strerror($ec));
   }
   else
   {
   /* PROBLEM IS HERE- what do I put instead of while (
$x
   == 0 )??? */
   $x = 0;
   while ( $x == 0 )
   {
   $buffer = socket_read ( $so, 1,
PHP_BINARY_READ);
   $string .= $buffer;
   }
   }
  
   // And (hopefully) return $string, for your viewing pleasure.
   return $string;
  }
  
  --
  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] trouble passing variables through a URL

2002-02-04 Thread James Hallam

That was *exactly* it..  I copied that code in and everything worked!
Thanks so much - my head was getting sore from beating it on my desk!

I still have much to get used to with 4.1.x ..

James

-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]]On Behalf Of Lars
Torben Wilson
Sent: Monday, February 04, 2002 1:36 PM
To: James Hallam
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] trouble passing variables through a URL


On Mon, 2002-02-04 at 11:49, James Hallam wrote:
 (try again - Sorry for the double)

 my config: PHP 4.1.1/NT/iPlanet 6.1

 This is the URL in its A tag:

 A

HREF=test_mediacoverage.php?locale=en_nasec=newssubsec=medianame=infowee
 k1Media Coverage Test Page/A


 Those variables are supposed to be used to populate this SQL statement:

 $sql = SELECT comp, content FROM $locale
   WHERE sec = '$sec' AND
   subsec = '$subsec' AND
   name = '$name'
   ORDER BY comp
   ;

 If I hard code the variables in on the page it works, but if I leave it as
 is, I get this:

 You have an error in your SQL syntax near 'WHERE sec = '' AND subsec = ''
 AND name = '' ORDER BY comp ' at line 2

 Any idea why these aren't being passed?

 James Hallam

Dollars to donuts you have register_globals turned off; that's the
default in PHP 4.1.x+. It's safer not to use it. :)

Try this:

$sql = SELECT comp, content FROM $_REQUEST[locale]
WHERE sec = '$_REQUEST[sec]' AND
subsec = '$_REQUEST[subsec]' AND
name = '$_REQUEST[name]'
ORDER BY comp
;


Hope this helps,

Torben

--
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


--
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] date problems

2002-02-04 Thread toni baker

$date1 = 12/12/2001;
$date1 = date(D M j Y, strtotime($date1));
print $date1.br;

When I execute the code above I get the following
output:

Tue Dec 11 2001 instead Wed Dec !2 2001

Why does this happen and how can I get the Dec 12 
output?  Thanks






__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

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





[PHP] problems using an elsif statement on apache php 4.06

2002-02-04 Thread cyberskydive

I have two php scripts being included on my website.

one is a switch statement used for page navigation, and the other is an
elseif used to display different html code based on the value of a variable
(different on each page)

My apache server keeps freezing up and my hosting company tells me that the
child processes arent dieing off, requiring me to call them everytime I need
to restart the server.

What could be causing this? Is theree a better way to display dynamic
content besides an elsif statemet?



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




[PHP] general question...

2002-02-04 Thread jas

Using php3 is there a way to have a page only be access if the user is
coming from another page?  I don't quite know how to word what I am thinking
but for instance...
Form -- page that contains a form to submit an email address to a mailing
list
Confirm -- page that confirms the users email address
Submit -- page that connects to database and submits users email address

What I want to do is have users not be able to access the submit page unless
they are refered from the confirm page...  Using php is this possible? And
if so could someone point out somewhere that has more info so I may begin
incorporating this into my scripts.
Thanks in advance...
Jas



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




[PHP] Large File Uploads

2002-02-04 Thread Ben Sinclair

I'm having some trouble with a file upload script that runs over SSL. It seems
that the file is kept in memory while being uploaded and then flushed to disk
as a temp file. This is fine, but when you are dealing with large files, you
can run out of memory. Apache (or PHP?) also doesn't seem to recover from large
file uploads very well. After uploading a few large files (30MB to 300MB), the
httpsd process continues to use ~400MB.

If I let it go long enough, with the machine swapping, the script will
eventually come back but it acts like there was no file uploaded.

Does anyone have suggestions? I need for my users to have the ability to upload
large files over a SSL connection using common browsers. I can't make them run
applets or use an insecure method for doing these transfers.

--
Ben Sinclair
[EMAIL PROTECTED]


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




Re: [PHP] general question...

2002-02-04 Thread Tyler Longren

if (eregi(page_user_has_to_come_from,$HTTP_REFERER) != ) {
print You didn't come from the right page, please go back.;
}
else {
print Congrats, you came from the right page!;
}

Tyler

- Original Message -
From: jas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 2:32 AM
Subject: [PHP] general question...


 Using php3 is there a way to have a page only be access if the user is
 coming from another page?  I don't quite know how to word what I am
thinking
 but for instance...
 Form -- page that contains a form to submit an email address to a mailing
 list
 Confirm -- page that confirms the users email address
 Submit -- page that connects to database and submits users email address

 What I want to do is have users not be able to access the submit page
unless
 they are refered from the confirm page...  Using php is this possible? And
 if so could someone point out somewhere that has more info so I may begin
 incorporating this into my scripts.
 Thanks in advance...
 Jas



 --
 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] problem with mail()/html/outlook

2002-02-04 Thread ryan-php

I'm trying to send an html email via a php script, but I'm running into a 
rather bizarre problem.  I can get it to send the email just fine, but when it 
is read on windows Outlook (macintosh outlook express are unaffected) clients, 
it strips two characters after any '=' signs, so it plays havoc on the html it 
tries to send:

div align=center
  table width=570 border=0 cellspacing=0 cellpadding=0

becomes:
div align=enter
  table width=70 border= cellspacing= cellpadding=

Now, I'm sending all the right headers, I think:

$headers.= Content-Type: text/html; charset=iso-8859-1\n;

I've read up on this as much as I can and it works for every other client other 
than MS Outlook under Windows.  Unfortuantely, that's a rather large percentage 
of people that are going to get a foo'd message of mine.  I know that there are 
certain mime characters like '=2D' that mean certain things, could it be that 
i'm not sending the right header and Outlook is interpreting a differnt mime 
type, therefore munching lines as it parses them?

Any help would be appreciated,
Ryan C. Creasey
Network Engineer
p11creative

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




[PHP] javascript delete

2002-02-04 Thread Mostafa Al-Mallawani

hi, i know this question's been asked before but i can't find the email...how do i do 
the delete link that pops up a message box with the information of the deleted entry 
using php? like the one in phpmyadmin 2.2.3. thanks. :) 



[PHP] HELP! I was just wondering

2002-02-04 Thread cyberskydive

I've been playing around with php alot lately and started to scheme ways to
use it-lol

so heres what I tried to do:

first there is a switch statement:
?
switch($page) {

case refer: require(some_file.php);
exit;
?
On that some_file.php I have an elseif like so:

?

if($page  == $refer)
{
$title = Welcome to this website;
}
elseif($page == $somethingelse)
{
$title = Something else than the other one;
}
else
{
$title =the default;
}

Both these are included by:
?
require('switch.php');
require('elseif.php');
?

Then on the page where thee are required I require them at the top of the
page.
and I have this:
title echo $title; ?
The first part of the if statement returns true always.

My question is why? Arent the variables $page and $refer etc passed over? Am
I going about this all wrong?
It doesnt work if even in the same file as the page and not in includes.

I thought that it didnt matter where we define variables in php, so I tried
to define the $title in the body of an html page but that didnt work
either-lol

using php4

on windows and solaris

is there a way to get this type of variable from any predefined HTTP
variables?

so I tried




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




Re: [PHP] date problems

2002-02-04 Thread Jim Lucas [php]

sounds like it might have something to do with leap year.

Jim Lucas
- Original Message - 
From: toni baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 04, 2002 12:03 PM
Subject: [PHP] date problems


 $date1 = 12/12/2001;
 $date1 = date(D M j Y, strtotime($date1));
 print $date1.br;
 
 When I execute the code above I get the following
 output:
 
 Tue Dec 11 2001 instead Wed Dec !2 2001
 
 Why does this happen and how can I get the Dec 12 
 output?  Thanks
 
 
 
 
 
 
 __
 Do You Yahoo!?
 Great stuff seeking new owners in Yahoo! Auctions! 
 http://auctions.yahoo.com
 
 -- 
 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: PEAR IMAGICK [WAS- RANT: Why doesn't PHP have built-in support for dynamic]

2002-02-04 Thread Michael Kimsal

Christian Stocker wrote:


see (which is how I labelled it above) and what I'm capable of actually
contributing.
Doing C-code PHP extensions is beyond my capabilities, so I make do with
what others contribute.  Simply because something is opensource doesn't
mean everyone has equal talent to add in actual code.  :(
I thank you for your contribution of this code so far, and should you
continue to work on it in whatever fashion you choose, so much the
better.  It is appreciated, OO or not (it would just be appreciated more
if it was OO.)  :)

 
 i would it appreciate as well, if it was OO. I was just not capable back
 then to do it OO, maybe i am the next time I invest more time in it.
 
 christian
 


FWIW, I re-evaluated the situation, and I think I was mistaken- it's not 
a PHP exension you're writing, is it?  It's just PHP code, like much of 
PEAR right?  Or is it an actual extension that I'd compile in?


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




Re: [PHP] date problems

2002-02-04 Thread Edward van Bilderbeek - Bean IT

i think it is the strtotime() function that gives the trouble... why don't
you try mktime() ?



 sounds like it might have something to do with leap year.

 Jim Lucas
 - Original Message -
 From: toni baker [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, February 04, 2002 12:03 PM
 Subject: [PHP] date problems


  $date1 = 12/12/2001;
  $date1 = date(D M j Y, strtotime($date1));
  print $date1.br;
 
  When I execute the code above I get the following
  output:
 
  Tue Dec 11 2001 instead Wed Dec !2 2001
 
  Why does this happen and how can I get the Dec 12
  output?  Thanks
 
 
 
 
 
 
  __
  Do You Yahoo!?
  Great stuff seeking new owners in Yahoo! Auctions!
  http://auctions.yahoo.com
 
  --
  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




[PHP] strtotime problem

2002-02-04 Thread toni baker

$date1 = 10/12/2002;
$date1 = date(D M j Y, strtotime($date1));
$date2 = date(D M j Y);
$date3 = date(D M j Y, $date1);
print $date1.br;
print $date2.br;
print $date3.br;

The code above gives me the following output:

Fri Oct 11 2002
Mon Feb 4 2002
Wed Dec 31 1969

Is the strtotime() function causing this problem?
Thanks.


__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

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




Re: [PHP] PHP and Apache authorization: how to logout. Help!

2002-02-04 Thread LaserJetter

I read somewhere that if you type an underscore it clears authentication
info. I haven't tried it and it seems obscure but its worth a try!


LJ

Frederick L. Steinkopf [EMAIL PROTECTED] wrote in message
018201c1ac67$c4d9c6a0$851a88ac@frederis">news:018201c1ac67$c4d9c6a0$851a88ac@frederis...
 While I've never done this before,
  couldn't you use a session and have session variables tied to the user
name
 and password and then have the logout function kill the session?

 - Original Message -
 From: Rodolfo Gonzalez [EMAIL PROTECTED]
 To: Matthew Walker [EMAIL PROTECTED]
 Cc: Aras Kucinskas [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Saturday, February 02, 2002 8:26 PM
 Subject: RE: [PHP] PHP and Apache authorization: how to logout. Help!


  On Fri, 1 Feb 2002, Matthew Walker wrote:
   Does anyone have the answer for this question? I need it too...
 
  As I learnt before, it's not possible without closing the user's
browser.
 
   My site is in directory which is protected with .htaccess file.
   I want to develope a logout function, which can reset Apache
   authorization.
 
 
  --
  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 question...

2002-02-04 Thread jas

Ok I think I know what I need to learn... how can I do a redirect based on
whether or not a user came from a certain page?  For example... if a user
comes from a page called confirm.php then it takes them to a page called
thanks.php and if the user came from a different server or typed the url
directly then it would redirect the user to the index.php page?
Thanks in advance...
Jas
P.S. A tutorial on this would definately prevent me from posting the same
question again. =)



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




[PHP] Re: General question...

2002-02-04 Thread Philip Hallstrom

Something along the lines of:

if( ereg(/confirm.php, $_SERVER['HTTP_REFERER']) )  {
Header(Location: thanks.php);
exit;
}else {
Header(Location: index.php);
exit;
}

You might want to do some additional checking as well.. the above would
match both /path/to/confirm.php as well as
/path/to/somewhere/else.php?fakeit=/confirm.php)

I'll leave that sort of stuff up to you :)

On Wed, 30 Jan 2002, jas wrote:

 Ok I think I know what I need to learn... how can I do a redirect based on
 whether or not a user came from a certain page?  For example... if a user
 comes from a page called confirm.php then it takes them to a page called
 thanks.php and if the user came from a different server or typed the url
 directly then it would redirect the user to the index.php page?
 Thanks in advance...
 Jas
 P.S. A tutorial on this would definately prevent me from posting the same
 question again. =)



 --
 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] uksort wisdom

2002-02-04 Thread Sondra Russell

Hi Guys!

I'm looking to get a *deeper understanding* of uksort.  My quandry:

$array[listing1][name] = listing 1;
$array[listing1][premiere] = ;
$array[listing2][name] = listing 2;
$array[listing2][premiere] = ;
$array[listing3][name] = listing 3;
$array[listing3][premiere] = yes;

I'd like the result to come out as:
$array[listing3] //(this is the one with the premiere set to yes)
$array[listing1] // (no premiere, but in order)
$array[listing2] // (again, no premiere, but again in order)

So far, I've got:

function cmp= ($a,$b) {
global $array;
if ($array [$a][premiere] == yes) {
return -1;
} else {
return ($a  $b) ? -1 : 1;
}
}

uksort($array_array,cmp);

But that ends up, strangely with:
$array[listing3]
$array[listing2]
$array[listing1]


Any wisdom?  Just would like a better idea of the inner workings of uksort.

Best,
Sondra

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




Re: [PHP] Email Attachment

2002-02-04 Thread Mauricio Sthandier

Thanxs... I couldn't use your script (because of my lack of experiencie
maybe) but you gave me a very good hint about what to look for.
I sent an attachment (with a class located in this URL :
http://renoir.vill.edu/~ylee/mailfile.txt), but that wasn't what my boss was
thinking of.
(Now he tells !)
Anyway, is useful and I repeat my gratitude.

Frank Hertogs [EMAIL PROTECTED] escribió en el mensaje
000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp">news:000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp...
 This should do the trick, experiment wit hit;

 function mail_attachment($email, $buffer)
  {
 //subject
 $subject = Testing pdf attachment..
 //sender
 $x_sender = F. Hertogs;
 //extra (optional) headers
 $x_headers = From: [EMAIL PROTECTED]\n;
 $x_headers .= PHP mailer\n;
 $x_headers .= MIME-version: 1.0\n;
 //tell mail program it's multipart/mixed
 $x_headers .= Content-type: multipart/mixed; ;
 //tell mail program what boundary looks like
 $x_headers .= boundary=\Message-Boundary\\n;
 //encoding
 $x_headers .= Content-transfer-encoding: 7BIT\n;
 //to prevent error in case email is empty (I only use this for testing
 //normally; use php or javascript to check forms before submitting
 if(!IsSet($email))
  $email = [EMAIL PROTECTED];
 //first boundary
 $body = --Message-Boundary\n;
 //start text message
 $body .= Content-type: text/plain; charset=US-ASCII\n;
 $body .= Content-transfer-encoding: 7BIT\n;
 $body .= Content-description: Mail message body\n\n;
 //text for message
 $body .= Dear sir,\n\nHere is the requested file blabla
 //end text message
 $body .= \n\n--Message-Boundary\n;
 //start application pdf in this example
 $body .= Content-type: application/pdf name=\attach.pdf\\n;
 $body .= Content-Transfer-Encoding: base64\n;
 $body .= Content-disposition: attachment; filename=\attach.pdf\\n\n;
 $enc_pdf = chunk_split(base64_encode($buffer));
 $body .= $enc_pdf . \n; }
 $body .= --Message-Boundary--\n;
 //mail actual message
 mail($email, $subject, $body, $x_headers);
 }

 I hope this helps you.

 Frank.

 -Oorspronkelijk bericht-
 Van: Mauricio Sthandier [mailto:[EMAIL PROTECTED]]
 Verzonden: vrijdag 1 februari 2002 20:45
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Email Attachment

 Hello, I'm new in php development... I was wondering how can I attach a
 Word
 (.doc) Document in an email sent with the mail() function (if I can do
 it
 just with it).

 I know it has to see with the additional headers of the email, but I
 would
 be grateful If anyone could tell where can i go to for this specific
 information.

 I couldn't find it in PHP manual (.pdf version).

 Thanxs !




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





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




[PHP] Apache/PHP get stuck when using form POST.

2002-02-04 Thread Scott Fletcher

Hi!

I have an interesting problem.  I am wondering if it is related to PHP
or Apache.  So, I need your feedback on this one.  What happen is when I use
the HTML Form POST and submitted it.  It worked fine and getting to the
2nd page.  The 2nd page include some PHP script and a modem script..  PHP is
able to executed the script and get result from the modem.  They all work
fine.

All of sudden I get customer complaining about problem with website.
After some feedback from them, I use two seperate web browsers to browse my
company's website.   One for the modem and the other for browsing around.
So, when I did the form POST and wait for the modem to fnish the task.  On
the 2nd browser, I was able to browse around but when the 2nd page from the
1st browser was executed.  The 2nd browser, all of a sudden, it stopped
browsing as if the webpage froze.  I kept trying to browser around but with
no luck until the modem from the 1st browser is finish.  It is when I was
again able to browse around on the 2nd browser.

In my opinion, the problem is either related to the C programming for
the modem or Apache that isn't able to dedicated it's resources to the
browsers.  That the problem have nothing to do with PHP itself.  Am I right?

Thanks,
 Scott



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




  1   2   >