RE: [PHP] using xp home

2004-02-23 Thread Jason Merrique
Hi Danny,

If you're going to be using PHP for testing purposes on your home PC,
I'd recommend installing EasyPHP. It's basically Apache MySQL and PHP
bundled together. It's pretty easy to set up, just run the installer,
then start the program and you have a PHP enabled webserver.

You should be able to get it at www.easyphp.org

Cheers

Jason

> -Original Message-
> From: danny cobbinah [mailto:[EMAIL PROTECTED] 
> Sent: 22 February 2004 00:12
> To: [EMAIL PROTECTED]
> Subject: [PHP] using xp home
> 
> is it better to use apache 1.3.29 or apache 2.0.48?
> 
> i am having the worst trouble ever trying to get this thing to work
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



RE: [PHP] Re: ftp software

2004-02-23 Thread Jason Merrique
I second that,

What I like the most about WSFTP is that you can edit files on the
remote site. Very handy!

 

> -Original Message-
> From: Pooya Eslami [mailto:[EMAIL PROTECTED] 
> Sent: 22 February 2004 21:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: ftp software
> 
> WS FTP is not bad.you cand download the LE version for free 
> here: (the last one at the end of the page!) 
> http://www.ipswitch.com/downloads/index.html
> 
> -Pooya
> 
> 
> "Nathan McIntyre" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Hello!
> >
> > I am new both to PHP and web dev, and I am wondering what 
> ftp software 
> > would  be best for me to use.
> 
> --
> 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] SQLite: getting field information (type etc)

2004-02-23 Thread Robert S
I am trying to port a small database application (php, MySQL) to sqlite.
How can I find the type of an arbitrary field?  In other words, what is the
equivalent of mysql_field_type() and mysql_field_flags() in sqlite?

I read something on the sqlite group recently that recommended using
pragma_show_datatypes in a query, but I couldn't get this to work and the
example on the newsgroup was written in C.

Could somebody please enlighten me?

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



Re: [PHP] Re: tow dimenshional arrays

2004-02-23 Thread joe-at
Like I supposed there is no efficient way how to do.
Thank you for the functios and the help of all of you.
Best regards,
joe-at

"Manuel VáZquez Acosta" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Namaste Adwinwijaya:
>
> I meant there's no PHP function neither to get a column nor to transpose
the
> matrix.
>
> The first answer you gave us, retrieves the amount of items in the column,
> not the column itself as an array. And the second one, just prints the
> matrix, but does not transpose it.
>
> Joe-At: I suggest you to tell us your exact problem, maybe there's a way
to
> solve it avoiding matrices, maybe there's a more suitable representation
to
> the problem's parameters.
>
> Manu.
>
> PS:
>
> This function retrives the j column, assuming that the matrix has no
> non-numerical indeces:
>
> function getColumn($arr, $j)
> {
> if (isset($arr[$j]) && count($arr[$j])>0)
> {
> $result = array();
> foreach($arr[$j] as $which)
> $result[] = $which;// You could make reference
> instead
> }
> }
>
> function getTranspose($arr)
> {
> if (count($arr)>0)
> {
> $result = array();
> for($i=0; $i for($j=0; $j {
> if (!isset($result[$j]))
> $result[$j] = array();
>
> $result[$j][$i] = $arr[$i][$j];
> }
> }
> }
>
> Keep in mind this are inefficient functions.
>
> Manu.
>
>
> "Adwinwijaya" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hello Manuel,
> >
> > Sunday, February 22, 2004, 5:47:02 AM, you wrote:
> >
> > MVA> As far as I know, there is no such a function. Maybe you should use
a
> > MVA> different approach.
> > MVA> Manu.
> >
> > MVA> "Joe-At" <[EMAIL PROTECTED]> wrote in message
> > MVA> news:[EMAIL PROTECTED]
> > >> Hallo,
> > >> 1) I want to work with the rows und columns of a tow dimensional
> > >> array[i][j]. With array[i] I get the i'th row. But how can I get the
> j'th
> > >> column?
> > >> 2) Is there any command to transpose a two dimensional array?
> > >> Thanks for help
> >
> >
> > 1. $array_j = $array[$i] ;
> >count($array_j) ;
> >
> > 2.
> > foreach($array as $sub_array){
> >foreach($subarray as $key=>$value)
> >  echo $key.'=='.$value ;
> > }
> >
> >
> > cmiiw
> >
> > -- 
> > Best regards,
> >  adwinwijayamailto:[EMAIL PROTECTED]

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



[PHP] read and modified getting data

2004-02-23 Thread Tommi Virtanen
Hi!

I have quite simple form (it has textarea input), where I can write for 
example:

Data1
Data2
This is text



So, input contains spaces, linefeeds and so on...

When I make page, which read data from this textarea-field, data came from 
without
spaces and linefeeds. How to correct this problem?

Regards,

gustavus

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


[PHP] read and modified getting data

2004-02-23 Thread Tommi Virtanen
Hi!

I have quite simple form (it has textarea input), where I can write for 
example:

Data1
Data2
This is text



So, input contains spaces, linefeeds and so on...

When I make page, which read data from this textarea-field, data came from 
without
spaces and linefeeds. How to correct this problem?

Regards,

gustavus

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


Re: [PHP] read and modified getting data

2004-02-23 Thread "Miguel J. Jiménez"
You must convert "\n" to  and spaces to   You can use 
strreplace() or some other function that exist in PHP just for that...

Tommi Virtanen wrote:

Hi!

I have quite simple form (it has textarea input), where I can write for 
example:

Data1
Data 2
This is text



So, input contains spaces, linefeeds and so on...

When I make page, which read data from this textarea-field, data came 
from without
spaces and linefeeds. How to correct this problem?

Regards,

gustavus

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] read and modified getting data

2004-02-23 Thread Richard Davey
Hello Tommi,

Monday, February 23, 2004, 10:25:10 AM, you wrote:

TV> So, input contains spaces, linefeeds and so on...

TV> When I make page, which read data from this textarea-field, data
TV> came from without spaces and linefeeds. How to correct this
TV> problem?

The characters will still actually be there (view the source to see)
it's just that HTML won't render them the way you're expecting. The
spaces will be converted into a single space and the
line-feeds/carriage returns won't do anything either unless you're
using a fixed-width font.

Two choices: Convert the non-displaying characters to their HTML
equivalents (i.e. space to  ) or wrap the text in a  tag.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] read and modified getting data

2004-02-23 Thread Jason Merrique

