[PHP] Hosting +PHP

2003-10-24 Thread Mindaugas
Hi,

How to do secure web server hosting +PHP? I don't want clients to see
filesystem usage, processes, etc. - even readonly on filesystem root /,
except on WWW CHROOT for example/home/user1.

Thanks

-- 
Mindaugas

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



Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Nathan Taylor
I am a recent fan of the single-quotes.  I used to use double only but when some gurus 
told me the disadvantages I converted my entire project over to single quotes.  Single 
quotes are ideal because as far coding goes it greatly decreases the time of 
development when you don't have to worry about dropping in the escape character on 
your HTML values, etc.  Granted, single quotes can be a nuisance in some instances 
(like when you need a new line character) but of course there is a way around.  I 
simply define a constant and call that at the end of every line in order to substitute 
for the new line character.

Horizontal Tab - define(T, chr(9));
New Line - define(NL, chr(10));

Cheers,
Nathan
  - Original Message - 
  From: Robert Cummings 
  To: Shawn McKenzie 
  Cc: PHP-General 
  Sent: Thursday, October 23, 2003 10:30 PM
  Subject: Re: [PHP] Code optimization: single vs. double quotes?


  On Thu, 2003-10-23 at 20:43, Shawn McKenzie wrote:
   I came across this post and was hoping to get a gurus opinion on the
   validity.  TIA
   
   -Shawn
   
   I remember reading somewhere re: PHP coding that it is a better coding
   practice to use single quotes as much as possible vs. using double quotes in
   scripts. When using double quotes, you are forcing PHP to look for variables
   within them, even though there may not be any, thus slowing execution
   time...
   
   For example it is better to code:
 Code:
 echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';
   
   vs.
 Code:
 echo td bgcolor=\$bgcolor2\nbsp;/td/tr;

  Better is a very subjective question; however, style 1 will run faster
  since it won't look for variable interpolation. Personally I always use
  style 1 unless I specifically need variable interpolation or one of the
  special characters such as a newline. Also when doing HTML the double
  quotes fit nicely in the the single quote paradigm. On the other hand
  when I do SQL queries, I often allow interpolation just because it is
  more readable and because I usually use single quotes to wrap strings in
  my queries.

  HTH,
  Rob.
  -- 
  ..
  | InterJinn Application Framework - http://www.interjinn.com |
  ::
  | An application and templating framework for PHP. Boasting  |
  | a powerful, scalable system for accessing system services  |
  | such as forms, properties, sessions, and caches. InterJinn |
  | also provides an extremely flexible architecture for   |
  | creating re-usable components quickly and easily.  |
  `'

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



Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Justin French
On Friday, October 24, 2003, at 10:43  AM, Shawn McKenzie wrote:

For example it is better to code:
  Code:
  echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';
vs.
  Code:
  echo td bgcolor=\$bgcolor2\nbsp;/td/tr;
Better is a very loose term, but I've adopted a coding style which 
uses single quotes on all lines which don't require special characters 
(\n, \t, etc) or variables.

At the same time, I dropped double quotes within my HTML where 
possible, realising that most of my echo's had double quotes, so I was 
escaping a lot of quotes.

I also adapted wrapping all variables in {parenthesis} so that PHP has 
no chance of being confused

On all but the most heavily visited sites, it's my humble opinion that 
you should take the approach of what's fast for you to code, read, 
maintain and re-develop, rather than what might get you a .0001 
% performance gain -- this is most likely due to the nature of the 
sites I develop -- but this seems to be the general consensus I've read 
over many years and from many sources.

No special chars or vars:
echo 'td bgcolor=\'#ff\'nbsp;/td/tr';
For cases with vars and special chars, I think these look terrible:
echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';
echo td bgcolor=\$bgcolor2\nbsp;/td/tr;
Whereas this is clear and easy to work with:
echo td bgcolor='{$bgcolor2}'nbsp;/td/tr;
You mileage will vary, but unless you're working on a hugely successful 
site (the kind that needs a dedicated server), take your personal 
preferences, and long-term readability and maintainability into account 
when deciding what suits you.

Justin

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


Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Richard Baskett
on 10/24/03 0:47, Nathan Taylor at [EMAIL PROTECTED] wrote:

 I am a recent fan of the single-quotes.  I used to use double only but when
 some gurus told me the disadvantages I converted my entire project over to
 single quotes.  Single quotes are ideal because as far coding goes it greatly
 decreases the time of development when you don't have to worry about dropping
 in the escape character on your HTML values, etc.  Granted, single quotes can
 be a nuisance in some instances (like when you need a new line character) but
 of course there is a way around.  I simply define a constant and call that at
 the end of every line in order to substitute for the new line character.
 
 Horizontal Tab - define(T, chr(9));
 New Line - define(NL, chr(10));
 
 Cheers,
 Nathan
 - Original Message -
 From: Robert Cummings
 To: Shawn McKenzie
 Cc: PHP-General 
 Sent: Thursday, October 23, 2003 10:30 PM
 Subject: Re: [PHP] Code optimization: single vs. double quotes?
 
 
 On Thu, 2003-10-23 at 20:43, Shawn McKenzie wrote:
 I came across this post and was hoping to get a gurus opinion on the
 validity.  TIA
 
 -Shawn
 
 I remember reading somewhere re: PHP coding that it is a better coding
 practice to use single quotes as much as possible vs. using double quotes in
 scripts. When using double quotes, you are forcing PHP to look for variables
 within them, even though there may not be any, thus slowing execution
 time...
 
 For example it is better to code:
   Code:
   echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';
 
 vs.
   Code:
   echo td bgcolor=\$bgcolor2\nbsp;/td/tr;
 
 Better is a very subjective question; however, style 1 will run faster
 since it won't look for variable interpolation. Personally I always use
 style 1 unless I specifically need variable interpolation or one of the
 special characters such as a newline. Also when doing HTML the double
 quotes fit nicely in the the single quote paradigm. On the other hand
 when I do SQL queries, I often allow interpolation just because it is
 more readable and because I usually use single quotes to wrap strings in
 my queries.

Now what is wrong with doing this?

echo 'td bgcolor=whitenbsp;/td'.\r\n;

That way you can still use your single quotes and still being able to use
the \r\n.. that does work doesn¹t it?  Im pretty sure I have used it
before..

Anyways I guess the point is that you are not forced to use double quotes
for the full echo just so you can use the special newline characters..

Rick

Freedom and immorality can not co-exist because freedom requires personal
responsibility. - Unknown

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



[PHP] limit to elements in an array?

2003-10-24 Thread Ian Truelsen
Is there an upper limit to the number of elements that can be in an
array? If so, what is that limit?

-- 
Ian Truelsen
Email: [EMAIL PROTECTED]
AIM: ihtruelsen
Homepage: http://www.ihtruelsen.dyndns.org

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



[PHP] Regular expressions

2003-10-24 Thread Fernando Melo
Hi all,

I have the following statement:

$text = ereg_replace
([live/]*content\.php\?[]*Item_ID=([0-9]*)Start=([0-9]*)Category_ID=([0-
9]*)[]*, content\\1start\\2CID\\3.php, $text);

Basically what I'm trying to do is if the URL includes live/ then I want
to include it in the replace.  The way I have it now check for all the
letters in live instead of the whole string.

I hope I explained this properly.

Regards
Fern

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



[PHP] php header function

2003-10-24 Thread Shaun van den Berg
Hi

I have tried the net , googling ect. but i cannot get a good description of
what the header function is al about ? Can anyone please define the header
function.

Thanks
Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za

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



RE: [PHP] php header function

2003-10-24 Thread chris . neale
http://uk.php.net/header

Have a look at that. As it says, sends an HTTP header. Useful if you want to
specify content type in the page that isn't HTML (maybe an image or a pdf).

Read the above for more info.

Regards

Chris

-Original Message-
From: Shaun van den Berg [mailto:[EMAIL PROTECTED]
Sent: 24 October 2003 09:47
To: [EMAIL PROTECTED]
Subject: [PHP] php header function


Hi

I have tried the net , googling ect. but i cannot get a good description of
what the header function is al about ? Can anyone please define the header
function.

Thanks
Shaun

--
Novtel Consulting
Tel: +27 21 9822373
Fax: +27 21 9815846
Please visit our website:
www.novtel.co.za

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

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



[PHP] HTTP request contents

2003-10-24 Thread Hanuska Ivo
Hi everyone,

I need to know, if there is a possibility to read full contents of HTTP request. I 
know, the response can be sent by header() function. But can I get the request of the 
client for server?

Thank you,

Ivo

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



[PHP] apache specific

2003-10-24 Thread dorgon
hi folks,

i know it's not really php specific, but i think, you guys are the right 
ones to address anyhow

i've been struggling all the evening with the followsymlinks option in 
httpd.conf. i've already used it before and it always worked... since i 
installed the gentoo distro last days. i compiled an apache 2.0.47 by my 
own (no gentoo ebuild) and php 5 beta (that wouldn't have influence 
anyhow on the symlink feature).

does anybody know bugs or some hint, why it doesn't work, even the 
settings MUST be correct?!

my httpd.conf looks like this:

snip

...blah blah blah...

Directory /
Options FollowSymLinks
AllowOverride None
/Directory
...blah...blah...

Directory /usr/local/httpd/htdocs
  Options Indexes FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
/Directory
...
/snip
as u can see, there's always the option enabled... I'm tired now gn8

/dorgon

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


[PHP] open source/php research software

2003-10-24 Thread Angelo Zanetti
Hi all.

I have heard about open source software that is used in tertiary
institutions and other research institutions that handles all the management
of the research articles. In other words, administrating the research
articles - adding, editing, deleting, searching, etc... something similiar
to what Emerald or Ebscohost use.

If anyone knows of any open source software that has the capabilities of the
above could they let me know.

TIA

Angelo
--

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] HTTP request contents

2003-10-24 Thread Nathan Taylor
Perhaps $_SERVER['REQUEST_URI'] in combination with $_SERVER['QUERY_STRING'] ?

Nathan
  - Original Message - 
  From: Hanuska Ivo 
  To: [EMAIL PROTECTED] 
  Sent: Friday, October 24, 2003 6:10 AM
  Subject: [PHP] HTTP request contents


  Hi everyone,

  I need to know, if there is a possibility to read full contents of HTTP request. I 
know, the response can be sent by header() function. But can I get the request of the 
client for server?

  Thank you,

  Ivo

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



Re: [PHP] HTTP request contents

2003-10-24 Thread Tom Rogers
Hi,

Friday, October 24, 2003, 8:10:03 PM, you wrote:
HI Hi everyone,

HI I need to know, if there is a possibility to read full contents of HTTP
HI request. I know, the response can be sent by header() function. But can I
HI get the request of the client for server?

HI Thank you,

HI Ivo

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

You probably need this if on apache
apache_request_headers()

-- 
regards,
Tom

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



[PHP] including files from different sub directories

2003-10-24 Thread Allex
Hi all,

What's the syntax for including/requiring files located in directories 
different than the root directory? Especially files from different sub 
directories under the root? Going down (classes/globals.php) is ok, 
but going up (../globals.php) makes problems

Example:

index.php: include_once('classes/globals.php') - works fine;
dbase.php: include_once('../globals.php') - generates an error;
controller.php:include_once('../dataaccess/dbase.php') - error;
root (dir)
+-classes (dir)
|  +-interface (dir)
|  | |-controller.php
|  +-dataaccess (dir)
|  | |-dbase.php
|  |globals.php
|index.php
|
I'm running PHP 4.3.2 with Apache 2 on WinXP box.

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


[PHP] Re: limit to elements in an array?

2003-10-24 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Is there an upper limit to the number of elements that can be in an
 array? If so, what is that limit?

That rather depends on available memory. How big is each array element?


-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] PHP 4.3.3 On Netscape WebServer

2003-10-24 Thread BENARD Jean-philippe
Hi,

I don't find anything about PHP module/integration for netscape
webserver. Does somebody has done it or know where I can found interesting
articles? (how to compile PHP, how to make a module, ...).

Many thanks in advance.

(o_   BENARD Jean-Philippe - Consultant STERIA Infogérance
(o_   (o_   //\ RENAULT DTSI/ODPS/[EMAIL PROTECTED] * ALO * API : MLB 02C 1 14
(/)_  (\)_  V_/_   2 Av du vieil étang * 78181 MONTIGNY-LE-BRETONNEUX
   Tél : +33 1-30-03-47-83 * Fax : +33 1-30-03-42-10

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



Re: [PHP] including files from different sub directories

2003-10-24 Thread Marek Kilimajer
including/requiring a file does not change the directory, the code is 
simply inserted into the current context. So you should have:

index.php: include_once('classes/globals.php')
dbase.php: include_once('classes/globals.php')
controller.php:include_once('classes/dataaccess/dbase.php')
Allex wrote:
Hi all,

What's the syntax for including/requiring files located in directories 
different than the root directory? Especially files from different sub 
directories under the root? Going down (classes/globals.php) is ok, 
but going up (../globals.php) makes problems

Example:

index.php: include_once('classes/globals.php') - works fine;
dbase.php: include_once('../globals.php') - generates an error;
controller.php:include_once('../dataaccess/dbase.php') - error;
root (dir)
+-classes (dir)
|  +-interface (dir)
|  | |-controller.php
|  +-dataaccess (dir)
|  | |-dbase.php
|  |globals.php
|index.php
|
I'm running PHP 4.3.2 with Apache 2 on WinXP box.

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


Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Joachim Krebs
That style is also the one I use. It works well, it is clean, and it is 
straightforward.

Joachim

Richard Baskett wrote:
on 10/24/03 0:47, Nathan Taylor at [EMAIL PROTECTED] wrote:


I am a recent fan of the single-quotes.  I used to use double only but when
some gurus told me the disadvantages I converted my entire project over to
single quotes.  Single quotes are ideal because as far coding goes it greatly
decreases the time of development when you don't have to worry about dropping
in the escape character on your HTML values, etc.  Granted, single quotes can
be a nuisance in some instances (like when you need a new line character) but
of course there is a way around.  I simply define a constant and call that at
the end of every line in order to substitute for the new line character.
Horizontal Tab - define(T, chr(9));
New Line - define(NL, chr(10));
Cheers,
Nathan
- Original Message -
From: Robert Cummings
To: Shawn McKenzie
Cc: PHP-General 
Sent: Thursday, October 23, 2003 10:30 PM
Subject: Re: [PHP] Code optimization: single vs. double quotes?

On Thu, 2003-10-23 at 20:43, Shawn McKenzie wrote:

I came across this post and was hoping to get a gurus opinion on the
validity.  TIA
-Shawn

I remember reading somewhere re: PHP coding that it is a better coding
practice to use single quotes as much as possible vs. using double quotes in
scripts. When using double quotes, you are forcing PHP to look for variables
within them, even though there may not be any, thus slowing execution
time...
For example it is better to code:
 Code:
 echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';
vs.
 Code:
 echo td bgcolor=\$bgcolor2\nbsp;/td/tr;
Better is a very subjective question; however, style 1 will run faster
since it won't look for variable interpolation. Personally I always use
style 1 unless I specifically need variable interpolation or one of the
special characters such as a newline. Also when doing HTML the double
quotes fit nicely in the the single quote paradigm. On the other hand
when I do SQL queries, I often allow interpolation just because it is
more readable and because I usually use single quotes to wrap strings in
my queries.


Now what is wrong with doing this?

echo 'td bgcolor=whitenbsp;/td'.\r\n;

That way you can still use your single quotes and still being able to use
the \r\n.. that does work doesn¹t it?  Im pretty sure I have used it
before..
Anyways I guess the point is that you are not forced to use double quotes
for the full echo just so you can use the special newline characters..
Rick

Freedom and immorality can not co-exist because freedom requires personal
responsibility. - Unknown
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] What does the word 'parse' meant when you do a XML parse...

2003-10-24 Thread Burhan Khalid
Robert Sedlacek wrote:
On Thu, 23 Oct 2003 18:36:20 -0500, John Nichel wrote:

Scott Fletcher wrote:

What does the word, 'parse' meant when you do a XML parse?  What is it and
what does it exactly do?
Ummm...it parses the XML document.


I think this would be a nice ~/.signature ;-)
Even better as a fortune :)

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


Re: [PHP] apache specific

2003-10-24 Thread Becoming Digital
I can't offer an answer but I can point you to some external resources.  Hopefully 
they help.
http://httpd.apache.org/docs-2.0/mod/core.html#directory
http://httpd.apache.org/docs-2.0/mod/core.html#options

Edward Dudlik
Those who say it cannot be done
should not interrupt the person doing it.

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU



- Original Message - 
From: dorgon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, 24 October, 2003 06:21
Subject: [PHP] apache specific


hi folks,

i know it's not really php specific, but i think, you guys are the right 
ones to address anyhow

i've been struggling all the evening with the followsymlinks option in 
httpd.conf. i've already used it before and it always worked... since i 
installed the gentoo distro last days. i compiled an apache 2.0.47 by my 
own (no gentoo ebuild) and php 5 beta (that wouldn't have influence 
anyhow on the symlink feature).

does anybody know bugs or some hint, why it doesn't work, even the 
settings MUST be correct?!

my httpd.conf looks like this:

snip

...blah blah blah...

Directory /
 Options FollowSymLinks
 AllowOverride None
/Directory


...blah...blah...

Directory /usr/local/httpd/htdocs
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
/Directory

...
/snip

as u can see, there's always the option enabled... I'm tired now gn8

/dorgon

-- 
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: What does the word 'parse' meant when you do a XML parse...

2003-10-24 Thread Scott Fletcher
Basically what I was asking about is what is the true definition of the
'parse' when using XML parsing.

I thought it had to do with data conversion, like something with the quote
or double quote for example.  But Chris pointed out a dictionary, I found
better definition there at http://en.wikipedia.org/wiki/Parse .  So, now I
know it basically is about breaking up the XML tags into something like
array or whatever the container is that XML get broken up into.

Dennis Sterzenbach [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Scott Fletcher [EMAIL PROTECTED] wrote:
  What does the word, 'parse' meant when you do a XML parse?  What is it
 and
  what does it exactly do?
 
  Thanks,
   Scott F.

 Sorry, but I don't get clearly what you are asking for.
 Could you ask your question again being more precise?

 --
  Dennis Sterzenbach
  www.darknoise.de

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



Re: [PHP] What does the word 'parse' meant when you do a XML parse...

2003-10-24 Thread Scott Fletcher
:-)

Burhan Khalid [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Robert Sedlacek wrote:
  On Thu, 23 Oct 2003 18:36:20 -0500, John Nichel wrote:
 
 Scott Fletcher wrote:
 
 What does the word, 'parse' meant when you do a XML parse?  What is it
and
 what does it exactly do?
 
 Ummm...it parses the XML document.
 
 
  I think this would be a nice ~/.signature ;-)

 Even better as a fortune :)


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

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



Re: [PHP] Ways to break up XML into Arrays????

2003-10-24 Thread Scott Fletcher
Will do...

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Try looking through http://pear.php.net for something.
 
 check out the xml functions, its an xml parser

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



Re: [PHP] Ways to break up XML into Arrays????

2003-10-24 Thread Scott Fletcher
I'll look into it.  Thanks for the head-up!

John Nichel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 snip
  On Thursday 23 October 2003 17:02, Scott Fletcher wrote:
 
 Hi Fellas!
 
 I don't want to use the PHP's XML feature at this moment because I
 found out that I need to recompile PHP with the XML support which I
can't
 do at this moment.  So, instead of recompiling, does anyone know of a
good
 sample coding or class out there on the Internet that would work   I'm
 looking for something similiar like this...  Problem is I don't have
good
 scripts that can handle the quote or double quote without missing up the
 XML data and PHP Array...
 
 snip

 Aren't the XML functions enabled by default?  Did your ISP specifically
 use '--disable-xml' when compiling?

 -- 
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com

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



Re: [PHP] Ways to break up XML into Arrays????

2003-10-24 Thread Scott Fletcher
Will do...

Ryan Thompson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Try looking through http://pear.php.net for something.

On Thursday 23 October 2003 17:02, Scott Fletcher wrote:
 Hi Fellas!

 I don't want to use the PHP's XML feature at this moment because I
 found out that I need to recompile PHP with the XML support which I can't
 do at this moment.  So, instead of recompiling, does anyone know of a good
 sample coding or class out there on the Internet that would work   I'm
 looking for something similiar like this...  Problem is I don't have good
 scripts that can handle the quote or double quote without missing up the
 XML data and PHP Array...

 --snip--
 //Individual
 FirstNameBill/FirstName
 LastNameClinton/LastName
 GenderM/Gender
 FavoratePetDog/FavoratePet
 //Joint
 FirstNameHillary/FirstName
 LastNameClinton/LastName
 GenderF/Gender
 FavoratePetCat/FavoratePet

 //This would be return in array like...
 echo $XML_Tag['FirstName'][0];  //Output would be Bill...
 echo  ; //Whitespace...
 echo $XML_Tag['LastName'][0]; //Output would be Clinton...
 echo 's favorate pet is a ;
 echo $XML_Tag['FavoratePet']; //Output would be Dog...
 echo  and his wife name is ;
 echo $XML_Tag['FirstName'][1];  //Output would be Hillary...
 echo  ; //Whitespace...
 echo $XML_Tag['LastName'][1]; //Output would be Clinton...
 --snip--

 Just something like that...   Thanks!!!

 Scott F.

-- 
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net
==
A computer scientist is someone who fixes
 things that aren't broken --Unknown

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



Re: [PHP] Ways to break up XML into Arrays????

2003-10-24 Thread Scott Fletcher
I wonder about overwritting the same tag twice, like 'FirstName' and end
up with one result when using hte XML parse...  Does anyone know that PHP
XML Parse can work without overwriting in this case and still get two
different result?

Scott F.

Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 While it's possible to process XML using regular expression. The whole
 point of using XML is that you wouldn't have to use hacked solutions
 like that :-)

 Scott Fletcher wrote:

 Hi Fellas!
 
 I don't want to use the PHP's XML feature at this moment because I
found
 out that I need to recompile PHP with the XML support which I can't do at
 this moment.  So, instead of recompiling, does anyone know of a good
sample
 coding or class out there on the Internet that would work   I'm looking
for
 something similiar like this...  Problem is I don't have good scripts
that
 can handle the quote or double quote without missing up the XML data and
PHP
 Array...
 
 --snip--
 //Individual
 FirstNameBill/FirstName
 LastNameClinton/LastName
 GenderM/Gender
 FavoratePetDog/FavoratePet
 //Joint
 FirstNameHillary/FirstName
 LastNameClinton/LastName
 GenderF/Gender
 FavoratePetCat/FavoratePet
 
 //This would be return in array like...
 echo $XML_Tag['FirstName'][0];  //Output would be Bill...
 echo  ; //Whitespace...
 echo $XML_Tag['LastName'][0]; //Output would be Clinton...
 echo 's favorate pet is a ;
 echo $XML_Tag['FavoratePet']; //Output would be Dog...
 echo  and his wife name is ;
 echo $XML_Tag['FirstName'][1];  //Output would be Hillary...
 echo  ; //Whitespace...
 echo $XML_Tag['LastName'][1]; //Output would be Clinton...
 --snip--
 
 Just something like that...   Thanks!!!
 
 Scott F.
 
 
 


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

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



[PHP] Globals on/off , PHP.ini and .htaccess - Best solution?

2003-10-24 Thread Ryan A
Hi,
we have a site that is catering to webhosts and programmers, as you can
understand these people know computers and programs :-)

They are fooling around with the default settings of their accounts and
giving us funny results and basically being a PITA, asking them nicely to
quit... we are sure just wont work...so we have decided to turn globals off.
We are in the process of doing this to around 250 scripts and now we have
run into a problem...

(we are on a shared host and so dont have access to our php.ini file)
we are planning to turn globals off via a .htaccess file...nearly all our
php files are in root (/www/) , but we are also running a third party
application 1 directory above root (/www/theApplication/) which requires
globals on, when we tried to use a htaccess to turn off globals in the root
all sub directories too went off...so we added another .htaccess in  the sub
and we got errors

What to do? how can we have globals off everywhere but in the
/www/theApplication/

Cheers,
-Ryan

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



Re: [PHP] XML Parser

2003-10-24 Thread Ray Hunter
I would probably make this a new thread since it is a new question.

Anyways, the answer to your question is no, unless you make that
happen.  When you use the xml parser in php you are using a expat parser
(stream-oriented parser) that you set up (register) handlers for.  So
when the parser encounters a tag (element) then it is handled by a
predefined handler (function in this case) that is created by the
developer.

Now if you are using the DOM XML parser then the entire xml document is
loaded as a DOM object like a tree. You can then access different
branches (nodes) of the tree via dom functions.

Each type of parser has its own pros and cons...I would suggest deciding
which one is best for what you are doing.  For example, if you have
large xml files to parse, then expat is probably the best way...however,
if you need to be able to access nodes of the document in random ways
then the DOM XML parser might be a better alternative.  Expat will be
faster and less memory intensive than DOM.

HTH...

--
Ray

On Fri, 2003-10-24 at 07:03, Scott Fletcher wrote:
 I wonder about overwritting the same tag twice, like 'FirstName' and end
 up with one result when using hte XML parse...  Does anyone know that PHP
 XML Parse can work without overwriting in this case and still get two
 different result?
 
 Scott F.
 
 Raditha Dissanayake [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  While it's possible to process XML using regular expression. The whole
  point of using XML is that you wouldn't have to use hacked solutions
  like that :-)
 
  Scott Fletcher wrote:
 
  Hi Fellas!
  
  I don't want to use the PHP's XML feature at this moment because I
 found
  out that I need to recompile PHP with the XML support which I can't do at
  this moment.  So, instead of recompiling, does anyone know of a good
 sample
  coding or class out there on the Internet that would work   I'm looking
 for
  something similiar like this...  Problem is I don't have good scripts
 that
  can handle the quote or double quote without missing up the XML data and
 PHP
  Array...
  
  --snip--
  //Individual
  FirstNameBill/FirstName
  LastNameClinton/LastName
  GenderM/Gender
  FavoratePetDog/FavoratePet
  //Joint
  FirstNameHillary/FirstName
  LastNameClinton/LastName
  GenderF/Gender
  FavoratePetCat/FavoratePet
  
  //This would be return in array like...
  echo $XML_Tag['FirstName'][0];  //Output would be Bill...
  echo  ; //Whitespace...
  echo $XML_Tag['LastName'][0]; //Output would be Clinton...
  echo 's favorate pet is a ;
  echo $XML_Tag['FavoratePet']; //Output would be Dog...
  echo  and his wife name is ;
  echo $XML_Tag['FirstName'][1];  //Output would be Hillary...
  echo  ; //Whitespace...
  echo $XML_Tag['LastName'][1]; //Output would be Clinton...
  --snip--
  
  Just something like that...   Thanks!!!
  
  Scott F.
  
  
  
 
 
  -- 
  Raditha Dissanayake.
  
  http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
  Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
  Graphical User Inteface. Just 150 KB  |  with progress bar.

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



Re: [PHP] Regular expressions

2003-10-24 Thread Curt Zirzow
* Thus wrote Fernando Melo ([EMAIL PROTECTED]):
 Hi all,
 
 I have the following statement:
 
 $text = ereg_replace
 ([live/]*content\.php\?[]*Item_ID=([0-9]*)Start=([0-9]*)Category_ID=([0-
 9]*)[]*, content\\1start\\2CID\\3.php, $text);
 
 Basically what I'm trying to do is if the URL includes live/ then I want
 to include it in the replace.  The way I have it now check for all the
 letters in live instead of the whole string.
 
 I hope I explained this properly.

I dont really quite follow what you want to do, your regex would
replace something like:

  lcontent.php?Item_ID=34Start=54Category_ID=98

  to 
  content34start54CID98.php

Curt
-- 
My PHP key is worn out

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

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



Re: [PHP] XML Parser

2003-10-24 Thread Scott Fletcher
Thanks!  Oh Boy!  :-)

For the repeating of the same XML name tag, I guess one way to do it is to
depend on the higher up XML name tag that group them together.  Chopped them
off and use it somehow.

For ex.
--snip--
Individual
 FirstName***/FirstName
/Individual
Joint
 FirstName***/FirstName
/Joint
--snip--

This may help  Now I'm going to have to decide on DOM XML or Expat...

Thanks,
  Scott F.

Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I would probably make this a new thread since it is a new question.

 Anyways, the answer to your question is no, unless you make that
 happen.  When you use the xml parser in php you are using a expat parser
 (stream-oriented parser) that you set up (register) handlers for.  So
 when the parser encounters a tag (element) then it is handled by a
 predefined handler (function in this case) that is created by the
 developer.

 Now if you are using the DOM XML parser then the entire xml document is
 loaded as a DOM object like a tree. You can then access different
 branches (nodes) of the tree via dom functions.

 Each type of parser has its own pros and cons...I would suggest deciding
 which one is best for what you are doing.  For example, if you have
 large xml files to parse, then expat is probably the best way...however,
 if you need to be able to access nodes of the document in random ways
 then the DOM XML parser might be a better alternative.  Expat will be
 faster and less memory intensive than DOM.

 HTH...

 --
 Ray

 On Fri, 2003-10-24 at 07:03, Scott Fletcher wrote:
  I wonder about overwritting the same tag twice, like 'FirstName' and
end
  up with one result when using hte XML parse...  Does anyone know that
PHP
  XML Parse can work without overwriting in this case and still get two
  different result?
 
  Scott F.
 
  Raditha Dissanayake [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   While it's possible to process XML using regular expression. The whole
   point of using XML is that you wouldn't have to use hacked solutions
   like that :-)
  
   Scott Fletcher wrote:
  
   Hi Fellas!
   
   I don't want to use the PHP's XML feature at this moment because
I
  found
   out that I need to recompile PHP with the XML support which I can't
do at
   this moment.  So, instead of recompiling, does anyone know of a good
  sample
   coding or class out there on the Internet that would work   I'm
looking
  for
   something similiar like this...  Problem is I don't have good scripts
  that
   can handle the quote or double quote without missing up the XML data
and
  PHP
   Array...
   
   --snip--
   //Individual
   FirstNameBill/FirstName
   LastNameClinton/LastName
   GenderM/Gender
   FavoratePetDog/FavoratePet
   //Joint
   FirstNameHillary/FirstName
   LastNameClinton/LastName
   GenderF/Gender
   FavoratePetCat/FavoratePet
   
   //This would be return in array like...
   echo $XML_Tag['FirstName'][0];  //Output would be Bill...
   echo  ; //Whitespace...
   echo $XML_Tag['LastName'][0]; //Output would be Clinton...
   echo 's favorate pet is a ;
   echo $XML_Tag['FavoratePet']; //Output would be Dog...
   echo  and his wife name is ;
   echo $XML_Tag['FirstName'][1];  //Output would be Hillary...
   echo  ; //Whitespace...
   echo $XML_Tag['LastName'][1]; //Output would be Clinton...
   --snip--
   
   Just something like that...   Thanks!!!
   
   Scott F.
   
   
   
  
  
   -- 
   Raditha Dissanayake.
 
 
   http://www.radinks.com/sftp/  |
http://www.raditha/megaupload/
   Lean and mean Secure FTP applet with  |  Mega Upload - PHP file
uploader
   Graphical User Inteface. Just 150 KB  |  with progress bar.

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



Re: [PHP] php header function

2003-10-24 Thread Chris Shiflett
--- Shaun van den Berg [EMAIL PROTECTED] wrote:
 I have tried the net , googling ect. but i cannot get a good
 description of what the header function is al about ? Can anyone
 please define the header function.

It allows you to specify an HTTP header to be included in the response to the
Web client. You can find more information specifically about header at:

http://www.php.net/header

If you want to know more about HTTP itself, and the valid headers, you can buy
HTTP Developer's Handbook. :-) Or, if you want to research the various
specifications yourself, I link to many of them from here:

http://shiflett.org/docs

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] HTTP request contents

2003-10-24 Thread Chris Shiflett
--- Hanuska Ivo [EMAIL PROTECTED] wrote:
 I need to know, if there is a possibility to read full contents of
 HTTP request. I know, the response can be sent by header() function.
 But can I get the request of the client for server?

In a way, yes, although most of this information is nicely parsed for you by
the time PHP has its turn. Look in the $_SERVER superglobal for many of the
headers:

print_r($_SERVER);

Most headers (I think all) begin with HTTP, as in $_SERVER['HTTP_USER_AGENT']
for the User-Agent header. The request line itself is broken into the method,
requested resource, and version.

There is also a nice function called apache_request_headers:

http://www.php.net/apache_request_headers

If you're using an older version, this might be called getallheaders.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



[PHP] Using PHP with JAVA

2003-10-24 Thread Matt Palermo
I have been searching the web for ways to execute remote PHP files through
the use of JAVA code, but I haven't had any luck.  I have found many ways to
call JAVA functions from a PHP script, but not the other way around.  What
I'm trying to accomplish is I want to build a JAVA application that will be
run from a users local computer after installation and this JAVA program
will connect to a url on my server (a url to a PHP script).  This PHP script
will be used to connect to the server's MySQL database and send some
retrieved information back to the JAVA application on the users machine.  I
have been searching the web for hours trying to find a tutorial, or advice
on how to accomplish this, but so far I have had no luck.  If anyone has any
advice or suggestions please let me know.

Thanks,

Matt

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



[PHP] Re: including files from different sub directories

2003-10-24 Thread Rob Adams
Allex [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 What's the syntax for including/requiring files located in directories
 different than the root directory? Especially files from different sub
 directories under the root? Going down (classes/globals.php) is ok,
 but going up (../globals.php) makes problems

 Example:

 index.php: include_once('classes/globals.php') - works fine;
 dbase.php: include_once('../globals.php') - generates an error;
 controller.php:include_once('../dataaccess/dbase.php') - error;

 root (dir)
 +-classes (dir)
 |  +-interface (dir)
 |  | |-controller.php
 |  +-dataaccess (dir)
 |  | |-dbase.php
 |  |globals.php
 |index.php
 |

What you probably need to do to go 'up' a directory is something like this:
$dir = dir($_SERVER['SCRIPT_FILENAME']);

Then take off the last directory.  Then either stay there or append another
directory name to it.
Try using strrchr().  Or there is probably a class somewhere to break a path
into all its parts.

  -- Rob




 I'm running PHP 4.3.2 with Apache 2 on WinXP box.

 Thanks,
 Allex

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



[PHP] Re: get user attributes php/ldap/win2k active directory

2003-10-24 Thread Redmond Militante
hello

thanks for replying.  i think i'm almost there...

here's what i've tried so far...

? 

//connect

if($ds = ldap_connect(my.domaincontroller.com)){
echo connected successfullybr;}
else {echo error connectingbr;}

//bind
if ( [EMAIL PROTECTED](my.domaincontroller.com)) {
echo bind successfulbr;}
else {echo error bindingbr;}

//the connect and bind above work successfully when executed on their own
//now, i'm going to try and get attributes

//Search LDAP for all users
// note, your OU entries may differ
$sr = ldap_search($ds,ou=users,dc=my.domaincontroller.com,dc=com, 'CN=*');

// Put the returned data into an array
$info = ldap_get_entries($ds, $sr);

//loop through all the users and display their name
for($i = 0; $i  $info['count']; $i++) {
  echo $info[$i]['cn'][0].\n;
}


? 

the above code basically tells me that i'm connecting and binding, but returns no 
attributes. is there anything i'm missing?

thanks
redmond


[Thu, Oct 23, 2003 at 01:02:58PM -0700]
This one time, at band camp, Justin Patrin said:

 I've been getting entries from an Active Directory server through LDAP 
 for a while now. Here's some example code:
 
 //connect and bind
 //$ds should be the handle returned from ldap_connect
 
 //Search LDAP for all users
 // note, your OU entries may differ
 $sr = ldap_search($ds,
 'OU=Employees,OU=Active Accounts,DC=whatever,DC=com', 'CN=*');
 
 // Put the returned data into an array
 $info = ldap_get_entries($ds, $sr);
 
 //loop through all the users and display their name
 for($i = 0; $i  $info['count']; $i++) {
   echo $info[$i]['cn'][0].\n;
 }
 
 
 If you need an LDAP Browser, I suggest Softerra LDAP Browser. It's very 
 nice for finding OU's and such.
 
 Justin Patrin
 
 
 Redmond Militante wrote:
 hi all
 
 my first email to the list re: php/ldap/win2k AD garnered no responses.  
 i've got most of the problem solved, however i can't get attributes from 
 the ldap server.
 
 i have a login script that authenticates against our win2k active 
 directory domain controller.  i'm able to open a connection/bind/verify a 
 password/and close the connection.  i'm really having trouble returning a 
 user's attributes (i'm mainly concerned with firstname and last name - cn 
 and givenname).
 
 i've been trying for several days to return attributes.  has anyone 
 accomplished this with php?  i can't find much relevant info for this 
 particular problem on the internet.  if you have any pointers, i'd 
 appreciate hearing them.
 
 i'd post relevant code, but nothing i've tried works, and i'm not sure if 
 the code i've tried is even valid...
 
 thanks
 
 redmond
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
FreeBSD 5.1-RELEASE-p10 FreeBSD 5.1-RELEASE-p10 #0: Fri Oct 3 21:30:51 CDT 2003
 9:00AM  up 10 days, 41 mins, 5 users, load averages: 1.00, 1.00, 1.00
 
Once upon a time, when I was training to be a mathematician, a group of
us bright young students taking number theory discovered the names of
the smaller prime numbers.

2:  The Odd Prime --
It's the only even prime, therefore it's odd.  QED.
3:  The True Prime --
Lewis Carroll: If I tell you three times, it's true.
31: The Arbitrary Prime --
Determined by unanimous unvote.  We needed an arbitrary prime
in case the prof asked for one, and so had an election.  91
received the most votes (well, it *looks* prime) and 3+4i the
next most.  However, 31 was the only candidate to receive none
at all.

Since the composite numbers are formed from primes, their qualities are
derived from those primes.  So, for instance, the number 6 is odd but
true, while the powers of 2 are all extremely odd numbers.
 


pgp0.pgp
Description: PGP signature


Re: [PHP] including files from different sub directories

2003-10-24 Thread Curt Zirzow
* Thus wrote Allex ([EMAIL PROTECTED]):
 Hi all,
 
 What's the syntax for including/requiring files located in directories 
 different than the root directory? Especially files from different sub 
 directories under the root? Going down (classes/globals.php) is ok, 
 but going up (../globals.php) makes problems

What you need to pay attention to is the php.ini setting:
  include_path

By default there is a value as '.' meaning relative to the calling
script. What might be a good idea is adding a path to the root of
your includes script to the setting (ie. /path/to/web_root) So
all inlucdes no matter what file is including them uses the same
syntax.

index.php: include_once('classes/globals.php')
dbase.php: include_once('classes/globals.php')
controller.php:include_once('classes/dataaccess/dbase.php')

 
 root (dir)
 +-classes (dir)
 |  +-interface (dir)
 |  | |-controller.php
 |  +-dataaccess (dir)
 |  | |-dbase.php
 |  |globals.php
 |index.php
 |
 

You might want to consider moving your included files outside your
public web tree:

home (dir)
 +-web root (dir)
 |  |-index.php
 |
 +-include root (dir)
+-classes (dir)
|  +-interface (dir)
|  | |-controller.php
|  +-dataaccess (dir)
|  | |-dbase.php
|  |globals.php

Then set the php_include path to 
  /path/to/include root/

Then all your include/requires are made relative to  the include
root.

HTH,

Curt
-- 
My PHP key is worn out

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

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



RE: [PHP] Using PHP with JAVA

2003-10-24 Thread Gregory Kornblum
For this you will want to use a standard socket to port 80 with GET
yourscript.php?var=foo HTTP/1.0\r\n\r\n in the send method and the recieve
method will return the results. They have higher level APIs for HTTP but
this is my preference. You should easily be able to find examples on using
sockets in Java. Regards.

-Gregory

-Original Message-
From: Matt Palermo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 10:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Using PHP with JAVA


I have been searching the web for ways to execute remote PHP files through
the use of JAVA code, but I haven't had any luck.  I have found many ways to
call JAVA functions from a PHP script, but not the other way around.  What
I'm trying to accomplish is I want to build a JAVA application that will be
run from a users local computer after installation and this JAVA program
will connect to a url on my server (a url to a PHP script).  This PHP script
will be used to connect to the server's MySQL database and send some
retrieved information back to the JAVA application on the users machine.  I
have been searching the web for hours trying to find a tutorial, or advice
on how to accomplish this, but so far I have had no luck.  If anyone has any
advice or suggestions please let me know.

Thanks,

Matt

-- 
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: Avoiding blank lines in HTML when field is empty

2003-10-24 Thread Robb Kerr
On Thu, 23 Oct 2003 12:46:29 -0500, Robb Kerr wrote:

Thanx for all the help. Your suggestions worked beautifully.

Robb

 I'm a PhP /MySQL newbie so please excuse the simple question. I'm returning
 results from a MySQL query on a webpage. My code includes...
 
 td valign=top
   ?php echo $row_rsVandyDivAddresses['First_Name']; ? ?php echo
 $row_rsVandyDivAddresses['Last_Name'];?, ?php echo
 $row_rsVandyDivAddresses['Degree']; ?
   br
   ?php echo $row_rsVandyDivAddresses['Address']; ?
   br
   ?php echo $row_rsVandyDivAddresses['City']; ?, ?php echo
 $row_rsVandyDivAddresses['State']; ??php echo
 $row_rsVandyDivAddresses['Zip']; ?
   br
   Phone: ?php echo $row_rsVandyDivAddresses['Phone']; ?
   br
   Email: ?php echo $row_rsVandyDivAddresses['Email']; ?
 /td
 
 Here's the problem. Some of the fields are empty (for instance 'Address')
 and the way my code is configured a blank line appears in the returned data
 when the field is empty. How do I change this code to add a conditional that
 only echos the field contents AND the br when the field is NOT empty?
 
 I've tried...
 
   ?php if (!empty($row_rsVandyDivAddresses['Address']) echo
 $row_rsVandyDivAddresses['Address']); ?
 
 but don't know how to include the line break br in the if statement.
 
 Any help is greatly appreciated,
 Robb

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



Re: [PHP] Globals on/off , PHP.ini and .htaccess - Best solution?

2003-10-24 Thread Curt Zirzow
* Thus wrote Ryan A ([EMAIL PROTECTED]):
 
 They are fooling around with the default settings of their accounts and
 giving us funny results and basically being a PITA, asking them nicely to

Put in their .htaccess something like:
  php_value engine off :)

 
 all sub directories too went off...so we added another .htaccess in  the sub
 and we got errors

What were the errors?

 
 What to do? how can we have globals off everywhere but in the
 /www/theApplication/

With the method you described above :)


Curt
-- 
My PHP key is worn out

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

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Ray Hunter
You have various options and it depends on how you want to accomplish it
and what you are familiar with.

Java has many capabilities of doing network io (class HttpUrlConnect).
You can contact your php page on your server and pull down the
information (similar to what a browser does). 

Another alternative is to have php run as soap and have your java access
the php soap service and get xml data. Then you java app can parse the
xml and then display it to the user.

HTH...

--
Ray 

On Fri, 2003-10-24 at 08:10, Matt Palermo wrote:
 I have been searching the web for ways to execute remote PHP files through
 the use of JAVA code, but I haven't had any luck.  I have found many ways to
 call JAVA functions from a PHP script, but not the other way around.  What
 I'm trying to accomplish is I want to build a JAVA application that will be
 run from a users local computer after installation and this JAVA program
 will connect to a url on my server (a url to a PHP script).  This PHP script
 will be used to connect to the server's MySQL database and send some
 retrieved information back to the JAVA application on the users machine.  I
 have been searching the web for hours trying to find a tutorial, or advice
 on how to accomplish this, but so far I have had no luck.  If anyone has any
 advice or suggestions please let me know.
 
 Thanks,
 
 Matt

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



Re: [PHP] Globals on/off , PHP.ini and .htaccess - Best solution?

2003-10-24 Thread Eugene Lee
On Fri, Oct 24, 2003 at 02:59:58PM +0200, Ryan A wrote:
: 
: (we are on a shared host and so dont have access to our php.ini file)
: we are planning to turn globals off via a .htaccess file...nearly all our
: php files are in root (/www/) , but we are also running a third party
: application 1 directory above root (/www/theApplication/) which requires
: globals on, when we tried to use a htaccess to turn off globals in the root
: all sub directories too went off...so we added another .htaccess in  the sub
: and we got errors
: 
: What to do? how can we have globals off everywhere but in the
: /www/theApplication/

You should be able to put an .htaccess file disabling globals into /www/,
then put an .htaccess file enable globals into /www/theApplication/.  If
this setup causes problems, feel free to report back.

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Ray Hunter
Sorry, 

i forgot to mention the package that you might really want to review...

java.net is the java package that provides all these classes, like
URLConnection and Sockets as mentioned by another person.

--
Ray

On Fri, 2003-10-24 at 08:24, Ray Hunter wrote:
 You have various options and it depends on how you want to accomplish it
 and what you are familiar with.
 
 Java has many capabilities of doing network io (class HttpUrlConnect).
 You can contact your php page on your server and pull down the
 information (similar to what a browser does). 
 
 Another alternative is to have php run as soap and have your java access
 the php soap service and get xml data. Then you java app can parse the
 xml and then display it to the user.
 
 HTH...
 
 --
 Ray 
 
 On Fri, 2003-10-24 at 08:10, Matt Palermo wrote:
  I have been searching the web for ways to execute remote PHP files through
  the use of JAVA code, but I haven't had any luck.  I have found many ways to
  call JAVA functions from a PHP script, but not the other way around.  What
  I'm trying to accomplish is I want to build a JAVA application that will be
  run from a users local computer after installation and this JAVA program
  will connect to a url on my server (a url to a PHP script).  This PHP script
  will be used to connect to the server's MySQL database and send some
  retrieved information back to the JAVA application on the users machine.  I
  have been searching the web for hours trying to find a tutorial, or advice
  on how to accomplish this, but so far I have had no luck.  If anyone has any
  advice or suggestions please let me know.
  
  Thanks,
  
  Matt

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



[PHP] Setlocale() not working

2003-10-24 Thread Mauricio Cuenca
Hello,

I'm trying to print the full date in spanish using the following lines:

setlocale(LC_TIME, 'es_ES');
strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, 12, 31, 2002));

But my sysadmin tells me that the server doesn't have the spanish locale
installed. Is there a way that I can write the date in other language
without the need to harcode the weekday names ??? Using only the strftime
function ???

Thanks,


Mauricio Cuenca

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



[PHP] imap_set_quota() function

2003-10-24 Thread dimon
Hello,

I'm trying to use PHP's imap_set_quota() function to manage user's quotas. I 
can set user's quota to 0 with:
imap_set_quota($mbox, user/afif, none); or
imap_set_quota($mbox, user/afif, 0);
And for sure I can set user's quota to any other value  0
But when I'm trying to delete quota (set unlimited quota) for the user with
imap_set_quota($mbox, user/afif, -1);
imap_errors() gives me this error:
IMAP protocol error: Invalid quota list in Setquota
I have compiled PHP with c-client 2001 FINAL as suggested at php.net site.
But it still doesn't work :-)

My configuration is:
name   : Cyrus IMAPD
version: v2.2.1-BETA 2003/07/16 21:18:54
os : FreeBSD
os-version : 4.7-RELEASE
environment: Built w/Cyrus SASL 2.1.13
 Running w/Cyrus SASL 2.1.15
 Sleepycat Software: Berkeley DB 3.3.11: (July 12, 2001)
 Built w/OpenSSL 0.9.6h  5 Dec 2002
 Running w/OpenSSL 0.9.6h  5 Dec 2002
 CMU Sieve 2.2
PHP-4.3.3
Apache/1.3.27 
c-client 2001 FINAL 

Have anyone had any issues or luck doing the same thing?
May be I missed something?

Any help would be greatly appreciated!
Dmitry

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



Re: [PHP] Setlocale() not working

2003-10-24 Thread Curt Zirzow
* Thus wrote Mauricio Cuenca ([EMAIL PROTECTED]):
 Hello,
 
 I'm trying to print the full date in spanish using the following lines:
 
 setlocale(LC_TIME, 'es_ES');
 strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, 12, 31, 2002));
 
 But my sysadmin tells me that the server doesn't have the spanish locale
 installed. Is there a way that I can write the date in other language
 without the need to harcode the weekday names ??? Using only the strftime
 function ???

In theory, you can install the locale language in your home dir:

  /path/to/your/homedir/locale/es_ES*

then set the environment to look there instead:
  setenv('PATH_LOCALE', '/path/to/your/homedir');

and then the setlocale and strftime should work.

Of course this is theory.


Curt
-- 
My PHP key is worn out

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

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



[PHP] Re: PHP 4.3.3 On Netscape WebServer

2003-10-24 Thread Michael Mauch
Benard Jean-Philippe wrote:

I don't find anything about PHP module/integration for netscape
 webserver. Does somebody has done it or know where I can found interesting
 articles? (how to compile PHP, how to make a module, ...).

What about http://fr.php.net/manual/en/install.netscape-enterprise.php
and http://fr.php.net/manual/fr/install.netscape-enterprise.php?

If have no idea about Netscape webservers, but these pages look rather
detailed.

Regards...
Michael

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



Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread olinux

 No special chars or vars:
 echo 'td bgcolor=\'#ff\'nbsp;/td/tr';
 
 For cases with vars and special chars, I think these
 look terrible:
 echo 'td bgcolor='.$bgcolor2.'nbsp;/td/tr';

I'm a fan of this style - works great with syntax
highlighting in homesite.

olinux


 echo td bgcolor=\$bgcolor2\nbsp;/td/tr;
 
 Whereas this is clear and easy to work with:
 echo td bgcolor='{$bgcolor2}'nbsp;/td/tr;


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Robert Cummings
On Fri, 2003-10-24 at 03:57, Justin French wrote:
 On Friday, October 24, 2003, at 10:43  AM, Shawn McKenzie wrote:
 
 [--CLIPPETY CLIP CLIP--]
 
 Whereas this is clear and easy to work with:
 echo td bgcolor='{$bgcolor2}'nbsp;/td/tr;
 

Unless your $bgcolor2 variable has double quotes in it, then the above
is poor HTML style. I don't think omission of double quotes has been
considered valid HTML since version 3 (admittedly though, as long as
they let it render, people will use it :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] limit to elements in an array?

2003-10-24 Thread Robert Cummings
On Fri, 2003-10-24 at 04:48, Ian Truelsen wrote:
 Is there an upper limit to the number of elements that can be in an
 array? If so, what is that limit?

I think it is only limitted by your computer's memory or the size of a
long integer (2.4 billion or so). I did a test one day to see just how
much a lookup into a configuration array would cost, and it was
negligible both for loading time and access time on a 1 entry array.
Load time increases a bit on a 1 million entry array, but lookup was
still extremely fast, which is fairly expected with any decent unique
key lookup implementation.

Cheers,
ROb.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Raditha Dissanayake
Hi,

For this scenario, Ray's suggestion of SOAP is IMHO the best option. But 
just out of curiosity why do you want to mix the two languages? If you 
are familiar with java you might be better off doing your server side 
stuff using J2EE. Then you might be able to use
Object Streams for your communications or RMI. Then there is the 
XMLEncoder class that was made availble with 1.4

better stop before someone shoots me down this is a PHP list after all :-)



Matt Palermo wrote:

I have been searching the web for ways to execute remote PHP files through
the use of JAVA code, but I haven't had any luck.  I have found many ways to
call JAVA functions from a PHP script, but not the other way around.  What
I'm trying to accomplish is I want to build a JAVA application that will be
run from a users local computer after installation and this JAVA program
will connect to a url on my server (a url to a PHP script).  This PHP script
will be used to connect to the server's MySQL database and send some
retrieved information back to the JAVA application on the users machine.  I
have been searching the web for hours trying to find a tutorial, or advice
on how to accomplish this, but so far I have had no luck.  If anyone has any
advice or suggestions please let me know.
Thanks,

Matt

 



--
Raditha Dissanayake.

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


RE: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Chris W. Parker
Justin French mailto:[EMAIL PROTECTED]
on Friday, October 24, 2003 12:57 AM said:

 I also adapted wrapping all variables in {parenthesis} so that PHP has
 no chance of being confused

heh... actually those are {curly braces} and these are (parenthesis).

 No special chars or vars:
 echo 'td bgcolor=\'#ff\'nbsp;/td/tr';

Even better (and valid HTML too!):

echo 'td bgcolor=#ffnbsp;/td/tr';


I've always been a big fan of:

 echo td bgcolor=\$bgcolor2\nbsp;/td/tr;

But this has been an interesting topic so I might just start changing my
style.


Chris.

p.s. If you're wondering how heredoc fits into all of this, it's really
slow.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Marek Kilimajer
Robert Cummings wrote:
echo td bgcolor='{$bgcolor2}'nbsp;/td/tr;
Unless your $bgcolor2 variable has double quotes in it, then the above
is poor HTML style. I don't think omission of double quotes has been
considered valid HTML since version 3 (admittedly though, as long as
they let it render, people will use it :)
Cheers,
Rob.
Single quotes are valid in html, though not in xhtml.

Marek

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


Re: [PHP] Code optimization: single vs. double quotes?

2003-10-24 Thread Robert Cummings
On Fri, 2003-10-24 at 12:03, Marek Kilimajer wrote:
 Robert Cummings wrote:
 echo td bgcolor='{$bgcolor2}'nbsp;/td/tr;
  
  Unless your $bgcolor2 variable has double quotes in it, then the above
  is poor HTML style. I don't think omission of double quotes has been
  considered valid HTML since version 3 (admittedly though, as long as
  they let it render, people will use it :)
  
  Cheers,
  Rob.
 
 Single quotes are valid in html, though not in xhtml.

Whoops my bad, for some reason I saw those single quotes as string
delimiters, which really makes no sense on my part at all. I'm claiming
the just woke up excuse :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Bas
Any help appreciated.

Regards,

Bas

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



[PHP] DOM XML difference between PHP versions 4.2.1 and 4.3.3

2003-10-24 Thread Simon
Hello

I wonder if anyone can help me with this problem or suggest an alternative
strategy.

I have two PHP boxes, one windows box running PHP version 4.2.1 and DOM XML
version 2.4.9, and the other one a FreeBSD box running PHP version 4.3.3 and
DOM XML version 2.5.11.

What I need to do is to join two XML documents together.  The code below
runs fine on the 4.2.1 box but fails on the 4.3.3 box.

  //$pagenodes_doc_xml and $menu_xml have been previously populated with
valid XML document objects
  // get page nodes root element
  $pagenodes_xml =  $pagenodes_doc_xml-document_element();
  //locate portalroot in menu xml
  $ctx = xpath_new_context($menu_xml);
  $nodes = xpath_eval($ctx, //[EMAIL PROTECTED]'portalroot']);
  $portalroot = $nodes-nodeset[0];
  //append pages nodes at portalroot location
  $new_xml = $portalroot-append_child($pagenodes_xml);

The error is Warning: append_child(): Can't append node, which is in a
different document than the parent node.

Simon

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



Re: [PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Daniel Guerrier
When you make a file using data from what source?
--- Bas [EMAIL PROTECTED] wrote:
 Any help appreciated.
 
 Regards,
 
 Bas
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] Php/mysql error....why?

2003-10-24 Thread Ryan A
Hi,
I am running a very simple query to the database, basically select all the
firms which start with 0-9,
eg.
1stcompany
3isgood
etc

using this:
$qry = select cust_no,firm from companies where firm LIKE `%0123456789%';

