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

2003-11-17 Thread Michael
Zend will never include a free encoder/accelerator into php by default.

What I am waiting for is Turck MMCache to offer a download of a file like
php-4.3.4.tar.gz with Turck included.  So when I need to upgrade php, I
would go download a new version of php from Turck instead of php.net.

What I want to know is ... Turck MMCache is open source and php is open
source so how hard is it to create that?



-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]
Sent: November 16, 2003 7:23 PM
To: PHP General list
Cc: John Smith
Subject: Re: [PHP] Include an encoder into PHP distribution?


John, et al --

...and then John Smith said...
%
% > I was not saying or implying that Zend controls PHP alone. In practice
% > they have the "knife and the cheese" in their hands, meaning currently
% > PHP programs depend on Zend Engine to run. Maybe when somebody develops
% > real PHP compilers things will be different.
%
% I know that you were not implying it, I just wanted to make my point.

Fair enough.


%
% In practice it seems that Zend has the final say on PHP,  and I think it's
% bad for the language.

Not at all.  If enough decide to include some other encoding engine
in PHP then Zend can happily withdraw all of their support from PHP,
perhaps making a new product called zPHP or such, and the PHP camp is
not controlled in any way.  It seems a bit extreme and probably not
worth it, but no materially different from supporting (insert your
favorite and my least favorite cause here) and watching us part ways.


%
% JS

I think that supporting this discussion any further might cause some
others to part ways with this list, so let's be done here :-)


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!

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



Re: [PHP] Unzip a file.

2003-11-17 Thread Raditha Dissanayake
For anyone playing around with zip files on a web application i hope you 
have updated your zip libraries there were some vulnerabilities in it 
recently.

Vincent M. wrote:

Kim Steinhaug wrote:

on phpclasses.org there is a ZIP class that does all you need to do.
Havnt got the time to give you the url right now, but look there.
All I found are classes to extract tar/gzip files:
http://www.phpclasses.org/search.html?words=zip&go_search=1&restrict=&method=and&sort=score 

Is there any I couldn't see ?

Thanks,
Vincent.


--
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] Re: greek in php-xml

2003-11-17 Thread Lucian Cozma
Send me a piece of the xml file you're having problems with. I'll make it
work (output a utf-8 html with greek characters).
BTW, do you use DOM or just the xml_parser_create functions?


"Pnp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I tried that, but still i got weird symbols.
> The xml, the xmlparser are set for utf-8 and so are the html pages.
>
> I used the code which is in the chm file ...
> Any ideas?
>
>
> "Lucian Cozma" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I've encountered this problem when developing for a greek company.
> > Do you create a html output from it ? If you do, make sure that you have
> > 
> > in the  tag of the html output.
> >
> > Lucian
> >
> > "Pnp" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi,
> > >
> > >  I want to read some texts in greek from an xml file and all i get  is
> > weird
> > > symbols..
> > >  The Xml's encoding is utf-8 and so is the xmlparser that I create.
> > >  Can anyone suggest anything?
> > >
> > > Thanx in advance,
> > > Panagiotis

-- 
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 Manuel Lemos
Hello,

On 11/17/2003 05:17 AM, Michael wrote:
Zend will never include a free encoder/accelerator into php by default.

What I am waiting for is Turck MMCache to offer a download of a file like
php-4.3.4.tar.gz with Turck included.  So when I need to upgrade php, I
would go download a new version of php from Turck instead of php.net.
What I want to know is ... Turck MMCache is open source and php is open
source so how hard is it to create that?
No. It is very simple. Turck MMCache is a shared library extension. You 
just need to drop the shared library (.so or .DLL) file in your PHP 
extensions directory and enable it in php.ini .

--

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] upload file size

2003-11-17 Thread Raditha Dissanayake
Gerard Samuel wrote:

On Friday 14 November 2003 12:48 pm, joe wrote:
 

is there a way to check the file size
without fully uploading the file?
   

No there isnt, well at least not via php...



correct. There are two solutions you can upload with a java applet, the
applet can be configured to lock the upload at a predefined limit. Would
save you a lot of bandwidth. The second is to upload via  perl script,
which can check the Content-length header *before* processing the file
upload and block it.  In fact megaupload - the php upload progress bar
that i did some time ago has this feature.
sorry about the belated reply message had been stuck in a que..

 



--
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] Re: Get value between 2 strings

2003-11-17 Thread Lucian Cozma
This should do the trick:

$line = "I want the value between word ONE and word TWO.  Please return
it...";
preg_match('/ONE(.*)TWO/i', $line, $ret);
print_r($ret);

"Matt Palermo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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] Get value between 2 strings

2003-11-17 Thread Justin French
On Monday, November 17, 2003, at 05:27  PM, 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.
Matt,

Regular expressions would be one solution:


// UNTESTED
$line = "I want the value between word ONE and word TWO.  Please return 
it...";
$match = preg_replace('/ONE (.*?) TWO/',' \\1 ',$line);
?>

Justin French

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


[PHP] Re: giving variable value in URL problem

2003-11-17 Thread Lucian Cozma
Try:

if (isset($_GET['status']) && $_GET['status'] ==0) {
echo "Trying";
}

The warning is triggered by the fact that you use a variable that was not
previously defined. Check it before use with isset.

If in php.ini the value error_reporting  =  E_ALL, it will output warnings.
If you want the warnings to dissapear, set in php.ini:

error_reporting = E_ALL & ~E_NOTICE

Lucian

"Burak Delice" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
>
> when I enter url like that http://localhost/menu.php?status=0 php return
an
> error below :
> "Warning: Undefined variable: status in
> D:\calismalar\cengiz_ozdelice\web\menu.php on line 41"
> my code on 41.line is :
> if ($status==0) echo '"trying";
>
> what is problem?
>
> thank you.

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



Re: [PHP] Unzip a file.