> From: "Miguel J. Jiménez" [mailto:[EMAIL PROTECTED] 

> You must convert "\n" to  and spaces to   You can use
> strreplace() or some other function that exist in PHP just for that...

nl2br() should do that.

Usage: nl2br($foo)

$foo is your textarea variable.

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



RE: [PHP] Slight cleaning of code needed in str_replace command.

2004-02-23 Thread Dave G
Jason,
Have no worries, I'm not looking for anyone to write my code for
me. It's precisely because the str_replace command is so simple that I
figure if the results are strange that there is something I don't
understand. And I want to understand it, not just be given code to copy
and paste.
As it turns out, by experimenting with the var_dump() command
that you recommended (which I wasn't aware of), I learned that what was
going wrong was that the line breaks coming out of my MySQL DB aren't
just \n, but \r\n. So swapping around the elements I was replacing, and
experimenting, was not going to do me much good until I knew this.
So now it's working, and largely thanks to the suggestions you
gave. I would never have been able to guess on my own at using
var_dump() in order to get at the solution. Please don't assume that
just because a query is simple that it means that the person asking is
not willing to work or that they haven't already attempted to work at
it. Sometimes it just means that the person asking doesn't know all the
angles possible.

Thanks for your help.

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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



[PHP] Split a string on a space, not in side an HTML tag.

2004-02-23 Thread Stuart Gilbert
Hi, I'm trying to get a 500 character split of a string, I only want 
about the fist 500 characters, I would like to split on a space, which I 
have managed to do so far, but I would also like the split to not take 
place inside an HTML tag, so that I don't end up with weird looking pages.

I was trying to use strip_tags() error checking to tell me whether I my 
string was valid html or not. If it's not valid html then I would like 
to split before that part of the html begins. Possibly even as simply as 
removing the last 10 characters (to the nearest space) until I get valid 
HTML.

Can anyone help me get a way to split my text at around the 500 
character mark without breaking any HTML which may be inside the string 
I am displaying on the page?

Also, if you're interested in the strip_tags() problem I was speaking 
about then take a look at: http://better.domain.name/php/strip.php there 
is a link to the source on the page.

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


[PHP] Character Encoding Problem

2004-02-23 Thread roland
Hi

I'm trying to encode text entered into an html form.  In dreamweaver,
special characters seem to be encoded as “ (a curly quote) for
example, which I assume is utf-8.

Here is my code snippet:

htmlentities(html_entity_decode(strip_tags(stripslashes(trim($data,
ENT_QUOTES), ENT_QUOTES, "utf-8")

but this does not seem to return the encoded value.  I've tried all the
character sets, but none of them seem to do anything apart from the windows
specific character set, which doesn't return the value I want.

I've tried using html_entity_decode with uft-8, but it throws an error
saying that the function doesn't support MBCS (Multibyte character sets???)

I've also tried using utf8_encode() before trying to html encode, but this
doesn't work either.

Any help gratefully appreciated

Thanks In Advance
Roland

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



Re: [PHP] Slight cleaning of code needed in str_replace command.

2004-02-23 Thread Jason Wong
On Monday 23 February 2004 19:12, Dave G wrote:

>   So now it's working, and largely thanks to the suggestions you
> gave. I would never have been able to guess on my own at using
> var_dump() in order to get at the solution. Please don't assume that
> just because a query is simple that it means that the person asking is
> not willing to work or that they haven't already attempted to work at
> it. Sometimes it just means that the person asking doesn't know all the
> angles possible.

It's good to know you've solved your problem. I hope you appreciate that my 
suggestions will be of more use to you in the long run than a straight 
forward answer to your problem. It's better to teach someone how to fish than 
to do the fishing for them.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You may easily play a joke on a man who likes to argue -- agree with him.
-- Ed Howe
*/

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



[PHP] Php and GpG

2004-02-23 Thread Paul Marinas

Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't
seems to work maybe my php is not compiled with some kind of support.

thanks


Paul
GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

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



[PHP] Re: Character Encoding Problem

2004-02-23 Thread Lucian Cozma
Try multibyte functions (http://www.php.net/manual/en/ref.mbstring.php):
mb_decode_numericentity
mb_encode_numericentity
mb_convert_encoding

See below:
';
echo c_to_n(n_to_c('“'));
?>

Hope it helps,
Lucian

"Roland" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> I'm trying to encode text entered into an html form.  In dreamweaver,
> special characters seem to be encoded as “ (a curly quote) for
> example, which I assume is utf-8.
>
> Here is my code snippet:
>
> htmlentities(html_entity_decode(strip_tags(stripslashes(trim($data,
> ENT_QUOTES), ENT_QUOTES, "utf-8")
>
> but this does not seem to return the encoded value.  I've tried all the
> character sets, but none of them seem to do anything apart from the
windows
> specific character set, which doesn't return the value I want.
>
> I've tried using html_entity_decode with uft-8, but it throws an error
> saying that the function doesn't support MBCS (Multibyte character
sets???)
>
> I've also tried using utf8_encode() before trying to html encode, but this
> doesn't work either.
>
> Any help gratefully appreciated
>
> Thanks In Advance
> Roland

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



[PHP] Connection handling and output_buffering

2004-02-23 Thread neko
Hi guys,

Was reading through:
http://uk.php.net/manual/en/features.connection-handling.php
And I was wondering how PHP handles script termination when you have 
'output_buffering = On' in your php.ini?

If I have a long script that does lots of database stuff for example, 
and is riddled with echo() function calls, how will php handle a user 
clicking stop in their browser half way through?

I'm guessing that it WILL continue execution to the end, then when you 
send the buffer back to the client it determines that the client stopped 
the request and it terminates.

I guess some simple testing will suffice!

Neko

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


[PHP] hello

2004-02-23 Thread gnat
read it immediately!
<>
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Connection handling and output_buffering

2004-02-23 Thread Matt Matijevich


Was reading through:
http://uk.php.net/manual/en/features.connection-handling.php 

And I was wondering how PHP handles script termination when you have 
'output_buffering = On' in your php.ini?

If I have a long script that does lots of database stuff for example, 
and is riddled with echo() function calls, how will php handle a user 
clicking stop in their browser half way through?



I think http://www.php.net/manual/en/function.ignore-user-abort.php
will give you some of the info you want

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



Re: [PHP] delete a function

2004-02-23 Thread Michal Migurski
>There are two (or more) different functions on my web site, that have the
>same name (an action). They are called depending on the permittions of
>the end user.  I want to have the code clean so I don't want to put
>the switch or if operators to it. I will call the wrapper that will check
>the grant of the user and call apropriate function. (For example:
>Load_action("List"))

You're going to have to put that switch logic someplace, though - the
usual way to approach this situation is to have a central dispatch
function/file which checks the user's permissions, and then makes
subrequests to specific display functions for drawing the individual parts
of an interface - disply_nav(), display_login(), etc. Adam suggested the
Factory pattern, but your desired behavior sounds much more like the
Command pattern to me:
http://www.phppatterns.com/index.php/article/articleview/96/1/1/

It's probably cleaner to have all your permissions logic in one place, and
not mess with multiple identically-named functions. It feels like asking
for trouble, to me - your philosophy of laziness is truly admirable, but
you could be creating a serious maintenance headache for yourself down the
road. :)

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] preg guru again.....

2004-02-23 Thread pete M
Am trying to do a strange thing with php..

Extract the urls from the Internet Explorer index.dat history files 
(dont ask why!)

Here is a snippet
ð­:2002020720020208:[EMAIL PROTECTED]://www.lyricsworld.com/cgi-bin/search.cgi?q=Bruce
+Springsteen&m=phrase&ps=20&o=0&wm=wrd&ul=&wf=1ð­ð­ð­ð­
it breaks down in the following elements
the :date: in the format mmddmmdd
The expression I'm using is
(":16[0-9]:")
ie matching the : with 16 digits :
I'm using  to match the url part  (taken from php manual - thanks).. 
however am getting all the illegal characters - nulls, binary, etc back 
as its a binary file

preg_match("/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $contents, $match);

also I want to allow / ~ ? & characters as well as http: file: protocols

Complete string is
preg_match(":16[0-9]:/^(.*:\/\/)?([^:\/]+):?([0-9]+)?(.*)/", $contents, 
$match);

Of course it doesnt work !!!

any help would be appreciated

Pete

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


RE: Re[2]: [PHP] Self Submitting Form

2004-02-23 Thread Sam Masiello

Ah ha!

I think I found where the problem lies(and also our confusing
disconnect).  Even though you and I were doing pretty much the same
thing, your case worked fine in the instance where the parameter being
submitted in the self submitting form was only one word.  If you changed
your test case to something like "hi there" (which is what I was using
in my testing), it breaks.  Why?  The parameter needs to be urlencoded
first.

Thank you very much for your help and suggestions, Toby!  I really
appreciate your time and effort in helping me to see the light.

--Sam


Toby Irmer wrote:
> Hi Sam,
> 
> I did that only because I was too lazy to upload and did the testing
> locally so I could grab the value in Javascript. 
> 
> Of course it works with post as well...
> 
> test.html
> 
> 
>   
> 
> window.open("test2.html", "test");
> 
> 
> 
> 
> test2.html
> 
> 
> 
>   
> 
>   document.write(' VALUE="'+opener.myform1.myvar1.value+'">'); 
> 
> 
> 
> test.php
> 
>  print_r($_POST);
>> 
> 
> Outputs:
> 
> Array ( [do_preview] => 1 [itworks] => testing )

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



RE: [PHP] Php and GpG

2004-02-23 Thread Sam Masiello

What is the error that you get when you try to use gpgext?

--Sam


Paul Marinas wrote:
> Those anyone know hoh to use php with gpg. I've tryed gpgext, but
> doesn't seems to work maybe my php is not compiled with some kind of
> support.  
> 
> thanks
> 
> 
> Paul
> GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

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



[PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Brian Dunning
This inserts nothing into the database, but returns no error that I can 
see. How come? What's wrong with it?

$dbname = "my_database";
$dbconnection = mysql_connect("mysql05.powweb.com","my_user","my_pass");
mysql_select_db($dbname, $dbconnection);
$query = "INSERT INTO invoices 
('ip','total','creation','first_name','email','session','last_name') 
VALUES 
('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
$result = mysql_query($query);

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


php-general Digest 23 Feb 2004 17:11:59 -0000 Issue 2607

2004-02-23 Thread php-general-digest-help

php-general Digest 23 Feb 2004 17:11:59 - Issue 2607

Topics (messages 178511 through 178540):

Re: PHP or MSIE Problem? -- SOLVED
178511 by: Beau Hartshorne

Re: using xp home
178512 by: Jason Merrique

Re: ftp software
178513 by: Jason Merrique

SQLite: getting field information (type etc)
178514 by: Robert S

Re: tow dimenshional arrays
178515 by: joe-at

read and modified getting data
178516 by: Tommi Virtanen
178517 by: Tommi Virtanen
178518 by: "Miguel J. Jiménez"
178519 by: Richard Davey
178520 by: Jason Merrique

Re: Slight cleaning of code needed in str_replace command.
178521 by: Dave G
178524 by: Jason Wong

Split a string on a space, not in side an HTML tag.
178522 by: Stuart Gilbert

Character Encoding Problem
178523 by: roland
178526 by: Lucian Cozma

Php and GpG
178525 by: Paul Marinas
178537 by: Sam Masiello

Embedded MySQL server (libmysqld)?
178527 by: user.domain.invalid

Connection handling and output_buffering
178528 by: neko
178530 by: Matt Matijevich

hello
178529 by: gnat.frii.com

Re: [PEAR] Re: PEAR DB 1.6.0 has been released
178531 by: Justin Patrin
178533 by: Richard Davey

Re: [PHP-DB] Embedded MySQL server (libmysqld)?
178532 by: Adam Voigt
178538 by: user.domain.invalid
178539 by: Adam Voigt

Re: delete a function
178534 by: Michal Migurski

preg guru again.
178535 by: pete M

Re: Self Submitting Form
178536 by: Sam Masiello

Can anyone tell me why this code doesn't insert anything?
178540 by: Brian Dunning

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
--- Begin Message ---
I described a situation where MSIE for Windows would not post all of a
form's fields under fairly unique circumstances. This problem occurs in
MSIE 5, 5.5, and 6 (with the most recent hotfixes applied). No other
browsers seem to be affected. When:

1. A form is submitted with the enctype attribute set to
"multipart/form-data".

2. No http header is sent to explicitly select a character encoding that
matches form input, or if the http header and xml prolog and/or meta
http-equiv="content-type" tag do not select the correct character
encoding[1].

3. The user has input a character into one of the form fields, such as
[TM], a curly quote, or some other character that could have been
copy-pasted from a word processor, that is not defined in the character
set identified by some combination of an http header, xml prolog, and
meta tag.

4. There is at least one unchecked checkbox on contained in the form
(thanks Pablo!).

MSIE will not return all of the name/value pairs sent in the posted form
to the server. If you check the checkbox, the form will post normally.
The earliest reference to this problem that I could find was in a German
Usenet post[2,3], where the special character was the Euro sign.
Although the behaviour is a little buggy, we can't blame MSIE for
getting it wrong.

I've posted a new version of my page that sends the correct header:



And that uses the correct meta tag:



I've omitted the xml prolog because of other problems that it can cause
with MSIE 6.

The page is still posted here:

http://hartshorne.ca/sandbox.php

Thanks!!

Beau

1. 
2. 
3.

--- End Message ---
--- Begin Message ---
Hi Danny,

If you're going to be using PHP for testing purposes on your home PC,
I'd recommend installing EasyPHP. It's basically Apache MySQL and PHP
bundled together. It's pretty easy to set up, just run the installer,
then start the program and you have a PHP enabled webserver.

You should be able to get it at www.easyphp.org

Cheers

Jason

> -Original Message-
> From: danny cobbinah [mailto:[EMAIL PROTECTED] 
> Sent: 22 February 2004 00:12
> To: [EMAIL PROTECTED]
> Subject: [PHP] using xp home
> 
> is it better to use apache 1.3.29 or apache 2.0.48?
> 
> i am having the worst trouble ever trying to get this thing to work
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
--- End Message ---
--- Begin Message ---
I second that,

What I like the most about WSFTP is that you can edit files on the
remote site. Very handy!

 

> -Original Message-
> From: Pooya Eslami [mailto:[EMAIL PROTECTED] 
> Sent: 22 February 2004 21:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: ftp software
> 
> WS FTP is not bad.you cand download the LE version for free 
> here: (the la

RE: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Sam Masiello

What happens if you echo out $query to the browser window and try to
copy and paste the query into  a command line mysql session (be sure to
connect to the database using the same authentication credentials that
you have in the script)?  Does it work?

--Sam


Brian Dunning wrote:
> This inserts nothing into the database, but returns no error that I
> can see. How come? What's wrong with it?
> 
> $dbname = "my_database";
> $dbconnection =
> mysql_connect("mysql05.powweb.com","my_user","my_pass");
> mysql_select_db($dbname, $dbconnection); $query = "INSERT INTO
> invoices
> ('ip','total','creation','first_name','email','session','last_name')
> VALUES
> ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
> $result = mysql_query($query); 

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



[PHP] Re: Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread pete M
Brian Dunning wrote:

This inserts nothing into the database, but returns no error that I can 
see. How come? What's wrong with it?

$dbname = "my_database";
$dbconnection = mysql_connect("mysql05.powweb.com","my_user","my_pass");
mysql_select_db($dbname, $dbconnection);
$query = "INSERT INTO invoices
(ip,total,creation,first_name,email,session,last_nam')
VALUES ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
$result = mysql_query($query);
also need to chack if there are add magic quotes and add slashes

pete

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


Re: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread BAO RuiXian


Brian Dunning wrote:

This inserts nothing into the database, but returns no error that I 
can see. How come? What's wrong with it?

$dbname = "my_database";
$dbconnection = mysql_connect("mysql05.powweb.com","my_user","my_pass");
mysql_select_db($dbname, $dbconnection);
$query = "INSERT INTO invoices 
('ip','total','creation','first_name','email','session','last_name') 
VALUES ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
$result = mysql_query($query);
Have you tried to insert the same SQL statement manually, i.e., not via 
your php scirpt?

Best

Bao

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


Re: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Adam Voigt
Change your query line to this:

$result = mysql_query($query) or die(mysql_error());

What does it output?


On Mon, 2004-02-23 at 12:11, Brian Dunning wrote:
> This inserts nothing into the database, but returns no error that I can 
> see. How come? What's wrong with it?
> 
> $dbname = "my_database";
> $dbconnection = mysql_connect("mysql05.powweb.com","my_user","my_pass");
> mysql_select_db($dbname, $dbconnection);
> $query = "INSERT INTO invoices 
> ('ip','total','creation','first_name','email','session','last_name') 
> VALUES 
> ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
> $result = mysql_query($query);
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Jason Wong
On Tuesday 24 February 2004 01:11, Brian Dunning wrote:
> This inserts nothing into the database, but returns no error that I can
> see. How come? What's wrong with it?

mysql_error()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Some scholars are like donkeys, they merely carry a lot of books.
-- Folk saying
*/

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



[PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Nicole
Is there a PHP alternative to an IFRAME? Here's what I mean.

Is there a way to include a file in my php document that will be positioned
where I want it, like an IFRAME? I want to have it aligned right with text
wrapping around it and I know IFRAME is not compatible with Netscape
browsers.

Thanks

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



[PHP] Re: Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Nicole
I don't know if this will help, but I always do:

$result = mysql_query($query,$dbconnection);

Nicole

"Brian Dunning" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This inserts nothing into the database, but returns no error that I can
> see. How come? What's wrong with it?
>
> $dbname = "my_database";
> $dbconnection = mysql_connect("mysql05.powweb.com","my_user","my_pass");
> mysql_select_db($dbname, $dbconnection);
> $query = "INSERT INTO invoices
> ('ip','total','creation','first_name','email','session','last_name')
> VALUES
> ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";
> $result = mysql_query($query);

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



Re: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Richard Davey
Hello Nicole,

Monday, February 23, 2004, 5:21:11 PM, you wrote:

N> Is there a PHP alternative to an IFRAME? Here's what I mean.

No, of course not. PHP is a server-side language. IFRAME's (and
anything related to page construction/display) is client-side.

N> Is there a way to include a file in my php document that will be positioned
N> where I want it, like an IFRAME? I want to have it aligned right with text
N> wrapping around it and I know IFRAME is not compatible with Netscape
N> browsers.

You're mixing technologies. If Netscape won't display something, there
is nothing PHP can do about it. You need to think of another layout
technique that it can display.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: hello

2004-02-23 Thread Ben Ramsey
I would advise against sending attachments to the list with the message 
"read it immediately."  Chances are, it won't be opened or looked at. 
Please include a description of the problem you are facing, as well as 
the code you are using in your message body--not in an attachment.

[EMAIL PROTECTED] wrote:
read it immediately!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread BAO RuiXian


Brian Dunning wrote:

On Feb 23, 2004, at 9:18 AM, BAO RuiXian wrote:

Have you tried to insert the same SQL statement manually, i.e., not 
via your php scirpt?


I did the insert in phpmyadmin & copied & pasted the SQL that it 
generated, and it's the same, so I'm left scratching my head big time.
How about from command line?

Please keep the discussion on the list.

Best

Bao

- Brian



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


Re: [PHP] Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Richard Davey
Hello Brian,

Monday, February 23, 2004, 5:11:55 PM, you wrote:

BD> $query = "INSERT INTO invoices
BD> ('ip','total','creation','first_name','email','session','last_name')
BD> VALUES 
BD> ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith')";

You shouldn't wrap the column names in quotes. Try:

$query = "INSERT INTO invoices (ip, total, creation, first_name,
email, session, last_name) VALUES ...

If that doesn't work there is probably an error between the query, the
query data and the SQL table structure. Post the SQL table layout so
the values can be checked.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] passthru and GET parameters

2004-02-23 Thread Guillouet Nicolas
Hi all,

I am trying to use htmldoc with passthru function : 

passthru("htmldoc -t html --quiet --jpeg --webpage --footer --bottom
0.2cm --left 1.78cm --right 1cm --top 0.2cm '' $options $filename");

where $filename is urls, it works fine but not with GET pamameters :
 if $filename is like
'http://host/file.php?PHPSESSID=**&value=1', passthru is
waiting for the command.

I think the trouble comes from the char '&', I have the same result on
command line except if I use quote for the filename. And when I watch
the process created by apache, the command is send without quote or
quotation mark even if I put some in the filename.

How can I do ?

Thanks 

Nicolas

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



Re: [PHP] Re: hello

2004-02-23 Thread BAO RuiXian
Based on the style of message body (short and shout), and the subject 
line, and the zip attachment, I conclude it as a virus. It may or may 
not a virus in face, I immediately delete it anyway:)

Best

Bao

Ben Ramsey wrote:

I would advise against sending attachments to the list with the 
message "read it immediately."  Chances are, it won't be opened or 
looked at. Please include a description of the problem you are facing, 
as well as the code you are using in your message body--not in an 
attachment.

[EMAIL PROTECTED] wrote:

read it immediately!


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


Re: [PHP] passthru and GET parameters

2004-02-23 Thread Marek Kilimajer
put quotes around:

passthru("htmldoc -t html --quiet --jpeg --webpage --footer --bottom
> 0.2cm --left 1.78cm --right 1cm --top 0.2cm '' $options '$filename'");
Guillouet Nicolas wrote:
Hi all,

I am trying to use htmldoc with passthru function : 

passthru("htmldoc -t html --quiet --jpeg --webpage --footer --bottom
0.2cm --left 1.78cm --right 1cm --top 0.2cm '' $options $filename");
where $filename is urls, it works fine but not with GET pamameters :
 if $filename is like
'http://host/file.php?PHPSESSID=**&value=1', passthru is
waiting for the command.
I think the trouble comes from the char '&', I have the same result on
command line except if I use quote for the filename. And when I watch
the process created by apache, the command is send without quote or
quotation mark even if I put some in the filename.
How can I do ?

Thanks 

Nicolas

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


[PHP] E-Commerce Advice? Squirrelcart?

2004-02-23 Thread Matt Hedges
Hello,

I am working on using PHP to build a web store.
http://www.squirrelcart.com/ looks to be pretty good for a shopping cart-
does anyone have any experience with this or others?

Also, what suggestions do ya'll have for a payment gateway?


thanks
matt

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



[PHP] Re: Search Engines || Dynamic Content || Apache Mod_Rewrite....

2004-02-23 Thread CF High
Hey all.

I've got a PHP-MySql database driven site setup in a shared hosting
environment that does NOT support apache mod_rewrite.

Is there a workaround for getting dynamic pages (e.g.
index.php?display=contact) indexed in major search engines without using
mod_rewrite?

Any clues very much appreciated.

TIA,

--Noah


--

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



[PHP] preg_guru

2004-02-23 Thread pete M
I'm trying to group matches..
the string is (all one line)
:2002020720020208: [EMAIL PROTECTED]://www.azlyrics.com __ continued...
/s/springsteen.html?dsd=sadsa&etc=tec
here the first bit I'm trying to match
:2002020720020208:
preg_match("(:[0-9]{16}:)", $contents, $match);
and then the default@ with
preg_match("([a-z]{1,20}@)", $contents, $match);
and then a combination of the two
preg_match("(:[0-9]{16}:)([a-z]{1,20}@)", $contents, $match);
get the error
Warning: Unknown modifier '(' in 
/home/incase/public_html/History.IE5/imp.php on line 36

I've trien all sort of stuff to no avail..

tia

Pete

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


Re: [PHP] E-Commerce Advice? Squirrelcart?

2004-02-23 Thread Adam Voigt
PayPal has some pretty impressive inter-active programming API's. Other
then that, the only suggestion I could make is try and steer clear of
AuthorizeNET.


On Mon, 2004-02-23 at 12:53, Matt Hedges wrote:
> Hello,
> 
> I am working on using PHP to build a web store.
> http://www.squirrelcart.com/ looks to be pretty good for a shopping cart-
> does anyone have any experience with this or others?
> 
> Also, what suggestions do ya'll have for a payment gateway?
> 
> 
> thanks
> matt
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP] E-Commerce Advice? Squirrelcart?

2004-02-23 Thread Elliott Mina
I have used OsCommerce, and not had any problems.

Original Message Follows
From: "Matt Hedges" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP] E-Commerce Advice?  Squirrelcart?
Date: Mon, 23 Feb 2004 11:53:14 -0600
Hello,

I am working on using PHP to build a web store.
http://www.squirrelcart.com/ looks to be pretty good for a shopping cart-
does anyone have any experience with this or others?
Also, what suggestions do ya'll have for a payment gateway?

thanks
matt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Take off on a romantic weekend or a family adventure to these great U.S. 
locations. http://special.msn.com/local/hotdestinations.armx

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


Re: [PHP] E-Commerce Advice? Squirrelcart?

2004-02-23 Thread Richard Baskett
on 2/23/04 9:53, Matt Hedges at [EMAIL PROTECTED] wrote:

> Hello,
> 
> I am working on using PHP to build a web store.
> http://www.squirrelcart.com/ looks to be pretty good for a shopping cart-
> does anyone have any experience with this or others?
> 
> Also, what suggestions do ya'll have for a payment gateway?
> 
> 
> thanks
> matt

I have not used squirrelcart, but I do really like eShox
(http://www.eshox.com) most of my clients use it and it has great
configurability.

Most of my clients use either Authorize.net or 2checkout.com, both seem to
work quite well, especially with eshox.

Cheers!

Rick

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



Re: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Nicole
Your right I was mixing up what I wanted.

What I wanted to know I guess was if I use an include and include a file can
I format where that file will display.

So what I have is a little box with some info in it.  I want it to display
to the right of the body text and have the body text wrap around it.

Nicole

"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Nicole,
>
> Monday, February 23, 2004, 5:21:11 PM, you wrote:
>
> N> Is there a PHP alternative to an IFRAME? Here's what I mean.
>
> No, of course not. PHP is a server-side language. IFRAME's (and
> anything related to page construction/display) is client-side.
>
> N> Is there a way to include a file in my php document that will be
positioned
> N> where I want it, like an IFRAME? I want to have it aligned right with
text
> N> wrapping around it and I know IFRAME is not compatible with Netscape
> N> browsers.
>
> You're mixing technologies. If Netscape won't display something, there
> is nothing PHP can do about it. You need to think of another layout
> technique that it can display.
>
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Chris W. Parker
Nicole 
on Monday, February 23, 2004 10:26 AM said:

> What I wanted to know I guess was if I use an include and include a
> file can I format where that file will display.
> 
> So what I have is a little box with some info in it.  I want it to
> display to the right of the body text and have the body text wrap
> around it. 

again, you're mixing things up. php doesn't have anything to do with
this EXCEPT that it sends html to the client. you have to decide what
html should be sent to the client.

you should join a list such as webdesign-l or thelist to ask this kind
of question.


chris.

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



Re[2]: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Richard Davey
Hello Nicole,

Monday, February 23, 2004, 6:26:24 PM, you wrote:

N> What I wanted to know I guess was if I use an include and include a file can
N> I format where that file will display.

Yes absolutely, but again this is still an HTML issue.

N> So what I have is a little box with some info in it.  I want it to display
N> to the right of the body text and have the body text wrap around it.

Say you've got a PHP file that has all of the HTML in it that you
want, other than this little box. At the place where you want the
content of that box to appear you need to use something like this:



Whatever is contained in the "little_box.php" script will then appear
in exactly that place in the final page.

Of course you're going to need to arrange the HTML in both files to
make this work, but I think it's what you are after.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
I'm using a prebuilt Perl form mailer script for a project, 
but because the form is so long, my client would like to 
give the user the ability to save the data and come back to 
finish it later. I was hoping to be able to code this part 
in PHP (because I don't know Perl), but I'm fairly new to 
PHP and don't know how to get one form to go to two 
different places. Because the target of the form is the Perl 
script (for emailing the submitted form), how can I grab the 
data from the form with PHP?

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] saving form data

2004-02-23 Thread Sam Masiello

If the PHP configuration doesn't have "register_globals" turned on in
the php.ini file, you will be able to access the form variables via the
_POST array like this:

$_POST["my_form_var"]

Of course, substitute my_form_var with the correct variable from the
form that you are submitting.

If the server does have register_globals turned on you can access the
variables just as they are named in the form.  For example, if you have
a text input field named "lastname", you can access the value in that
text box using the variable $lastname.

HTH!

--Sam



Charlie Fiskeaux II wrote:
> I'm using a prebuilt Perl form mailer script for a project,
> but because the form is so long, my client would like to
> give the user the ability to save the data and come back to
> finish it later. I was hoping to be able to code this part
> in PHP (because I don't know Perl), but I'm fairly new to
> PHP and don't know how to get one form to go to two
> different places. Because the target of the form is the Perl
> script (for emailing the submitted form), how can I grab the
> data from the form with PHP?
> 
> --
> 
> Charlie Fiskeaux II
> Media Designer
> Cre8tive Group
> cre8tivegroup.com

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



Re: [PHP] Php and GpG

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 08:35, Paul Marinas wrote:
> Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't
> seems to work maybe my php is not compiled with some kind of support.

You will need to call gpg from your script using either a socket
connection[1], something from the exec family[2], or backticks[3].

[1] http://www.php.net/popen
[2] http://www.php.net/ref.exec
[3] http://www.php.net/operators.execution

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] Possible to write CRC/MD5 to the file?

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 00:01, Evan Nemerson wrote:
> What you would have to do is find a collision, which is thankfully difficult 
> to do- if it were easy, MD5 would be useless. Theoretically, you could modify 
> say John The Ripper and have it brute force something, but you may end up 
> waiting a few lifetimes :)

Just as a note, check out www.md5crk.com.  They aim to do just this and
imho have a good plan of attack.  I have already moved to sha1 for
passwords, this is only further support of why it's time to move on.

> I'd recommend PGP/GPG signing instead- anyone can create a valid MD5 checksum, 
> but only you can cryptographically sign your files (theoretically- if someone 
> else can, you've got serious problems)
> 
> Everyone seems happy enough with detached signatures. Also, you could use the 
> OpenPGP specification to do what you want, just like when you send a 
> PGP-signed e-mail the signature and the message are all in a single 
> container. You may have to hack GPG a bit (not as difficult as you'd think) 
> to have the PGP stuff in PHP comments, but i think you could do it... Sorry, 
> I'm rambling.

Here, here, PGP adds more benefits as long as you don't leak your
private key.  You could always try and wrap everything as a mime message
or zip the two together.  Also, place a link to the pgp signature in the
README file.  Not that anyone ever reads those though. ;)

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Axel IS Main
Guys, this isn't THAT stupid of a question is it? From my perspective, 
the way PHP seems to see it is that I should already know what kind of 
file I'm looking at. In most cases that's not an unreasonable 
assumption. Unfortunately, that's only good for most cases. PHP is rich 
in ways to work with the HTTP protocol, but has no way of detecting 
whether it's opening a text file or a binary file. To me this is a 
glaring omission. There has to be a way to do it, even if it's a 
round-a-bout or backdoor kind of way. Nothing is impossible.

Nick

Axel IS Main wrote:

I'm using file_get_contents() to open URLs. Does anyone know if there 
is a way to look at the result and determine if the file is binary? 
I'd like to be able to block binaries from being processed without 
having to try to think of all the possible binary extensions and omit 
them with a function that looks for these extensions.

Nick

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


Re: [PHP] Re: hello

2004-02-23 Thread Duncan Hill
On Monday 23 February 2004 17:27, Ben Ramsey wrote:
> I would advise against sending attachments to the list with the message
> "read it immediately."  Chances are, it won't be opened or looked at.
> Please include a description of the problem you are facing, as well as
> the code you are using in your message body--not in an attachment.

Even better chances that that was a neutered virus.

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Adam Voigt
Couldn't you just check the extension on the file?


On Mon, 2004-02-23 at 14:03, Axel IS Main wrote:
> Guys, this isn't THAT stupid of a question is it? From my perspective, 
> the way PHP seems to see it is that I should already know what kind of 
> file I'm looking at. In most cases that's not an unreasonable 
> assumption. Unfortunately, that's only good for most cases. PHP is rich 
> in ways to work with the HTTP protocol, but has no way of detecting 
> whether it's opening a text file or a binary file. To me this is a 
> glaring omission. There has to be a way to do it, even if it's a 
> round-a-bout or backdoor kind of way. Nothing is impossible.
> 
> Nick
> 
> Axel IS Main wrote:
> 
> > I'm using file_get_contents() to open URLs. Does anyone know if there 
> > is a way to look at the result and determine if the file is binary? 
> > I'd like to be able to block binaries from being processed without 
> > having to try to think of all the possible binary extensions and omit 
> > them with a function that looks for these extensions.
> >
> > Nick
> >
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Axel IS Main
Yes, and in fact that is what I am doing now. This is a spider bot 
though, so I'm having to think of every single type of binary file that 
could be linked to on the web. So far I'm up to 28 with no end in sight. 
What about a .com file? I can't omit links that end in .com can I? That 
would be counterproductive to say the least. Also, the function that 
does the checking just keep getting longer and longer, which makes the 
spider go slower and slower. Granted, the thing is pretty fast if it has 
enough BW to work with, but still. This could eventually turn into a 
script killer. Detecting whether the stream from file_get_contents(), or 
fopen() for that matter, is binary or not and going with that result is 
the elegant solution to this problem. There has to be a way to do it.

Nick

Adam Voigt wrote:

Couldn't you just check the extension on the file?

On Mon, 2004-02-23 at 14:03, Axel IS Main wrote:
 

Guys, this isn't THAT stupid of a question is it? From my perspective, 
the way PHP seems to see it is that I should already know what kind of 
file I'm looking at. In most cases that's not an unreasonable 
assumption. Unfortunately, that's only good for most cases. PHP is rich 
in ways to work with the HTTP protocol, but has no way of detecting 
whether it's opening a text file or a binary file. To me this is a 
glaring omission. There has to be a way to do it, even if it's a 
round-a-bout or backdoor kind of way. Nothing is impossible.

Nick

Axel IS Main wrote:

   

I'm using file_get_contents() to open URLs. Does anyone know if there 
is a way to look at the result and determine if the file is binary? 
I'd like to be able to block binaries from being processed without 
having to try to think of all the possible binary extensions and omit 
them with a function that looks for these extensions.

Nick

 

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


Re: [PHP] Re: hello

2004-02-23 Thread John Nichel
Ben Ramsey wrote:

I would advise against sending attachments to the list with the message 
"read it immediately."  Chances are, it won't be opened or looked at. 
Please include a description of the problem you are facing, as well as 
the code you are using in your message body--not in an attachment.

[EMAIL PROTECTED] wrote:

read it immediately!


Eh, I'm going to say that the email was sent by an infected computer, 
unknown to the comptuer's owner.  ie, It's a virius spawned email. ;)

--
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] Detecting Binaries

2004-02-23 Thread Jas
Well you can do a check on the mime type of the file.  eg.

$mimes = array("1" => "application/octet-stream",
   "2: => "image/jpeg",
etc.
For more info...
http://us4.php.net/manual/en/ref.filesystem.php
Just like the upload file function you can check for the mime types...
http://us4.php.net/manual/en/features.file-upload.php
Just a thought, might not be a comlete solution however.
HTH
Jas
Axel Is Main wrote:
Guys, this isn't THAT stupid of a question is it? From my perspective, 
the way PHP seems to see it is that I should already know what kind of 
file I'm looking at. In most cases that's not an unreasonable 
assumption. Unfortunately, that's only good for most cases. PHP is rich 
in ways to work with the HTTP protocol, but has no way of detecting 
whether it's opening a text file or a binary file. To me this is a 
glaring omission. There has to be a way to do it, even if it's a 
round-a-bout or backdoor kind of way. Nothing is impossible.

Nick

Axel IS Main wrote:

I'm using file_get_contents() to open URLs. Does anyone know if there 
is a way to look at the result and determine if the file is binary? 
I'd like to be able to block binaries from being processed without 
having to try to think of all the possible binary extensions and omit 
them with a function that looks for these extensions.

Nick

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


Re[2]: [PHP] Detecting Binaries

2004-02-23 Thread Richard Davey
Hello Axel,

Monday, February 23, 2004, 7:03:38 PM, you wrote:

AIM> Guys, this isn't THAT stupid of a question is it? From my perspective,
AIM> the way PHP seems to see it is that I should already know what kind of
AIM> file I'm looking at. In most cases that's not an unreasonable 
AIM> assumption. Unfortunately, that's only good for most cases. PHP is rich

Even Windows doesn't *know* what type of file you've got until you
actually try and open it. You could rename a jpg to mp3 and you won't
know about it until Winamp moans at you as you open it.

AIM> in ways to work with the HTTP protocol, but has no way of detecting
AIM> whether it's opening a text file or a binary file. To me this is a
AIM> glaring omission. There has to be a way to do it, even if it's a 
AIM> round-a-bout or backdoor kind of way. Nothing is impossible.

You could say it's a glaring omission from operating systems too,
because most succumb to this. The only way to tell for sure is to read
in the header of the file and parse it. If you are blanket rejecting
all binaries - good luck, it'll take ages. Another solution might be
to just treat the file as text regardless and strip out every byte
that is above the standard ASCII value. Hello CPU upgrade requirement.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Adam Voigt
Well actually to check .com, just make sure it contains a / then the
.com, that will filter yahoo.com, but keep yahoo.com/downloadme.com


On Mon, 2004-02-23 at 14:19, Axel IS Main wrote:
> Yes, and in fact that is what I am doing now. This is a spider bot 
> though, so I'm having to think of every single type of binary file that 
> could be linked to on the web. So far I'm up to 28 with no end in sight. 
> What about a .com file? I can't omit links that end in .com can I? That 
> would be counterproductive to say the least. Also, the function that 
> does the checking just keep getting longer and longer, which makes the 
> spider go slower and slower. Granted, the thing is pretty fast if it has 
> enough BW to work with, but still. This could eventually turn into a 
> script killer. Detecting whether the stream from file_get_contents(), or 
> fopen() for that matter, is binary or not and going with that result is 
> the elegant solution to this problem. There has to be a way to do it.
> 
> Nick
> 
> Adam Voigt wrote:
> 
> >Couldn't you just check the extension on the file?
> >
> >
> >On Mon, 2004-02-23 at 14:03, Axel IS Main wrote:
> >  
> >
> >>Guys, this isn't THAT stupid of a question is it? From my perspective, 
> >>the way PHP seems to see it is that I should already know what kind of 
> >>file I'm looking at. In most cases that's not an unreasonable 
> >>assumption. Unfortunately, that's only good for most cases. PHP is rich 
> >>in ways to work with the HTTP protocol, but has no way of detecting 
> >>whether it's opening a text file or a binary file. To me this is a 
> >>glaring omission. There has to be a way to do it, even if it's a 
> >>round-a-bout or backdoor kind of way. Nothing is impossible.
> >>
> >>Nick
> >>
> >>Axel IS Main wrote:
> >>
> >>
> >>
> >>>I'm using file_get_contents() to open URLs. Does anyone know if there 
> >>>is a way to look at the result and determine if the file is binary? 
> >>>I'd like to be able to block binaries from being processed without 
> >>>having to try to think of all the possible binary extensions and omit 
> >>>them with a function that looks for these extensions.
> >>>
> >>>Nick
> >>>
> >>>  
> >>>
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Robert Sossomon
Just place



In your web page in the location where the little box is.  Word wrap
typically only happens with images though, so you may have to turn your
text into an image, in which case you could just use a javascript
commands to change the image as needed.  If you are including the text
into a table it would be something like:


some text that keeps running and running



HTH,
Robert

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



[PHP] PHP 5

2004-02-23 Thread Karl Timmermann
Hi,

I am new to the list, so sorry if this has been asked before. I was 
wondering if anyone knew of an approx. date for the final release of 
PHP 5.0? I ask because I have a project to do semi-soon that uses XML 
and I would rather wait for PHP 5 and use the SimpleXML extension to 
make things easier. My client does not want to put beta software on 
their server, which is why I can't use B4.

Thanks!

Karl

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


Re: [PHP] Possible to write CRC/MD5 to the file?

2004-02-23 Thread Sean McCarthy
Hi,

At 04:20 23/02/2004, Simon Fredriksson wrote:
I wonder if it's possible to write the MD5 or CRC checksum of my 
scriptfile to the scriptfile. I know that if I change it, the value will 
change, but is there any way to calculate what it will be?
There's no way you can add the CRC after calculating it without modifing 
the CRC for that file. If you add the CRC after you have calculated it, you 
are indeed modifing the file, so the CRC would change.

If you want to just check the script file itself, you can create a custom 
CRC calculation for your scripts that calculates it just for a section of it:


//{CRC-START}
... your script stuff here
//{CRC-END}
?>
Just calculate the CRC between the tags and add it. Be sure you don't 
modify the contents between the tags (carriage returns, etc), since it will 
change the CRC of the file.

Also remember that the CRC will change if you upload the file through FTP 
in ASCII mode between Windows/Linux, so the CRC check will also fail.

Sean McCarthy 

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


[PHP] Send mail with attached

2004-02-23 Thread francesco
Hi all,
is possible to send an email, with mail() function, with an attached?
I see on www.php.net but there isn't nothing about this.
If someone have the solution please send the solution.
Thanks in advance.
Frank
[EMAIL PROTECTED]
www.automationsoft.biz
 

Re: [PHP] Detecting Binaries

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 14:19, Axel IS Main wrote:
> Yes, and in fact that is what I am doing now. This is a spider bot 
> though, so I'm having to think of every single type of binary file that 
> could be linked to on the web. So far I'm up to 28 with no end in sight. 
> What about a .com file? I can't omit links that end in .com can I? That 
> would be counterproductive to say the least. Also, the function that 
> does the checking just keep getting longer and longer, which makes the 
> spider go slower and slower. Granted, the thing is pretty fast if it has 
> enough BW to work with, but still. This could eventually turn into a 
> script killer. Detecting whether the stream from file_get_contents(), or 
> fopen() for that matter, is binary or not and going with that result is 
> the elegant solution to this problem. There has to be a way to do it.

You could trying writing a script to check the first several bytes of
the file for control characters.  If the first 1kb is >= 20% (randomly
pulled from my head) control characters it's a safe bet it is a binary
file.  This is not 100% accurate, but it's something to play with that
doesn't rely on mime types or file extensions, both of which can easily
be inaccurate.

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Marek Kilimajer
Generally, binaries have \0 in them, but it is not necessery.

Axel IS Main wrote:
Guys, this isn't THAT stupid of a question is it? From my perspective, 
the way PHP seems to see it is that I should already know what kind of 
file I'm looking at. In most cases that's not an unreasonable 
assumption. Unfortunately, that's only good for most cases. PHP is rich 
in ways to work with the HTTP protocol, but has no way of detecting 
whether it's opening a text file or a binary file. To me this is a 
glaring omission. There has to be a way to do it, even if it's a 
round-a-bout or backdoor kind of way. Nothing is impossible.

Nick

Axel IS Main wrote:

I'm using file_get_contents() to open URLs. Does anyone know if there 
is a way to look at the result and determine if the file is binary? 
I'd like to be able to block binaries from being processed without 
having to try to think of all the possible binary extensions and omit 
them with a function that looks for these extensions.

Nick


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


Re: [PHP] PHP 5

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 14:25, Karl Timmermann wrote:
> I am new to the list, so sorry if this has been asked before. I was 
> wondering if anyone knew of an approx. date for the final release of 
> PHP 5.0? I ask because I have a project to do semi-soon that uses XML 
> and I would rather wait for PHP 5 and use the SimpleXML extension to 
> make things easier. My client does not want to put beta software on 
> their server, which is why I can't use B4.

It will be released when it is done.  AFAIK there is not a release date
yet at all.  It will be released when enough bugs are fixed and enough
people do not complain about it not working right when they use it.  If
you want to shorten the time to release you can always go and fix some
bugs. :)

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP] preg guru again.....

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 11:36, pete M wrote:
> Here is a snippet
> ð­:2002020720020208:[EMAIL 
> PROTECTED]://www.lyricsworld.com/cgi-bin/search.cgi?q=Bruce
> +Springsteen&m=phrase&ps=20&o=0&wm=wrd&ul=&wf=1ð­ð­ð­ð­
> 
> it breaks down in the following elements
> the :date: in the format mmddmmdd
> The expression I'm using is
> (":16[0-9]:")
> ie matching the : with 16 digits :

here's a start:
/:(\d+):([EMAIL PROTECTED])@([\w&=+\/:\\%-]+)/i

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re[2]: [PHP] Detecting Binaries

2004-02-23 Thread Richard Davey
Hello Axel,

Monday, February 23, 2004, 7:38:25 PM, you wrote:

AIM> Thanks, you just gave me the solution, I think. I don't have to strip
AIM> out every character above standard ascii, I just have to look for them.
AIM> If one is there, then just get rid of it. It's true that an OS can't
AIM> tell the difference between a jpg and an exe file, but that's to be
AIM> expected. But the file_get_contents() function DOES open the file. Since
AIM> there is a definite difference between a text file and a binary file, it
AIM> should be able to detect that.

The difference isn't as obvious as you might think. Opening a binary
file into a hex editor will show you this. Your brain can determine if
the codes in-front of you are "English" or not, but from a pure logic
point of view that's a little harder.

Also bear in mind that on Unix ALL files are binary files. It is up to
you to determine the type of the file contents as you see fit. For
example you can check for line-terminated data.

It would be wise to check for characters from 0 to 31, if they appear
then it's almost certainly (but not guaranteed) binary.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Detecting Binaries

2004-02-23 Thread Axel IS Main
Thanks, that's very helpful. It beats the heck out of doing it the way 
I've been doing it.

Richard Davey wrote:

Hello Axel,

Monday, February 23, 2004, 7:38:25 PM, you wrote:

AIM> Thanks, you just gave me the solution, I think. I don't have to strip
AIM> out every character above standard ascii, I just have to look for them.
AIM> If one is there, then just get rid of it. It's true that an OS can't
AIM> tell the difference between a jpg and an exe file, but that's to be
AIM> expected. But the file_get_contents() function DOES open the file. Since
AIM> there is a definite difference between a text file and a binary file, it
AIM> should be able to detect that.
The difference isn't as obvious as you might think. Opening a binary
file into a hex editor will show you this. Your brain can determine if
the codes in-front of you are "English" or not, but from a pure logic
point of view that's a little harder.
Also bear in mind that on Unix ALL files are binary files. It is up to
you to determine the type of the file contents as you see fit. For
example you can check for line-terminated data.
It would be wise to check for characters from 0 to 31, if they appear
then it's almost certainly (but not guaranteed) binary.
 

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


Re: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Nicole
I'm not having much luck explaining what I want here ... a drawback of
emailing.  I know how to include files, I just wanted to include it in such
a way that my body text still wrapped around it.

I think I need to tackle this using HTML.

"Robert Sossomon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Just place
>
>include "box_info.php";
> ?>
>
> In your web page in the location where the little box is.  Word wrap
> typically only happens with images though, so you may have to turn your
> text into an image, in which case you could just use a javascript
> commands to change the image as needed.  If you are including the text
> into a table it would be something like:
>
> 
> some text that keeps running and running
>include "box_info.php";
> ?>
> 
>
> HTH,
> Robert

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



Re: [PHP] delete a function

2004-02-23 Thread Adam Bregenzer
On Sun, 2004-02-22 at 07:25, Sztankó Demeter wrote:
> I'm not sure that I want to start OOP-ing in my php code, but I will if
> necessary.

Ok, I have below a non-OO response.  Personally, while I enjoy the OO
methodology, I don't think it is the "one true way."  I adhere to the
philosophy that anything that can be done using OO can also be done
without it.

> I'l tell the problem I want to solve. It also will help me to understand the
> problem:
> 
> There are two (or more) different functions on my web site, that have the
> same name (an action). They are called depending on the permittions of the
> end user. (for example, if it is an unregistered user, then it is redirected
> to registration form, if it is a registered user, some table is generated
> from database, if it a administrator user, some additional controls a shown
> that allow to change the table). I want to have the code clean so I don't
> want to put the switch or if operators to it. I will call the wrapper that
> will check the grant of the user and call apropriate function. (For example:
> Load_action("List"))
> 
> So there is a set of grant properties assigned to each function and a list
> (array, whatever) of such functions is assigned to the action. The wrapper
> walks through the list and finds the first function which grant properties
> match the user grant properties.
> 
> The second side is that I want to make the coding very easy and simple. So
> if I want don't want to bother with the name of the functions a write for
> the action. I want to write the function, and call some method that accepts
> action name and a permission set as an argument (permission set will be a
> string that will be evaluted by the wrapper), for example  :
> Add_function_to_container("List","(P_READ AND P_WRITE) OR P_ADMIN","Some
> kind of description of this function");
> This method adds the copy of function to array then deletes the original
> function, so I can use the same function name next time. (For simplicity,
> the function names is always the same as the action name, so it always knows
> which function to add)
> 
> This will also simplify the process of writing developers documentation.

I like your approach, I am glad to see someone wanting to use some
design forethought to save time down the road.  Just make sure you stay
flexible.

> 1.
> I wouldn't be so lazy and will make another function name. For example if
> there is an action called List, then there will be following functions:
> function Action_List_1()
> function Action_List_2()
> function Action_List_3()
> The wrapper then looks up for the new function with the help of
> get_defined_functions() and adds the Action_List_...() function that is
> still not in the list.

One spin off on this design would be to setup a naming convention to
your functions.  Action_List() could become:
Action_List_nouser()
Action_List_user()
Action_List_admin()

You could have a function that pairs a "List" call with the user's state
and generates the function call:
$func = 'Action_' . $func_name . '_' . $user_state;
$output = $func($args);

> 2.
> I will make same kind of an abstract class called the same way as action and
> there will be derived classes that implement the functions.
> This sounds nice but a little bit cumbersome. There will be 200 actions and
> I don't want to write an abstract class for each of them.This contradicts my
> philosophy of lazyness.

You can aggregate this with the Command pattern Michal mentioned
earlier.  I would recommend using a variation of the Command pattern to
collect your actions, then use the Factory pattern to manage your user
states and select the appropriate set of actions.  This will give you a
lot of flexibility down the road at the expense of some additional
programming now.  You should not need to create abstract classes for
each action, however you will need classes to handle creation,
execution, etc. of these classes.  IMHO laziness is a boon to
programming, over implementation will be the death of us all. :)

> 3.
>  Some great idea that You will provide. Maybe based on OOP, maybe not, but
> it is easy to code and perfect.

Here's another non-OO solution.  You could define these functions in
their own files.  For example, hold all the admin versions of these
functions in an admin include, do the same for user, etc.  Then include
the appropriate file based in the user's state and proceed from there. 
You will not need to worry about having duplicate function names, though
the implementation will be somewhat unique.  Also, if a user changes
state you will have to issue an HTTP redirect to reload the correct
functions.  Fortunately, I would guess that would rarely, if ever,
happen in the middle of a script's execution.

In looking for a non-OO solution, my opinion is that option 1 would be
the best.  It is easy to implement and documentation/code reading will
be easier as time passes.  Having multiple functions with the same name
performing different tasks p

[PHP] Embedded MySQL server (libmysqld)?

2004-02-23 Thread user
Howdy --
Would someone point or provide me with an example of PHP + libMysqld 
(Embedded MySQL server)?

 My problem is my churchs web site doesn't provide a MySQL database as 
a default package (add $15.95/mo)for a MySQL Db.

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


[PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Justin Patrin
Lukas Smith wrote:

Justin Patrin wrote:

I think you're confusing the issue. PEAR DB does support many 
databases, but it only loads the code for the ones that you are 
currently using. So if you're using one database it is effectively a 
one database API.

Jakes wrote:

What is performance like using this class? I've gone through the 
class and
it just seams to be over kill, for a DB API (13 databases).

Are there any time stats showing the different time in using a single 
DB API
class to the PEAR class.


Yes things are really not that bad. However expect to give up somewhere 
a fairly significant amount of performance. If you are using an 
abstraction layer you have to do it with a good reason (you need to 
support multiple databases mainly :-)  ).

Here is a benchmark John Lim came up with:
http://phplens.com/lens/adodb/
It only tests MySQL though and it implements a very unrealistic 
scenario. The reason that ADODB scores so high can be read here:
http://marc.theaimsgroup.com/?l=pear-dev&m=100793507904834&w=2

Well, yes, you're going to lose some processing time using an 
abstraction layer, but IMHO the pros far outweight the cons, even if you 
don't need ot support multiple DBs.
  1) Many very useful utility functions which will give you the data 
you want and automatically free resources for you, such as getRow(), 
getAll(), and getOne().
  2) Good and easy to use error handling (this is very important, 
believe me).
  3) A unified architecture for mysql and Oracle. You don't have to 
remember different functions for use with different databases.
  4) You never know when you might want to switch to another DB.
  5) You never know someone else using your code might want to switch 
to another DB.

The company I'm at now had an abstraction layer of their own (for all of 
these reasons) and it wasn't nearly as good as PEAR DB even after all of 
the work I put into it. I just didn't have the time to deal with it all 
on my own. I'd much rather use PEAR DB which has lots of developers 
working on it and using it, finding bugs and making patches. :-)

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


[PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread Adam Voigt
Check these guys out:

http://spenix.com/WebHostingPlans.aspx

Very cheap, very reliable, great features, and support is second to none
I've ever experienced, and before you ask, no I'm not now nor have I
ever been an employee or shareholder. =) Just a satisfied customer.

On Mon, 2004-02-23 at 09:53, [EMAIL PROTECTED] wrote:
> Howdy --
> Would someone point or provide me with an example of PHP + libMysqld 
> (Embedded MySQL server)?
> 
>   My problem is my churchs web site doesn't provide a MySQL database as 
> a default package (add $15.95/mo)for a MySQL Db.
> 
> TIA,
> David
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Richard Davey
Hello Justin,

Monday, February 23, 2004, 4:11:40 PM, you wrote:

JP>3) A unified architecture for mysql and Oracle. You don't have to
JP> remember different functions for use with different databases.