It gives me this error:

Error: Unknown column '0123456789%'' in 'where clause'

any idea why its ignoring the LIKE statement? the funny part is LIKE is
working for another program..

What am i missing?

Thanks,
-Ryan

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



RE: [PHP] Php/mysql error....why?

2003-10-24 Thread Dan Joseph
 `%0123456789%';

You have a ` instead a ' before the %0123.  I believe that is what is
causing your grief.

-Dan Joseph

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



[PHP] New line characters and carriage returns

2003-10-24 Thread Jonathan Villa
Ok, don't know what I am doing wrong here...but for some reason I cannot
get new line or carriage return characters to work correctly...

For example, 

When I send some emails, I try

$msg .= From: [EMAIL PROTECTED]
Content-Type: text/plain\r\n

And it doesn't work correctly... the Content Type shows in my mail
body


More importantly, I'm trying to write a system logger

$fileName = 'errors.'.date('dmY').'.log';
$error = date('h:i:s').'  '.$script.'   '.$error.'\n';  
error_log ($error, 3, '/var/www/killerspin/logs/'.$fileName);

but the output into my log file shows the \n but does not use it.

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



[PHP] w3c-compliant form-action parameters

2003-10-24 Thread Timo Boettcher
Hi,

  I am trying to get my pages through the w3c-validator for html.
  It doesn't like my
  FORM action=mypage.php?para1=val1para2=val2
  Changing  to amp; got my page through the validator, but broke my
  app, which seems not to be getting any parameters over URL anymore.
  How can I fix that?

  PS.: Moving that information from the URL to hidden fields or
  cookies/sessions is not an option.

 Timo

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