2003-11-17 Thread volker at multiartstudio dot de
tip, search php.net for zziplib

there are very useful hints and functions  from other users..
i found there everything i needed, but a class is somewhat 
bettersure.

regards,
volker
Raditha Dissanayake wrote:

For anyone playing around with zip files on a web application i hope 
you have updated your zip libraries there were some vulnerabilities in 
it recently.

Vincent M. wrote:

Kim Steinhaug wrote:

on phpclasses.org there is a ZIP class that does all you need to do.
Havnt got the time to give you the url right now, but look there.
All I found are classes to extract tar/gzip files:
http://www.phpclasses.org/search.html?words=zip&go_search=1&restrict=&method=and&sort=score 

Is there any I couldn't see ?

Thanks,
Vincent.


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


[PHP] MySQL Time Zones, correct codes, and global variable setting (was: Set time zone)

2003-11-17 Thread Dave G
> > GoLive Gurus,
> GoLive? This is PHP :P

Doh! Sorry about that. Got my wires crossed.

> http://www.php.net/putenv
> putenv("TZ=EST"); etc. (check the user notes).

  Ah, that's done it! Thank you!
  Now, of course, the problem is MySQL. My PHP scripts all think they
are in Japan, and my MySQL db thinks it's Nevada. My impression from
reading the MySQL online manual is that what I need to do is set the
GLOBAL variable "TZ" to the Japan time zone. Armed with information from
the MySQL online manual, in phpMyAdmin, in the SQL command entry field,
I tried:
SET GLOBAL TZ=JST;
But it keeps rejecting it. I also tried the following:
SET GLOBAL TZ=Japan;
SET GLOBAL timezone=JST;
SET GLOBAL timezone='JST';
... and as many other combinations of codes and punctuation that I could
think of. But I believe I'm barking up the wrong tree. Question one is,
what is wrong with my syntax?
  Another thing that I have noticed is missing from most of the
documentation I have seen on the net and in the manuals is a listing of
what all the accepted codes for different time zones are. Every example
always uses either GMT, EST, PST or UTC. So I guessed the code for Japan
was "JST". But when I used putenv("TZ=JST"), it was off by a few hours.
So then I tried putenv("TZ=Japan"), and it's now correct. I've seen some
reference that Linux machines have a configuration file which would keep
a list of various time zone codes, but I haven't come across any
reference on the web which tells me what that list looks like. So,
question two is, how can I tell which is the right code to set "TZ" to?
"JST"? "Japan"?
  Your help is 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] Good php WebMail Clients thru apache

2003-11-17 Thread Becoming Digital
SquirrelMail isn't bad and it's PHP-based.

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

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



- Original Message - 
From: "Jerry Alan Braga" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, 16 November, 2003 18:39
Subject: [PHP] Good php WebMail Clients thru apache


Any suggestions ?

-- 
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] Feature or Bug: Omission of closing PHP tag...

2003-11-17 Thread Becoming Digital
I'm guessing we don't have to include a '?>' anymore?  Not sure I like that idea...

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

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



- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "PHP-General" <[EMAIL PROTECTED]>
Sent: Sunday, 16 November, 2003 03:11
Subject: [PHP] Feature or Bug: Omission of closing PHP tag...


The word from internals is that this is a feature.

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

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

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



Re: [PHP] include/require not allowed in classes?

2003-11-17 Thread Pavel Jartsev
Boyan Nedkov wrote:
Initializing data members ("var"-s) of a class with non-constant values 
is completely legal operation in PHP, so I don't think this could be a 
reason for the problem.

hmmm... PHP manual says something else...

http://www.php.net/manual/en/language.oop.php

"In PHP 4, only constant initializers for var  variables are allowed. To 
initialize variables with non-constant values, you need an 
initialization function which is called automatically when an object is 
being constructed from the class. Such a function is called a 
constructor (see below)."



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


Re: [PHP] Feature or Bug: Omission of closing PHP tag...

2003-11-17 Thread Robert Cummings
On Mon, 2003-11-17 at 03:32, Becoming Digital wrote:
> I'm guessing we don't have to include a '?>' anymore?  Not sure I like that idea...

It's optional, so you can feel free to include it if it makes you happy.
But from a library standpoint, it's generally just a hassle to include
it and then pray you didn't have some whitespace following. IMHO the
code is cleaner if it has no HTML content (unless via print or echo) and
you don't include the closing tag.

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] Include an encoder into PHP distribution?

2003-11-17 Thread Michael
I've tried installing it but I need MS Visual Studio C++ so they have to
make it even easier.


Windows Installation Notes
==
To build Turck MMCache on Windows platform you will need MS Visual Studio
C++ 6.0.

Step 1. Compiling Turck MMCache
- Unpack php sources.
- Put mmcache sources under "ext/mmcache".
- Put "php4ts.lib" into "ext/mmcache".
- Copy "main/config.w32.h.in" into "main/config.w32.h".
- Open project file "ext/mmcache/mmcache.dsp".
- Select release configuration and build "mmcache.dll".

Step 2. Installing Turck MMCache
Copy "mmcache.dll" into your PHP extension folder.

Step 3. Configuring Turck MMCache
Add the following lines into your "php.ini" file (usually
"c:\winnt\php.ini")