That abstraction only abstracts the functions to connect to, select and
query the database, surely? Oracle/SQL Server/MySQL all use slightly
different SQL syntax - so if the query you pass in has to be unique
depending on the database in hand - you're already having to remember
a stack of system specific SQL and will have to code your application
to take into consideration all of those different syntax.

What I'm trying to say is that abstracting the connection to the
database is the easy part, writing an application that will support
them all is another matter.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread user
Adam Voigt wrote:
Check these guys out:

http://spenix.com/WebHostingPlans.aspx

Very cheap, very reliable, great features, and support is second to none
I've ever experienced, and before you ask, no I'm not now nor have I
ever been an employee or shareholder. =) Just a satisfied customer.
Admin --
There is no shortage of good cheap hosting package.
The choice of hosting providers is out of my hands.
What I'm looking for is a way to implement a  relational database in 
docuument_root of the web site (ie. /home/username)?

David

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


Re: [PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread Adam Voigt
Alright, well with any txt based system, your probably going to run into
problems with multi-users (multiple browsers) updating the DB.

Reguardless, if you must use txtbased, I recommend SQL-Lite, it supports
SQL statements, and is very small and very fast.

http://www.sqlite.com



On Mon, 2004-02-23 at 11:53, [EMAIL PROTECTED] wrote:
> Adam Voigt wrote:
> > Check these guys out:
> > 
> > http://spenix.com/WebHostingPlans.aspx
> > 
> > Very cheap, very reliable, great features, and support is second to none
> > I've ever experienced, and before you ask, no I'm not now nor have I
> > ever been an employee or shareholder. =) Just a satisfied customer.
> > 
> Admin --
> There is no shortage of good cheap hosting package.
> The choice of hosting providers is out of my hands.
> 
> What I'm looking for is a way to implement a  relational database in 
> docuument_root of the web site (ie. /home/username)?
> 
> David
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Justin Patrin
Richard Davey wrote:

Hello Justin,

Monday, February 23, 2004, 4:11:40 PM, you wrote:

JP>3) A unified architecture for mysql and Oracle. You don't have to
JP> remember different functions for use with different databases.
That abstraction only abstracts the functions to connect to, select and
query the database, surely? Oracle/SQL Server/MySQL all use slightly
different SQL syntax - so if the query you pass in has to be unique
depending on the database in hand - you're already having to remember
a stack of system specific SQL and will have to code your application
to take into consideration all of those different syntax.
What I'm trying to say is that abstracting the connection to the
database is the easy part, writing an application that will support
them all is another matter.
Very true. In that case, you can use a package such as DB_DataObject or 
DB_QueryTool to abstract the SQL as well.

Or you can use fairly simple SQL with just a few rules and you should be 
fine. For instance, always select columns as upper case (for Oracle 
compatibility) or always convert them to lower case 
(DB_PORTABILITY_LOWERCASE), always use DB::quoteSmart() for values and 
DB::quoteIdentifier() for table / column names, etc.

The real hairy part is dealing with joins as the syntax is very 
different across the DBs. This can be solved by simply not doing them or 
using a syntax that most use. Or you can try to use DB_DataObject, but 
I'm not sure it works for all DBs yet.

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


Re[2]: [PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Richard Davey
Hello Justin,

Monday, February 23, 2004, 5:30:16 PM, you wrote:

JP> The real hairy part is dealing with joins as the syntax is very 
JP> different across the DBs. This can be solved by simply not doing them or

I wish :)