Re: [PHP] New line characters and carriage returns

2003-10-24 Thread Jonathan Villa
ok, I see, I have to use double quotes around it...

why is that?


On Fri, 2003-10-24 at 11:57, Jonathan Villa wrote:
 Ok, don't know what I am doing wrong here...but for some reason I cannot
 get new line or carriage return characters to work correctly...
 
 For example, 
 
 When I send some emails, I try
 
 $msg .= From: [EMAIL PROTECTED]
   Content-Type: text/plain\r\n
 
 And it doesn't work correctly... the Content Type shows in my mail
 body
 
 
 More importantly, I'm trying to write a system logger
 
 $fileName = 'errors.'.date('dmY').'.log';
 $error = date('h:i:s').'  '.$script.'   '.$error.'\n';
 error_log ($error, 3, '/var/www/killerspin/logs/'.$fileName);
 
 but the output into my log file shows the \n but does not use it.

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



Re: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread John Nichel
Timo Boettcher wrote:
Hi,

  I am trying to get my pages through the w3c-validator for html.
  It doesn't like my
  FORM action=mypage.php?para1=val1para2=val2
  Changing  to amp; got my page through the validator, but broke my
  app, which seems not to be getting any parameters over URL anymore.
  How can I fix that?
  PS.: Moving that information from the URL to hidden fields or
  cookies/sessions is not an option.
 Timo