-Original Message-
From: Manuel Lemos [mailto:[EMAIL PROTECTED]
Sent: November 17, 2003 2:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Include an encoder into PHP distribution?


Hello,

On 11/17/2003 05:17 AM, Michael wrote:
> Zend will never include a free encoder/accelerator into php by default.
>
> What I am waiting for is Turck MMCache to offer a download of a file like
> php-4.3.4.tar.gz with Turck included.  So when I need to upgrade php, I
> would go download a new version of php from Turck instead of php.net.
>
> What I want to know is ... Turck MMCache is open source and php is open
> source so how hard is it to create that?

No. It is very simple. Turck MMCache is a shared library extension. You
just need to drop the shared library (.so or .DLL) file in your PHP
extensions directory and enable it in php.ini .

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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

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



[PHP] PHP browser windows control.

2003-11-17 Thread Carles Xavier Munyoz Baldó
Hi,
I would like to know if it is possible to have any kind of control from php 
over the web browser openned windows.

I have the main web browser window and another soon window. 
I want to know if this windows is open. If it is not open, open it, and if is 
already open, bring it to front.
May I do it using PHP ?

I believe thah I can do it using javascript ... may someone give me a web 
address where can I get any help about this iussue ?

Greetings.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



Re: [PHP] Unzip a file.

2003-11-17 Thread Kim Steinhaug
Hello!

This one :
http://www.phpclasses.org/browse.html/package/870.html

I remember doing the "zip" research a while ago and tested several classes
and
methods, but this class was the one that worked flawlessly! Ive installed
and
used this class myself, and it works on both linux and windows.

This can zip down a directory of 1GB of data (tested), and depack it to
another
directory (tested). You can also extract single files out of the directory.

If you havnt found a sollution you should try this one.

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


"Vincent M." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Kim Steinhaug wrote:
> > on phpclasses.org there is a ZIP class that does all you need to do.
> > Havnt got the time to give you the url right now, but look there.
> >
> All I found are classes to extract tar/gzip files:
>
http://www.phpclasses.org/search.html?words=zip&go_search=1&restrict=&method=and&sort=score
>
> Is there any I couldn't see ?
>
> Thanks,
> Vincent.

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



Re: [PHP] Storing images for photo album?

2003-11-17 Thread Kim Steinhaug
Yes,

What system are you using for generating the thumbs for your images?
ImageMagick or GD? If you are able to choose you should by all means
choose ImageMagick since its much more powerfull than GD.

Ive been using both (meaning, I use GD as a second sollution where Image
Magick isnt available, for extra compability) and never run into memory
problems. Only thing to remember when batching many Hi-Res images that the
default timeout is 30 seconds, but aslong as you are processing 1 image
into several others this should never be a problem.

Give us some specs and we might be able to help you!

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] PHP browser windows control.

2003-11-17 Thread Pavel Jartsev
Carles Xavier Munyoz Baldó wrote:
...
May I do it using PHP ?
No, PHP is "unfortunately" server-side. :)

I believe thah I can do it using javascript ... may someone give me a web 
address where can I get any help about this iussue ?

Maybe here: http://javascript.internet.com/

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


Re: [PHP] Can't fetch HTTP POST data in PHP?

2003-11-17 Thread Kim Steinhaug
I dont see the problem here at all, here is my test :
CutNpaste into your own environment ans save as .php file .

All I did was remove the php_info() so that variables dont get
messed up (apparently), and removed the error_reporting.

Result gives this :
array(3) { ["username"]=> string(3) "123" ["email"]=> string(3) "123"
["submit"]=> string(10) "Submit me!" }

-



 Untitled


\n";
//phpinfo();
echo "\n";
var_dump($_POST);
?>

Your name: 
Email: 




--

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] _SESSION, _POST, and _GET

2003-11-17 Thread Marek Kilimajer
David T-G wrote:
Yeah.  In fact, about half an hour ago I figured that I was spending more
time figuring out how to extract in the right order -- or in a limited
way -- than I would just doing it right, so I started running through the
code looking for any $pw and friends to change :-)
When register_globals are on, the order in which variables are extracted 
are controled by gpc_order setting. G - GET, P - POST, C - COOKIE, later 
overwrite earlier.

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


[PHP] greek in php-xml

2003-11-17 Thread pnp
Hi, I'm developing a web site for a greek company and I want to show some
greek texts from an xml file to an html page. The pages encoding is utf-8.
So is the xml file and the xmlparses params. But the output is a bunch of
???...

What am I doing wrong? Is there any way to do this?

Thanks in advance,
Peter

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



[PHP] php-xml

2003-11-17 Thread pnp
Hi, I'm developing a web site for a greek company and I want to show some
greek texts from an xml file to an html page. The pages encoding is utf-8.
So is the xml file and the xmlparses params. But the output is a bunch of
???...

What am I doing wrong? Is there any way to do this?

Thanks in advance,
Peter

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



Re: [PHP] Can't fetch HTTP POST data in PHP?

2003-11-17 Thread Ivan Marenic
Hi, Kim.

Your example is good but you missed the point here. Chris knows exactly
where my problem is.

Sending HTTP POST from mobile device is a bit different than using classic
web client. It shouldnt be, but it is.

Data is going trough WAP gateways, mobile operators proxeis ...

Worst case scenario is that some header items can be generated by
application, some by the phone's runtime, and others by the WAP gateway.

And those reaching the server might not be what we expect.

Regards,
Ivan







"Kim Steinhaug" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I dont see the problem here at all, here is my test :
> CutNpaste into your own environment ans save as .php file .
>
> All I did was remove the php_info() so that variables dont get
> messed up (apparently), and removed the error_reporting.
>
> Result gives this :
> array(3) { ["username"]=> string(3) "123" ["email"]=> string(3) "123"
> ["submit"]=> string(10) "Submit me!" }
>
> -
> 
> 
> 
>  Untitled
> 
> 
>  //error_reporting(E_ALL);
> echo "\n";
> //phpinfo();
> echo "\n";
> var_dump($_POST);
> ?>
> 
> Your name: 
> Email: 
> 
> 
> 
> 
> --
>
> -- 
> Kim Steinhaug
> ---
> There are 10 types of people when it comes to binary numbers:
> those who understand them, and those who don't.
> ---
>
>
> "David T-G" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]

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



[PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
Hello again guys,  thanks for the help over the past 48 hours :)

Over the past week i have had the job of tweaking the php pages of a friends
site.  so far so good :)