JP> using a syntax that most use. Or you can try to use DB_DataObject, but
JP> I'm not sure it works for all DBs yet.

Yeah, I thought as much. I think if I was creating an application to
be distributed open-source on the Internet it'd make life easier
for other developers if it used something like the PEAR-DB class, but
when you're building your own/companies site and know the environment
it lessens the value somewhat.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] PHP Alternative to IFRAME?

2004-02-23 Thread Chris W. Parker
Nicole 
on Monday, February 23, 2004 12:06 PM said:

> I'm not having much luck explaining what I want here ... a drawback of
> emailing.  I know how to include files, I just wanted to include it
> in such a way that my body text still wrapped around it.

myfile.php:
here is some more body text.\n";

?>

main.php:



that will output:

here is some body text. here is some body text. here is some body text.
here is some body text. here is some body text. here is some body text.
here is some more body text.
here is some body text. here is some body text. here is some body text.
here is some body text. here is some body text. here is some body text.


hth,
chris.

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



Re: [PHP] Php and GpG

2004-02-23 Thread Evan Nemerson
On Monday 23 February 2004 10:49 am, Adam Bregenzer wrote:
> On Mon, 2004-02-23 at 08:35, Paul Marinas wrote:
> > Those anyone know hoh to use php with gpg. I've tryed gpgext, but doesn't
> > seems to work maybe my php is not compiled with some kind of support.
>
> You will need to call gpg from your script using either a socket
> connection[1], something from the exec family[2], or backticks[3].