I'm curiouswhy are hidden fields not an option?

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


Re: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread Marek Kilimajer
It breaks your server side scripts. amp; should be translated to  by 
the browser and never get to php.

Timo Boettcher wrote:
Hi,

  I am trying to get my pages through the w3c-validator for html.
  It doesn't like my
  FORM action=mypage.php?para1=val1para2=val2
  Changing  to amp; got my page through the validator, but broke my
  app, which seems not to be getting any parameters over URL anymore.
  How can I fix that?
  PS.: Moving that information from the URL to hidden fields or
  cookies/sessions is not an option.
 Timo

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


Re: [PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Bas
A textarea.
Daniel Guerrier [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 When you make a file using data from what source?
 --- Bas [EMAIL PROTECTED] wrote:
  Any help appreciated.
 
  Regards,
 
  Bas
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product search
 http://shopping.yahoo.com

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



Re: [PHP] New line characters and carriage returns

2003-10-24 Thread Richard Baskett
on 10/24/03 10:00, Jonathan Villa at [EMAIL PROTECTED] wrote:

 ok, I see, I have to use double quotes around it...
 
 why is that?

Because they actually have to be evaluated.. when they are in single quotes
php thinks they are the string \r\n and not newline or carriage returns that
they are when you use double quotes.. otherwise there would be no way of
echoing '\r\n' if php always thought they were newlines or carriage returns.

Cheers!

Rick

 On Fri, 2003-10-24 at 11:57, Jonathan Villa wrote:
 Ok, don't know what I am doing wrong here...but for some reason I cannot
 get new line or carriage return characters to work correctly...
 
 For example, 
 
 When I send some emails, I try
 
 $msg .= From: [EMAIL PROTECTED]
 Content-Type: text/plain\r\n
 
 And it doesn't work correctly... the Content Type shows in my mail
 body
 
 
 More importantly, I'm trying to write a system logger
 
 $fileName = 'errors.'.date('dmY').'.log';
 $error = date('h:i:s').'  '.$script.'   '.$error.'\n';
 error_log ($error, 3, '/var/www/killerspin/logs/'.$fileName);
 
 but the output into my log file shows the \n but does not use it.

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



RE: [PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Chris W. Parker
Bas mailto:[EMAIL PROTECTED]
on Friday, October 24, 2003 10:06 AM said:

 A textarea.

Hey do us all a favor (or you can just do me a favor) and trim your
posts and don't top post.



thanks.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] .htaccess question protect my php test environment

2003-10-24 Thread Frank Tudor
I have to apologies about this posting in advance so please
don't flame me too bad for being off topic.

Question:

I want to create an .htaccess file to protect my files

I did the passwrd -c /directory/file frank

the set a password and then confirmed the password

I created a .htaccess file with vi and put this in it.

  AuthName restricted stuff
  AuthType Basic
  AuthUserFile /var/password/frank

  require valid-user

then in the redhat http server utitily under server settings

I went tot he virtual directory section and created a new
virtual dir called virtual 0 and check marked the box at the
bottom for .htaccess protection. 

I restart the server and then go to another computer and put in
the URL and no password box comes up.

:(





__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread Pablo Gosse
Hi, Timo.  Why can't use use hidden fields instead of appending the
values to the url?  It would be the same to access them via
$_GET['para1'] $_GET['para2] (unless you were using post as your method,
in which case it would simply be $_POST['varname']) if they were on the
url or in hidden fields.

Why can't you make this switch?

Also, have you tried using the % entity for ampersand (%26 if memory
serves me correct) instead of amp; or the literal ampersand?

So instead of mypage.php?para1=val1para2=val2 you would use
mypage.php?para1=val1%26para2=val2.

Cheers,
Pablo

-Original Message-
From: Timo Boettcher [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 24, 2003 9:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] w3c-compliant form-action parameters

Hi,

  I am trying to get my pages through the w3c-validator for html.
  It doesn't like my
  FORM action=mypage.php?para1=val1para2=val2
  Changing  to amp; got my page through the validator, but broke my
  app, which seems not to be getting any parameters over URL anymore.
  How can I fix that?

  PS.: Moving that information from the URL to hidden fields or
  cookies/sessions is not an option.

 Timo

-- 
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] using mail() - what is max number of email addresses I can specify in To field?

2003-10-24 Thread Wouter van Vliet
Here's some of my considerations ;)

First of all, for the matter of anti-spam, please do not use the to for more
people than, well .. Usually just one actually. Rather use the 'Bcc:' line.
If there's no personalized information in the email (you might, for example,
want to start with Good Afternoon John for a mail to a fella named John),
I'd split up the list in chunks of 20 or 50 or smth. Or at least an amount
every mailer could handle. Also, you'll probably want to group those chunks
by domain. That way your mailersoftware will have to connect to as little
different addessas as possible. Just specify your own address as 'To:' of
you want to use only BCC. Or even better, specify something like
Undisclosed Recepients [EMAIL PROTECTED] so those mails will just
vanish out of existence.

Or you can, as suggested, make one mail for every recepient. Looks more
personal anyways. I'm not sure if it increases the speed here also if you
give your messages to mail sorted on domain name but I know it won't hurt
;).