Now i am onto the admin area for running the website.  I downloaded one of
the many db managers scripts from www.hotscripts.com
Luckly its a very simple app, easy to mod.  Anyways most of my php knowledge
is in conjuction with flash www.innovativedesigns.org.uk.  most of the
problems i have had here have been fairly simple to learn and fix.

Now the job this week is with php+html (total newbie to this area). most of
the problems i have been able to fix with some help from here as well.

http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

~This is the admin area.  I manged to get the drop down menu working to
select the revelent table and then set $tablename with the result being
displayed in the next page as:
$tablename table";
?>
The new page has 4 links to load other php files to edit,delete, view, and
add new data to the DB
On the links have:
View database

~Now in the edit.php i have :
$result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
table");

$tablename is not being passed with the link.

What am i missing?


Cheers
Paul

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



[PHP] Re: thanks for the summary (was "Re: [PHP] Can't fetch ...")

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

...and then Ivan Marenic said...
% 
% Sending HTTP POST from mobile device is a bit different than using classic
% web client. It shouldnt be, but it is.

Ouch.  How very interesting.

I had missed that through this thread, so I'm really grateful for the
summary.  I'm even more grateful because one of the items on my feature
list is to allow customers to post pix directly from their phone cams; it
sounds like there could be some wrinkles in there.


Thanks again & 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] Include an encoder into PHP distribution?

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

...and then Michael said...
% 
% I've tried installing it but I need MS Visual Studio C++ so they have to
% make it even easier.

It's easier already: abandon Windows for some *NIX system ;-)

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
looked at either (I don't even know what an encoder does; I *think* that
it could be a precompiler or an obfuscator but don't really care), but
neither can be impossible to build and so you can have it without worry
of politics -- or you could write your own in something other than VS C++
or get a different one or...


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] setting a global var so that all pages can see var

2003-11-17 Thread Burhan Khalid
PAUL FERRIE wrote:

Hello again guys,  thanks for the help over the past 48 hours :)

Over the past week i have had the job of tweaking the php pages of a friends
site.  so far so good :)
Now i am onto the admin area for running the website.  I downloaded one of
the many db managers scripts from www.hotscripts.com
Luckly its a very simple app, easy to mod.  Anyways most of my php knowledge
is in conjuction with flash www.innovativedesigns.org.uk.  most of the
problems i have had here have been fairly simple to learn and fix.
Now the job this week is with php+html (total newbie to this area). most of
the problems i have been able to fix with some help from here as well.
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

~This is the admin area.  I manged to get the drop down menu working to
select the revelent table and then set $tablename with the result being
displayed in the next page as:
$tablename table";
?>
The new page has 4 links to load other php files to edit,delete, view, and
add new data to the DB
On the links have:
View database
~Now in the edit.php i have :
$result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
table");
$tablename is not being passed with the link.

What am i missing?
RTFM @ http://www.php.net/security.registerglobals
STFA
This question is another one of those twice daily ones.

--
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] Re: Alternet row colors

2003-11-17 Thread Chris Hayes
At 01:28 16-11-03, you wrote:
It's so much easier to use the mod (%) operator:
Ah, the alternating rowcolors.
I have a proposal that's a lot lighter on your server.
I prefer this as it does not require a calculation for each row (%2), and 
no counter (and no numrows call). I think it will be noticably faster with 
longer result sets. And your code is shorter.

$rowcolor=FALSE; //initialise

echo '';

while(...walk trough resultset...)
 {
 echo ''.$somevalue.' ';
 $rowcolor=!$rowcolor;  //toggles true/false and hence the row color
 }
echo '';





Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
lol
i not that feeling whaen it come to flash based questions  ;)

Cheers]

"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PAUL FERRIE wrote:
>
> > Hello again guys,  thanks for the help over the past 48 hours :)
> >
> > Over the past week i have had the job of tweaking the php pages of a
friends
> > site.  so far so good :)
> >
> > Now i am onto the admin area for running the website.  I downloaded one
of
> > the many db managers scripts from www.hotscripts.com
> > Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
> > is in conjuction with flash www.innovativedesigns.org.uk.  most of the
> > problems i have had here have been fairly simple to learn and fix.
> >
> > Now the job this week is with php+html (total newbie to this area). most
of
> > the problems i have been able to fix with some help from here as well.
> >
> > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >
> > ~This is the admin area.  I manged to get the drop down menu working to
> > select the revelent table and then set $tablename with the result being
> > displayed in the next page as:
> >  > print "MyAdmin database for $tablename table";
> > ?>
> > The new page has 4 links to load other php files to edit,delete, view,
and
> > add new data to the DB
> > On the links have:
> > View database
> >
> > ~Now in the edit.php i have :
> > $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> > table");
> >
> > $tablename is not being passed with the link.
> >
> > What am i missing?
>
> RTFM @ http://www.php.net/security.registerglobals
> STFA
>
> This question is another one of those twice daily ones.
>
> --
> 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] Re: GD question

2003-11-17 Thread DvDmanDT
$im=imagecreatetruecolor(9,9);
$im2=imagecreatefrompng('tile.png');
imagecopy($im,$im2,0,0,0,0,3,3);
imagecopy($im,$im2,3,0,0,0,3,3);
imagecopy($im,$im2,6,0,0,0,3,3);
imagecopy($im,$im2,0,3,0,0,3,3);
imagecopy($im,$im2,6,3,0,0,3,3);
imagecopy($im,$im2,0,6,0,0,3,3);
imagecopy($im,$im2,3,6,0,0,3,3);
imagecopy($im,$im2,6,6,0,0,3,3);
imagepng($im);
imagedestroy($im);imagedestroy($im2);

or something like that.. :s
-- 
// 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]
##
"René fournier" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
I want to write a function the creates a new image composited from a
3x3 tile. The idea is that the center tile will be a photo, and the
surrounding eight images will constitute a border and shadow to the
composited image. So... The eight "border/shadow" images will always be
the same, but the center image will be unique.