I seem to remember someone writing an extension using GPGME, but IIRC GPGME is 
GPL'd so there may be some licensing issues... worth a look, though
>
> [1] http://www.php.net/popen
> [2] http://www.php.net/ref.exec
> [3] http://www.php.net/operators.execution
>
> --
> Adam Bregenzer
> [EMAIL PROTECTED]
> http://adam.bregenzer.net/

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

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



Re: Re[2]: [PHP] Detecting Binaries

2004-02-23 Thread Evan Nemerson
On Monday 23 February 2004 11:55 am, Richard Davey wrote:
> Hello Axel,
>
> Monday, February 23, 2004, 7:38:25 PM, you wrote:
>
> AIM> Thanks, you just gave me the solution, I think. I don't have to strip
> AIM> out every character above standard ascii, I just have to look for
> them. AIM> If one is there, then just get rid of it. It's true that an OS
> can't AIM> tell the difference between a jpg and an exe file, but that's to
> be AIM> expected. But the file_get_contents() function DOES open the file.
> Since AIM> there is a definite difference between a text file and a binary
> file, it AIM> should be able to detect that.
>
> The difference isn't as obvious as you might think. Opening a binary
> file into a hex editor will show you this. Your brain can determine if
> the codes in-front of you are "English" or not, but from a pure logic
> point of view that's a little harder.
>
> Also bear in mind that on Unix ALL files are binary files. It is up to
> you to determine the type of the file contents as you see fit. For
> example you can check for line-terminated data.
>
> It would be wise to check for characters from 0 to 31, if they appear
> then it's almost certainly (but not guaranteed) binary.