Hope I helped a bit,
Wouter

-Original Message-
From: Rolf Brusletto [mailto:[EMAIL PROTECTED] 
Sent: Thursday 23 October 2003 06:54
To: John Christopher
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] using mail() - what is max number of email addresses I
can specify in To field?

It really depends on the mta you use... if your going to use mail(); the I
would put the list of addresses in an array and the do

foreach($addressArray as $address) {
mail($address,'Here is your subject','Here is your content'); }

Rolf Brusletto
http://www.phpexamples.net

John Christopher wrote:

I am writing a script that will query a database table for some 
statistical information, and then email it (daily, weekly, and monthly) 
to a list of subscribers.  I don't know ahead of time how many persons 
will be subscribed to receive the info (it could be 20 persons or 2000 
or more).  Email addresses can be added to or deleted from the 
subscriber list at any time.

If I am not mistaken, MTAs have a limit on how many recipients can be 
specified on the To: line of an email message.  What is the limit, or 
does it depend on the MTA you're using (sendmail, qmail, etc), or other 
factors?  If there is such a limit, then what is the best way to send 
the message to each recipient?

Thank you.


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search 
http://shopping.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



Re: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread Marek Kilimajer
Whoops. The first sentense should be a question.

Marek Kilimajer wrote:
It breaks your server side scripts. amp; should be translated to  by 
the browser and never get to php.

Timo Boettcher wrote:

Hi,

  I am trying to get my pages through the w3c-validator for html.
  It doesn't like my
  FORM action=mypage.php?para1=val1para2=val2
  Changing  to amp; got my page through the validator, but broke my
  app, which seems not to be getting any parameters over URL anymore.
  How can I fix that?
  PS.: Moving that information from the URL to hidden fields or
  cookies/sessions is not an option.
 Timo


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