Anyways, I've been playing with GD functions for a little while, and
would appreciate any suggestions on how to accomplish this. I haven't
been able to find a good tutorial on this kind of thing
specifically—compositing tiles of images into a single image.

Any ideas?

...Rene=

-- 
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 John W. Holmes
David T-G wrote:
...and then Michael said...
> 
> I've tried installing it but I need MS Visual Studio C++ so they have to
> make it even easier.
>
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.  
That's not really the issue here. Sure, anyone can build it for their 
own server. That's all well and good. But try distributing a script 
that's dependent upon it and telling your clients that they must also 
install it, or get their ISP to install it. That's the PITA part.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] Re: thanks for the summary (was "Re: [PHP] Can't fetch ...")

2003-11-17 Thread Kim Steinhaug
Alrighty! That sheds some more light on this.
How exactly can I replicate this scenario then, using my mobile phone?

I have a Nokia 3610i i think, with MMS capabilituies and GPRS WAP.
Ive never accually thought of expanding website possibilities with this
use, how excatly do I post from my mobile?

It might be a dumb question, but when I know this I might be able to
look further into the problem.

-- 
Kim Steinhaug
---
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---


"David T-G" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

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



Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread PAUL FERRIE
I am still stuck
I now have this in the navigation page
{$_GET['tablename']}";

} else {
 "$tablename did not get sent";
}
?>
this gets the tablename from the previous page from the dropdown menu
but still the other pages are not picking it up :(
Please i need to get this working

Cheers
paul

"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> PAUL FERRIE wrote:
>
> > Hello again guys,  thanks for the help over the past 48 hours :)
> >
> > Over the past week i have had the job of tweaking the php pages of a
friends
> > site.  so far so good :)
> >
> > Now i am onto the admin area for running the website.  I downloaded one
of
> > the many db managers scripts from www.hotscripts.com
> > Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
> > is in conjuction with flash www.innovativedesigns.org.uk.  most of the
> > problems i have had here have been fairly simple to learn and fix.
> >
> > Now the job this week is with php+html (total newbie to this area). most
of
> > the problems i have been able to fix with some help from here as well.
> >
> > http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
> >
> > ~This is the admin area.  I manged to get the drop down menu working to
> > select the revelent table and then set $tablename with the result being
> > displayed in the next page as:
> >  > print "MyAdmin database for $tablename table";
> > ?>
> > The new page has 4 links to load other php files to edit,delete, view,
and
> > add new data to the DB
> > On the links have:
> > View database
> >
> > ~Now in the edit.php i have :
> > $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> > table");
> >
> > $tablename is not being passed with the link.
> >
> > What am i missing?
>
> RTFM @ http://www.php.net/security.registerglobals
> STFA
>
> This question is another one of those twice daily ones.
>
> --
> 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] php-xml

2003-11-17 Thread Becoming Digital
Please post some of your code.  It is incredibly difficult to help you without it.

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

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



- Original Message - 
From: "pnp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, 17 November, 2003 05:42
Subject: [PHP] php-xml


Hi, I'm developing a web site for a greek company and I want to show some
greek texts from an xml file to an html page. The pages encoding is utf-8.
So is the xml file and the xmlparses params. But the output is a bunch of
???...

What am I doing wrong? Is there any way to do this?

Thanks in advance,
Peter

-- 
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] Feature or Bug: Omission of closing PHP tag...

2003-11-17 Thread Becoming Digital
> from a library standpoint, it's generally just a hassle to include
> it and then pray you didn't have some whitespace following. 

I hadn't thought of it that way.  I run everything through a code cleaner to prevent 
just that, but it might be nice to stop doing so.

> code is cleaner if it has no HTML content (unless via print or echo) and
> you don't include the closing tag.

For small blocks of HTML, I'm inclined to agree.  I still prefer that large blocks be 
printed "plainly," both from an editing and (slight) performance standpoint, but I see 
where you're coming from.

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

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



- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Becoming Digital" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Monday, 17 November, 2003 03:42
Subject: Re: [PHP] Feature or Bug: Omission of closing PHP tag...


On Mon, 2003-11-17 at 03:32, Becoming Digital wrote:
> I'm guessing we don't have to include a '?>' anymore?  Not sure I like that idea...

It's optional, so you can feel free to include it if it makes you happy.
But from a library standpoint, it's generally just a hassle to include
it and then pray you didn't have some whitespace following. IMHO the
code is cleaner if it has no HTML content (unless via print or echo) and
you don't include the closing tag.

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

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

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



Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread Pavel Jartsev
PAUL FERRIE wrote:

> ...
add new data to the DB
On the links have:
View database
U are outputting those links incorrectly, because resulting HTML 
contains "$tablename". Try output those links this way...

View 
database

...or this way


echo 'View 
database';
?>



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