Assuming that's decimal, you're including 0x09 0x0a and 0x0d which are, 
respectively, tab, line feed, and carriage return. That's off the top of my 
head, which means two things: (1) i may be forgetting something, and (2) I 
need a life ;)

I'm not up to speed on this thread, but perhaps you could (ab)use some 
techniques from natural language processing? May be overkill, though ;)

>
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

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



[PHP] Re: XSLT in php v5 beta 4

2004-02-23 Thread Ryan C. Creasey

Steve Dieke wrote:
| I am guesing that I have installed something incorrectly.  I am trying to
| use the function xslt_create().  I installed php v5 Beta 4 successfully.
| but when I try to use the function xslt_create() I get the following
| error:
| 
| Fatal Error: Call to undefined function xslt_create()

I too am having difficulty getting this up on our development boxes.  I've
installed php5a5 via FreeBSD ports, and get the same error.  My
configuration options are here:

http://hastur.p11.com/phpinfo.php

>From my understanding, I know that there are major changes to XML/XSL in
php5, but is there anywhere documenting their changes explicitly?  I've
just read a bunch of lip service saying that it's changing, but I have no
idea how it'll affect my xml/xhtml apps when php5 goes release.  I'd love
to get a head start on it now, but have to get this working right.

Are the XSL functions used with php4/sablotron going to be supported in the
php5/libxml implementations?  Or am I going to have to re-code a bunch of
my xsl functions?

-- 
Ryan C. Creasey
Network Engineer
p11creative, inc.

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



Re: [PHP] Send mail with attached

2004-02-23 Thread janet
In a message dated 2/23/2004 11:41:00 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:

>is possible to send an email, with mail() function, with an attached?
>I see on www.php.net but there isn't nothing about this.
>If someone have the solution please send the solution.
>Thanks in advance.
>Frank

You do it by including an email header that instructs that the message be
sent as an attachment, like the following:

$to = "[EMAIL PROTECTED]";
$subj = "Testing an attachment";
$mess = "This is the test message.";
$headers = "Content-disposition: attachment; filename=test.txt\n";
$mailsend = mail($to,$subj,$mess,$headers);

This will send the message in $mess as an attachment with the filename
test.txt.

Good Luck,

Janet

---
Janet Valade, 
Author, PHP & MySQL for Dummies
Author, PHP 5 for Dummies
 

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



Re: [PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
Sam Masiello wrote:

If the PHP configuration doesn't have "register_globals" turned on in
the php.ini file, you will be able to access the form variables via the
_POST array like this:
$_POST["my_form_var"]

Of course, substitute my_form_var with the correct variable from the
form that you are submitting.
If the server does have register_globals turned on you can access the
variables just as they are named in the form.  For example, if you have
a text input field named "lastname", you can access the value in that
text box using the variable $lastname.
Thanks, but how do I get the info submitted to the PHP 
script to access the data in the first place? Since the 
target of the form is the Perl script, the submit button 
submits the form to the Perl script; can I add a second 
button of some type to submit the form to a different 
location (the PHP script)? Or can I use the DOM (ie 
document.formname.fieldname.value) to grab the data straight 
from the fields and then pass it on somehow?

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: hello

2004-02-23 Thread Nathan Torkington
On Feb 24, 2004, at 6:45 AM, BAO RuiXian wrote:
Based on the style of message body (short and shout), and the subject 
line, and the zip attachment, I conclude it as a virus. It may or may 
not a virus in face, I immediately delete it anyway:)
Yeah, that's a bloody virus on someone else's machine, using my e-mail 
address.  The curse of a long-lived address 

Nat
(aka gnat AT frii.com)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] saving form data

2004-02-23 Thread Richard Davey
Hello Charlie,

Monday, February 23, 2004, 9:27:07 PM, you wrote:

CFI> Thanks, but how do I get the info submitted to the PHP
CFI> script to access the data in the first place? Since the 
CFI> target of the form is the Perl script, the submit button 
CFI> submits the form to the Perl script; can I add a second 
CFI> button of some type to submit the form to a different 
CFI> location (the PHP script)? Or can I use the DOM (ie 
CFI> document.formname.fieldname.value) to grab the data straight 
CFI> from the fields and then pass it on somehow?

You can't make one form submit to two different scripts sadly, but to
be honest if you're going to write a PHP script to capture this
information - why not make it do what the Perl formmail script does
too? (i.e. send the email) and remove the Perl script from the
equation?

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re[4]: [PHP] Detecting Binaries

2004-02-23 Thread Richard Davey
Hello Evan,

Monday, February 23, 2004, 8:57:43 PM, you wrote:

>> It would be wise to check for characters from 0 to 31, if they appear
>> then it's almost certainly (but not guaranteed) binary.

EN> Assuming that's decimal, you're including 0x09 0x0a and 0x0d which are,
EN> respectively, tab, line feed, and carriage return. That's off the top of my
EN> head, which means two things: (1) i may be forgetting something, and (2) I
EN> need a life ;)

Let me rephrase - check for the existence of characters 0 through 31
and count how many there are. Set a percentage weight yourself and
figure out in your script if you deem the quantity too many or too
few.

The count_chars() function will be absolutely ideal for this.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] saving form data

2004-02-23 Thread Charlie Fiskeaux II
Richard Davey wrote:

You can't make one form submit to two different scripts sadly, but to
be honest if you're going to write a PHP script to capture this
information - why not make it do what the Perl formmail script does
too? (i.e. send the email) and remove the Perl script from the
equation?
It's just a matter of development time; if there's a way to 
use the Perl mail script with a PHP data saving script, it 
would save time. If I do have to rewrite the whole thing in 
PHP, how would I accept uploaded file attachments and attach 
them to the emailed form results?

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem deleting a cookie...

2004-02-23 Thread Dave O
Hi all.  I'm currently experiencing a problem deleting cookies on a test 
server.  Before I go on, here's the server info:

Server 1
--
Apache 1.3.29
PHP Version 4.3.4
Server 2
--
Apache 2.0.48
PHP Version 4.3.4
Previously running PHP 5.0.0.a4
I've got a technical support app running on Server 1.  Well I wanted to 
add some features and started playing around with PHP 5 and Apache 2 on 
Server 2.  So, I tried out some of my scripts that used the following 
for using cookies.

Here's what I use to set the cookie.
$value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
SetCookie("Trackookie", $value, 0, "", "server.mssystems.com" );
Here's what I use to delete the cookie.
SetCookie("Trackookie", "", time()-3600, "", "support.mssystems.com" );
Now, creating the cookie is no problem.  Deleting the cookie is where I 
started having problems on Server 2.  At first, I thought it was PHP5 so 
I went to PHP4.  However, I still kept having the same problem.

Looking at the headers using Mozilla Live-Headers I was able to see that 
this was sent from both servers:

Set-Cookie: Trackookie=deleted; expires=Sun, 23-Feb-2003 22:47:22 GMT; 
domain=server.mssystems.com

However, if I look at the Mozilla cookie manager, I still see the cookie 
there for Server 2.  If I try the same thing on Server 1, the cookie 
gets deleted without any problems.

I suspect it may be due to my using Apache 2 and downgrading won't be a 
problem, but I wanted to check first if anyone had been experiencing the 
same problems.

I should add, though, that I was a little overzealous and added quite a 
few extensions on Server 2 in order to experiment with them.  Have there 
been any reports of extensions causing confllicts with cookies.

Thanks and I appreciate any general comments or advice about this.

do

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


Re: [PHP] Re: Problem deleting a cookie...

2004-02-23 Thread Dave O
Forgot to -cc the list.
André Cerqueira wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 > Here's what I use to set the cookie.
 > $value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
 > SetCookie("Trackookie", $value, 0, "", "server.mssystems.com" );
 >
 > Here's what I use to delete the cookie.
 > SetCookie("Trackookie", "", time()-3600, "", "support.mssystems.com");
the domain is different
one of them uses one domain for creating and deleting, the other uses 
the other domain, right?
check that...


Sorry, didn't proofread my initial message.  I wish it were that easy as 
what you pointed out.  Here are the actual commands used in the script

Server 1 (support.mssystems.com)

Set cookie:
$value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
SetCookie("Trackookie", $value, 0, "", "support.mssystems.com" );
Delete cookie:
SetCookie("Trackookie", "", time()-3600, "", "support.mssystems.com" );
Server 2 (token.mssystems.com)

