Re: [PHP] rmdir withour rmdir function.

2003-11-17 Thread Eugene Lee
On Mon, Nov 17, 2003 at 09:37:52PM -0500, Vincent M. wrote:
: 
: I can't use the function rmdir:
:  Warning: rmdir() has been disabled for security reasons
: 
: But I do need to delete a directory with php. How can I do ? Is there 
: any way to delete an empty directory without using the rmdir function ?
: 
: I tried to use the unlink function on the directory, but It does not 
: work, it only works for files...

Sounds like your PHP host did a thorough job of securing themselves.
If you can't do it, then you can't do it.  Then it's a matter of talking
to your PHP host's admin and convincing him that the feature you need is
worth the effort.

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



Re: [PHP] Single Session for different websites

2003-11-17 Thread Manisha Sathe
thanks for your soln, I searched the web, and got some readymade soln files
too, I have one question regarding this,

if my php.ini is giving me 'session.save_handler' as 'files'  and as server
is a shared server so i may not be able to change it, so what can we do to
resolve this ?

manisha

"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Manisha Sathe wrote:
>
> > I hv physically one single server, but with different websites on it
> >
> > like www.aaa.com / www.bbb.com / www.ccc.com
> >
> > Now the problem is about session. What I want is login page at
www.aaa.com
> > only but session  is accessible from www.bbb.com and www.ccc.com
> >
> > can it be possible, if yes how ? if no any other work around ?
>
> You can store the session information in a database that can be read
> from all three websites.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> ---
> "Documentation is like sex: when it is good,
>   it is very, very good; and when it is bad,
>   it is better than nothing."

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



[PHP] PHP and PayFlow Pro Issues

2003-11-17 Thread Henrik Hudson
Hey List-

Hoping someone can point me in the right direction :)

OS: FreeBSD 4.4, patched
OpenSSL: 0.9.7c
Apache: 1.3.27
PHP: 4.3.4
PayFlow: 3.06

I've compiled PHP with various flags and the Payflow flag, 
--with-pfpro=shared,/usr/local  and added the extension to the php.ini file.

Running phpinfo() shows that the extension loads and when I do a 
pfpro_version() I get 306 spit back at me. The problem is this:

No matter where I do a pfpro_init() it just spits me back to whatever site I'm 
coming from in Mozilla and IE just sits and spins it's wheels forever. I 
can't find any messages in any error log, anywhere (Apache or PHP) as to what 
it's doing or not doing.

If I bypass pfpro_init and just call the process function (pfpro_process) and 
it's happy with it's input then it still "freezes" doing the init call 
internally.

Running the test.sh script from the CLI works just fine as does passing 
arguments to the pfpro binary directly, but I would prefer to work from 
within the library and not do system calls.

Any suggestions on where to look? or solutions? Did I just miss a step in 
installation?

Thanks.

Henrik
-- 
Henrik Hudson
[EMAIL PROTECTED]

"`If there's anything more important than my ego
around, I want it caught and shot now.'" 
--Hitchhikers Guide to the Galaxy

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



Re: [PHP] Communicating with remote server

2003-11-17 Thread Burhan Khalid
Matt Palermo wrote:
I am writing a desktop application using PHP-GTK.  I would like this program
to be able to connect to a remote server, call some functions that I
specify, and return the right information (most likely from a MySQL db).  I
have access to the server, so I can create any and all functions that I
want, but I don't know how to connect to the remote server page and get all
the results.  I am new to cross-server comunication programming, so if
anyone knows of a very detailed and easy to learn tutorial please send me
the link.  I would appreciate any help you are willing to offer.
Consider using SOAP or XML-RPC

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] rmdir withour rmdir function.