[PHP] Re: setting a global var so that all pages can see var still :(

2003-11-17 Thread PAUL FERRIE
How would i pass tablename in the submit button?
Check out edit record u wil see
http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html

Cheers
Paul

"Paul Ferrie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello again guys,  thanks for the help over the past 48 hours :)
>
> Over the past week i have had the job of tweaking the php pages of a
friends
> site.  so far so good :)
>
> Now i am onto the admin area for running the website.  I downloaded one of
> the many db managers scripts from www.hotscripts.com
> Luckly its a very simple app, easy to mod.  Anyways most of my php
knowledge
> is in conjuction with flash www.innovativedesigns.org.uk.  most of the
> problems i have had here have been fairly simple to learn and fix.
>
> Now the job this week is with php+html (total newbie to this area). most
of
> the problems i have been able to fix with some help from here as well.
>
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/adm/myadmin.html
>
> ~This is the admin area.  I manged to get the drop down menu working to
> select the revelent table and then set $tablename with the result being
> displayed in the next page as:
>  print "MyAdmin database for $tablename table";
> ?>
> The new page has 4 links to load other php files to edit,delete, view, and
> add new data to the DB
> On the links have:
> View database
>
> ~Now in the edit.php i have :
> $result = mysql_query("SELECT * FROM $tablename")or die("couldnt select
> table");
>
> $tablename is not being passed with the link.
>
> What am i missing?
>
>
> Cheers
> Paul

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



[PHP] Is PHP License GPL?

2003-11-17 Thread Chris
I was looking for license information on the PHP site and only found "The
PHP License, version 3.0" http://www.php.net/license/3_0.txt

1 - Is this license information only applicable to PHP version 3.0?
2 - Is there no license for Version 4+ or is this now covered by GPL?

>From the PHP web site:
Q. Why is PHP 4 not dual-licensed under the GNU General Public License (GPL)
like PHP 3 was?

A. GPL enforces many restrictions on what can and cannot be done with the
licensed code. The PHP developers decided to release PHP under a much more
loose license (Apache-style), to help PHP become as popular as possible.

3 - What is dual-licensed mean?

4 - Where can I find this "loose license (Apache-style)" agreement?


Thanks
Chris

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



[PHP] Unexpected result in floor function

2003-11-17 Thread ruben
Hi:

Why is the "floor" function returning 27564 instead of 27565 in this 
script? PHP version is 4.2.2.

Thanks!
Ruben.


#!/usr/bin/php -q



$b = 275.65 * 100;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b);// Incorrect. why 27564?
$b = 27565;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b)."\n\n";// Correct
?>

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


RE: [PHP] PHP fopen function

2003-11-17 Thread Jay Blanchard
[snip]
Yes, I am calling the fopen with two parameters.
The filename is also a string. The problem is when
I pass a string variable the fopen fails but succeeds
when I pass a constant string.
[/snip]

Can you show us the actual code for your fopen? Including the place
where the string variable is set up?

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



Re: [PHP] Is PHP License GPL?

2003-11-17 Thread David Otton
On Mon, 17 Nov 2003 08:44:52 -0600, you wrote:

>I was looking for license information on the PHP site and only found "The
>PHP License, version 3.0" http://www.php.net/license/3_0.txt
>
>1 - Is this license information only applicable to PHP version 3.0?

The licence is bundled with the software.

>2 - Is there no license for Version 4+ or is this now covered by GPL?

I think you'll find that "The PHP License, version 3.0" means that it's
version 3.0 of the document, not that it only applies to version 3.0 of the
software. (I can see how it would be ambiguous).

>3 - What is dual-licensed mean?

Released under more than one licence. For example, you could release a
photograph under creative commons for non-commercial use but require anyone
who wants to use it comemrically to agree to a different licence.

>4 - Where can I find this "loose license (Apache-style)" agreement?

AFAIK 3.0 is the latest version of the document.

-- 
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 Manuel Lemos
Hello,

On 11/17/2003 06:57 AM, Michael wrote:
I've tried installing it but I need MS Visual Studio C++ so they have to
make it even easier.
Yes, you are right for those that want to build it from source on 
Windows, having to buy MSVC++ may be a drag. I think I saw somewhere 
that there is a build to build it with CygWin though.

Anyway, the Turck author provides already built extensions DLL for the 
latest PHP versions. So you really do not have build it yourself.

http://sourceforge.net/project/showfiles.php?group_id=69426

--

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] Unexpected result in floor function

2003-11-17 Thread Randal Neirynck
This has to do with the floating point precision.

I quote the manual:
It is quite usual that simple decimal fractions like 0.1 or 0.7 cannot be
converted into their internal binary counterparts without a little loss of
precision. This can lead to confusing results: for example,
floor((0.1+0.7)*10) will usually return 7 instead of the expected 8 as the
result of the internal representation really being something like
7.99

This is related to the fact that it is impossible to exactly express some
fractions in decimal notation with a finite number of digits. For instance,
1/3 in decimal form becomes 0.333. . ..

So never trust floating number results to the last digit and never compare
floating point numbers for equality. If you really need higher precision,
you should use the arbitrary precision math functions or gmp functions
instead.


Hope this helps you

Randal

- Original Message - 
From: "ruben" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 17, 2003 1:52 PM
Subject: [PHP] Unexpected result in floor function


> Hi:
>
> Why is the "floor" function returning 27564 instead of 27565 in this
> script? PHP version is 4.2.2.
>
> Thanks!
> Ruben.
>
>
>
> #!/usr/bin/php -q
>
> 
> $b = 275.65 * 100;
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b);// Incorrect. why 27564?
>
> $b = 27565;
> echo "\n\nb= ".$b;
> echo "\nfloor(b)= ".floor($b)."\n\n";// Correct
>
> ?>
>
> -- 
> 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] Single Session for different websites

2003-11-17 Thread Manisha Sathe
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 ?

Thanks in advance
manisha

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



Re: [PHP] Unexpected result in floor function

2003-11-17 Thread Marek Kilimajer
ruben wrote:
Hi:

Why is the "floor" function returning 27564 instead of 27565 in this 
script? PHP version is 4.2.2.

Thanks!
Ruben.


#!/usr/bin/php -q



$b = 275.65 * 100;
$b = (int)$b;
/*
$b was a floating point number with value something like 27564.989, 
when displayed it shows correctly 27565, but in calculations 
27564.989 is used.

Q: Do you know why pentiums are faster than 486 processors?
A: Because 486 computes, pentium guesses.
*/
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b);// Incorrect. why 27564?
$b = 27565;
echo "\n\nb= ".$b;
echo "\nfloor(b)= ".floor($b)."\n\n";// Correct
?>

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


[PHP] fopen and preg_match

2003-11-17 Thread Sami Kyösti
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.