Re: [PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Marek Kilimajer
stripslashes

Bas wrote:
A textarea.
Daniel Guerrier [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
When you make a file using data from what source?
--- Bas [EMAIL PROTECTED] wrote:
Any help appreciated.

Regards,

Bas

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


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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


[PHP] session_destroy causes backspace on IE

2003-10-24 Thread bill
The following code causes IE to break the /h1 tag.

?php
session_start();
header(Cache-control: private);
echo html
headtitlelogout/title
/head
body
h1 align=\center\Logout page/h1;
$_SESSION = array();
session_destroy();
echo pSession destroyed/p\n;
echo /body
/html\n;
?
View/Source in IE: displays this (note /h1 broken):

html
headtitlelogout/title
/head
body
h1 align=centerLogout page/pSession destroyed/p
/body
/html
h1
Details: Works fine in other browsers I've tried, and this version of IE 
(5.5) does -not- have cookies enabled.

Any ideas?

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


Re: [PHP] .htaccess question protect my php test environment

2003-10-24 Thread Raditha Dissanayake
Hi,
It's htpasswd and not passwd. As many others on this group i don't use 
the redhat config system it's lame. You will be better off editing 
httpd.conf and adding an AllowOverrides directive.

best regards

Frank Tudor wrote:

I have to apologies about this posting in advance so please
don't flame me too bad for being off topic.
Question:

I want to create an .htaccess file to protect my files

I did the passwrd -c /directory/file frank

the set a password and then confirmed the password

I created a .htaccess file with vi and put this in it.

 AuthName restricted stuff
 AuthType Basic
 AuthUserFile /var/password/frank
 require valid-user

then in the redhat http server utitily under server settings

I went tot he virtual directory section and created a new
virtual dir called virtual 0 and check marked the box at the
bottom for .htaccess protection. 

I restart the server and then go to another computer and put in
the URL and no password box comes up.
:(





__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 



--
Raditha Dissanayake.

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


Re: [PHP] DOM XML difference between PHP versions 4.2.1 and 4.3.3

2003-10-24 Thread Tom Rogers
Hi,

Friday, October 24, 2003, 9:37:07 PM, you wrote:
S Hello

S I wonder if anyone can help me with this problem or suggest an alternative
S strategy.

S I have two PHP boxes, one windows box running PHP version 4.2.1 and DOM XML
S version 2.4.9, and the other one a FreeBSD box running PHP version 4.3.3 and
S DOM XML version 2.5.11.

S What I need to do is to join two XML documents together.  The code below
S runs fine on the 4.2.1 box but fails on the 4.3.3 box.

S   //$pagenodes_doc_xml and $menu_xml have been previously populated with
S valid XML document objects
S   // get page nodes root element
S   $pagenodes_xml =  $pagenodes_doc_xml-document_element();
S   //locate portalroot in menu xml
S   $ctx = xpath_new_context($menu_xml);
S   $nodes = xpath_eval($ctx, //[EMAIL PROTECTED]'portalroot']);
S   $portalroot = $nodes-nodeset[0];
S   //append pages nodes at portalroot location
S   $new_xml = $portalroot-append_child($pagenodes_xml);

S The error is Warning: append_child(): Can't append node, which is in a
S different document than the parent node.

S Simon

I think you have to use clone node

 $pagenodes_xml =  $pagenodes_doc_xml-document_element();
 $newnode = $pagenodes_xml-clone_node(1); //don't remember why the 1 :)

 $ctx = xpath_new_context($menu_xml);
 $nodes = xpath_eval($ctx, //[EMAIL PROTECTED]'portalroot']);
 $portalroot = $nodes-nodeset[0];
 $new_xml = $portalroot-append_child($newnode);

-- 
regards,
Tom

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



Re: [PHP] .htaccess question protect my php test environment

2003-10-24 Thread John Nichel
Frank Tudor wrote:
I have to apologies about this posting in advance so please
don't flame me too bad for being off topic.
Question:

I want to create an .htaccess file to protect my files

I did the passwrd -c /directory/file frank
The above is wrong, the below is right

htpasswd -c /path/to/file username

the set a password and then confirmed the password

I created a .htaccess file with vi and put this in it.

  AuthName restricted stuff
  AuthType Basic
  AuthUserFile /var/password/frank
  require valid-user

then in the redhat http server utitily under server settings

I went tot he virtual directory section and created a new
virtual dir called virtual 0 and check marked the box at the
bottom for .htaccess protection. 

I restart the server and then go to another computer and put in
the URL and no password box comes up.
:(
Make sure you are allowing enough override for .htaccess to work.  Can't 
help with the GUI...never used one.

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


[PHP] php IDEs

2003-10-24 Thread Lai, Kenny
can anyone recommend a good, and -free- PHP ide?

thanks
kenny

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



Re: [PHP] Php/mysql error....why?

2003-10-24 Thread Tom Rogers
Hi,

Saturday, October 25, 2003, 2:50:46 AM, you wrote:
RA Hi,
RA I am running a very simple query to the database, basically select all the
RA firms which start with 0-9,
RA eg.
RA 1stcompany
RA 3isgood
RA etc

RA using this:
RA $qry = select cust_no,firm from companies where firm LIKE `%0123456789%';

RA It gives me this error:

RA Error: Unknown column '0123456789%'' in 'where clause'

RA any idea why its ignoring the LIKE statement? the funny part is LIKE is
RA working for another program..

RA What am i missing?

RA Thanks,
RA -Ryan


You have a backtick instead of a quote (`%)

-- 
regards,
Tom

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



Re: [PHP] php IDEs

2003-10-24 Thread John Nichel
Lai, Kenny wrote:
can anyone recommend a good, and -free- PHP ide?

thanks
kenny
Check the mailing list archives.  This is discussed almost weekly.

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


Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Matt Palermo
I don't neccessarily WANT to mix the 2 languages.  I just have an
application on my webserver that uses MySQL databases and the script is all
written in PHP (which I am pretty good at).  The only reason I want to use
JAVA is so a user can download and install a program that I write (since
JAVA is platform independant) that they can run on their local computers.
This JAVA program will connect to the server (PHP files) and send back all
the information to the JAVA app.  This way, the user doesn't even have to go
to the website for this script.  They can just open the JAVA program and it
will be passed all the neccessary information.  I'm just a beginner in JAVA,
so it will probably take me quite a while to figure out how to build a whole
program like this.  Eventually, I want it to be similar to the Gallery
Remote program (found at:  http://gallery.menalto.com/) for a PHP image
gallery.  I got a long way to go before I will have this created though,
since I'm very new to JAVA (I'm much stronger in PHP).  Anyway, I'm sure you
get the idea.

Matt


Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 For this scenario, Ray's suggestion of SOAP is IMHO the best option. But
 just out of curiosity why do you want to mix the two languages? If you
 are familiar with java you might be better off doing your server side
 stuff using J2EE. Then you might be able to use
 Object Streams for your communications or RMI. Then there is the
 XMLEncoder class that was made availble with 1.4

 better stop before someone shoots me down this is a PHP list after all :-)



 Matt Palermo wrote:

 I have been searching the web for ways to execute remote PHP files
through
 the use of JAVA code, but I haven't had any luck.  I have found many ways
to
 call JAVA functions from a PHP script, but not the other way around.
What
 I'm trying to accomplish is I want to build a JAVA application that will
be
 run from a users local computer after installation and this JAVA program
 will connect to a url on my server (a url to a PHP script).  This PHP
script
 will be used to connect to the server's MySQL database and send some
 retrieved information back to the JAVA application on the users machine.
I
 have been searching the web for hours trying to find a tutorial, or
advice
 on how to accomplish this, but so far I have had no luck.  If anyone has
any
 advice or suggestions please let me know.
 
 Thanks,
 
 Matt
 
 
 


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

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Raditha Dissanayake
hi,

Great to hear that PHP is your language of choice. There are several 
SOAP libraries available and they come with good docs. However if you 
are building an image gallery type application, you will be able to do 
mos of the work just by using java.net package has has been pointed out.

all the best

Matt Palermo wrote:

I don't neccessarily WANT to mix the 2 languages.  I just have an
application on my webserver that uses MySQL databases and the script is all
written in PHP (which I am pretty good at).  The only reason I want to use
JAVA is so a user can download and install a program that I write (since
JAVA is platform independant) that they can run on their local computers.
This JAVA program will connect to the server (PHP files) and send back all
the information to the JAVA app.  This way, the user doesn't even have to go
to the website for this script.  They can just open the JAVA program and it
will be passed all the neccessary information.  I'm just a beginner in JAVA,
so it will probably take me quite a while to figure out how to build a whole
program like this.  Eventually, I want it to be similar to the Gallery
Remote program (found at:  http://gallery.menalto.com/) for a PHP image
gallery.  I got a long way to go before I will have this created though,
since I'm very new to JAVA (I'm much stronger in PHP).  Anyway, I'm sure you
get the idea.
Matt

Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Hi,

For this scenario, Ray's suggestion of SOAP is IMHO the best option. But
just out of curiosity why do you want to mix the two languages? If you
are familiar with java you might be better off doing your server side
stuff using J2EE. Then you might be able to use
Object Streams for your communications or RMI. Then there is the
XMLEncoder class that was made availble with 1.4
better stop before someone shoots me down this is a PHP list after all :-)



Matt Palermo wrote:

   

I have been searching the web for ways to execute remote PHP files
 

through
 

the use of JAVA code, but I haven't had any luck.  I have found many ways
 

to
 

call JAVA functions from a PHP script, but not the other way around.
 

What
 

I'm trying to accomplish is I want to build a JAVA application that will
 

be
 

run from a users local computer after installation and this JAVA program
will connect to a url on my server (a url to a PHP script).  This PHP
 

script
 

will be used to connect to the server's MySQL database and send some
retrieved information back to the JAVA application on the users machine.
 

I
 

have been searching the web for hours trying to find a tutorial, or
 

advice
 

on how to accomplish this, but so far I have had no luck.  If anyone has
 

any
 

advice or suggestions please let me know.

Thanks,

Matt



 

--
Raditha Dissanayake.

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

 



--
Raditha Dissanayake.

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


Re: [PHP] php IDEs

2003-10-24 Thread Daniel Guerrier
zend.com has one
and PHPEdit

use what you like.
--- Lai, Kenny [EMAIL PROTECTED] wrote:
 can anyone recommend a good, and -free- PHP ide?
 
 thanks
 kenny
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Ray Hunter
Also, I would like to point out that you could possibly use php-gtk to
do some gui applications. Since it has a windows and *nix port you can
use that too. I have built a couple of apps with it that pull snmp data
from routers with it that worked great. I also used a java installer to
install the required files.

Might be worth looking into since it is php based.

--
Ray

On Fri, 2003-10-24 at 12:20, Raditha Dissanayake wrote:
 hi,
 
 Great to hear that PHP is your language of choice. There are several 
 SOAP libraries available and they come with good docs. However if you 
 are building an image gallery type application, you will be able to do 
 mos of the work just by using java.net package has has been pointed out.
 
 all the best
 
 
 Matt Palermo wrote:
 
 I don't neccessarily WANT to mix the 2 languages.  I just have an
 application on my webserver that uses MySQL databases and the script is all
 written in PHP (which I am pretty good at).  The only reason I want to use
 JAVA is so a user can download and install a program that I write (since
 JAVA is platform independant) that they can run on their local computers.
 This JAVA program will connect to the server (PHP files) and send back all
 the information to the JAVA app.  This way, the user doesn't even have to go
 to the website for this script.  They can just open the JAVA program and it
 will be passed all the neccessary information.  I'm just a beginner in JAVA,
 so it will probably take me quite a while to figure out how to build a whole
 program like this.  Eventually, I want it to be similar to the Gallery
 Remote program (found at:  http://gallery.menalto.com/) for a PHP image
 gallery.  I got a long way to go before I will have this created though,
 since I'm very new to JAVA (I'm much stronger in PHP).  Anyway, I'm sure you
 get the idea.
 
 Matt
 
 
 Raditha Dissanayake [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   
 
 Hi,
 
 For this scenario, Ray's suggestion of SOAP is IMHO the best option. But
 just out of curiosity why do you want to mix the two languages? If you
 are familiar with java you might be better off doing your server side
 stuff using J2EE. Then you might be able to use
 Object Streams for your communications or RMI. Then there is the
 XMLEncoder class that was made availble with 1.4
 
 better stop before someone shoots me down this is a PHP list after all :-)
 
 
 
 Matt Palermo wrote:
 
 
 
 I have been searching the web for ways to execute remote PHP files
   
 
 through
   
 
 the use of JAVA code, but I haven't had any luck.  I have found many ways
   
 
 to
   
 
 call JAVA functions from a PHP script, but not the other way around.
   
 
 What
   
 
 I'm trying to accomplish is I want to build a JAVA application that will
   
 
 be
   
 
 run from a users local computer after installation and this JAVA program
 will connect to a url on my server (a url to a PHP script).  This PHP
   
 
 script
   
 
 will be used to connect to the server's MySQL database and send some
 retrieved information back to the JAVA application on the users machine.
   
 
 I
   
 
 have been searching the web for hours trying to find a tutorial, or
   
 
 advice
   
 
 on how to accomplish this, but so far I have had no luck.  If anyone has
   
 
 any
   
 
 advice or suggestions please let me know.
 
 Thanks,
 
 Matt
 
 
 
   
 
 --
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
 Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB  |  with progress bar.
 
 
 
   
 
 
 
 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
 Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
 Graphical User Inteface. Just 150 KB  |  with progress bar.
 

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



Re: [PHP] How do i delete all escaped backslashes when i make a file???

2003-10-24 Thread Daniel Guerrier
http://us3.php.net/manual/en/function.addcslashes.php
--- Bas [EMAIL PROTECTED] wrote:
 A textarea.
 Daniel Guerrier [EMAIL PROTECTED] wrote in
 message

news:[EMAIL PROTECTED]
  When you make a file using data from what source?
  --- Bas [EMAIL PROTECTED] wrote:
   Any help appreciated.
  
   Regards,
  
   Bas
  
   -- 
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit:
 http://www.php.net/unsub.php
  
 
 
  __
  Do you Yahoo!?
  The New Yahoo! Shopping - with improved product
 search
  http://shopping.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] uncompressing gz string

2003-10-24 Thread Decapode Azur
I don't understand why gzinflate and gzuncompress don't work?

?php
$gz_content = file_get_contents('hello.txt.gz');

echo gzinflate($gz_content);
// Warning: data error

echo gzuncompress($gz_content);
// Warning: data error
?

but if I make it from bash the content is there :
cat hello.txt.gz | gunzip
Hello!

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



Re: [PHP] .htaccess question protect my php test environment

2003-10-24 Thread John Nichel
Frank Tudor wrote:
John,

Sorry I did use htpasswd...

Override?

Do you have a snip from a config file that I can look at?

I don't mind editing the httpd.conf manually.

Frank
This controls which options the .htaccess files in directories can 
override. Can also be All, or any combination of Options, 
FileInfo, AuthConfig, and Limit

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


Re: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread Chris Shiflett
--- Timo Boettcher [EMAIL PROTECTED] wrote:
 I am trying to get my pages through the w3c-validator for html.
 It doesn't like my
 FORM action=mypage.php?para1=val1para2=val2
 Changing  to amp; got my page through the validator, but broke
 my app, which seems not to be getting any parameters over URL
 anymore.

I find that *very* hard to believe. I'm not aware of any browser that
mishandles HTML entities. Basically, when you say this:

action=/mypage.php?para1=val1amp;para2=val2

Your browser's HTTP request line will appear as:

/mypage.php?para1=val1para2=val2

So, by the time PHP sees it, everything is the same either way. My guess is
that you have some other problem.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] session_destroy causes backspace on IE

2003-10-24 Thread Eugene Lee
On Fri, Oct 24, 2003 at 01:24:32PM -0400, bill wrote:
: 
: The following code causes IE to break the /h1 tag.
: 
: ?php
: session_start();
: header(Cache-control: private);
: echo html
: headtitlelogout/title
: /head
: body
: h1 align=\center\Logout page/h1;
: $_SESSION = array();
: session_destroy();
: echo pSession destroyed/p\n;
: echo /body
: /html\n;
: ?
: 
: View/Source in IE: displays this (note /h1 broken):
: 
: html
: headtitlelogout/title
: /head
: body
: h1 align=centerLogout page/pSession destroyed/p
: /body
: /html
: h1
: 
: Details: Works fine in other browsers I've tried, and this version of IE 
: (5.5) does -not- have cookies enabled.

Besides tossing out IE?  :-)

Try splitting your big echo() statement into smaller pieces and see what
happens.

echo 'html'.\n;
echo 'headtitlelogout/title'.\n;
echo '/head'.\n;
echo 'body'.\n;
echo 'h1 align=centerLogout page/h1'.\n;

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



[PHP] Re: uncompressing gz string

2003-10-24 Thread Adam Zey
I've had the exact same problem. I get .html.gz files uploaded to me. My
script does a file_get_contents on those, and then tried to use gzinflate or
gzuncompress. Neither works. Instead I use a shell command to use the 'gzip'
program to do the decompression.

This is a big bug that's been around a while, I'm surprised it hasn't been
fixed.

Regards, Adam.

Decapode Azur [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I don't understand why gzinflate and gzuncompress don't work?

 ?php
 $gz_content = file_get_contents('hello.txt.gz');

 echo gzinflate($gz_content);
 // Warning: data error

 echo gzuncompress($gz_content);
 // Warning: data error
 ?

 but if I make it from bash the content is there :
 cat hello.txt.gz | gunzip
 Hello!


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003

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



Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Matt Palermo
I don't know much about that, but it definitely sounds better, escpecially
since it's still PHP based.  Do you know of any websites or tutorials I can
go to to learn more about it?  It sounds like a much better option.

Thanks,

Matt


Ray Hunter [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Also, I would like to point out that you could possibly use php-gtk to
 do some gui applications. Since it has a windows and *nix port you can
 use that too. I have built a couple of apps with it that pull snmp data
 from routers with it that worked great. I also used a java installer to
 install the required files.

 Might be worth looking into since it is php based.

 --
 Ray

 On Fri, 2003-10-24 at 12:20, Raditha Dissanayake wrote:
  hi,
 
  Great to hear that PHP is your language of choice. There are several
  SOAP libraries available and they come with good docs. However if you
  are building an image gallery type application, you will be able to do
  mos of the work just by using java.net package has has been pointed out.
 
  all the best
 
 
  Matt Palermo wrote:
 
  I don't neccessarily WANT to mix the 2 languages.  I just have an
  application on my webserver that uses MySQL databases and the script is
all
  written in PHP (which I am pretty good at).  The only reason I want to
use
  JAVA is so a user can download and install a program that I write
(since
  JAVA is platform independant) that they can run on their local
computers.
  This JAVA program will connect to the server (PHP files) and send back
all
  the information to the JAVA app.  This way, the user doesn't even have
to go
  to the website for this script.  They can just open the JAVA program
and it
  will be passed all the neccessary information.  I'm just a beginner in
JAVA,
  so it will probably take me quite a while to figure out how to build a
whole
  program like this.  Eventually, I want it to be similar to the Gallery
  Remote program (found at:  http://gallery.menalto.com/) for a PHP image
  gallery.  I got a long way to go before I will have this created
though,
  since I'm very new to JAVA (I'm much stronger in PHP).  Anyway, I'm
sure you
  get the idea.
  
  Matt
  
  
  Raditha Dissanayake [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  
  
  Hi,
  
  For this scenario, Ray's suggestion of SOAP is IMHO the best option.
But
  just out of curiosity why do you want to mix the two languages? If you
  are familiar with java you might be better off doing your server side
  stuff using J2EE. Then you might be able to use
  Object Streams for your communications or RMI. Then there is the
  XMLEncoder class that was made availble with 1.4
  
  better stop before someone shoots me down this is a PHP list after all
:-)
  
  
  
  Matt Palermo wrote:
  
  
  
  I have been searching the web for ways to execute remote PHP files
  
  
  through
  
  
  the use of JAVA code, but I haven't had any luck.  I have found many
ways
  
  
  to
  
  
  call JAVA functions from a PHP script, but not the other way around.
  
  
  What
  
  
  I'm trying to accomplish is I want to build a JAVA application that
will
  
  
  be
  
  
  run from a users local computer after installation and this JAVA
program
  will connect to a url on my server (a url to a PHP script).  This PHP
  
  
  script
  
  
  will be used to connect to the server's MySQL database and send some
  retrieved information back to the JAVA application on the users
machine.
  
  
  I
  
  
  have been searching the web for hours trying to find a tutorial, or
  
  
  advice
  
  
  on how to accomplish this, but so far I have had no luck.  If anyone
has
  
  
  any
  
  
  advice or suggestions please let me know.
  
  Thanks,
  
  Matt
  
  
  
  
  
  --
  Raditha Dissanayake.
 

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

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



Re: [PHP] Is it worth $49? - codeSECURE 1.0 released - - Protecting PHP code

2003-10-24 Thread Adam Zey
I'm sorry to say I must agree with the parent post. There are too many free
programs out there to charge 50$ for a program that does the same thing.

The free programs might even do more than your 50$ product. mmcache's
primary function is to cache compiled opcodes to speed up code execution.
It's the fastest PHP optimizer out there, it even beats out Zend
Accelerator. And in addition to this, it also does a number of other things,
including code encoding.

Regards, Adam.

John Black [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Andrei,
 Thank you for writing.


 I have read announcement about CodeSecure. I am sorry to say, but I am
 not sure this product is worth $49.

 No problem, that is totally your opinion and you have a right to it.

  The problem is not $49, which is very small amount indeed,

 Yes, this is aimed at the average PHP person, professional or novice.


 1) If someone need just PHP obfuscator - here is proven GPL product
 called POBS (http://pobs.mywalhalla.net/).

 An excellent product, we are using it in codeSECURE as the first layer
 ourselves and have made a custom interface for all people who purchase
 codeSECURE to
 1.upload their files
 2.click the settings they want
 3.obfuscate the files
 4.download in .zip or .tar format

 then run the obfuscated files thru codeSECURE.

 This saves them the setting up and other things of POBS, plus its totally
 free for people who purchase our codeSECURE.

 2) PHP encoding/decoding on the fly without extra PHP extensions is
 possible with GPL-ed software called Phrozen
 (http://sourceforge.net/projects/phrozen/).

 Again pretty good, but not so secure plus a problem setting up and
running,
 the first time anyway.

 3) PHP Scripts may be stored (and distributed to the clients) in
 compiled form with opcode cash TurckMMcache, which is also Open Source.

 No idea about this one. Sorry.

 4) Another (very similar) product called CodeLock  costs $55, but
requires
 option Globals On to be set, and some people reported weird problems
 with it. I do not know if CodeSecure might have (or have not) similar
 issues because of similar architecture.

 You are right of course, codelock is very similar to our product, and our
 product requires Globals on
 (Only during encoding). We think the architecture is very close as we were
 looking very close at this product when we
 made ours, in output ours is much more secure as we ran over some of the
 problems with codelock.


 Any other questions / suggestions or criticisms

 Cheers,
 -JB








 I have read announcement about CodeSecure. I am sorry to say, but I am
 not sure this product is worth $49. The problem is not $49, which is
 very small amount indeed, but the features available with other Open
 Source software.

 1) If someone need just PHP obfuscator - here is proven GPL product
 called POBS (http://pobs.mywalhalla.net/).

 2) PHP encoding/decoding on the fly without extra PHP extensions is
 possible with GPL-ed software called Phrozen
 (http://sourceforge.net/projects/phrozen/).

 3) PHP Scripts may be stored (and distributed to the clients) in
 compiled form with opcode cash TurckMMcache, which is also Open Source.

 4) Another (very similar) product called CodeLock
 (http://www.websitecreations.co.nz/codelock/) costs $55, but requires
 option Globals On to be set, and some people reported weird problems
 with it. I do not know if CodeSecure might have (or have not) similar
 issues because of similar architecture.

 PS. Anyway, I am welcome to the creative ideas.


  Greetings everyone,
  We have just launched a new product called codeSECURE and would like
  you to
  check it out.
 
  codeSECURE is a PHP obfuscator.
 
  Basically codeSecure is a small collection of scripts to obfuscate or
  garble up php code so that PHP developers can protect their
  intellectual
  property, distribute locked php scripts, time expiring scripts etc.
 
  While making it nearly impossible for a human to understand or read
  your
  code/scripts, they will cause no problem for the computer to decipher
  and
  run.
 
  E.g.
 
  $a=Hello world;
 
  will become something like
 
  $23sfaAST3s=v4Mèåwuz™24fz{(2{•w;
 

 *
 *   Best Regards   ---   Andrei Verovski
 *
 *   Personal Home Page
 *   http://snow.prohosting.com/guru4mac
 *   Mac, Linux, DTP, Development, IT WEB Site
 *

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


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.530 / Virus Database: 325 - Release Date: 22/10/2003

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



Re: [PHP] uncompressing gz string

2003-10-24 Thread Ray
i had a similar problem, it seems that a .gz file had 10 bytes of 
header that inflate and uncompress didn't like, or something wierd 
like that. but i can't find the code that i had in the end.

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

but depending on how your actually using the data, one of the 'read 
from the file' might serve you better
http://www.php.net/manual/en/function.gzread.php
http://www.php.net/manual/en/function.gzgets.php
http://www.php.net/manual/en/function.gzpassthru.php

On Friday 24 October 2003 13:48, you wrote:
 I don't understand why gzinflate and gzuncompress don't work?

 ?php
 $gz_content = file_get_contents('hello.txt.gz');

 echo gzinflate($gz_content);
 // Warning: data error

 echo gzuncompress($gz_content);
 // Warning: data error
 ?

 but if I make it from bash the content is there :
 cat hello.txt.gz | gunzip
 Hello!

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



Re: [PHP] session_destroy causes backspace on IE

2003-10-24 Thread bill
Hi Eugene,

Tried breaking up the echo, but still didn't work.

?php
session_start();
header(Cache-control: private);
echo html;
echo headtitlelogout/title;
echo /head;
echo body;
echo h1 align=\center\Logout page/h1;
$_SESSION = array();
session_destroy();
echo pSession destroyed/p\n;
echo /body
/html\n;
?
I know it is the session_destroy() command because commenting it out the 
problem goes away.

kind regards,

bill

Eugene Lee wrote:

On Fri, Oct 24, 2003 at 01:24:32PM -0400, bill wrote:
: 
: The following code causes IE to break the /h1 tag.
: 
: ?php
: session_start();
: header(Cache-control: private);
: echo html
: headtitlelogout/title
: /head
: body
: h1 align=\center\Logout page/h1;
: $_SESSION = array();
: session_destroy();
: echo pSession destroyed/p\n;
: echo /body
: /html\n;
: ?
: 
: View/Source in IE: displays this (note /h1 broken):
: 
: html
: headtitlelogout/title
: /head
: body
: h1 align=centerLogout page/pSession destroyed/p
: /body
: /html
: h1
: 
: Details: Works fine in other browsers I've tried, and this version of IE 
: (5.5) does -not- have cookies enabled.

Besides tossing out IE?  :-)

Try splitting your big echo() statement into smaller pieces and see what
happens.
	echo 'html'.\n;
	echo 'headtitlelogout/title'.\n;
	echo '/head'.\n;
	echo 'body'.\n;
	echo 'h1 align=centerLogout page/h1'.\n;
 

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


Re: [PHP] w3c-compliant form-action parameters

2003-10-24 Thread Burhan Khalid
Chris Shiflett wrote:

--- Timo Boettcher [EMAIL PROTECTED] wrote:

I am trying to get my pages through the w3c-validator for html.
It doesn't like my
FORM action=mypage.php?para1=val1para2=val2
Changing  to amp; got my page through the validator, but broke
my app, which seems not to be getting any parameters over URL
anymore.


I find that *very* hard to believe. I'm not aware of any browser that
mishandles HTML entities. Basically, when you say this:
action=/mypage.php?para1=val1amp;para2=val2

Your browser's HTTP request line will appear as:

/mypage.php?para1=val1para2=val2

So, by the time PHP sees it, everything is the same either way. My guess is
that you have some other problem.
I agree with Chris. This is not a browser problem.

However, there is a php.ini setting that will allow you to set the 
separator for get requests, but I suggest you investigate this problem 
further.

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


Re: [PHP] Using PHP with JAVA

2003-10-24 Thread Ray Hunter
Yeah,

http://gtk.php.net 

Also they have a mailing list that you can join and get help from those
experienced users.

HTH

--
Ray


On Fri, 2003-10-24 at 13:26, Matt Palermo wrote:
 I don't know much about that, but it definitely sounds better, escpecially
 since it's still PHP based.  Do you know of any websites or tutorials I can
 go to to learn more about it?  It sounds like a much better option.
 
 Thanks,
 
 Matt
 
 
 Ray Hunter [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Also, I would like to point out that you could possibly use php-gtk to
  do some gui applications. Since it has a windows and *nix port you can
  use that too. I have built a couple of apps with it that pull snmp data
  from routers with it that worked great. I also used a java installer to
  install the required files.
 
  Might be worth looking into since it is php based.
 
  --
  Ray
 
  On Fri, 2003-10-24 at 12:20, Raditha Dissanayake wrote:
   hi,
  
   Great to hear that PHP is your language of choice. There are several
   SOAP libraries available and they come with good docs. However if you
   are building an image gallery type application, you will be able to do
   mos of the work just by using java.net package has has been pointed out.
  
   all the best
  
  
   Matt Palermo wrote:
  
   I don't neccessarily WANT to mix the 2 languages.  I just have an
   application on my webserver that uses MySQL databases and the script is
 all
   written in PHP (which I am pretty good at).  The only reason I want to
 use
   JAVA is so a user can download and install a program that I write
 (since
   JAVA is platform independant) that they can run on their local
 computers.
   This JAVA program will connect to the server (PHP files) and send back
 all
   the information to the JAVA app.  This way, the user doesn't even have
 to go
   to the website for this script.  They can just open the JAVA program
 and it
   will be passed all the neccessary information.  I'm just a beginner in
 JAVA,
   so it will probably take me quite a while to figure out how to build a
 whole
   program like this.  Eventually, I want it to be similar to the Gallery
   Remote program (found at:  http://gallery.menalto.com/) for a PHP image
   gallery.  I got a long way to go before I will have this created
 though,
   since I'm very new to JAVA (I'm much stronger in PHP).  Anyway, I'm
 sure you
   get the idea.
   
   Matt
   
   
   Raditha Dissanayake [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
   
   
   Hi,
   
   For this scenario, Ray's suggestion of SOAP is IMHO the best option.
 But
   just out of curiosity why do you want to mix the two languages? If you
   are familiar with java you might be better off doing your server side
   stuff using J2EE. Then you might be able to use
   Object Streams for your communications or RMI. Then there is the
   XMLEncoder class that was made availble with 1.4
   
   better stop before someone shoots me down this is a PHP list after all
 :-)
   
   
   
   Matt Palermo wrote:
   
   
   
   I have been searching the web for ways to execute remote PHP files
   
   
   through
   
   
   the use of JAVA code, but I haven't had any luck.  I have found many
 ways
   
   
   to
   
   
   call JAVA functions from a PHP script, but not the other way around.
   
   
   What
   
   
   I'm trying to accomplish is I want to build a JAVA application that
 will
   
   
   be
   
   
   run from a users local computer after installation and this JAVA
 program
   will connect to a url on my server (a url to a PHP script).  This PHP
   
   
   script
   
   
   will be used to connect to the server's MySQL database and send some
   retrieved information back to the JAVA application on the users
 machine.
   
   
   I
   
   
   have been searching the web for hours trying to find a tutorial, or
   
   
   advice
   
   
   on how to accomplish this, but so far I have had no luck.  If anyone
 has
   
   
   any
   
   
   advice or suggestions please let me know.
   
   Thanks,
   
   Matt
   
   
   
   
   
   --
   Raditha Dissanayake.
  
 
   http://www.radinks.com/sftp/  |
 http://www.raditha/megaupload/
   Lean and mean Secure FTP applet with  |  Mega Upload - PHP file
 uploader
   Graphical User Inteface. Just 150 KB  |  with progress bar.
   
   
   
   
   
  
  
   --
   Raditha Dissanayake.
   
   http://www.radinks.com/sftp/  |  http://www.raditha/megaupload/
   Lean and mean Secure FTP applet with  |  Mega Upload - PHP file uploader
   Graphical User Inteface. Just 150 KB  |  with progress bar.
  

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



[PHP] prepend file to all scripts...

2003-10-24 Thread Jonathan Villa
I thought I read that this was possible once, but I can't find anything
to substantiate/refute it...

Is it possible to prepend a configuration file to my pages?

For example, 

I have a app.config.inc file which contains an application specific
include path as well as includes the classes my application needs. 
Currently this file is in my web root, but I would like to place it
outside of my web root but still include it in all of my pages...

Is this possible?

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



RE: [PHP] prepend file to all scripts...

2003-10-24 Thread Wouter van Vliet
Add: 
php_value   auto_prepend_file   /path/to/file

To your .htaccess or VirutualHosts section.

You might also want to use auto_append_file

Wouter

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED] 
Sent: Friday 24 October 2003 22:00
To: [EMAIL PROTECTED]
Subject: [PHP] prepend file to all scripts...

I thought I read that this was possible once, but I can't find anything to
substantiate/refute it...

Is it possible to prepend a configuration file to my pages?

For example, 

I have a app.config.inc file which contains an application specific include
path as well as includes the classes my application needs. 
Currently this file is in my web root, but I would like to place it outside
of my web root but still include it in all of my pages...

Is this possible?

--
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] prepend file to all scripts...

2003-10-24 Thread Ray
snip from:
http://www.php.net/manual/en/configuration.directives.php

auto_prepend_file  string

Specifies the name of a file that is automatically parsed before 
the main file. The file is included as if it was called with the 
include() function, so include_path is used.

The special value none disables auto-prepending.

auto_append_file string

Specifies the name of a file that is automatically parsed after 
the main file. The file is included as if it was called with the 
include() function, so include_path is used.

The special value none disables auto-appending.

Note: If the script is terminated with exit(), auto-append will not 
occur.

http://www.php.net/manual/en/configuration.directives.php

On Friday 24 October 2003 15:00, Jonathan Villa wrote:
 I thought I read that this was possible once, but I can't find
 anything to substantiate/refute it...

 Is it possible to prepend a configuration file to my pages?

 For example,

 I have a app.config.inc file which contains an application specific
 include path as well as includes the classes my application needs.
 Currently this file is in my web root, but I would like to place it
 outside of my web root but still include it in all of my pages...

 Is this possible?

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



[PHP] Problem using Arrays

2003-10-24 Thread Geeta Rajaraman
Hi:
I am trying to create a function that can store the user's info.
Currently I have this:
sessionInfo.inc
===
?php

class sessionInfo {
/*
 * @(#) sessionInfoBean.java
 *
 * A class to handle sessions.
 *
 * @version  10 1 Oct 2003
 *
 *
*/
 /**
  * Variables
  */
  var $last_name;
  var $first_name;
  var $userid;
  var $email_address;
  var $group = array();

  function sessionInfo(){
 }

  /**
   * Function to determine the group the user belongs to.
   *
   * @param groupIdChecks if the user is a member of the group.
   *
   */
  function ismemberof($groupid){
   for($i=0;$i=count($group);$i++) {
   if($group[i].equals($groupid)){
  return true;
  }
   }
   }


  /**
  * Method to get the user id to establish a session.
  */
  function getuserid(){
   return $this -userid;
  }

  /**
   * Method that returns the available groups.
   */
   function getgroups(){
 return $this - group;
}

   /**
* Method to set the user id.
* @param userid  the user id.
*/
   function setuserid($userid){
  $this-userid = $userid;
   }

   /**
* Method to add a new group.
* @param group  name of the group.
*/
   function addgroup($groupid,$var){
 $this -group[$var] = $groupid;
   }

 };
?

Now, in my login.php, I am trying to add the groups that the user
belongs to, like this:
login.php
===
$username = $_POST['username'];
$password = $_POST['password'];
//include the database connection file
include 'include/dbConnection.php';
$query1 = select * from users where username='$username' AND
password='$password';
$result=mysql_query($query1, $conn);
//check that at least one row was returned
$rowCheck = mysql_num_rows($result);
if($rowCheck  0){
  while($row = mysql_fetch_array($result)){
 //start the session and register a variable
 $userid = $row['userid'];
   /**
* Set the user's information.
*/
   require 'include/sessionInfo.inc';
   $sessionVar= new sessionInfo();
   $sessionVar-setuserid($userid);
  }
  mysql_free_result($result);

   $query2 = SELECT group_id FROM user_groups WHERE
userid=.$userid;
   $result = mysql_query($query2, $conn);
  //Get number of rows returned
  $numOfRows = mysql_num_rows($result);
   $i=0;
   while($row = mysql_fetch_array($result)){
  $sessionVar-addgroup($row[group_id],i);
  while($inumOfRows){
   $i .= 1;
   }
  }
   session_start();
  $_SESSION['obj'] = $sessionVar;
--
Now I redirect to a test page, where I am trying to print the no of
groups the user belongs to. (As an example, every user belongs to
atleast 3 groups).
in Test.php
=
?php
require 'include/sessionInfo.inc';
session_start();
   //get the user_id from sessionInfo.
$sessionVar = $_SESSION['obj'];
echo User id is :.$sessionVar-getuserid().br;
echo User name is :.$sessionVar-getfirstname().
.$sessionVar-getlastname().br;
$var = count($sessionVar-getgroups());
echo No of Groups User belongs to:.$var.br;
?
Its gives this:
User id is :7
User name is :Test Test
No of Groups User belongs to:0

Any ideas, where I am going wrong ?

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

Re: [PHP] New line characters and carriage returns

2003-10-24 Thread Curt Zirzow
* Thus wrote Jonathan Villa ([EMAIL PROTECTED]):
 Ok, don't know what I am doing wrong here...but for some reason I cannot
 get new line or carriage return characters to work correctly...
 
 For example, 
 
 When I send some emails, I try
 
 $msg .= From: [EMAIL PROTECTED]
   Content-Type: text/plain\r\n
 

$msg .= From: [EMAIL PROTECTED]: text/plain\r\n;

Your mail Program is seeing:
  From: [EMAIL PROTECTED]

  Content-Type: text/plain


The empty line tells the program that it has reached the end of
headers.


Curt
-- 
My PHP key is worn out

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

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



[PHP] Re: Regular expressions

2003-10-24 Thread Michael Mauch
Fernando Melo wrote:

 I have the following statement:
 
 $text = ereg_replace
 ([live/]*content\.php\?[]*Item_ID=([0-9]*)Start=([0-9]*)Category_ID=([0-
 9]*)[]*, content\\1start\\2CID\\3.php, $text);
 
 Basically what I'm trying to do is if the URL includes live/ then I want
 to include it in the replace.  The way I have it now check for all the
 letters in live instead of the whole string.
 
 I hope I explained this properly.

$text = ereg_replace
 
((live/)?content\.php\?[]*Item_ID=([0-9]*)Start=([0-9]*)Category_ID=([0-9]*)[]*, 
  content\\1start\\2CID\\3.php, $text);

The (live/)? should catch zero or one occurence of live/. Maybe the
regex library in your PHP doesn't know about ?, than you could use *
instead - consider using the PCRE preg_replace function.

Regards...
Michael

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



  1   2   >