2003-11-17 Thread Vincent M.
I'm not lucky, there is no ftp access to the server. This can sound a 
little strange, but there is no... :(

Marek Kilimajer wrote:
ftp_rmdir()

Vincent M. wrote:

Hello,

I can't use the function rmdir:
 Warning: rmdir() has been disabled for security reasons
But I do need to delete a directory with php. How can I do ? Is there 
any way to delete an empty directory without using the rmdir function ?

I tried to use the unlink function on the directory, but It does not 
work, it only works for files...

Thanks,
Vincent.
PS: list of disabled functions:
get_current_user, php_uname, putenv, set_time_limit, getmyuid, 
getmypid, dl, mail, ini_alter, ini_restore, ini_set, exec, passthru, 
system, popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp, 
diskfreespace, rmdir, realpath, tmpfile, link, imap_mail, email, 
mb_send_mail

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


[PHP] ereg_replace help

2003-11-17 Thread Martin Towell
Hi All,

I have an array of strings in the following format:
"abcd - rst"
"abcd - uvw"
"abcd - xyz"
"foobar - rst"
"blah - rst"
"googol - uvw"

What I want to do is strip everything from the " - " bit of the string to
the end, _but_ only for the strings that don't start with "abcd"

I was thinking something like the following:
echo ereg_replace("(!abcd) - xyz", "\\1", $str)."\n";
but obviously this doesn't work, otherwise I wouldn't be emailing the
list...

Can anyone help? I need to use ereg_replace() because it's part of our code
library and therefore can't change :(

TIA
Martin

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



[PHP] About iMail Help

2003-11-17 Thread D. Jame
Hi,

Anyone know about imail.?




Re: [PHP] Making a Search Function?

2003-11-17 Thread Ryan Thompson
To reduce the time it takes to process it all you might want to try using LIKE 
in your queries. This means your script will only have to process say 50 
instead of 10 000 results. (Not saying your DB is this big).

For example:
SELECT page FROM table_name WHERE description LIKE '%$keyword%';

This is all off the top of my head so the syntax might be off a little.
Read some SQL documentation about LIKE for more information.


On Monday 17 November 2003 21:56, Dimitri Marshall wrote:
> Hello...
>
> I'm trying to make a search function for my site. This is how it needs to
> work:
>
> First, a user types in a search (ex: niagara falls). All the words then get
> seperated or stay together, depending on the what the user selects in the
> form. I can figure this out, all I have to do is use the explode() right?
>
> Second, this array needs to search against a description on the database.
> What I was thinking is getting the description ($description) and then
> exploding that into an array and then comparing all arrays against each
> other.
>
> I'm pretty sure there's a way easier way to do this. Could someone
> enligthin me?
>
> Greatly appreciate any help in advance,
> Dimitri Marshall

-- 
"I have a photographic memory. I just forgot the film" --Unknown
=
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net



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



Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Rob Burris
Adam wrote:

My question, how do you guys build your pages? Do your scripts 
generate all the HTML? I'm looking for tips and resources. Remember 
for my first site I've embarked on a fairly large site. Code 
maintenance will be an issue for me as I need to enhance and fix it 
later on.

The practice I would recommend is to remember to use functions for any 
code that is reusable. I create a separate file that encapsulates all my 
functions and include that file in all my scripts. That way every 
function is available anywhere in the project, and you can always add to 
that list. This is just one way you can break down your projects into 
more manageable pieces.

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


Re: [PHP] rmdir withour rmdir function.

2003-11-17 Thread Marek Kilimajer
ftp_rmdir()

Vincent M. wrote:
Hello,

I can't use the function rmdir:
 Warning: rmdir() has been disabled for security reasons
But I do need to delete a directory with php. How can I do ? Is there 
any way to delete an empty directory without using the rmdir function ?

I tried to use the unlink function on the directory, but It does not 
work, it only works for files...

Thanks,
Vincent.
PS: list of disabled functions:
get_current_user, php_uname, putenv, set_time_limit, getmyuid, getmypid, 
dl, mail, ini_alter, ini_restore, ini_set, exec, passthru, system, 
popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp, diskfreespace, 
rmdir, realpath, tmpfile, link, imap_mail, email, mb_send_mail

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


[PHP] Making a Search Function?

2003-11-17 Thread Dimitri Marshall
Hello...

I'm trying to make a search function for my site. This is how it needs to
work:

First, a user types in a search (ex: niagara falls). All the words then get
seperated or stay together, depending on the what the user selects in the
form. I can figure this out, all I have to do is use the explode() right?

Second, this array needs to search against a description on the database.
What I was thinking is getting the description ($description) and then
exploding that into an array and then comparing all arrays against each
other.

I'm pretty sure there's a way easier way to do this. Could someone enligthin
me?

Greatly appreciate any help in advance,
Dimitri Marshall

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



Re: [PHP] Communicating with remote server

2003-11-17 Thread Marek Kilimajer
Vail, Warren wrote:
The caviate is that anyone who can come up with the correct url (and can
access your database machine), will be able to trigger the extract of data.
If this is not acceptable, then you need to consider other options.
https connection and some secret string in a get variable or ip address 
check will make it secure.

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


[PHP] rmdir withour rmdir function.

2003-11-17 Thread Vincent M.
Hello,

I can't use the function rmdir:
 Warning: rmdir() has been disabled for security reasons
But I do need to delete a directory with php. How can I do ? Is there 
any way to delete an empty directory without using the rmdir function ?

I tried to use the unlink function on the directory, but It does not 
work, it only works for files...

Thanks,
Vincent.
PS: list of disabled functions:
get_current_user, php_uname, putenv, set_time_limit, getmyuid, getmypid, 
dl, mail, ini_alter, ini_restore, ini_set, exec, passthru, system, 
popen, leak, mysql_list_dbs, listen, chown, chmod, chgrp, diskfreespace, 
rmdir, realpath, tmpfile, link, imap_mail, email, mb_send_mail

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


Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Robert Cummings
On Mon, 2003-11-17 at 20:47, Jason Godesky wrote:
> 
> There's certainly nothing wrong with putting bits of PHP into a primarily 
> HTML document, but for very large, complicated sites (and you mention that 
> yours is), you'll probably want to use templates to separate out 
> presentation and logic.
> 
> http://smarty.php.net/
> http://sourceforge.net/projects/xtpl/

And there also:

http://www.interjinn.com

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

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Vail, Warren
If you don't care who sees your data, or you are operating behind a
firewall, then the simplest solution has already been mentioned (described
as http).

You basically code a script on your GTK app to perform an open (see fopen
function) to a url on the server machine like
"http://remotedbserver.com/phpfetchscript.php?var=foo&var2=bar"; where foo
and bar specify the data selection criterion for your database script.

On the database server, under the control of it's web server, the script
phpfetchscript.php executes, referencing the parameters passed in the url

$var1 = $_GET["var"];
$var2 = $_GET["var2];

the phpfetchscript.php on the server then runs the query and begins echoing
the comma separated columns from the database, perhaps ending with a new
line "\n";

Your GTK app now begins performing fgets reads against the data until fgets
returns a false and does what it needs to do with the data, perhaps loading
it into a grid control, or some such.

The caviate is that anyone who can come up with the correct url (and can
access your database machine), will be able to trigger the extract of data.
If this is not acceptable, then you need to consider other options.

good luck,

Warren Vail

-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 5:31 PM
To: Vail, Warren; 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server


Yes, both my server and the remote server have webservers with PHP
installed.  I have access to both servers to edit/modify/create files
etc.  I don't have SSH on the server's though.  I have FTP access, so I
can work with anything that way.  I basically just need a relatively
easy way to communicate back and forth between the servers.  I just have
no prior experience doing it so I need a little guidance.

Thanks,

Matt

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 7:09 PM
To: 'Webmaster'; 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Lot's of options.  

Will this access be across the internet, or behind a firewall?  

Are you concerned about securing your information from prying eyes?  

You seem to be focusing on a script that runs on the remote machine,
does
this machine have a web server as well, or will you be executing PHP as
a
standalone process?

I am taking it for granted that you have PHP installed on the remote
machine?

Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?

What platforms are involved at each end?

Just a few questions that may have an impact on your solution...

Warren Vail

-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server


Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($qu

Re: [PHP] file descriptor problem with tcpclient

2003-11-17 Thread Bill Shupp
On Nov 17, 2003, at 4:49 PM, Bill Shupp wrote:

Hello,

I'm trying to use the program execution functions (like exec, system, 
passthru, etc) with tcpclient (from Dan Bernstein's ucspi-tcp command 
line tools), but get this error in the apache log with all of them:

tcpclient: fatal: unable to set up descriptor 7: file descriptor not 
open

Any idea why this descriptor is not accessible?  Here's what I'm 
running:

Apache/1.3.28 (Darwin) PHP/4.3.2
Ok, I have discovered that this ONLY occurs when I have started a 
session with session_start().  So, I'm assuming that session_start is 
using file descriptor 7.  Is there a way to control this?

Regards,

Bill Shupp

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


Re: [PHP] PHP process .html extension file

2003-11-17 Thread Jason Wong
On Monday 17 November 2003 18:03, BennyYim wrote:
> PHP server will interpret .php extension files (index.php) as default.
>
> What should I set if I want the PHP server also interpret .html files (e.g.
> index.html) before send to client?

If using apache:

  AddType application/x-httpd-php .php .html

-- 
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
--
/*
Perhaps, after all, America never has been discovered.  I myself would
say that it had merely been detected.
-- Oscar Wilde
*/

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



[PHP] PHP process .html extension file

2003-11-17 Thread BennyYim
PHP server will interpret .php extension files (index.php) as default.

What should I set if I want the PHP server also interpret .html files (e.g. 
index.html) before send to client?

Thank You !

.---.
| Message Posted by NewsgroupXplorer|
| http://www.newsgroupxplorer.com   |
|   |
| Your newsreader in your browser.  |
`---'

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



Re: [PHP] [Q] Development Best Practices

2003-11-17 Thread Jason Godesky
There's certainly nothing wrong with putting bits of PHP into a primarily 
HTML document, but for very large, complicated sites (and you mention that 
yours is), you'll probably want to use templates to separate out 
presentation and logic.

http://smarty.php.net/
http://sourceforge.net/projects/xtpl/
--
Jason Godesky
[EMAIL PROTECTED]
http://www.tribaldawn.com/jason/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] auto_prepend/append in htaccess....

2003-11-17 Thread Jason Wong
On Tuesday 18 November 2003 06:46, Jonathan Villa wrote:
> Thanks for the info, but I was hoping on getting some information as to
> why the code configuration I posted is not working.

Because it's incorrect. Try:

  php_value auto_prepend_file header.inc
  php_value auto_append_file footer.inc

-- 
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
--
/*
May you live in uninteresting times.
-- Chinese proverb
*/

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



[PHP] [Q] Development Best Practices

2003-11-17 Thread Adam
All,

I'm not new to programing or web development but I am new to creating 
dynamic pages.

I've read through a couple books. I've worked through problems and 
exercises. Installed and configured the software a few different times 
in Win32 and OS X. At this point, I feel I have a good handle on the 
environment and lexical structure. What I don't have is a grasp on best 
practices. For real sites I'm a little confused on how to implement all 
this new knowledge. For example, I've got a site that was static with 
bits of CGI to PHP. I was going to generate all the HTML from a PHP 
script, but that turned into a mess. So I tried creating the pages is 
mostly HTML with little bits of PHP. Placing the logic in another file 
and linking the two pages. I'm not really sure if that is the best 
approach.

My question, how do you guys build your pages? Do your scripts generate 
all the HTML? I'm looking for tips and resources. Remember for my first 
site I've embarked on a fairly large site. Code maintenance will be an 
issue for me as I need to enhance and fix it later on.

Thanks guys!

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


RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Yes, both my server and the remote server have webservers with PHP
installed.  I have access to both servers to edit/modify/create files
etc.  I don't have SSH on the server's though.  I have FTP access, so I
can work with anything that way.  I basically just need a relatively
easy way to communicate back and forth between the servers.  I just have
no prior experience doing it so I need a little guidance.

Thanks,

Matt

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 7:09 PM
To: 'Webmaster'; 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Lot's of options.  

Will this access be across the internet, or behind a firewall?  

Are you concerned about securing your information from prying eyes?  

You seem to be focusing on a script that runs on the remote machine,
does
this machine have a web server as well, or will you be executing PHP as
a
standalone process?

I am taking it for granted that you have PHP installed on the remote
machine?

Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?

What platforms are involved at each end?

Just a few questions that may have an impact on your solution...

Warren Vail

-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server


Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

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

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



[PHP] Re: Fwd: MMCache segmentation faults

2003-11-17 Thread Manuel Lemos
On 11/17/2003 02:46 PM, Uros Gruber wrote:
Subject: MMCache segmentation faults

===8<==Original message text===
Hello!
I send this to [EMAIL PROTECTED]  but It was returned. So I'll ask here if somebody have any idea.
You can always try to mail [EMAIL PROTECTED] .


I upgrade my php and mmcache (php 4.3.4 and mmcache 2.4.6) and
I have a lot of
[Mon Nov 17 13:49:17 2003] [notice] child pid 32974 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:18 2003] [notice] child pid 32767 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:19 2003] [notice] child pid 33282 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:20 2003] [notice] child pid 33289 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:22 2003] [notice] child pid 33291 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:24 2003] [notice] child pid 33346 exit signal Segmentation fault (11)
messages in my apache error log.

server is FreeBSD 5.1 Release.

my php.ini

zend_extension="/usr/local/lib/php/20020429/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"
mmcache.keys="shm_and_disk"
mmcache.sessions="shm_and_disk"
mmcache.content="shm_and_disk"
I delete cache folder when I upgrade. If i remove mmcache from php.ini
there's no problems. But strange is that pages load normaly.
Have you tried it with the optimizer off?

Anyway, you may want to enable debug to be able to see in the Web server 
error log, which scripts are actually crashing. Then you may try 
isolating the fault to figure what exactly is the code that make the 
server segfault.



--

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


Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Raditha Dissanayake
you can with myODBC

Mike R wrote:

You can't interface MySQL with ODBC?

-Mike

 

I agree. I've found MS SQL (and MS Access databases) to be extremely fast
when well optimised, even with massive databases. As you can 
interface with
them using ODBC I prefer to use MS database backends when my 
clients already
have them installed alongside PHP for Win32.

C

Hi,

From my experiences, your coworkers are somewhat correct.  I found
MySQL to
be as fast in most cases, however in databases with millions of records,
MySQL started slowing down before the MS SQL did.
As for PHP being slower to program, I disagree.  Its about the same,
and in
some cases, PHP might have a few more shortcuts.
	Maybe they're using some visual editors to speed them up?

-Dan Joseph

   

-Original Message-
From: Mike R [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 11:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Microsoft .NET arguement


I have someone here at my desk arguing that Microsoft's .NET is
better than
PHP - faster to process, easier and quicker to program, etc.
They also (claim) that Microsoft's SQL is much faster and such 
 

vs. MySQL.
   

Any comments to help me defend PHP or to educate me?

:)

 

--
Raditha Dissanayake.

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


Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Raditha Dissanayake
but still keep HTTP open... and that's running the notorius IIS :-)

Jason Wong wrote:

>On Tuesday 18 November 2003 00:27, Mike R wrote:
>  
>
>>Actually, their claim is that Microsoft environments are secure - you just
>>need the proper firewall (that, basically, the problems with Windows boxes
>>has to do with the firewall, not the OS).
>>
>>That one I laughed at.
>>
>>
>
>But it's true, you can solve most of the security problems by tightening up 
>the firewall so that nothing goes in or out.
>
>  
>


-- 
Raditha Dissanayake.

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

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



Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Raditha Dissanayake
Dan Joseph wrote:

Hi,

From my experiences, your coworkers are somewhat correct.  I found MySQL to
be as fast in most cases, however in databases with millions of records,
MySQL started slowing down before the MS SQL did.
This is true for inserts but retrievals mysql would still be faster.

As for PHP being slower to program, I disagree.  Its about the same, and in
some cases, PHP might have a few more shortcuts.
	Maybe they're using some visual editors to speed them up?

-Dan Joseph

 




--
Raditha Dissanayake.

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


Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Raditha Dissanayake
I have a friend who is has MCDBA, MCSE and MCSD  he had 100% scores for 
a couple of exams!
was a die hard fan of ASP.NET until recently when he discovered PHP. 
hasn't written any ASP.NET code since. That should tell us something :-)

Mike R wrote:

I have someone here at my desk arguing that Microsoft's .NET is better than
PHP - faster to process, easier and quicker to program, etc.
They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.

Any comments to help me defend PHP or to educate me?

:)

-Mike

 



--
Raditha Dissanayake.

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


[PHP] file descriptor problem with tcpclient

2003-11-17 Thread Bill Shupp
Hello,

I'm trying to use the program execution functions (like exec, system, 
passthru, etc) with tcpclient (from Dan Bernstein's ucspi-tcp command 
line tools), but get this error in the apache log with all of them:

tcpclient: fatal: unable to set up descriptor 7: file descriptor not 
open

Any idea why this descriptor is not accessible?  Here's what I'm 
running:

Apache/1.3.28 (Darwin) PHP/4.3.2

Thanks!

Bill Shupp

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


RE: [PHP] Communicating with remote server

2003-11-17 Thread Vail, Warren
Lot's of options.  

Will this access be across the internet, or behind a firewall?  

Are you concerned about securing your information from prying eyes?  

You seem to be focusing on a script that runs on the remote machine, does
this machine have a web server as well, or will you be executing PHP as a
standalone process?

I am taking it for granted that you have PHP installed on the remote
machine?

Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?

What platforms are involved at each end?

Just a few questions that may have an impact on your solution...

Warren Vail

-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server


Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

-- 
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] Communicating with remote server

2003-11-17 Thread Marek Kilimajer
Webmaster wrote:
Yes, the remote server does have PHP.  This sounds like a good idea.  Is
it relatively easy to do?  I have never worked with HTTP protocol
functions for this.  Do you know of a tutorial I could look through to
learn a little of this?
The easiest way is using filesystem functions with url wrappers:

$request = fopen('http://server/function.php?f=fname&arg1=foo','r');

if(!$request) alert_user('Could not connect!');

and now read the response and parse it. (I just realized you can use 
serialize and unserialize functions, that will be realy easy for you)

But this works only if you don't send large datasets to the server, then 
you need to use post mothod, really easy with an http class, check out 
this one: http://www.phpclasses.org/browse.html/package/3.html
There is an example for the post method.

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


Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Eugene Lee
On Mon, Nov 17, 2003 at 11:06:37AM -0500, Mike R wrote:
: 
: I have someone here at my desk arguing that Microsoft's .NET is better
: than PHP - faster to process, easier and quicker to program, etc.
: 
: They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.

Without real benchmarks, all claims on speed are just that:
unsubstantiated claims.

But one nice thing about .NET is that it provides a nice framework that
is available at all times and is fairly optimized.  It's like having
PEAR installed automatically.  And having your APIs consistently named
also helps the developer to more easily remember the interfaces.

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



Re: [PHP] Looking for Spam free php form

2003-11-17 Thread Justin French
On Tuesday, November 18, 2003, at 04:30  AM, David Buchmueller wrote:

I am looking for a canned php form which hides the recipient email from
prying eyes. Everything I have found uses a hidden field.
You couldn't write one yourself?

The key is to store the email address' in a server-side array or DB, 
and only give them the option of seeing the address' related name or id 
in the form, rather than the address itself.

Build the form:


 $p)
{
echo "{$person[0]}\n";
}
?>

After the form is submitted, you match the recipient ID with an email 
address server side, and send the email with mail().


$id = $_POST['to']; 		// eg 3
$to = "{$addr[$id][0]} <{$addr[$id][1]}>;	// eg Bob Smith 
<[EMAIL PROTECTED]>
?>

A basic form (once you know what you're doing) shouldn't take more than 
15-20 minutes... then add in some email address validation [1], make 
sure all fields were completed, add in a site-wide header and footer, 
make sure everything validates to whatever DOCTYPE you're using, and 
all is well.

Better still, rather than something canned, you will fully understand 
your script, and will be able to customise it to suit any situation as 
needed.

1. http://www.killersoft.com/downloads/pafiledb.php?action=viewall

Justin French

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


Re: [PHP] auto_prepend/append in htaccess....

2003-11-17 Thread Jonathan Villa
Thanks for the info, but I was hoping on getting some information as to
why the code configuration I posted is not working.

On Fri, 2003-11-14 at 03:06, Eugene Lee wrote:
> On Thu, Nov 13, 2003 at 11:32:34AM -0600, Jonathan Villa wrote:
> : 
> : I want to prepend a configuration file which is located outside of my
> : document root into my scripts.  I can use auto_prepend_file, but I'm not
> : sure how do it with an htaccess file or a virtual host entry.. I would
> : prefer VHost.
> : 
> : Anyway, this is what I am trying/assuming...
> : 
> : 
> : ServerAdmin [EMAIL PROTECTED]
> : DocumentRoot /var/www/testdomain/www
> : ServerName testdomain
> : ErrorLog logs/testdomain-error_log
> : CustomLog logs/testdomain-access_log combined
> : 
> : auto_prepend_file=header.inc
> : auto_append_file=footer.inc
> : 
> : 
> : 
> : Is it possible to append/prepend more than file?
> 
> I don't think this is possible with auto_prepend_file.
> 
> : Or would be better
> : to simply include one file and in that file include the others.
> 
> This sounds workable.
> 
> : What should the file be relative to?  Or should it be an absolute value?
> 
> It can be a relative pathname, in which case PHP will search its defined
> include_path.  Absolute pathnames should be okay too.

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



Re: [PHP] php-xml

2003-11-17 Thread pnp
I think i found it...

thank you for trying to help.

Peter

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Yes, the remote server does have PHP.  This sounds like a good idea.  Is
it relatively easy to do?  I have never worked with HTTP protocol
functions for this.  Do you know of a tutorial I could look through to
learn a little of this?

Thanks,

Matt


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:26 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would like this
program
> to be able to connect to a remote server, call some functions that I
> specify, and return the right information (most likely from a MySQL
db).  I
> have access to the server, so I can create any and all functions that
I
> want, but I don't know how to connect to the remote server page and
get all
> the results.  I am new to cross-server comunication programming, so if
> anyone knows of a very detailed and easy to learn tutorial please send
me
> the link.  I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt
> 
> 

If the remote server has webserver with php, you can use http protocol 
to call functions and get the results. You can use one of the http 
classes that can make both get and post requests in your GTK-PHP app, to

return information from the server I would use XML, but you can use 
other format - csv, or even php code that you will eval()

Keep security in mind!

Marek

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



Re: [PHP] Communicating with remote server

2003-11-17 Thread Marek Kilimajer
Matt Palermo wrote:
I am writing a desktop application using PHP-GTK.  I would like this program
to be able to connect to a remote server, call some functions that I
specify, and return the right information (most likely from a MySQL db).  I
have access to the server, so I can create any and all functions that I
want, but I don't know how to connect to the remote server page and get all
the results.  I am new to cross-server comunication programming, so if
anyone knows of a very detailed and easy to learn tutorial please send me
the link.  I would appreciate any help you are willing to offer.
Thanks,

Matt


If the remote server has webserver with php, you can use http protocol 
to call functions and get the results. You can use one of the http 
classes that can make both get and post requests in your GTK-PHP app, to 
return information from the server I would use XML, but you can use 
other format - csv, or even php code that you will eval()

Keep security in mind!

Marek

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


RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Jeff McKeon
Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

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



[PHP] Communicating with remote server

2003-11-17 Thread Matt Palermo
I am writing a desktop application using PHP-GTK.  I would like this program
to be able to connect to a remote server, call some functions that I
specify, and return the right information (most likely from a MySQL db).  I
have access to the server, so I can create any and all functions that I
want, but I don't know how to connect to the remote server page and get all
the results.  I am new to cross-server comunication programming, so if
anyone knows of a very detailed and easy to learn tutorial please send me
the link.  I would appreciate any help you are willing to offer.

Thanks,

Matt


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



Re: [PHP] escaping ' when inside a " "

2003-11-17 Thread Adam Williams
Yeah thats what I meant to do, my PHP is very rusty if you can't tell 
(and so is my SQL) :)

Jay Blanchard wrote:

[snip]

If I have the SQL statement:

$sql = "select subject from subwhile where subject = '*$var[0]*'";


Don't you want to do:
$sql = "select subject from subwhile where subject LIKE '%$var[0]%'";
[/snip]
Not if the variable is exactly what he is looking for.

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


RE: [PHP] Re: From form to an array

2003-11-17 Thread Jeff McKeon
Jay Blanchard wrote:
> [snip]
> Ok, now on submit of this second form I want to take field1
> from each line and put it into $array1 and field2 from each
> line and put it into $arrray2.
> [/snip]
> 
> Form 1's info would have to be held as hidden fields in Form
> 2's construction. An example ...
> 
> /* formOne.php */
> 
>   
>   
> 
> 

Jay,

Sorry but I don't follow what your doing here.   Form one doesn't need
an array, it only has one piece of data, the number of rows that form2
should have.

> /* nextForm.php */
> 
>   
>   
>   " method="POST">












Does that make more sense or am I just not understanding what your
trying to do?

Thanks,

Jeff

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



RE: [PHP] escaping ' when inside a " "

2003-11-17 Thread Jay Blanchard
[snip]
> If I have the SQL statement:
> 
> $sql = "select subject from subwhile where subject = '*$var[0]*'";

Don't you want to do:
$sql = "select subject from subwhile where subject LIKE '%$var[0]%'";
[/snip]

Not if the variable is exactly what he is looking for.

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



Re: [PHP] escaping ' when inside a " "

2003-11-17 Thread Marek Kilimajer
Adam Williams wrote:
If I have the SQL statement:

$sql = "select subject from subwhile where subject = '*$var[0]*'";
Don't you want to do:
$sql = "select subject from subwhile where subject LIKE '%$var[0]%'";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] escaping ' when inside a " "

2003-11-17 Thread David T-G
Adam --

...and then Adam Williams said...
% 
% If I have the SQL statement:
% 
% $sql = "select subject from subwhile where subject = '*$var[0]*'";
% 
% do I need to put a \ before each '?

1) You should have just tried it.

2) No.


You owe the Newbie Guide a paragraph on quoting and escaping.

HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] Re: From form to an array

2003-11-17 Thread Jay Blanchard
[snip]
Ok, now on submit of this second form I want to take field1 from each
line and put it into $array1 and field2 from each line and put it into
$arrray2.  
[/snip]

Form 1's info would have to be held as hidden fields in Form 2's
construction. An example ...

/* formOne.php */





/* nextForm.php */



http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread John Nichel
Mike R wrote:
I have someone here at my desk arguing that Microsoft's .NET is better than
PHP - faster to process, easier and quicker to program, etc.
I've never coded anything for .NET, so I can't speak to that.  However, 
in all the test my company has ever done, php on Linux/Apache blew the 
doors off of .NET on Win2k/IIS when it came to speed.

They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.
This person is just wrong here.  MySQL is one of the, if not the fastest 
RDMS' out there.  MSSQL is, well to put it nicely, SLOW.  MSSQL has more 
features than MySQL (not for long though), but as far as speed goes, not 
even Oracle can compete with MySQL, much less MSSQL.

Any comments to help me defend PHP or to educate me?
There's no need to defend PHP...it speaks for itself.  Not to mention 
that with most MS people, it doesn't matter how much fact you show them, 
they won't believe it.

:)

-Mike



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


[PHP] escaping ' when inside a " "

2003-11-17 Thread Adam Williams
If I have the SQL statement:

$sql = "select subject from subwhile where subject = '*$var[0]*'";

do I need to put a \ before each '?

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



[PHP] Re: passing second function through a function

2003-11-17 Thread DvDmanDT
function call_some_function($function,$args=NULL)
{
eval("$function($args)"); // Or something like that..
$function(); // also works I think..
}
-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
##
Please, if you are using windows, you may be infected by Swen. Please go
here to find out more:
http://us.mcafee.com/virusInfo/default.asp?id=helpCenter&hcName=swen
http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED]
##
"Ian Truelsen" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> What I want to do is to call a function from within a function, but pass
> the secondary function name through the first function. Like this:
>
> function1(function2)
>
> Then call function2 from within function1. Unfortunately, I have been
> unable to figure out the proper syntax for calling the second function.
>
> Does anyone know if this is possible and what the proper syntax would be
> for calling a function from a variable name?
>
> -- 
> Ian Truelsen
> Email: [EMAIL PROTECTED]
> AIM: ihtruelsen
> Homepage: http://www.ihtruelsen.dyndns.org

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



RE: [PHP] Re: From form to an array

2003-11-17 Thread Jeff McKeon
DvDmanDT wrote:
> Hmm... Intresting... Like... Hmm.. Name the elements of the
> second form like   name="array2[LINE_NUM]"> 
> 
> Then turn on register_globals, then you'll very automaticly
> have $array1 and $array2..

Sorry register_globals are off and not getting turned on...

e=swen
http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED]
ml
##
"Jeff McKeon" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
.
Is it possible to pass the values of a form directly into an array?

I have a multi level, dynamic form.  The first level (first form
actually) askes how many levels there are and gives you a field to
enter in that number. 

Then upon submit of form1 it creates a new form (form2) that contains 2
fields for each level (the number of levels was entered in form1).  So
if you entered 2 in the first form, you'd be given another form with 2
lines, each containing 2 fields.   

Ok, now on submit of this second form I want to take field1 from each
line and put it into $array1 and field2 from each line and put it into
$arrray2.  

Then pass those array's to a function as elements.  Any idea how I can
do this? 

Thanks,

Jeff

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



Jeff McKeon
IT Manager
Telaurus Communications LLC
[EMAIL PROTECTED]
(973) 889-8990 ex 209

***The information contained in this communication is confidential. It
is intended only for the sole use of the recipient named above and may
be legally privileged. If the reader of this message is not the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication, or any of its contents
or attachments, is expressly prohibited. If you have received this
communication in error, please re-send it to the sender and delete the
original message, and any copy of it, from your computer system. Thank
You.***

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



Re: [PHP] PHP, HTML, CSS and a lot of problems

2003-11-17 Thread Björn Berg
David T-G wrote:

% through the PHP script. A link relation to a favicon works without problems 
% and is displayed in the browser URL.
% 
% Does anybody know how to get it running?

Not until you show us some code and some before-and-after.  We're not
mind readers, you know :-)
 

Yes you are right. But mind readers would do things quite more easier 
*fg*. So I send the script and the abbrevitiated output to this ML.
The script is attached and the source output from browser comes here:

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


anubisnet / Products / dBASE Reader


	
http://anubisnet.sf.net/pics/favicon.ico";>


@import url(default.css);


[snipped] Regards, Björn -- Die größte aller Schwächen ist, zu fürchten, schwach zu erscheinen. (Jacques Benigne Bossuet) showsite.php Description: Zip archive -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] From form to an array

2003-11-17 Thread Jeff McKeon
Jay Blanchard wrote:
> [snip]
> Is it possible to pass the values of a form directly into an array?
> [/snip] 
> 
> Each form is passed to an array already. Dependent upon form
> method (GET or POST) the form values are in the $_GET or
> $_POST array (newer versions of PHP).
> 
> Start here
> http://us3.php.net/manual/en/language.variable> s.predefined.php

Yes but $_POST[] array contains ALL the fields using an index of their
names.  I need the entries for field1 in one array and the entries for
field2 in another.

In a later function I need to move through the arrays incrementing their
index with every pass.  This can only be done if the array index numeric
as opposed to "named" right?

The field names in the form are like this

Tier1,price1
Tier2,price2
Tier3,price3

These are built automatcally and I need all the "Tier" values in one
array and all the "Price" values in another.

[code snip begin]




Enter the upper size limit and price for each Tier


Tier  Limit 
Tier  Price 

Email Size 
  


[code snip end]
Jeff McKeon
IT Manager
Telaurus Communications LLC
[EMAIL PROTECTED]
(973) 889-8990 ex 209

***The information contained in this communication is confidential. It
is intended only for the sole use of the recipient named above and may
be legally privileged. If the reader of this message is not the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication, or any of its contents
or attachments, is expressly prohibited. If you have received this
communication in error, please re-send it to the sender and delete the
original message, and any copy of it, from your computer system. Thank
You.***

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



[PHP] Re: From form to an array

2003-11-17 Thread DvDmanDT
Hmm... Intresting... Like... Hmm.. Name the elements of the second form like
 

Then turn on register_globals, then you'll very automaticly have $array1 and
$array2..
-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
##
Please, if you are using windows, you may be infected by Swen. Please go
here to find out more:
http://us.mcafee.com/virusInfo/default.asp?id=helpCenter&hcName=swen
http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED]
##
"Jeff McKeon" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
Is it possible to pass the values of a form directly into an array?

I have a multi level, dynamic form.  The first level (first form
actually) askes how many levels there are and gives you a field to enter
in that number.

Then upon submit of form1 it creates a new form (form2) that contains 2
fields for each level (the number of levels was entered in form1).  So
if you entered 2 in the first form, you'd be given another form with 2
lines, each containing 2 fields.

Ok, now on submit of this second form I want to take field1 from each
line and put it into $array1 and field2 from each line and put it into
$arrray2.

Then pass those array's to a function as elements.  Any idea how I can
do this?

Thanks,

Jeff

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



Re: [PHP] PHP, HTML, CSS and a lot of problems

2003-11-17 Thread David T-G
Björn --

...and then Björn Berg said...
% 
% I have written a short script in PHP that parses an HTML template and 
% replaces Blocks (looks-like special HTML Tags) with information fetched 
% from a Mysql database.

Sounds neat.


% 
% The problem I have is that the HTML template includes several Javascripts 
% and CSS definitions, looks like that:
% 
% 
% @import url(default.css);

Seems straightforward enough.


% 
% I do not understand why the browser cannot interpret it after it is parsed 

Well, how does it look?


% through the PHP script. A link relation to a favicon works without problems 
% and is displayed in the browser URL.
% 
% Does anybody know how to get it running?

Not until you show us some code and some before-and-after.  We're not
mind readers, you know :-)


% 
% Regards,
% Björn


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Help with Solaris/iPlanet 4.1 Setup

2003-11-17 Thread Evans, Tim
No luck with this on php-install, so I thought I'd try here.  Thanks.


> -Original Message-
> From: Evans, Tim [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 17, 2003 8:30 AM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP-INSTALL] Help with Solaris/iPlanet 4.1 Setup
> 
> 
> I've followed the instructions at 
> http://www.php.net/manual/en/install.netscape-enterprise.php 
> for setting up PHP 4.3.4 with iPlanet 4.1 on Solaris 8, including:
> 
> mime.types:
> 
> type=magnus-internal/x-httpd-phpexts=php
> 
> obj.conf:
> 
> Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans"
> shlib="/us
> r/local/netscape/server4/bin/libphp4.so"
> Init fn="php4_init" LateInit="yes" errorString="Failed to 
> initialize PHP!" [php_ ini="/usr/local/lib/php.ini" 5="]" 
> PathCheck fn="find-index" index-names="index.html,home.html,index.php"
> ObjectType fn="force-type" type="text/plain, 
> magnus-internal/x-httpd-php" Service fn="php4_execute" 
> type="magnus-internal/x-httpd-php"
> 
> iPlanet startup successfully loads the php lib:
> 
> [13/Nov/2003:16:21:16] info (27344): php4_init reports: 
> Initialized PHP Module ( 128 threads exspected)
> 
> However, when attempting to load a simple (phpinfo()) test 
> page, all web browsers I test attempt to download the php 
> page, rather than displaying its content.
> 
> Where else do I need to look?  Thanks.
> --
> Tim Evans   | [EMAIL PROTECTED]
> Social Security Administration  | (410) 965-4217
> Office of Electronic Services   | (410) 597-1187 (FAX)
> Baltimore, MD 21235 | http://www.socialsecurity.gov/
> 

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



RE: [PHP] From form to an array

2003-11-17 Thread Jay Blanchard
[snip]
Is it possible to pass the values of a form directly into an array?
[/snip]

Each form is passed to an array already. Dependent upon form method (GET
or POST) the form values are in the $_GET or $_POST array (newer
versions of PHP). 

Start here
http://us3.php.net/manual/en/language.variables.predefined.php

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



[PHP] PHP, HTML, CSS and a lot of problems

2003-11-17 Thread Björn Berg
I have written a short script in PHP that parses an HTML template and replaces Blocks (looks-like special HTML Tags) with information fetched from a Mysql database.

The problem I have is that the HTML template includes several Javascripts and CSS definitions, looks like that:


@import url(default.css);
I do not understand why the browser cannot interpret it after it is parsed through the PHP script. A link relation to a favicon works without problems and is displayed in the browser URL.

Does anybody know how to get it running?

Regards,
Björn
--
Die größte aller Schwächen ist, zu fürchten,
schwach zu erscheinen. (Jacques Benigne Bossuet)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] From form to an array

2003-11-17 Thread Jeff McKeon
Is it possible to pass the values of a form directly into an array?

I have a multi level, dynamic form.  The first level (first form
actually) askes how many levels there are and gives you a field to enter
in that number.

Then upon submit of form1 it creates a new form (form2) that contains 2
fields for each level (the number of levels was entered in form1).  So
if you entered 2 in the first form, you'd be given another form with 2
lines, each containing 2 fields.

Ok, now on submit of this second form I want to take field1 from each
line and put it into $array1 and field2 from each line and put it into
$arrray2.

Then pass those array's to a function as elements.  Any idea how I can
do this?

Thanks,

Jeff

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



RE: [PHP] explode()

2003-11-17 Thread Jay Blanchard
[snip]
I am having a user enter a phrase into a textbox, and then I need to 
seperate the words he has typed into variables so I can use each one 
in an sql statement.  I know I will use the explode() function to do
this, 
but how will I know how many variables I've created.  For instance, if a

user types in 3 words seperated by spaces, how will I know i'll have 
var[0] through var[2]?  how about when they type in 2 words or 4 words?

How will I know how many words they have typed in?  The only way I can 
think of to do this is:
[/snip]

Use count() http://www.php.net/count

Counts the array ...

$arrayFoo = explode(" ", $theLine);
$countFoo = count($arrayFoo);

for($i = 0; $i < $countFoo; $i++){
   echo $arrayFoo[$i];
}

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



[PHP] explode()

2003-11-17 Thread Adam Williams
I am having a user enter a phrase into a textbox, and then I need to 
seperate the words he has typed into variables so I can use each one 
in an sql statement.  I know I will use the explode() function to do this, 
but how will I know how many variables I've created.  For instance, if a 
user types in 3 words seperated by spaces, how will I know i'll have 
var[0] through var[2]?  how about when they type in 2 words or 4 words?  
How will I know how many words they have typed in?  The only way I can 
think of to do this is:

// $var is the input after being ran through explode()

$i = 0;
while ($var[$i])
{
$i++;
}

I will then take the data they enter and create the sql statement:

$j = 0;

$sql = "select subject from subfile where";

while ($j <= $i)
{
$j++;
$sql .= "suject matches '*$var[$j]*'";

if ( $j != $i)
{
$sql .= " and ";
}
}




but I think there has to be a better way to do this.  any ideas?

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



[PHP] mcrypt libraries?

2003-11-17 Thread Jas
I am not sure if I should post my question here but I will anyways.

Ok, I have compiled the mcrypt libraries on a Redhat 9 box running 
apache 2 with php4.  And I need to know the next step(s) in getting php 
to use the libmcrypt libraries.  If anyone has set this up in the past 
or has some pointers (other than reading the manual) I would appreciate it.
Jas

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


RE: [PHP] To Loop or Not to Loop?

2003-11-17 Thread Chris W. Parker
Matt Matijevich 
on Monday, November 17, 2003 12:10 PM said:

> The second thing I would do, and this is just at a glance of the code,
> I would separate it into 2 tables, inventory(the table you already
> have) and inventory_pics (or something like that) and make that a one
> to many relationship, one row in the inventory table can have many
> rows in the inventory_pics table.

Jay, something you might want to look into is called database
normalization. That is the process of taking redundant information out
of database tables and putting it into separate tables (as to reduce
redundancy). It's what Matt described above.


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

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



Re: [PHP] To Loop or Not to Loop?

2003-11-17 Thread Matt Matijevich

The code below inserts the same inventory item into the db multiple
times - 
I just need 1 line entry for each inventory item, but multiple photos
of 
each itemHow to do this?

I know the code I wrote below is extremely awful, but I am a nebie and
that 
was the only way I could get it to half-way do what I am wanting



First you can take you database connect statement out of your loop and
put it somewhere before the loop, no need to connect multiple times.

The second thing I would do, and this is just at a glance of the code,
I would separate it into 2 tables, inventory(the table you already have)
and inventory_pics (or something like that) and make that a one to many
relationship, one row in the inventory table can have many rows in the 
inventory_pics table.

I can take closer look at your code tonight.
 

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



[PHP] To Loop or Not to Loop?

2003-11-17 Thread Jay Fitzgerald
The code below inserts the same inventory item into the db multiple times - 
I just need 1 line entry for each inventory item, but multiple photos of 
each itemHow to do this?

I know the code I wrote below is extremely awful, but I am a nebie and that 
was the only way I could get it to half-way do what I am wanting


for($q=0;$q<$tot;$q++)
{
$thefile = $_FILES['userfile']['name'][$q];
$temp_name = $_FILES['userfile']['tmp_name'][$q];
$thefile1 = $_FILES['userfile']['name']['0'];
$thefile2 = $_FILES['userfile']['name']['1'];
$thefile3 = $_FILES['userfile']['name']['2'];
$thefile4 = $_FILES['userfile']['name']['3'];
$thefile5 = $_FILES['userfile']['name']['4'];
$thefile6 = $_FILES['userfile']['name']['5'];
$thefile7 = $_FILES['userfile']['name']['6'];
$thefile8 = $_FILES['userfile']['name']['7'];
if (move_uploaded_file($temp_name, $uploaddir.'/'.$thefile))
{
$connection = mysql_connect('localhost','*','*') 
or die ('Couldn\'t make connection.');
$db = mysql_select_db('*', $connection) or die 
('Couldn\'t select database.');
$sql = "INSERT INTO inventory (
id, status, stocknum, year, make, model, price, class, 
type, mileage, slides, extcolor, intcolor, awning, generator, bedsize, 
location, description, picname1,  picname2, picname3, picname4, 
picname5, picname6, picname7, picname8
) VALUES (
'', '$_POST[status]', '$_POST[stocknum]', '$_POST[year]', 
'$_POST[make]', '$_POST[model]', '$_POST[price]', '$_POST[class]', 
'$_POST[type]','$_POST[mileage]', '$_POST[slides]', 
'$_POST[extcolor]', '$_POST[intcolor]', '$_POST[awning]', 
'$_POST[generator]', '$_POST[bedsize]', 
'$_POST[location]',  '$_POST[description]', '$thefile1', 
'$thefile2', '$thefile3', '$thefile4', '$thefile5', '$thefile6', 
'$thefile7', '$thefile8'
)";

$sql_result = mysql_query($sql) or die ('Couldn\'t execute 
query.');
if (!$sql_result)
{
echo 'Could not add inventory.';
exit;
}

$invfile = "$thepath/$thefile";
}
else
{
$invfile = "$thepath/$spacer";
}
?>


$myid = mysql_insert_id();
mysql_close($connection);


Jay Fitzgerald, Design Director
- Certified Professional Webmaster (CPW-A)
- Certified Professional Web Designer (CPWDS-A)
- Certified Professional Web Developer (CPWDV-A)
- Certified E-Commerce Manager (CECM-A)
- Certified Small Business Web Consultant (CWCSB-A)
Bayou Internet - http://www.bayou.com
Toll Free: 888.30.BAYOU (22968)
Vox: 318.338.2034 / Fax: 318.338.2506
E-Mail: [EMAIL PROTECTED]
ICQ: 38823829 / AIM: bayoujf / MSN: bayoujf / Yahoo: bayoujf
  

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


Re: [PHP] passing PHP variables to Javascript ...

2003-11-17 Thread CPT John W. Holmes
From: "Kenn Murrah" <[EMAIL PROTECTED]>
> I need to be able to pass a PHP variable to a Javascript and can't 
> figure out how to do it.  In short, the Javascript win() statement is 
> used open a page as defined in PHP -- i.e., $php_name = 
> "http://www.somewhere.com/something/3.jpg"; , a filename that was 
> generated dynamically in PHP ... how do I pass that variable to my 
> Javascript routine?


var mywin = '';

win(mywin);



or something like that. 

---John Holmes...

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



[PHP] passing PHP variables to Javascript ...

2003-11-17 Thread Kenn Murrah
Greetings.

I need to be able to pass a PHP variable to a Javascript and can't 
figure out how to do it.  In short, the Javascript win() statement is 
used open a page as defined in PHP -- i.e., $php_name = 
"http://www.somewhere.com/something/3.jpg"; , a filename that was 
generated dynamically in PHP ... how do I pass that variable to my 
Javascript routine?

(Pardon me if this is more of a Javascript issue than a PHP issue -- I 
couldn't decide where to ask for help first :-)

Thank in advance.

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


Re: [PHP] passing second function through a function

2003-11-17 Thread CPT John W. Holmes
From: "David Otton" <[EMAIL PROTECTED]>
> >From: "Ian Truelsen" <[EMAIL PROTECTED]>
> >
> >> What I want to do is to call a function from within a function, but
pass
> >> the secondary function name through the first function. Like this:
> >>
> >> function1(function2)
> >>
> >> Then call function2 from within function1. Unfortunately, I have been
> >> unable to figure out the proper syntax for calling the second function.
> >
> >$function = 'print';
> >$function('you mean like this??');
>
> Does that snippet run for you, as-is?

Of course not... lol...sorry...

But this does:



$function must be a user defined function, I guess.

Same as with your example, you could just use $f(); instead of
call_user_func ($f);

Just depends which is clearer to you...

---John Holmes...

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



Re: [PHP] passing second function through a function

2003-11-17 Thread David Otton
On Mon, 17 Nov 2003 11:04:47 -0800, you wrote:

>What I want to do is to call a function from within a function, but pass
>the secondary function name through the first function. Like this:
>
>function1(function2)
>
>Then call function2 from within function1. Unfortunately, I have been
>unable to figure out the proper syntax for calling the second function.

function A ()
{
echo ("A");
}

function B ($f)
{
call_user_func ($f);
echo ("B");
}

B ('A');

untested.

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



Re: [PHP] passing second function through a function

2003-11-17 Thread CPT John W. Holmes
From: "Ian Truelsen" <[EMAIL PROTECTED]>

> What I want to do is to call a function from within a function, but pass
> the secondary function name through the first function. Like this:
> 
> function1(function2)
> 
> Then call function2 from within function1. Unfortunately, I have been
> unable to figure out the proper syntax for calling the second function.

$function = 'print';
$function('you mean like this??');

---John Holmes...

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



[PHP] passing second function through a function

2003-11-17 Thread Ian Truelsen
What I want to do is to call a function from within a function, but pass
the secondary function name through the first function. Like this:

function1(function2)

Then call function2 from within function1. Unfortunately, I have been
unable to figure out the proper syntax for calling the second function.

Does anyone know if this is possible and what the proper syntax would be
for calling a function from a variable name?

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

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



[PHP] Compensating for time zones in PHP

2003-11-17 Thread Dave G
PHP Gurus,
I'm building a calendar which does some things like compare
dates. For example, if an event is in the past, then the link in the
calendar is made inactive. To do this I'm converting everything into
UNIX time stamps, so I can do simple "greater than" or "less than" type
equations to figure out which dates come in what order.
Here's how I've got it set up:
$currentMonth and $currentYear are the month and year that the
user has selected to look at. $dayCount is where I'm storing the date. I
build the calendar table by using a loop to put in the right date in
$dayCount and then echo it out in each table cell to draw a months worth
of dates.
So, to compare dates, I take these variables and make it into a
unix timestamp:
$dateFromPHP = mktime(' ',' ',' ',$currentMonth, $dayCount,
$currentYear);
Then, I get all the relevant event dates for that month from
MySQL, like so:
$query = "SELECT UNIX_TIMESTAMP(eventdate) FROM table WHERE
MONTH(eventdate) = " . $currentMonth;
I put the results into an array called $dateFromMySQL.
Okay, now here's where it gets wonky. If both PHP and MySQL are
set to default time zone settings, then this following command will
return some results:
if (in_array($dateFromPHP, $dateFromMySQL)
I use the results to determine if in any one table cell I need
to do some handling of events. If there are no matches in the array,
then I just echo out the date. As I say, this works fine when I don't
try to adjust time zones.
But, if at the top of my PHP script I declare the time zone as
being in Japan, like so:
putenv("TZ=Japan");
Then the in_array command never returns anything anymore.
I don't understand why this happens. Since I don't specify the
hours, minutes, or seconds, the time zone difference shouldn't apply.
I thought maybe MySQL needed to be set to have the same time
zone as the PHP script, but, according to my web hosting service, that
is impossible to set for just my site without affecting all the other
sites on the same server.
So I need to compensate for different time zones between my
script and my MySQL server. But I can't figure out how to do that since
I don't know why there is a difference in the first place.
Any help would be much appreciated.

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



Re: [PHP] strtotime bad logic or strtotime bug?

2003-11-17 Thread Gnik
WOW! Blindingly simple mistake --> couldn't see the forest before the
trees (or something like that). THANKS for the helping hand! 

Gnik
--- Eugene Lee <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2003 at 08:53:41PM -0800, Gnik wrote:
> : 
> : One of my servers required a PHP upgrade. Afterwards one of the PHP
> : projects stopped functioning. When it would run one section would
> : scroll endlessly. I can't figure out if it's a 'bug' or if it's bad
> : logic in the coding. 
> 
> Bad logic.  But it took me a while to figure it out.  I'm glad I did;
> I know it will save me countless headaches in the future!  :-)
> 
> : I isolated the problem to be in the 'strtotime' function. Here is a
> : test I ran - when it runs, after getting to 2003-10-26, it scrolls
> : incessently: 
> : 
> : BEGIN CODE--
> :  : echo "Testing strtotime ";
> : print " " ;
> : $stop= "2003-12-27" ;
> : $start= "2003-01-01" ;
> : While ($start <> $stop) {
> : echo " Date: " . $start ;
> : $start = date('Y-m-d', strtotime($start) + 86400);
> : }
> : ?>
> : END CODE--
> 
> It's a logic bug due to the wonderful world of Daylight Saving Time.
> When the clock strikes 2003-10-26, adding 86400 seconds to calculate the
> next day's timestamp is normally correct.  However, that date is also
> the last Sunday of Octobor when the U.S. officially reverts from
> Daylight Saving Time back to normal time.  Your next day's timestamp
> "loses" one hour, i.e. 3600 seconds; your timestamp for 2003-10-27 12am
> is now 2003-10-26 11pm.  Because your date() call extracts only the
> date,
> your truncation error is causing you to get stuck on 2003-10-26.  This
> is
> the cause of your infinite loop.
> 
> There are several ways to avoid this problem.  The easiest way to change
> date() to gmdate().  This gets you on UTC time, which is independent of
> Daylight Saving Time or your timezone.
> 
> Hope this helps!

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



Re: [PHP] fopen and preg_match

2003-11-17 Thread Sami Kyösti
Chris Hayes wrote:
At 15:07 17-11-03, you wrote:

Hi,

I have a code that should fetch the information from another webpage. 
The code find's the page, but I can't make it stop on  sign.

preg_match("|1.+\<\/table\>|is", $buffer, $regs );


It probably looks for the last table tag. Is that so? Then you need to 
tell the script in a modifier that it should not be greedy (not my 
terminology, but the regexp term for this).  The modifiers are the 
letters after the patern itself, in your example the i (do not make a 
difference between capital and small letters) and s ( I think: ignore 
line breaks). Try adding a U for making it non greedy. If that does not 
help check the docs on 'non greedy'.
Thanks for advice! The letter U did the "thing".
Are there more modifiers than letter i,s or U and where I can find more 
information on modifiers?

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


RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Wouter van Vliet
Jay Blanchard wrote:
> [snip]
> I have someone here at my desk arguing that Microsoft's .NET
> is better than PHP - faster to process, easier and quicker to
> program, etc. 
> 
> They also (claim) that Microsoft's SQL is much faster and such vs.
> MySQL. 
> 
> Any comments to help me defend PHP or to educate me? [/snip]
> 
> Both 'arguments' are so general as to be laughable. Come up
> with some specific issues and we can go toe-to-toe.
> 
> NET v PHP
> 1. Platform dependency? (Run on M$ platforms v. running on a
> variety of platforms, including M$)
> 
> MySQL v MSSQL
> 1. MSSQL is bloated. Speed is an issue. Footprint is an issue.
> 2. Platform dependency?
> 
> Have fun!

To add a little bit to this conversation, one thing I heard about the .NET
technology is that it supports multiple scripting languages in one file. Not
that it would really (usually) be the best thing, but that means that you
can use Perl, C#, PHP and ASP.NET all in the same file.. 

;),
Wouter

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



RE: [PHP] Looking for Spam free php form

2003-11-17 Thread Steve Murphy
Is this what your looking for?
http://www.pfohlsolutions.com/projects/mailer/

-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 1:08 PM
To: Chris Boget
Cc: David Buchmueller; PHP General
Subject: Re: [PHP] Looking for Spam free php form


> > I am looking for a canned php form which hides the recipient email from
> > prying eyes. Everything I have found uses a hidden field.
> 
> If you only need the email address on the back end, why not encode it
> (using your flavor of choice) and stick that value in the hidden field.  Then,
> upon submission, just decode and use.

Maybe I am misreading this question but why not just use id's
instead.  For example, in your database you might have:

  id name  email
  1  john  [EMAIL PROTECTED]
  2  fred  [EMAIL PROTECTED]

In the form you use the names, and unique ids, and the backend
will get the email addresses from the ids.  This way they choose 
names to send to but don't see the email addresses.

Regards,
Philip

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


Re: [PHP] Looking for Spam free php form

2003-11-17 Thread David T-G
David --

...and then David Buchmueller said...
% 
% Hello List,

Hi!


% 
% I am looking for a canned php form which hides the recipient email from
% prying eyes. Everything I have found uses a hidden field.

Why not just encode the recipient as "david" or "joe" or "1288" and then
determine the real address in your script based on that input.  Think of
aliases with your script (or an external file if more convenient) as the
address book.  Of course, if there's only one possible recipient then
there's no need to show address, alias, or anything.


% -- 
% Thank you,
% 
% David Buchmueller


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Looking for Spam free php form

2003-11-17 Thread Philip Olson
> > I am looking for a canned php form which hides the recipient email from
> > prying eyes. Everything I have found uses a hidden field.
> 
> If you only need the email address on the back end, why not encode it
> (using your flavor of choice) and stick that value in the hidden field.  Then,
> upon submission, just decode and use.

Maybe I am misreading this question but why not just use id's
instead.  For example, in your database you might have:

  id name  email
  1  john  [EMAIL PROTECTED]
  2  fred  [EMAIL PROTECTED]

In the form you use the names, and unique ids, and the backend
will get the email addresses from the ids.  This way they choose 
names to send to but don't see the email addresses.

Regards,
Philip

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



Re: [PHP] Looking for Spam free php form

2003-11-17 Thread Chris Boget
> I am looking for a canned php form which hides the recipient email from
> prying eyes. Everything I have found uses a hidden field.

If you only need the email address on the back end, why not encode it
(using your flavor of choice) and stick that value in the hidden field.  Then,
upon submission, just decode and use.

Chris

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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Brian V Bonini
On Mon, 2003-11-17 at 11:27, Mike R wrote:
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
> 
> That one I laughed at.
> 

See how deep seeded the brainwashing is... ??

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



[PHP] Looking for Spam free php form

2003-11-17 Thread David Buchmueller
Hello List,

I am looking for a canned php form which hides the recipient email from
prying eyes. Everything I have found uses a hidden field.
-- 
Thank you,

David Buchmueller

-
Brian Sooy & Co.  |  t. 440.322.5142  |  www.briansooyco.com
- 

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



[PHP] Re: Get value between 2 strings

2003-11-17 Thread Al
Here's what I use:

/**
* get_text()
*
* $t The total text string
* $s starting text string [e.g. ]
* $e ending text string [e.g. 
*
* @return the extracted text string. [e.g., returns string between 
start and end texts.
*/
function get_text($text, $s, $e) // Get string out of text
{
   $sp = strpos($text, $s, 0) + strlen($s);
   $ep = strpos($text, $e, 0);
   return substr($text, $sp, $ep - $sp);
}



Matt Palermo wrote:

Hello.  I was wondering if anyone knew of a function to get the value
between 2 strings.  For example, lets say I have the following line:
$line = "I want the value between word ONE and word TWO.  Please return
it...";
Now, I want to get everything between "ONE" and "TWO".  In this example it
should return the value " and word ".  Is there some sort of function I
could use to easily do this?  Please let me know if you have any ideas.
Thanks,

Matt
 

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


RE: [PHP] Include an encoder into PHP distribution?

2003-11-17 Thread Michael
Oh my god thanks Curt!  I don't know when they added that in for windows but
now my scripts are flying.  My scripts are pretty bloated since I'm using
both smarty and adodb and my times were hovering around 1.5 seconds but I
installed mmcache and I'm at 0.14 seconds now.  Sweet!

mmcache should really take out needing visual c and put this in its place
1. Copy mmcache.dll to C:\PHP\extensions\mmcache.dll
2. Copy and paste the mmcache settings into C:\WINDOWS\php.ini

Ignore what I said earlier cuz I don't think you can make it any easier.


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: November 17, 2003 10:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Include an encoder into PHP distribution?


* Thus wrote Michael ([EMAIL PROTECTED]):
> I've tried installing it but I need MS Visual Studio C++ so they have to
> make it even easier.

There is a compiled version on the website for windows.  Go to the
download section and you'll see that they have it available for
multiple version of php there.


Curt
--
"My PHP key is worn out"

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

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

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



Re: [PHP] Single Session for different websites

2003-11-17 Thread Burhan Khalid
Manisha Sathe wrote:

I hv physically one single server, but with different websites on it

like www.aaa.com / www.bbb.com / www.ccc.com

Now the problem is about session. What I want is login page at www.aaa.com
only but session  is accessible from www.bbb.com and www.ccc.com
can it be possible, if yes how ? if no any other work around ?
You can store the session information in a database that can be read 
from all three websites.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
"Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Include an encoder into PHP distribution?

2003-11-17 Thread David T-G
Michael, et al --

...and then Michael said...
% 
% David T-G says
% > I hate to sound like a curmudgeon, but if you want this then you should
% > build it, just like John anyone else who wants it should.  No, I haven't
...
% 
% 1. An obsfuscator scrambles all the variable, function and class names
% 2. An encoder stores your source in compiled form whatever that looks like
% 3. An accelerator speeds up the php scripts by 1 to 10 times

Thanks.  Very helpful.


% 
% Option 1 and 2 are debateable whether it should be included in php.  Option
% 3 is a no brainer that it should be included.

One would think, but not necessarily; 1) there might be other accelerators
out there and 2) it's more for the maintainers to have to keep up to date
and bug-free.  Maybe, just maybe, php should stay very slim and in The
Unix Way any addons remain separate and not-required addons.  [I'm used
to seeing this sort of argument about mutt's code and featureset, and so
I tend to make these counterarguments.]


% 
% Why don't I make my own?  I don't know how.  Should I learn and do it?  No

Neither do I.  Someone obviously does, though, which is a nice start.


% because there's already an open source encoder and accelerator.  Why do
% redundant work?

But the point is that your wish to have it would force that upon those
who write and maintain the php code.  If you want it, then at the very
least put together the pieces to make it happen for a stock tarball so
that someone can download your contributed patch/enhancement and include
it in the build.

If enough people want some item included, then they mmight or might not
be able to convince the code maintainers to include that piece, and can
always fall back to making a patch to the source tarball and/or even
making a very-similar-but-yet-completely-independent product.


HTH & HAND & thanks again

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] convert string to number

2003-11-17 Thread Jay Blanchard
[snip]
> > [snip]
> > what is the easiest way to convert a string like this "1,300.99" to
a
> > number?
> > [/snip]
>
> http://www.php.net/settype

That'll just result in the number 1, though, since the conversion to
"float"
will stop at the comma.

If you know that it's just going to be commas in there, a simple
str_replace(',','',$number) will get rid of the commas. Then PHP's type
juggling will take care of the rest for you and treat it like a FLOAT if
it
needs to be. Or you can then use settype() to ensure it's a float.
[/snip]


*oops* You are right John, I pulled the trigger too soon in myresponse.
The brain skipped the comma entirely.

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



Re: [PHP] convert string to number

2003-11-17 Thread CPT John W. Holmes
From: "Jay Blanchard" <[EMAIL PROTECTED]>
> From: "Diana Castillo" <[EMAIL PROTECTED]>
>
> > [snip]
> > what is the easiest way to convert a string like this "1,300.99" to a
> > number?
> > [/snip]
>
> http://www.php.net/settype

That'll just result in the number 1, though, since the conversion to "float"
will stop at the comma.

If you know that it's just going to be commas in there, a simple
str_replace(',','',$number) will get rid of the commas. Then PHP's type
juggling will take care of the rest for you and treat it like a FLOAT if it
needs to be. Or you can then use settype() to ensure it's a float.

---John Holmes...

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



[PHP] Fwd: MMCache segmentation faults

2003-11-17 Thread Uros Gruber
Subject: MMCache segmentation faults

===8<==Original message text===
Hello!

I send this to [EMAIL PROTECTED]  but It was returned. So I'll ask here if somebody 
have any idea.

I upgrade my php and mmcache (php 4.3.4 and mmcache 2.4.6) and
I have a lot of

[Mon Nov 17 13:49:17 2003] [notice] child pid 32974 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:18 2003] [notice] child pid 32767 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:19 2003] [notice] child pid 33282 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:20 2003] [notice] child pid 33289 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:22 2003] [notice] child pid 33291 exit signal Segmentation fault (11)
[Mon Nov 17 13:49:24 2003] [notice] child pid 33346 exit signal Segmentation fault (11)

messages in my apache error log.

server is FreeBSD 5.1 Release.

my php.ini

zend_extension="/usr/local/lib/php/20020429/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"
mmcache.keys="shm_and_disk"
mmcache.sessions="shm_and_disk"
mmcache.content="shm_and_disk"

I delete cache folder when I upgrade. If i remove mmcache from php.ini
there's no problems. But strange is that pages load normaly.
  

-- 
Best regards,
 Uros  mailto:[EMAIL PROTECTED]


===8<===End of original message text===



-- 
lp,
 Uroš

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



RE: [PHP] msession - giving me a hard time

2003-11-17 Thread Guillaume Dupuis
Mea culpa!!

Even if my PHP is version 4.3.3, I had to compile it with
'--enable-trans-sid' in the configure. Now it works.

Faulty PHP doc:
PHP is capable of transforming links transparently. Unless you are using PHP
4.2 or later, you need to enable it manually when building PHP. Under UNIX,
pass --enable-trans-sid to configure. If this build option and the run-time
option session.use_trans_sid are enabled, relative URIs will be changed to
contain the session id automatically.

Now all works.

Thanks for your consistent and thorough help,
Guillaume

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 11:16 AM
To: Guillaume Dupuis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] msession - giving me a hard time


From: "Guillaume Dupuis" <[EMAIL PROTECTED]>

> This works. My second page has the suffix '?PHPSESSID=e6t9tu43j9tj39j...',
> that matches the 'echo $sessid' I've added to your script above, so this
> part did work. But to test it, I do this in my second page:
>
>  session_start();
> $sessid = session_id();
> echo $sessid;
> ?>
>
> $sessid does echo a session_id... but not the one as the one I passed
> it!!?!?! And I do see the right SID in the Address bar!

No reason that shouldn't be working. Let's help out PHP a little more...



Try that. You're telling PHP to use the session id passed in the URL (which
it should do by default, anyhow) by calling the session_id() function before
session_start().

Are you clearing your cookies while doing all of this? session_start() on
the second page may be picking up an old cookie instead of picking up the
value in the URL...

---John Holmes...

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



RE: [PHP] convert string to number

2003-11-17 Thread Jay Blanchard
[snip]
what is the easiest way to convert a string like this "1,300.99" to a
number?
[/snip]

http://www.php.net/settype

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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Dan Joseph
Hi,

> > Actually, their claim is that Microsoft environments are secure
> - you just
> > need the proper firewall (that, basically, the problems with
> Windows boxes
> > has to do with the firewall, not the OS).
> >
> > That one I laughed at.
>
> But it's true, you can solve most of the security problems by
> tightening up
> the firewall so that nothing goes in or out.

...and everyone needs to keep in mind that there isn't a 100% secure
operating system, or server environment.

-Dan Joseph

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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Mike R

You can't interface MySQL with ODBC?

-Mike


> 
> I agree. I've found MS SQL (and MS Access databases) to be extremely fast
> when well optimised, even with massive databases. As you can 
> interface with
> them using ODBC I prefer to use MS database backends when my 
> clients already
> have them installed alongside PHP for Win32.
> 
> C
> 
> 
> Hi,
> 
>   From my experiences, your coworkers are somewhat correct.  I found
> MySQL to
> be as fast in most cases, however in databases with millions of records,
> MySQL started slowing down before the MS SQL did.
> 
>   As for PHP being slower to program, I disagree.  Its about the same,
> and in
> some cases, PHP might have a few more shortcuts.
> 
>   Maybe they're using some visual editors to speed them up?
> 
> -Dan Joseph
> 
> > -Original Message-
> > From: Mike R [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 17, 2003 11:07 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Microsoft .NET arguement
> >
> >
> >
> > I have someone here at my desk arguing that Microsoft's .NET is
> > better than
> > PHP - faster to process, easier and quicker to program, etc.
> >
> > They also (claim) that Microsoft's SQL is much faster and such 
> vs. MySQL.
> >
> > Any comments to help me defend PHP or to educate me?
> >
> > :)
> >
> > -Mike
> >
> > --
> > 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
>  
> If you are not the intended recipient of this e-mail, please preserve the
> confidentiality of it and advise the sender immediately of any error in
> transmission. Any disclosure, copying, distribution or action taken, or
> omitted to be taken, by an unauthorised recipient in reliance upon the
> contents of this e-mail is prohibited. Somerfield cannot accept liability
> for any damage which you may sustain as a result of software viruses so
> please carry out your own virus checks before opening an attachment. In
> replying to this e-mail you are granting the right for that reply to be
> forwarded to any other individual within the business and also to 
> be read by
> others. Any views expressed by an individual within this message do not
> necessarily reflect the views of Somerfield.  Somerfield reserves 
> the right
> to intercept, monitor and record communications for lawful business
> purposes.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



Re: [PHP] Microsoft .NET arguement

2003-11-17 Thread Jason Wong
On Tuesday 18 November 2003 00:27, Mike R wrote:
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
>
> That one I laughed at.

But it's true, you can solve most of the security problems by tightening up 
the firewall so that nothing goes in or out.

-- 
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
--
/*
Save the whales.  Collect the whole set.
*/

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



[PHP] convert string to number

2003-11-17 Thread Diana Castillo
what is the easiest way to convert a string like this "1,300.99" to a
number?

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



Re: [PHP] fopen and preg_match

2003-11-17 Thread Jason Wong
On Tuesday 18 November 2003 00:03, Chris Hayes wrote:
> At 15:07 17-11-03, you wrote:

> >I have a code that should fetch the information from another webpage. The
> >code find's the page, but I can't make it stop on  sign.
> >
> >preg_match("| >class=\"listIndex\">1.+\<\/table\>|is", $buffer, $regs );
>
> It probably looks for the last table tag. Is that so? Then you need to tell
> the script in a modifier that it should not be greedy (not my terminology,
> but the regexp term for this).  The modifiers are the letters after the
> patern itself, in your example the i (do not make a difference between
> capital and small letters) and s ( I think: ignore line breaks). Try adding
> a U for making it non greedy. If that does not help check the docs on 'non
> greedy'.

Also, characters are being escaped unecessarily. The "table" fragment should 
probably be simply:

  

ie no need to escape the forward slash (/) and the greater-than sign (>).

-- 
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
--
/*
America!!  I saw it all!!  Vomiting!  Waving!  JERRY FALWELLING into
your void tube of UHF oblivion!!  SAFEWAY of the mind ...
*/

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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread chris . neale
I agree. I've found MS SQL (and MS Access databases) to be extremely fast
when well optimised, even with massive databases. As you can interface with
them using ODBC I prefer to use MS database backends when my clients already
have them installed alongside PHP for Win32.

C



-Original Message-
From: Dan Joseph [mailto:[EMAIL PROTECTED]
Sent: 17 November 2003 16:26
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Microsoft .NET arguement


Hi,

From my experiences, your coworkers are somewhat correct.  I found
MySQL to
be as fast in most cases, however in databases with millions of records,
MySQL started slowing down before the MS SQL did.

As for PHP being slower to program, I disagree.  Its about the same,
and in
some cases, PHP might have a few more shortcuts.

Maybe they're using some visual editors to speed them up?

-Dan Joseph

> -Original Message-
> From: Mike R [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 17, 2003 11:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Microsoft .NET arguement
>
>
>
> I have someone here at my desk arguing that Microsoft's .NET is
> better than
> PHP - faster to process, easier and quicker to program, etc.
>
> They also (claim) that Microsoft's SQL is much faster and such vs. MySQL.
>
> Any comments to help me defend PHP or to educate me?
>
> :)
>
> -Mike
>
> --
> 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
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

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



FW: [PHP] Having fits with input to array

2003-11-17 Thread Susan Ator
Sorry, forgot to post to the list.

sa

-Original Message-
From: Susan Ator 
Sent: Monday, November 17, 2003 11:12 AM
To: 'CPT John W. Holmes'
Subject: RE: [PHP] Having fits with input to array


D'oh. You're right. I have a tendency to do things the hard way. That's what
comes of getting too focused on doing things a certain way. :P

Thanks, I think that does it for me!

susan

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 11:12 AM
To: Susan Ator; ''Lowell Allen' '; 'PHP '
Subject: Re: [PHP] Having fits with input to array


- Original Message - 
From: "Susan Ator" <[EMAIL PROTECTED]>

> Hm... I should clarify this some more. This is the result of $Array2:
>
> Array (
> [0] => Array (
>   [0] => 15083
[snip]
> What I need is to be able to assign a variable to $Array2[0] - [0] so for
> the first one it would be:
>
>   $var0 = 15083
[snip]
> How do I get to this point?

The question is, why do you need to get to that point? I think you're doing
to much work. You already have the variable $Array2[0][0] that you can use
anywhere, why do you need to assign it to yet another variable.

Maybe you just need to look at foreach() for looping through the array?

What was your point of getting $var0, $var1, $var2, etc... there's probably
a better method for whatever you're doing.

---John Holmes...

-- 
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] Microsoft .NET arguement

2003-11-17 Thread Dan Joseph
Hi,

I will give MS credit, they are aware they need to do better, and are
making strides to be better.  I won't fault them on that until they give up,
or stop progressing.

As for secure environments and code, even linux+php applications and
servers can be volnerable.  I think the whole OS vs OS arguments, and Code
vs Code arguments (in regards to security) are humorous.  Yes, get a good
firewall, and have an auditor audit your system and code.  That will give
you a secure environment.

-Dan Joseph

> -Original Message-
> From: Mike R [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 17, 2003 11:28 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Microsoft .NET arguement
>
>
>
> Actually, their claim is that Microsoft environments are secure - you just
> need the proper firewall (that, basically, the problems with Windows boxes
> has to do with the firewall, not the OS).
>
> That one I laughed at.
>
> -Mike
>
>
>
> > and next they will no doubt claim that IIS (and windowz in general) is a
> > secure environment -- just the place to run your important applications.
> >
> >
> >
> > -- Original Message --
> > > From: Mike R <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Date: Monday, November 17, 2003 11:06:37 AM -0500
> > > Subject: [PHP] Microsoft .NET arguement
> > >
> > >
> > > I have someone here at my desk arguing that Microsoft's .NET is better
> > > than PHP - faster to process, easier and quicker to program, etc.
> > >
> > > They also (claim) that Microsoft's SQL is much faster and such vs.
> > > MySQL.
> > >
> > > Any comments to help me defend PHP or to educate me?
> > >
> > > :)
> > >
> > > -Mike
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > -- End Original Message --
> >
> >
> >
> >
>
> --
> 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] confusing ouput!

2003-11-17 Thread Jay Blanchard
[snip]
- I'm a newbie to this affair! So I hope this wasn't a wrong decision.
Nevertheless, the follwing are the few lines I added to the httpd.conf.
file:
 
#LoadModule php4_module c:/php/sapi/php4apache.dll 
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .php3
#AddType application/x-httpd-php .phtml 
#AddType application/x-httpd-php-source .phps
#AddModule mod_php4.c
#
[/snip]

All of those lines are commented out (the '#' sign). Uncomment them and
restart Apache.

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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Mike R

Actually, their claim is that Microsoft environments are secure - you just
need the proper firewall (that, basically, the problems with Windows boxes
has to do with the firewall, not the OS).

That one I laughed at.

-Mike



> and next they will no doubt claim that IIS (and windowz in general) is a
> secure environment -- just the place to run your important applications.
>
>
>
> -- Original Message --
> > From: Mike R <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Date: Monday, November 17, 2003 11:06:37 AM -0500
> > Subject: [PHP] Microsoft .NET arguement
> >
> >
> > I have someone here at my desk arguing that Microsoft's .NET is better
> > than PHP - faster to process, easier and quicker to program, etc.
> >
> > They also (claim) that Microsoft's SQL is much faster and such vs.
> > MySQL.
> >
> > Any comments to help me defend PHP or to educate me?
> >
> > :)
> >
> > -Mike
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> -- End Original Message --
>
>
>
>

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



[PHP] confusing ouput!

2003-11-17 Thread ike strong
For a trial, I saved the following input in ..\apache\htdocs as suggested. 
 


Today's Date


Today's Date (according to this web server) is



 
But this is the only thing I could see on my browser: "Today's Date (according to this 
web server) is"
 
After severeral trials and inspecting the httpd.conf configuration file, I tried the 
following input:
 

 
  PHP Test
 
 
 Hello World
 

 
This time nothing appeared on my browser. I'd really appreciate some help with this 
one.
 
I installed apache 1.3 as a server and it runs fine each time I click on "Start Apache 
in Console"
 
I'm mainly interested in using these facilities for my private learning so I chose to 
use PHP as a module in apache - I'm a newbie to this affair! So I hope this wasn't a 
wrong decision. Nevertheless, the follwing are the few lines I added to the 
httpd.conf. file:
 
#LoadModule php4_module c:/php/sapi/php4apache.dll 
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php .php3
#AddType application/x-httpd-php .phtml 
#AddType application/x-httpd-php-source .phps
#AddModule mod_php4.c
#
 
I'd appreciate to hear/read from anyone who has managed to solved this sort of problem 
before.
 
Thanks in advance
 
Ike
 


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

Re: [PHP] SSH and php

2003-11-17 Thread David T-G
Ryna --

...and then Ryan A said...
% 
% Hey David,

Hiya!


% 
% % Is it possible to run a SSH command from php?
% >Sure; it's possible to run any command from php.  It may not work all
% >that well, though :-)
% 
% heheh, good one. As helpful as usual :-D

Always there for ya, man :-)


% 
% >Good enough.  What do you want to do?
% 
% Basically stop/restart apache when i make changes to the httpd.conf file.

There are ways to do that -- I personally would create a kick script
outside of the htdocs tree, give the apache user permission to run that,
and call that script from an https page with some authentication -- but
you always have to fall back to "if that script fails, then I need to log
in and use the shell" anyway.


% But then thinking of it I realize that if I stop apache from a script, once
% apache is stopped
% I cant run any php to restart it...right?

You certainly can't run any php web script :-)


% So I guess my question gets cut down to basically "any good place/program to
% learn/use SSH?"

As you've been shown, ssh is nothing magical; what you want to do is
learn how to use a *NIX shell.  Think DOS command prompt.  If you can
already use a command prompt, then try an ssh in and look around (ls,
chdir, pwd, ...).


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


  1   2   >