Where is the problem?

Here is the code
-
$fp=fopen("http://www.yle.fi/top40/index.php?page=lista_singlet20","r";);
$buffer = fread ($fp, 100);
preg_match("|1.+\<\/table\>|is", $buffer, $regs );
$table = $regs[0];

echo "$table";
-
Thanks for advance
Sami
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] WinXP+Apache2+php4+php5=almost true

2003-11-17 Thread Øystein Håland
I had no problem installing php4 as sapi module and php5 as cgi executeable.
The server starts with no error messages. BUT, when I try opening a file
(phpinfo.php5 with content  the server return a 500
Internal Server Error.
Have the following lines added to httpd.conf

LoadModule php4_module "D:/php/sapi/php4apache2.dll"
ScriptAlias /php5/ "D:/php5/"
Action application/x-httpd-php5 /php5/php.exe
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php5 .php5

-- 
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 Jay Blanchard
[snip]
In practice it seems that Zend has the final say on PHP,  and I think
it's
bad for the language.
[/snip]

That is just plain incorrect. If there were a final arbiter PHP would
cease to be truly open source, and I think the folks on the PHP-DEV list
would be quick to correct you.

--
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
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
> looked at either (I don't even know what an encoder does; I *think* that
> it could be a precompiler or an obfuscator but don't really care), but
> neither can be impossible to build and so you can have it without worry
> of politics -- or you could write your own in something other than VS C++
> or get a different one or...

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

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

Why don't I make my own?  I don't know how.  Should I learn and do it?  No
because there's already an open source encoder and accelerator.  Why do
redundant work?

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



[PHP] easy and simple way to read xml into array

2003-11-17 Thread Victor Spång Arthursson
Hi!

Need to read a xml-file into an array, but searching around I havent 
found a way that's easy and simple… Arent there an easy way in PHP to 
accomplish this?

Sincerely

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


RE: [PHP] Having fits with input to array

2003-11-17 Thread Susan Ator
Hm... I should clarify this some more. This is the result of $Array2:

Array ( 
[0] => Array (
  [0] => 15083
  [1] => bash
  [2] => S
  [3] => 4380
  [4] => 10:31
  [5] => 000
  [6] => sator
  [7] => 00:00:00
  [8] => -bash 
  )
[1] => Array (
  [0] => 15126
  [1] => bash
  [2] => S
  [3] => 4380
  [4] => 10:31
  [5] => 000
  [6] => sator
  [7] => 00:00:00
  [8] => -bash
  )
[2] => Array (
  [0] => etc...
  )
) 

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
  $var1 = bash
  $var2 = S
  $var3 = 4380
  etc...

How do I get to this point?

Susan

-Original Message-
From: Susan Ator 
Sent: Friday, November 14, 2003 6:35 PM
To: 'CPT John W. Holmes '; ''Lowell Allen' '; 'PHP '
Subject: RE: [PHP] Having fits with input to array


Actually, what I need to do is:

  $var1 = $Array2[1]
  $var2 = $Array2[2]
  etc...

but I just seem to get

  Array

as the output of $var1, $var2, etc...

susan

-Original Message-
From: CPT John W. Holmes
To: Susan Ator; 'Lowell Allen'; PHP
Sent: 11/14/03 4:01 PM
Subject: Re: [PHP] Having fits with input to array

From: "Susan Ator" <[EMAIL PROTECTED]>

> Perfect! That did exactly what I needed.

Good...

> Now, *ahem*, I thought I knew how to assign variables to the elements
in
> Array2 but *cough* I'm somewhat befuddled. I've not been able to find
> anything in the online php manual. Could you point me in the right
direction
> for that?

Not sure I'm following you, but

$Array2[] = $somvariable;

will add the value of $somevariable to the next element of $Array2.

Can you explain a little more what you want if that's not it.

---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] SSH and php

2003-11-17 Thread Ryan A
Hey David,

% 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


% coming from a windows background I have no idea about shell/SSH and am
% pretty lost.
% Doing a quick search on google for "SSH commands" and "SSH help" returned
% quite a lot
% of crap that really didnt help me learn.

>Good enough.  What do you want to do?

Basically stop/restart apache when i make changes to the httpd.conf file.
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?
So I guess my question gets cut down to basically "any good place/program to
learn/use SSH?"



 Cheers,
 -Ryan
PHP Web hosting http://Bestwebhosters.com


- Original Message - 
From: "David T-G" <[EMAIL PROTECTED]>
To: "PHP General list" <[EMAIL PROTECTED]>
Cc: "Ryan A" <[EMAIL PROTECTED]>
Sent: Monday, November 17, 2003 4:23 AM
Subject: Re: [PHP] SSH and php

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



[PHP] WinXP+Apache2+php4+php5=almost true

2003-11-17 Thread Øystein Håland
I had no problem installing php4 as sapi module and php5 as cgi executeable.
The server starts with no error messages. BUT, when I try opening a file
(phpinfo.php5 with content  the server return a 500
Internal Server Error.
Have the following lines added to httpd.conf

LoadModule php4_module "D:/php/sapi/php4apache2.dll"
ScriptAlias /php5/ "D:/php5/"
Action application/x-httpd-php5 /php5/php.exe
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php5 .php5




-- 
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 Curt Zirzow
* 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



Re: [PHP] SSH and php

2003-11-17 Thread Duncan Hill
On Monday 17 November 2003 15:02, Ryan A wrote:
> So I guess my question gets cut down to basically "any good place/program
> to learn/use SSH?"

No such thing as an 'ssh command' really.. apart from the command used to 
invoke SSH.  SSH (crudely) is an encrypted form of telnet.

You need a beginner's guide on unix shell commands - cd, ls, etc

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



Re: [PHP] Can't fetch HTTP POST data in PHP?

2003-11-17 Thread Curt Zirzow
* Thus wrote Arne Rusek ([EMAIL PROTECTED]):
> 
> If someone is interested in reading through the whole result it could
> be downloaded from
> 
>   http://zonk.matfyz.cz/php_post_problem

Your problem exists here:

Server API => Command Line Interface
_ENV["SERVER_SOFTWARE"] => Boa/0.94.13

Seeing this tells me your webserver is not configured correctly,
Boa should not be using the CLI version of php it should be using
the CGI version.




Curt
-- 
"My PHP key is worn out"

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

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



Re: [PHP] SSH and php

2003-11-17 Thread Mike Migurski
>% Doing a quick search on google for "SSH commands" and "SSH help" returned
>% quite a lot
>% of crap that really didnt help me learn.
>
>>Good enough.  What do you want to do?
>
>Basically stop/restart apache when i make changes to the httpd.conf file.
>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?

Right. And you wouldn't be able to stop it in the first place, unless
youre system was so insecure that Apache ran as a privileged user.


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

I think that learning SSH isn't really what you're after - you want to
learn how to use the command line interface, which is a whole different
thing (SSH is just the intermediary program you use to access the remote
machine). It depends on the shell you're using, the operating system
you're on, the location of Apache binaries, your $PATH, and a wide range
of other factors.

In the normal case (unix OS, you have sudo or root permissions, and
everything is within your path) it's a simple one-liner, like so:

sudo apachectl graceful


-mike.

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

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



Re: [PHP] Can't fetch HTTP POST data in PHP?

2003-11-17 Thread Curt Zirzow
* Thus wrote Ivan Marenic ([EMAIL PROTECTED]):
> I did not omit content.
> Copied whole text box in sniffer using context menu comands (select all,
> copy) - pasted to news agent.
> There is no content.

I didn't see the output of phpinfo or your print_r(). that leads me
to believe that your sniffer is only catching the headers.

Curt
-- 
"My PHP key is worn out"

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

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



Re: [PHP] php-xml

2003-11-17 Thread Curt Zirzow
* Thus wrote pnp ([EMAIL PROTECTED]):
> Hi, I'm developing a web site for a greek company and I want to show some
> greek texts from an xml file to an html page. The pages encoding is utf-8.
> So is the xml file and the xmlparses params. But the output is a bunch of
> ???...

You need to set the charset for the document to a greek charset so
it knows how the characters are encoded. You also have to make sure
that that charset is on the computer viewing the page.

ie:
  header('Content-Type: text/html; charset=ISO-8895-7');

Curt
-- 
"My PHP key is worn out"

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

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



Re: [PHP] setting a global var so that all pages can see var

2003-11-17 Thread Curt Zirzow
* Thus wrote PAUL FERRIE ([EMAIL PROTECTED]):
> Hello again guys,  thanks for the help over the past 48 hours :)
> 
> Over the past week i have had the job of tweaking the php pages of a friends
> site.  so far so good :)
> 
> Now i am onto the admin area for running the website.  I downloaded one of
> the many db managers scripts from www.hotscripts.com