Set cookie:
$value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
SetCookie("Trackookie", $value, 0, "", "token.mssystems.com" );
Delete cookie:
SetCookie("Trackookie", "", time()-3600, "", "token.mssystems.com" );
As I stated in the initial post, the only difference between the two 
servers is the apache version (1.3.29 vs 2.0.48).  These are virtual 
hosts and the php directives are the same for both servers.  This just 
seems very puzzling.

do

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


[PHP] Re: To Separate, or Not to Separate

2004-02-23 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
i think if the most accessed fields are much smaller than the hole 
thing, you can consider splitting it
whats the average size of your records?
whats the size of the fields you access the most? (check your sql's for 
that one...)
amount of records would influence that decision too

btw, if they are all 0/1 preferences, maybe you could put them all in a 
single field using set or some int type with 1 bit for each preference 
(int would be enough for 32 preferences flags)

Monty wrote:
I have a member DB table that has about 50 fields in it for each record. It
holds things like username, password, mailing address, and general site
preferences. 

I'm wondering if I will see any noticeable speed increase if I were to split
the 20+ fields that hold preferences (nearly all are single-digit 1/0
fields) out from the other fields that hold general member data, and put
them into their own table? Or maybe there's some other good reason for doing
this that I'm not aware of?
I'd actually prefer to keep it all together, because it's a lot easier to
update a single table in MySQL than several if a member makes changes to
their account or preferences.
What do you think?

Monty.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAOo/WaxdA/5C8vH8RAq6mAJ49bHhJbFDxPvwU16HSc2DiLRjLJwCaAhoi
SyJaWOebs87TP+eDC53foNc=
=5Rhw
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Finding out the local path to a file.

2004-02-23 Thread Simon Fredriksson
I'm wondering if there's a way for PHP fo know the local path of 
REQUEST_URI. I've used a script to list directories, in order to replace 
the looks of the traditional Indexes look (apache). By setting 
DirectoryIndex to a fixed file (/list/lister.php) that file is now 
executed whenever there's no other indexfile in the folder. But how can 
I let it know which folder to work in? Let's say that it gets 
example.com/~simon/files/ as URL. All the local variables I've seen by 
using phpinfo() point to the location of the file, not the folder I'm 
requesting.

Any ideas?

//Simon

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


[PHP] Re: Problem deleting a cookie...

2004-02-23 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> Here's what I use to set the cookie.
> $value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
> SetCookie("Trackookie", $value, 0, "", "server.mssystems.com" );
>
> Here's what I use to delete the cookie.
> SetCookie("Trackookie", "", time()-3600, "", "support.mssystems.com");
the domain is different
one of them uses one domain for creating and deleting, the other uses 
the other domain, right?
check that...



Dave O wrote:

Hi all.  I'm currently experiencing a problem deleting cookies on a test 
server.  Before I go on, here's the server info:

Server 1
--
Apache 1.3.29
PHP Version 4.3.4
Server 2
--
Apache 2.0.48
PHP Version 4.3.4
Previously running PHP 5.0.0.a4
I've got a technical support app running on Server 1.  Well I wanted to 
add some features and started playing around with PHP 5 and Apache 2 on 
Server 2.  So, I tried out some of my scripts that used the following 
for using cookies.

Here's what I use to set the cookie.
$value=(time() + 9000) . ":$uid:$username:$gid:$fullname";
SetCookie("Trackookie", $value, 0, "", "server.mssystems.com" );
Here's what I use to delete the cookie.
SetCookie("Trackookie", "", time()-3600, "", "support.mssystems.com" );
Now, creating the cookie is no problem.  Deleting the cookie is where I 
started having problems on Server 2.  At first, I thought it was PHP5 so 
I went to PHP4.  However, I still kept having the same problem.

Looking at the headers using Mozilla Live-Headers I was able to see that 
this was sent from both servers:

Set-Cookie: Trackookie=deleted; expires=Sun, 23-Feb-2003 22:47:22 GMT; 
domain=server.mssystems.com

However, if I look at the Mozilla cookie manager, I still see the cookie 
there for Server 2.  If I try the same thing on Server 1, the cookie 
gets deleted without any problems.

I suspect it may be due to my using Apache 2 and downgrading won't be a 
problem, but I wanted to check first if anyone had been experiencing the 
same problems.

I should add, though, that I was a little overzealous and added quite a 
few extensions on Server 2 in order to experiment with them.  Have there 
been any reports of extensions causing confllicts with cookies.

Thanks and I appreciate any general comments or advice about this.

do
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAOpAPaxdA/5C8vH8RAndlAKCd3n+pH4DxylGSLpJ4bPJSc3TiUQCeP8oR
G7W4tri3muQTIjPklUi8Yk0=
=rBso
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Detecting Binaries

2004-02-23 Thread Axel IS Main
That's not bad, but I found a way to do it simply using chr() and 
passing it a value. It turns out the if I go 0-31 Almost nothing will 
get through. Even the simples html has something in there from that 
list. However, by just looking between 14 and 26, one more than carriage 
return, and one less than escape, it worked really well. I crawled a 
site with a large number of jpg, gif, mp3, wav, and pdf files. Of the 
100's of binaries there only one pdf got through. Not a bad record. I 
also found that in order for this to work I have to process the URLs. 
This makes things really slow so I'm going to have to use both this and 
the "check for extension" function together. Still, I can worry a lot 
less about getting my index weighted down by binary files. The code is 
pretty basic at this point, but here it is:

   // Check for binaries
   $ckbin = 14;
   while($ckbin <= 26){
   $ck = chr($ckbin);
   $cbin = substr_count($read, $ck);
   if($cbin > 0){
   echo "Killing off binary file URL: $url\n";
   $kill = mysql_unbuffered_query("DELETE FROM search WHERE 
url_id='$url_id'");
   continue 2;
   }
   ++$ckbin;
   }
I know it looks kind of funky out of context, but it works really great.

Nick

Richard Davey wrote:

Hello Evan,

Monday, February 23, 2004, 8:57:43 PM, you wrote:

 

It would be wise to check for characters from 0 to 31, if they appear
then it's almost certainly (but not guaranteed) binary.
 

EN> Assuming that's decimal, you're including 0x09 0x0a and 0x0d which are,
EN> respectively, tab, line feed, and carriage return. That's off the top of my
EN> head, which means two things: (1) i may be forgetting something, and (2) I
EN> need a life ;)
Let me rephrase - check for the existence of characters 0 through 31
and count how many there are. Set a percentage weight yourself and
figure out in your script if you deem the quantity too many or too
few.
The count_chars() function will be absolutely ideal for this.

 



RE: [PHP] saving form data

2004-02-23 Thread Gary Sanders
Charlie,

Can you make the submit target be the PHP script and have the PHP script
call the Perl script to send the email?

Gary

> -Original Message-
> From: Charlie Fiskeaux II [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 2:15 PM
> To: PHP General
> Subject: Re: [PHP] saving form data
> 
> 
> Richard Davey wrote:
> 
> > You can't make one form submit to two different scripts 
> sadly, but to 
> > be honest if you're going to write a PHP script to capture this 
> > information - why not make it do what the Perl formmail script does 
> > too? (i.e. send the email) and remove the Perl script from the 
> > equation?
> > 
> 
> It's just a matter of development time; if there's a way to 
> use the Perl mail script with a PHP data saving script, it 
> would save time. If I do have to rewrite the whole thing in 
> PHP, how would I accept uploaded file attachments and attach 
> them to the emailed form results?
> 
> -- 
> 
> Charlie Fiskeaux II
> Media Designer
> Cre8tive Group
> cre8tivegroup.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP] system / exec Question...

2004-02-23 Thread Gary Sanders
Title: Message



Hello... I'm using 
with PHP with Windows XP.  I just set it up today and terribly new to PHP 
(1st day).  Anyway, I'm having a problem calling an .exe file with system 
and exec.  I can call lots of other programs, but not this one.  Can 
you tell me what's the best way to debug a problem like this - or how I enable 
the debugging options?  
 
Thanks,
Gary
 
--  Give someone a fish, and he 
eats for a day.  Give him a fishing rod and he goes hungry until you give 
him the dam fish so he has some bait.  
;-)
Gary Sanders Sr. Engineer - 
replaytvDigital Networks North America 2600 San Tomas Expwy.Santa Clara, 
CA 95051-0953408-565-7103
 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Finding out the local path to a file.

2004-02-23 Thread Evan Nemerson
On Monday 23 February 2004 04:31 pm, Simon Fredriksson wrote:
> I'm wondering if there's a way for PHP fo know the local path of
> REQUEST_URI. I've used a script to list directories, in order to replace
> the looks of the traditional Indexes look (apache). By setting
> DirectoryIndex to a fixed file (/list/lister.php) that file is now
> executed whenever there's no other indexfile in the folder. But how can
> I let it know which folder to work in? Let's say that it gets
> example.com/~simon/files/ as URL. All the local variables I've seen by
> using phpinfo() point to the location of the file, not the folder I'm
> requesting.
>
> Any ideas?

dirname($_SERVER['SCRIPT_FILENAME'])?
>
> //Simon

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

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



RE: [PHP] Finding out the local path to a file.

2004-02-23 Thread Chris W. Parker
Evan Nemerson 
on Monday, February 23, 2004 4:33 PM said:

> dirname($_SERVER['SCRIPT_FILENAME'])?

__FILE__ will also do it.






chris.

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



Re: [PHP] saving form data

2004-02-23 Thread Evan Nemerson
On Monday 23 February 2004 02:51 pm, Charlie Fiskeaux II wrote:
> Richard Davey wrote:
> > CFI> It's just a matter of development time; if there's a way to
> > CFI> use the Perl mail script with a PHP data saving script, it
> > CFI> would save time. If I do have to rewrite the whole thing in
> > CFI> PHP, how would I accept uploaded file attachments and attach
> > CFI> them to the emailed form results?
> >
> > Then how about in reverse? Add something to the end of the Perl script
> > that passes the values to a PHP script? It could even do it via the
> > query string, maybe also passing an md5 encoded password that only
> > your two scripts know (in order to stop someone spoofing your script).
>
> I don't think that would work because they will need to save
> without sending the form. But I had thought about the
> reverse: a PHP script that saves the data and then possibly
> passes it on to the Perl script.
>
> Do you or anyone else know how to pass on form results in
> PHP to another script? (Like I said, I'm pretty new to PHP...)

Well you could try using an HTTP 302 Found or 307 Temporary Redirect, but IIRC 
clients must not redirect the request unless the response is received in 
response to a GET or HEAD request, so you'd have to use GET. I seem to 
remember reading something about uploading files, which is kinda difficult 
with GET...

Possibly your best option would be to send a POST request through the HTTPD 
via a socket- there are libraries out there to help you do this easily, try 
PEAR, hotscripts, phpclasses, etc.
>
> Thanks!
>
> --
>
> Charlie Fiskeaux II
> Media Designer
> Cre8tive Group
> cre8tivegroup.com
> 859/858-9054x29
> cell: 859/608-9194

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

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



  1   2   >