You should try phpmyadmin, you wont have to meddle around with the
code except for configuring it, which can be done in less than 30
seconds.

http://www.phpmyadmin.net/

Curt
-- 
"My PHP key is worn out"

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

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



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

2003-11-17 Thread Guillaume Dupuis
> Now, if you don't see any session ID appended to the URL, that means SID
> is empty and you're more than likely depending upon cookies. So, you
> need to retrieve the session id and append it to the URL yourself.
>
>  $sessname = session_name();
> $sessid = session_id();
>
@ echo $sessid;
>
> echo "Server 2";
> ?>

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:



$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!

What the ???
Thanks in advance.

Guillaume
P.S.
PHP v4.3.3, with MSESSION v1.21 downloaded 2 weeks ago, thanks :)

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 8:29 PM
To: Guillaume Dupuis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] msession - giving me a hard time


Guillaume Dupuis wrote:

> This is now my initial page:
>
>  session_start($_GET['SID']);
> echo SID;
> ?>
>
> And it returns nothing to me.

Heh... okay, let's start over.

 From Server1:

If you create a link like this:

Server 2

Do you see the session ID appended to that URL? If you do, then a simple
session_start() on the server2/page.php will be enough to continue the
session.

Now, if you don't see any session ID appended to the URL, that means SID
is empty and you're more than likely depending upon cookies. So, you
need to retrieve the session id and append it to the URL yourself.

Server 2";
?>

Now, you should see a link that has something like PHPSESSID=X.

Again, a simple session_start() on the next page will continue the session.

So, to recap:

1. Both servers only use session_start().

2. When linking between servers, you must pass the session ID in the URL
using one of the above methods

3. When staying on the same server, it appears the session ID is being
passed around in a cookie, so you don't need to do anything to those links.

Hope this helps some more... :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com



>

-- 
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 Chris Hayes
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'.

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


Re: [PHP] easy and simple way to read xml into array

2003-11-17 Thread Chris Hayes
At 15:47 17-11-03, you wrote:
Hi!

Need to read a xml-file into an array, but searching around I havent found 
a way that's easy and simple… Arent there an easy way in PHP to accomplish 
this?
have you been at http://se.php.net/xml ?

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


[PHP] Microsoft .NET arguement

2003-11-17 Thread Mike R

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



Re: [PHP] Having fits with input to array

2003-11-17 Thread CPT John W. Holmes
- 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



RE: [PHP] Microsoft .NET arguement

2003-11-17 Thread Jay Blanchard
[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!

--
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,

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



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

2003-11-17 Thread CPT John W. Holmes
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] Microsoft .NET arguement

2003-11-17 Thread Jay Blanchard
[snip]
...
[/snip]

http://www.sitepoint.com/article/870

GIS for Microsoft NET vs. PHP

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



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


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



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



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



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



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



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



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



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



[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


[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



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



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



  1   2   >