Re: [PHP] Linux vs. Windows

2003-06-06 Thread Maxim Maletsky
>  c) In Linux Im using Apache, where in Windows Im using
> IIS

probably this is the issue. Make it be apache as well. 


--
Maxim Maletsky
[EMAIL PROTECTED]


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



Re: [PHP] How easy is this idea?

2003-06-06 Thread Maxim Maletsky

Short Answer: Its all about programming. Task you asked is easy to
accomplish.

Long Answer: PHP or JavaScript, it is still to program. If you feel
yourself being a good programmer already or a being a quick learner then
there should be no worries from your side doing such thingies... in PHP
or JavaScript or both.


--
Maxim Maletsky
[EMAIL PROTECTED]


On Fri, 6 Jun 2003 10:38:05 +0100
"Simon Thurtle" <[EMAIL PROTECTED]> wrote:

> OK, now I have I have been convinced that PHP is the best thing since cheese
> burgers, I have a question...
> How easy is it to... Have a set of 6 HTML drop downs each with texted based
> info that when selections are made generate a dynamic on screen  price?
> 
> So in english, drop down one could be vehicle type, drop down two could be
> engine size, three is CD player (yes / no selection). OK?
> 
> So would I need to make a DB for this? (Baring in mind the prices are pretty
> much static) or can I justy define the variables in an include?
> 
> Or am I talking rubbish?
> 
> Cheers,
> 
> S
> 
> 
> 
> 
> -- 
> 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] Catching Oracle Errors

2003-02-07 Thread Maxim Maletsky

by using OCIError() function.
php.net/ocierror


--
Maxim Maletsky
[EMAIL PROTECTED]



fdo cruz <[EMAIL PROTECTED]> wrote... :

> 
> I'm working with Oracle 8.1.5 and my connection is working fine as well as my SQL 
>parsing but I want that when there's an error, show and friendly message to the user 
>and not an Oracle error. How can I catch the error and display it ??
> 
> Thanks,
> 
> Fernando Cruz
> 
> 
> 
> -
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now


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




Re: [PHP] Client Side PHP

2003-02-06 Thread Maxim Maletsky


Goetz Lohmann <[EMAIL PROTECTED]> wrote... :

> Php schrieb:
> > PHP codes gets executed at the server (server side), so I wonder how you can
> > make it to work at the client side?
> > 
> > But good thinking :)
> > 
> > huzz
> 
> 
> Client Side PHP ? ... maybe you could ;-) ... you only have to install PHP on
> your box. PHP is too mighty and huge to implement in the browser like JavaScript
> or VBscript nor will M$ ever wan't to replace VB with PHP. But you have to use
> a PHP system ruuning on your box to interpret the code. That way everybody who
> want to use Client-Side PHP have to get the hole PHP system ... that's not the
> point it will ever go so this is a dead end. And who realy needs it ?
> The browsers and HTML lacks on other problems than on possibilys to manage
> somethin with a good scripting tool.


well, in lots of cases PHP will not have to be installed fully in order
to support client side. It could be something like a tiny virtual
machine, similar to Java's. I agree that writing client-side scripts in
PHP could be easier than in Java or VB and thus I see it as a
possibility. The downside is the limited user-base it would be - any way
you wish it to work it will have to be a plugin

--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Client Side PHP

2003-02-06 Thread Maxim Maletsky

I am doing now ;)


How would you guys like the idea, though?


--
Maxim Maletsky
[EMAIL PROTECTED]



Pete <[EMAIL PROTECTED]> wrote... :

> Has any one ever considered creating browser / client-side php to 
> replace Javascript and vb??
> 
> One language across the whole web ;-)
> 
> Posted this question in the evangelism so I'd be interested in more 
> reaction:
> 
> Pete
> 
> 
> 
> -- 
> 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: [PHP-DB] PHP Database Abstraction Layer

2003-02-06 Thread Maxim Maletsky

"Luke Woollard" <[EMAIL PROTECTED]> wrote... :

> I once read a great article in the first or second issue of
> http://www.phparch.com/ on database abstraction layers. At which point I
> used the tutorial as a starting point for creating a very similar structure
> I named dbWave. There are only minor differences and a postgresql driver is
> now included for the most common pg_* functions.
> 
> I was just wondering if anyone has developed a database abstraction layer
> that allows you to separate your SQL queries from your application logic
> like dbWave does? I'm looking for a more advanced way of doing this?
> 
> 
> Attached is dbWave for anyone to look at/use. To run it you need to use the
> following tags in your file:
> 
>   // DBWave include files
>   include( "[attached_filename].php" );
> 
> To instantiate the dbWave object you use the following code in a file name
> connect.php
>  
>   /* This file instantiates dbWave using our chosen API */
>   /* It is automatically generated by the database setup program */
> 
>   // Instantiate dbWave using the MySQL API
>   $dbWave = new Mysql();
> 
>   // Connect to the database
>   $dbWave->connect( 'yourhost', 'yourport', 'yourdbname', 'yourdbuser',
> 'yourdbpass' );
> ?>


ZoomStats uses it: http://sf.net/projects/zoomstats

P.S: I wrote that phparch article, and I based it on my ZoomStats
experoence which I also founded.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




[PHP] Re: [PHP-DEV] Database Abstraction

2003-02-05 Thread Maxim Maletsky
* forwarding to PHP general



"Kasper Skårhøj" <[EMAIL PROTECTED]> wrote... :

 
> There are millions of PHP-scripts using MySQL. Most 
> of them probably doesn't use an Database Abstraction Layer (DBAL) in
> order to support other databases. When the requirement is made some day
> that a script should support another DB than MySQL programmers are
> facing the challenge of literally rewrite most of their code to fit some
> DBAL, like ADOdb or whatever.

There are already tons of them written. The most famous ones are PEAR
and ADODB. No need reinventing the wheel, contributing, maybe.

> So my idea was to make a DBAL which basically offers a parallel set
> of functions to the current MySQL-functions (search/replace) but
> internally parses the queries and re-makes the query into something
> Oracle or MSSql or some third DB would understand. This would be totally
> transparent and give instant DBA to millions of PHP-scripts. A "MySQL
> emulator". For MySQL it wouldn't affect performance. For other DBs I
> would require a little parsing time of the query.

Parsing the query is
1) bad idea because I don't want anything to mess with my SQL code
2) does not substitute something and limits something else
3) when moving to another database you also change your database design,
this way the queries will have to be rewritten anyway


> I know this is not as simple as it sounds, but is it
> *totally impossible* since noone made it yet and if some of you think it
> is, please let me know why. I think the idea is obvious.

Pretty much impossible. Oh well, adding all the logic, you can reduce
the problems at most, but never to the perfection.

Consider this:

to select some data in mySQL you do "SELECT ..." while Oracle supports
stored procedures, where you will have to bind the variables with
OCIBindByName() function and a whole PL/SQL block as the query. How will
you accomplish that?

Also, databases differ bewteen themselves too much in the SQL itself,
which is never SQL92 compatible. Rewriting that will lead to many
unexpected results and, in most parts it is impossible. For instance, in
Oralce I can do:


SELECT
*
FROM
customers
WHERE
customer_id = 
SELECT
customer_id
FROM
purchases
WHERE
product_id = '$product' AND
rownum = 1
)


How would you transform that from Oracle to mySQL? You'd need to whole
queries in mySQL for that thing...

The only solution is:

storing queries separately. Check out how I did that for ZoomStats:
www.sf.net/projects/zoomstats

I have also written about it at PHP Architect (www.phparch.com)



--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] PHP connecting to MS Access

2003-02-05 Thread Maxim Maletsky

You could use ODBC


--
Maxim Maletsky
[EMAIL PROTECTED]



"Phil Schwarzmann" <[EMAIL PROTECTED]> wrote... :

> If a MS Access database and a PHP server were on the same machine, could
> they connect without having to use something like MS SQL Server?  
> 


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




Re: [PHP] Security question with PHP on Unix / Linux.

2003-02-05 Thread Maxim Maletsky

"Ananth Kesari" <[EMAIL PROTECTED]> wrote... :

> Thanks for your inputs. Will proceed from here.
> 
> Well, if you did not know, NetWare is an operating system brought out
> by Novell. 

I know :)

> We are working on porting PHP onto NetWare. In fact, we
> already have ported PHP 4.2.3 onto NetWare and we have synched up our
> souces for the 4.3 branch.

Interesting. Are you working with the php-dev team or on your own?


--
Maxim Maletsky
[EMAIL PROTECTED]


> >>> Maxim Maletsky <[EMAIL PROTECTED]> 02/04/03 08:45PM >>>
> 
> "Ananth Kesari" <[EMAIL PROTECTED]> wrote... :
> 
> 
> > I am working on porting PHP onto NetWare.
> 
> What exactly do you mean?
> 
> > I am newbie to Unix / Linux systems and at this point of time, I am
> > trying to understand the way security is implemented for PHP on Unix
> /
> > Linux. I mean, how are the different users distinguished from Unix /
> > Linux. 
> 
> From PHP's point of view, every PHP process will run as apache's
> process, with apache's user. Most often `nobody' or `apache'.
> 
> > Do they get to login into the Unix / Linux system? 
> 
> No.
> 
> > Do they have
> > separate data space for each user? 
> 
> No. Only sessions, if you use them. Sessions have their own unique IDs
> and are stored in a certain directory by default. A database solution
> can also be implemented.
> 
> > What is the API that is used to login to Unix / Linux.
> 
> There is no login to the Unix / Linux. You might write one on your
> own,
> if you wish, but that would be your thing. PHP as it is, logs nobody
> to
> the Linux, it runs everybody's request as Apache's user.
> 
> > User may enter his username and password on the
> > browser, but how do they get translated onto the Unix / Linux box?
> 
> Whatever inputted to the broswer, is send to your script. Stays up to
> you to decide what to do with the user/pass. Basically, you would
> usually store the credentials in a database and then authenticate the
> users against the database, not Linux Shell itself.
> 
> > Since I am a newbie, I may have misunderstood some concepts here. 
> 
> Most of them. PHP is a programming language, not a shell interface or
> something. Stays up to you what to do once user runs your PHP script.
> 
> 
> --
> Maxim Maletsky
> [EMAIL PROTECTED] 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 


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




Re: [PHP] php3 + HTTP_POST_FILES

2003-02-04 Thread Maxim Maletsky

same as what $_FILES since PHP 4.1.0 gives you

--
Maxim Maletsky
[EMAIL PROTECTED]



"Dan Rossi" <[EMAIL PROTECTED]> wrote... :

> i looked there i'm sure i didnt see that :| what a pain , another reason to
> get them to upgrade ;) what information can i get out of the file then ?
> 
> -----Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 05, 2003 2:06 AM
> To: electroteque
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] php3 + HTTP_POST_FILES
> 
> 
> 
> No, PHP3 does not support it.
> 
> http://www.php.net/manual/en/features.file-upload.php";>
> 
>   Note: In PHP versions prior 4.1.0 this was named $HTTP_POST_FILES
>   and it's not an autoglobal variable like $_FILES is. PHP 3 does not
>   support $HTTP_POST_FILES.
> 
> 
> 
> 
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
> 
> 
> 
> "electroteque" <[EMAIL PROTECTED]> wrote... :
> 
> > is there a way to get this variable in php3 for some reason i cannot acess
> > it ?
> >
> >
> >
> > --
> > 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] Security question with PHP on Unix / Linux.

2003-02-04 Thread Maxim Maletsky

"Ananth Kesari" <[EMAIL PROTECTED]> wrote... :


> I am working on porting PHP onto NetWare.

What exactly do you mean?

> I am newbie to Unix / Linux systems and at this point of time, I am
> trying to understand the way security is implemented for PHP on Unix /
> Linux. I mean, how are the different users distinguished from Unix /
> Linux. 

From PHP's point of view, every PHP process will run as apache's
process, with apache's user. Most often `nobody' or `apache'.

> Do they get to login into the Unix / Linux system? 

No.

> Do they have
> separate data space for each user? 

No. Only sessions, if you use them. Sessions have their own unique IDs
and are stored in a certain directory by default. A database solution
can also be implemented.

> What is the API that is used to login to Unix / Linux.

There is no login to the Unix / Linux. You might write one on your own,
if you wish, but that would be your thing. PHP as it is, logs nobody to
the Linux, it runs everybody's request as Apache's user.

> User may enter his username and password on the
> browser, but how do they get translated onto the Unix / Linux box?

Whatever inputted to the broswer, is send to your script. Stays up to
you to decide what to do with the user/pass. Basically, you would
usually store the credentials in a database and then authenticate the
users against the database, not Linux Shell itself.

> Since I am a newbie, I may have misunderstood some concepts here. 

Most of them. PHP is a programming language, not a shell interface or
something. Stays up to you what to do once user runs your PHP script.


--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] php3 + HTTP_POST_FILES

2003-02-04 Thread Maxim Maletsky

No, PHP3 does not support it.

http://www.php.net/manual/en/features.file-upload.php";>

Note: In PHP versions prior 4.1.0 this was named $HTTP_POST_FILES
and it's not an autoglobal variable like $_FILES is. PHP 3 does not
support $HTTP_POST_FILES. 




--
Maxim Maletsky
[EMAIL PROTECTED]



"electroteque" <[EMAIL PROTECTED]> wrote... :

> is there a way to get this variable in php3 for some reason i cannot acess
> it ?
> 
> 
> 
> -- 
> 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] Help with classes (oop)

2003-02-03 Thread Maxim Maletsky

When you name a function in the class with the same name as the class
itself, this function gets automatically executed upon defining the
object (class). this is called `constructor'.

in your very case, this is the function first, which requires two
parameters to be passed to it. You need to create the instance (define)
your class with already passing parameters to it. Like this:

$obj = new First($par1, $par2);

The next, you don't need to call $obj->first(..., ...); once again, as
you just did it one line above.

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Mon, 3 Feb 2003 14:27:36 -0500 "Leonard Burton" <[EMAIL PROTECTED]> wrote:

> Greetings,
> 
>   I am trying to figure out using classes.  I have read and read and read
> about them but still cannot figure them new fangled things out.  Could
> someone please alter this snippet just a bit so it would be a correct test
> script with a call to it?
> 
> When  I run the script I get this in my browser <<
> 
> Warning: Missing argument 1 for first() in /usr/~index.php on
> line 8
> Warning: Missing argument 2 for first() in /usr/~/index.php
> on line 8
> 35chris
> >>
> 
> As you see it does print the output.  What am I doing wrong?
> 
> Thanks,
> 
> Leonard
> [EMAIL PROTECTED]
> 
> 
> 
>  class first
> {
> var $age;
> var $name;
> 
> function first($age, $name)
> {
> return $age.$name;
> }
> }
> 
> //main script
> $first = new first;
> $test=$first->first(35, "chris");
> 
> print $test;
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP Framework

2003-02-03 Thread Maxim Maletsky

I agree, I'd go for Smarty. Though, on the other hand, I often see no
reason for using the Templates of any kind. Why? Because you stil get to
hard code the tags in it. Not making that much sense as many think. You
might simply create a framework by appending the genuine PHP files where
HTML code resides and PHP code includes the variables. This will be
faster and native. Will also do the necessary thing: separate code (*)
from layout(**).

(*)  Code - the actual functionalty
(**) Layout - HTML, JavaScript orwhatever that receives the PHP
variables and places them within the layout.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Danny Shepherd" <[EMAIL PROTECTED]> wrote... :

> Well, Yahoo! have moved/are moving to Smarty and they get a few million
> views a day.
> 
> The killer part with smarty is that it converts the Smarty tags, in your
> template, to real PHP code - that's what makes it so fast. It's also very
> easy to extend.
> 
> Danny.
> 
> 
> - Original Message -
> From: "John Wards" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 03, 2003 2:41 PM
> Subject: Re: [PHP] PHP Framework
> 
> 
> On Monday 03 Feb 2003 2:01 pm, karthikeyan.balasubramanian wrote:
> > Hi All,
> >
> >   I finally decided to upgrade my PHP.  Just want to know your thoughts on
> > which Framework is the best with a clear seperation of content from
> > presentation.
> >
> >   Please let me know which do you think is the best and why?
> 
> I use SMARTY (smarty.php.net) and think its the dogs bolxs.
> 
> Its fast, its easy to use. The template pasing language is simple.
> 
> My site gets somewhere in the region on 100,000 p.v.s a day and it copes
> easily.
> 
> But, there is a pertender lurking in the shadows.
> 
> phorum.org, yes its a message board. But phorum 5 which is not pre alpha yet
> has its own built in templating system which I thnk with a bit of tweaking
> could be used as a full blown templating system.
> 
> John
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] mktime with Feb or Jan ..

2003-02-03 Thread Maxim Maletsky
readon about strtotime() function
www.php.net/strtotime

you might not even need to preg_match() it  


--
Maxim Maletsky
[EMAIL PROTECTED]



Torsten Rosenberger <[EMAIL PROTECTED]> wrote... :

> Hello
> 
>   I parse the apache logfile and get a date format like this
> [03/Feb/2003:09:22:50 +0100] 
> OK i split it with preg_match and the result is 
> 
> Array
> (
> [0] => 03
> [1] => Feb
> [2] => 2003
> [3] => 09
> [4] => 22
> [5] => 50
> )
> 
> Now I'd like to convert it in a timestamp 
> with mktime but the problem is Feb ($t[1])
> 
> $lasttime = mktime($t[3], $t[4], $t[5], $t[1], $t[0], $t[2]);
> 
> Is it possible to convert Feb in 02,
> 
> BR/Torsten
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] file copy

2003-02-03 Thread Maxim Maletsky
You must change the headers for the file so it is being downloaded.
Something like this:

header('Content-Type: GIF');   // not sure of this one
header('Content-Length: ' . filesize('file.gif'));
header("Content-Disposition: attachment; 
filename=\"file.gif\"");



--
Maxim Maletsky
[EMAIL PROTECTED]



"Cenk Uysal" <[EMAIL PROTECTED]> wrote... :

> hi,
> 
> how can i copy a file from web to my local disk?
> 
> http://www.xxx.com/xxx.gif
> 
> i try to get xxx.gif to my local disk...
> 
> 
> 
> -- 
> 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] how to write clean code.

2003-02-02 Thread Maxim Maletsky

Coding style is a very personal issue, one codes the way he/she likes.
But, for keeping the maintenance easier, K&R style (named after
Kernighan and Ritchie - the Linux fathers) would probably be the best. I
(personally) prefer it quite a lot, without much modifications.

Here are a few references for K&R:

http://www.purists.org/linux/
http://www.jetcafe.org/~jim/c-style.html
http://www.cs.utexas.edu/users/scottm/cs307/Handouts/codingStandards.htm
http://staff.oclc.org/~thompson/correct_style.html


-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Sun, 02 Feb 2003 20:34:35 +0100 anders thoresson <[EMAIL PROTECTED]> wrote:

> Where can I find good guidelines on how to write PHP-code that's easy to 
> read for a human?
> 
> -- 
> anders thoresson
> 
> -- 
> 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] fputs / fwrites ?

2003-01-31 Thread Maxim Maletsky

Please, don't hijack(*) the threads.

(*) Hijack a thread - replying to an email from the usergroup modifying
its subject and body making it look like a new post. Emails have also
the in-reply-to headers which make the threads visualize in mail clients
as the follow ups, although was intended as a new thread.

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Fri, 31 Jan 2003 23:41:12 -0600 "Lee Herron" <[EMAIL PROTECTED]> wrote:

> Okay, so I want to open a file, get a small number from it (less than 3
> digits) then overwrite a new number (incremented the original by 1) and
> close the file.
> 
> The goal is to do this in the fastest way possible .. I don't like having to
> open the file more than once to do this.
> 
> I've tried:
> $cfile = fopen("lcnt.txt", 'r+');
> $lcnt = fgets($cfile,10);
> 
> This results in $lcnt having a value of 1 (from value in text file)
> 
> Now, if I increment it:
> 
> $nc = $lcnt+1;
> 
> then write it back to the file:
> 
> $nul = fwrite($cfile, $nc);
> 
> It writes starting at where the last read left off -- I want to start at
> zero offset so to overwrite the existing value. I can't find a method for
> resetting the offset pointer without having to close the file and reopen it
> with w+
> 
> There must be a simpler way to do this and I have a mental block.
> 
> 
> 
> -- 
> 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] Screen Size detect??

2003-01-31 Thread Maxim Maletsky

On Sat, 01 Feb 2003 18:44:19 +0100 Maxim Maletsky <[EMAIL PROTECTED]> wrote:

> There is no way to do that with PHP.
> 
> PHP/JavaScript rule #1:
> 
>   PHP = Client Side
>   JS  = Server Side

Geez I mean viceversa :) In Stalin's times I'd get killed for
certain mistakes :)


-- 
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Screen Size detect??

2003-01-31 Thread Maxim Maletsky

There is no way to do that with PHP.

PHP/JavaScript rule #1:

PHP = Client Side
JS  = Server Side

Obviously, client's browser is Client Side and PHP, which is Server Side,
cannot be used for detecting Client's properties on page request (page
wasn't prepared by PHP yet to activate any JS).

With JS you can detect screen sizes by using JavaScript `screen' and
`window' objects.  Find them on developer.netscape.com.

The wildest combination of PHP with client's screen sizes would be adding
JS code into a page that sets the width/height (JS) variables as the
page starts loading to then launch an 1x1 pixel image with these two
variables passed as the URL parameters of the image tag and, the image
is actually to be a PHP script which temporarily records it. 

Comparing the sessions of the current page and image's request you would
be able to retrieve the screen size before continuing the page loads,
adjusting the HTML to fit into that very screen.

But, that is only theoretical. Technically it would mean a lot of
trouble. Firstly because you would need to suspend the page load till
when the client requested that image so your server knows the screen
width/height, to then release the rest of thepage to browser. Not all
browsers will support it either and you might end up in a lot of loops
and slow response times/timeouts.

I have once done something silly like that for a project which *really*
depended on it (a videogame). And, I wouldn't do it once again :)

Best solution? Perhaps using an absolute width for HTML tables (100%)
or a fixed (minimal) page width (775 px recommended)

P.S: Hope this email gets read archived and read from there :)

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Fri, 31 Jan 2003 20:48:19 -0800 (PST) Dade Register <[EMAIL PROTECTED]> wrote:

> I'm trying to detect the screen size of any client
> browser, or at least IE. Is there a php function that
> can do this? If not, does anyone have any ideas on a
> JS that would work too? Plz help. Thanx.
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] php.net links page question

2003-01-30 Thread Maxim Maletsky

mail it to [EMAIL PROTECTED]


--
Maxim Maletsky
[EMAIL PROTECTED]



dan <[EMAIL PROTECTED]> wrote... :

> i would like to suggest a link for the php.net links page, how would i 
> go about doing that?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP Crashing on iPlanet 6sp4 Enterprise, Solaris 8, PHP 4.3.0

2003-01-29 Thread Maxim Maletsky

why don't you check the bug database at bugs.php.net and investigate
whether there is anything similar to this? If not, test well, combine
your information together (specs, code, system, trace/logs etc) and
submit it as a bug. Unless, this is not a bug :)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Dilts, John" <[EMAIL PROTECTED]> wrote... :

> I get this error after php executes a script a few times.  This doesn't seem
> to reproduce under any certain conditions, typically within a few hits
> though.
> 
> Warning:
> Unknown(/local/home/cxadmin/content/Sites/Site01/DocumentRoot/phpinfo.php):
> failed to create stream: Too many open files in Unknown on line 0
> 
> Warning: Unknown(): Failed opening
> '/local/home/cxadmin/content/Sites/Site01/DocumentRoot/phpinfo.php' for
> inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
> 
> MEASURES ALREADY TAKEN:
> recompile of the php module ('./configure' '--without-mysql'
> '--with-nsapi=/local/Netscape/iplanet/www6.0sp4' '--enable-track-vars'
> '--enable-libgcc' )
> Upped the Hard File Descriptor to 7554
> explicitly set include path, session.save path, and safe_mode
> ENVIRONMENT:
> We have this running with out a hitch on two other boxes, under the same
> environment setup, with the exception of there are two instances of iPlanet
> running on the box that keeps crashing.
> CODE:
> // Logic To Decide Which Image To Include
> $DESIGN;
> if ($SEL == 1) {
> $DESIGN="design_1.jpg";
>   }
> else if ($SEL == 2) {
>   $DESIGN="design_2.jpg";
>   }
> else if ($SEL == 3) {
>   $DESIGN="design_3.jpg";
>   }
> else if ($SEL == 4) {
>   $DESIGN="design_4.jpg";
>   }
> else if ($SEL == 5 ) {
>   $DESIGN="design_5.jpg";
>   }
> else {
>   $DESIGN="design_6.jpg";
>   }
> 
> //Email Headers
> $headers .= "From: ".$FNAME."<".$FEML.">\n";
> $headers .= "X-Sender: <".$FEML.">\n";
> $headers .= "X-Mailer: <".$FNAME.">\n";
> $headers .= "Return-Path: <".$FEML.">\n";
> $headers .= "Content-Type: text/html";
> // Display Header Content
> $Message =" bgcolor=#99>\n";
> $Message .="\n";
> ...Other $Message Code Ommitted  to save space
> 
> //Mail function (variables are passed from the from on the previous page)
> Globals are set to on
> mail($TEML, $TNAME.", You Have An AE-card From ".$FNAME, $Message,
> $headers); 
> 
> Anyone run into anything even remotely similar?  All help will be
> appreciated.
> 
> John
> Web Developer
> [EMAIL PROTECTED]
> 
> There is a theory which states that if ever anybody discovers exactly what
> the Universe is for and why it is here, it will instantly disappear and be
> replaced by something even more bizarre and inexplicable. There is another
> theory which states that this has already happened. - Douglas Adams
> 
> 
> -- 
> 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] new

2003-01-29 Thread Maxim Maletsky

and the question is 


--
Maxim Maletsky
[EMAIL PROTECTED]



Ysrael Guzmán <[EMAIL PROTECTED]> wrote... :

> Warning: Failed opening 'cliente.php' for inclusion
> (include_path='.;c:\php4\pear') in Unknown on line 0
> 
> -- 
> 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] test

2003-01-29 Thread Maxim Maletsky
worked


--
Maxim Maletsky
[EMAIL PROTECTED]



"Sol" <[EMAIL PROTECTED]> wrote... :

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


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




Re: [PHP] php and sql problem with mysql_query and insert

2003-01-29 Thread Maxim Maletsky
Guess what?

add this on top of the file:


error_reporting(E_ALL);

this will probably tell you these variables are unset :) Why? Register
global... wrong logic... etc...

What php 4 is exactly installed there?


--
Maxim Maletsky
[EMAIL PROTECTED]



"Sunfire" <[EMAIL PROTECTED]> wrote... :

> hi ...
> 
> im having a little problem with mysql_query("insert into members
> ('$company', '$name1', '$name2', '$address1', '$address2', ''$ac1', '$ext2',
> '$num1', '$ac2', '$ext2', '$num2', '$city', '$state', '$zip', '$desc',
> '$flags')");
> 
> for some reason those variables are empty by the time they get into the
> table...
> im running mysql 3.2.3.x, php 4 used as module in apache, windows me and
> apache 1.3.4  the variables come from a form and then posted to a
> comfirmation page where all the contents of the variables are printed in a
> table before  user would click the continue link at the bottum of the
> page... after that the link would call a file called addtolist.php which
> would add the var list to a table and return either an error message or a
> success message.. i havent yet found how to have a php script load a new web
> page other than include() or require() and dont know if that is making my
> problem or just what it is... i will include the test file called
> addtolist.php below...:
>  mysql_db_query("wata", "insert into members VALUES('$company', '$name1',
> '$name2', '$address1', '$address2', '$city', '$state', '$zip', '$ac1',
> '$ext1', '$num1', '$ac2', '$ext2', '$num2', '$desc', '$flags')");
> echo "\n";
> echo mysql_error();
> 
> echo << $post['name1']
> your entry was added
> 
> go back to the main menu by clicking here.
> ENDOF_BLOCK;
> ?>
> tnx for the help
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
> 
> 
> -- 
> 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] ayuda help

2003-01-29 Thread Maxim Maletsky
you used a wrong password


--
Maxim Maletsky
[EMAIL PROTECTED]



Rot Alvarez <[EMAIL PROTECTED]> wrote... :

> 
> Tengo este herros y no se de q esWarning: MySQL Connection Failed: Access denied for 
>user: 'fullweb@localhost' (Using password: YES) in 
>/home/sites/site22/web/45/connect_database.php on line 8
> Error in connecting to MySQL.
> 
> 
> 
> _
> Registra gratis tu cuenta email en http://www.exploraiquique.cl
> 
> _
> Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, 
>POP & more! http://www.everyone.net/selectmail?campaign=tag
> 
> -- 
> 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] Advice on uploaded files

2003-01-29 Thread Maxim Maletsky
Two problems for filesystem:

1. You cannot store over a tot number of images on some systems. Thus,
storing them in DB will be headechless. Unless, you know that there will
be at most some hundred pics or so.

2. Storing them in filesystem gives more trouble as you need to make
sure it is - writable, permissions won't change, things won't get
corrupted, it's writable by you and but not by other user etc

I'd say that DB is a better way, although altogether it would get it
a little slower, but not by too much. DB will be quite large.


--
Maxim Maletsky
[EMAIL PROTECTED]



Manuel Ochoa <[EMAIL PROTECTED]> wrote... :

> 
> I writting a php program for a small insurance company and they want to receive 
>uploaded digital photos.
> 
> Should I store the photos in a mysql database or in a directory on the hard drive?
> 
> If you have experience with this any advice would be appreciated.


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




Re: [PHP] register_globals

2003-01-29 Thread Maxim Maletsky

three solutions:

1. turn register_globals off for compatibility purposes via .htaccess
file in the script's directory

2. create a auto_prepend file with the following: extract($_GET), this
should do the trick

3. rewrite the whole code to make any user-input (form) variable to be
$_REQUEST or $_GET/$_POST respectively


--
Maxim Maletsky
[EMAIL PROTECTED]



"Kiswa" <[EMAIL PROTECTED]> wrote... :

> I know its stupid but i´ve been writing a site for a register_globals = on
> enviroment
> now i need to convert all the code to an off setting
> 
> the page is built by sending a whole lot off vars to diferent pages.
> as you can see below the hyperlink sends the id var to the same page and
> then echos the code.
> can anyone help humpty dumpty?
> 
> 
> 
> 
> Finansiering
>   If($id==1){
>  echo " color=\"#00\">Leasing
>  Räntefri
> avbet.
>   color=\"#00\">Studentlån";
> };
> ?>
> 
> 
> 
> -- 
> 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] best way to save form data on user side

2003-01-29 Thread Maxim Maletsky
Isn't it simplier to just do like when you purchase something? You also
need a prove then that you have paid and are expecting the merchandise
to be shipped. That is simply solved with mailing a copy plus a
registration number for future reference.

Should be more than enough.


--
Maxim Maletsky
[EMAIL PROTECTED]



Petre Agenbag <[EMAIL PROTECTED]> wrote... :

> Hi
> I have a rather annoying problem regarding forms. 
> I have built an app that allows the users to fill in a rather large form
> (much like a claim form) and then have the data pumped into a mysql db.
> The problem is: the users want to be able to "save" their forms on their
> systems as a) backup/proof that they have filled it in and b) for their
> records for future use and c) the hope is that it would also allow for a
> reliable method to complete the form off-line and then submit it when
> online again.
> 
> So, I'm not sure what the best way is to tackle this situation. My gutt
> says it would need some kind of client stand alone app, but I wouldn't
> want to go there unless I am proven beyond reasonable doubt that it is
> the only way.
> 
> The users are mostly in computer limbo, and if they had their way, they
> would want to use "Word or Excel" to complete the forms, save it to
> their hard drive and "click to send it away"...
> 
> Help!, Please?!
> 
> 
> 
> 
> 
> 
> -- 
> 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] Access

2003-01-28 Thread Maxim Maletsky

with ODBC

www.php.net/odbc


--
Maxim Maletsky
[EMAIL PROTECTED]



"Todd Barr" <[EMAIL PROTECTED]> wrote... :

> Access
> 
> Does anyone here have any idea how to connect access to PHP?
> 
> Thanks
> 
> 
> -- 
> 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] parsing ini files

2003-01-28 Thread Maxim Maletsky
there is a bunch of examples to parse the ini files in PHP. You can even
do one on your own:

1. loop every line
2. if format is [**] then this is the key
3. everything till the empty line is a key = value pair

P.S: please, when replying click on "new email" and cut&paste the email
address. If you click "reply-to" and change the "to" and "body" to your
own so it looks like a new post, some of us still get it as a thread of
the previous one.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Erich C. Beyrent" <[EMAIL PROTECTED]> wrote... :

> Hey everybody,
> 
> I'm new the list and to PHP, so I thought I'd launch right in with a
> question.
> 
> I have a file which contains the following syntax:
> 
> ; Events listings
> [event]
> month = january
> day = 23
> year = 2003
> venue = some club
> description = this is an event
> 
> [event]
> month = january
> day = 12
> year = 2003
> venue = another club
> description = this is another event
> 
> Each one of these headers sections represents the start of a new event.  So,
> my code does the following:
> 
> $EVENTS = parse_ini_file('./data/events', TRUE);
> while($key = key($EVENTS))
> {
>  $$key = current($EVENTS); //variable variables
>  next($EVENTS);
> }
> 
> The problem is that when I try to print the values for $venue, $day, etc, I
> only get the values for the last section encountered.  I need a way to get
> the values of all the events - do my section heads need to be unique, or can
> I continue to use the same format in my ini file?
> 
> Thanks in advance!
> 
> -Erich-
> 
> 
> -- 
> 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] problem with copy()

2003-01-28 Thread Maxim Maletsky

you need to escape the windows backslash:

$file = "c:\pic.jpg";

should be 

$file = "c:\\pic.jpg";

or 

$file = "c:/pic.jpg";

which will work the same

--
Maxim Maletsky
[EMAIL PROTECTED]



"Bartosz Matosiuk" <[EMAIL PROTECTED]> wrote... :

> hi
> 
> can the string source in copy () looks like that: "c:\pic.jpg". If not
> than how should it look like.
> 
> I'm not sure becouse script gives me "Unable to open c:\pic.jpg for
> reading: No such file or directory" but the file is there.
> 
> and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me:
> 'Unable to open 'none' for reading: No such file or directory'.
> 
> 
> 
> -- 
> 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] Thread safety

2003-01-28 Thread Maxim Maletsky

Don't the current PHP extensions have a good example there? It's pretty
much easy to understand reading the code.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Olga Tonkonog" <[EMAIL PROTECTED]> wrote... :

> Hello !
> 
> I write extension for PHP. I create bibliothek for Windows and for Linux.
> I set switch ZTS for thread-safety in Windows and use project php4ts.
> How can I set thread-safety for Linux? Help!!
> 
> Thank you at advance
> 
> Olga
> 
> 
> -- 
> 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] printing

2003-01-28 Thread Maxim Maletsky

It's easy to do with JavaScript. Client will only have to confirm.
Sometimes, in PDF nor even confirming is necessary. Not sure if what I
said makes sense.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Shaun van den Berg" <[EMAIL PROTECTED]> wrote... :

> Hey,
> 
> Is there a way in php to print to a printer? say i have a order from , when
> someone clicks the submit button - then print the form plus the entered
> details to a page ?
> 
> Thanks for you help
> 
> Shaun
> 
> --
> Novtel Consulting
> Tel: +27 21 9822373
> Fax: +27 21 9815846
> Please visit our website:
> www.novtel.co.za
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Need Guru's Help

2003-01-28 Thread Maxim Maletsky

What about looking for something like that written in C that would
convert your HTML into XML and then use PEAR's XMLParser to get it into
a PHP structure?


--
Maxim Maletsky
[EMAIL PROTECTED]



Tariq Murtaza <[EMAIL PROTECTED]> wrote... :

> Hi All Guru's here,
> 
> I need your help regarding converting HTML Table structure to DB schema 
> or XML format. I am not a Regular expression expert.
> 
> (Actually i have 500 html files containing this table struction,and need 
> to read all 500 files and convert them to DB schema or XML format)
> 
> Looking for anybody to help me out.
> Regards  Tariq
> 
> 
> 
> http://www.ababasons.com
> 
>   >A. BABA & SONS 
> 
>240/2, SECTOR 6.1,
> Lahore.
>   [LAHORE ] 
> 
>   Phone:
>   92021-6974878
>   Mobile:
>   0333-66566 
>   Fax:
>   92021-6901145
> 
> 
> http://www.ababasons.com
> 
>   >ABC & CO 
> 
> 
>240/2, SECTOR 6.1,
> NORTH KARACHI,
>   KARACHI.
>   [KARACHI ] 
> 
>   Phone:
>   92021-6974878
>   Mobile:
>   033-565659
>   Fax:
>   92021-6118625 
> 
> 
> http://www.ababasons.com
> 
>   >ARahat Textile 
> 
> 
>240/2, SECTOR 6.1,
> NORTH KARACHI,
>   KARACHI.
>   [KARACHI ] 
> 
>   Phone:
>   92021-6974878
>   Mobile:
>     
>   Fax:
>   92021-6966625 
> 
> 
> http://www.ababasons.com
> 
>   >A. Corvid Ltd 
> 
> 
>240/2, SECTOR 6.1,
> NORTH Peshawar
>   [PESHAWAR ] 
> 
>   Phone:
>   92021-6974878
>   Mobile:
>   0332-656656 
>   Fax:
>   92021-69086265
> 
> 
> -- 
> Tariq Murtaza
> Assistant Web Master
> Business Technology Team
> Small & Medium Enterprise Development Authority
> 
> 
> 
> 
> -- 
> Tariq Murtaza
> Assistant Web Master
> Business Technology Team
> Small & Medium Enterprise Development Authority
> 
> 
> 
> -- 
> 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] Good way to organize code using classes???

2003-01-28 Thread Maxim Maletsky

"@ Nilaab" <[EMAIL PROTECTED]> wrote... :

> Hello everyone,
> 
> I want to be able to use objects to create my future pages. My goal is to
> use methods of classes to make the original front-line script easier to
> read, while all the processing is done with a simple call to the different
> classes from a single class. Please read futher, as I'll get to a point and
> to my question...
> 
> I have many classes that do different tasks, like formValidator.class,
> stringManipulator.class, db.class, fileManipulation.class, template.class,
> etc (these are self-explanitory as their names suggest). Then, I might have
> a class called category.class that adds, deletes, edits, moves, and renames
> categories within the filesystem and database. But I would have a front-line
> script called category.php that would call the necessary methods of
> category.class at certain points, depending on the task being done on a
> specific step.
> 
> In other words I want category.class to call the other classes and do
> something with them, then in turn I want category.php to call objects in
> category.class for a specific task, such as:
> 
>  
> // category.php
> 
> include ("category.class");
> $cat = new category ();
> $cat->addCategory($new_cat_name);
> // or
> $cat->editCategory($cat_name);
> // or
> $cat->deleteCategory($cat_name);
> // or
> $cat->moveCategory($cat_name);
> // or
> $cat->renameCategory($cat_name);
> 
> ?>
> 
> 
> My question is:
> 
> How can I call a class within another class and do something with it? Right
> now I'm doing it the most convenient way I know, which is including other
> classes using the include() function within the methods of the
> category.class. There is no multiple-inheritance allowed in PHP, so I can
> only use inheritance on one class.

Including new classes within the existing classes is not such a bad idea
as it ensures you to have only the necessary classes called.

> I am also extremely skeptical about creating too many classes at a time in
> one script. Do the above examples degrade performance speed of the script
> when I call too many classes? Also, isn't there a way to use sessions to
> save created classes and then use them again for other scripts without the
> need to make a new instance of the same class again and again?

yes, you can serialize/unserialize classes into the sessions. This makes
it a little more complicated, but can be helpful sometimes.

> I am really looking for a better way to organize my code while still being
> able to use these classes whenever I need them and at the same time keeping
> the category.php file clean and easy to read. Is there a tutorial on how to
> organize code? I'm not looking for html template tutorials. Just how to get
> around inheritance limits while still keeping performance and clean-code in
> mind.

You know what I have once done? I created a file with functions that
return you the object pointers. It would create (declare) the class
whenever it was not declared before or just return the pointer from a
global variable if it was declared before. That way, you only load a few
functions, and whenever you need a class you assign a variable to the
function's return to have the class. This limits you script to only
classes you use and no includes within the script itself. A kind of
silly method, but can be easy to work with.


Also, check out the new Zend 2 engine, it has tons of improvements with
classes for PHP5. Currently the code is in CVS (checkout php5 module).
Changes are listed here:

http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES


--
Maxim Maletsky
[EMAIL PROTECTED]




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




Re: [PHP] PHP Page Refresh on Redirection

2003-01-28 Thread Maxim Maletsky

make sure that new page's headers do not cache. See www.php.net/header
for examples.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Phil" <[EMAIL PROTECTED]> wrote... :

> I have a PHP page with a form that submits to another PHP processing page.
> On completion of the PHP actions on the processing page, I have echoed into
> the page the javascript action of 'location.href=...' and the location is
> redirected to the PHP form page that starting the process. Both pages take
> data from an SQL server. The problem I'm having is that the the javascript
> always grabs the cached page. I need a newly refreshed page to return with
> updated data from the SQL server. 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] Access to Pear

2003-01-28 Thread Maxim Maletsky
It is a bad idea to "hijack" someone's thread. In other words, when
posting a new question, do not reply to an existing post changing its
subject and content. Mail headers still reference to the old one and we
all see it just being another post of a thread.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Warren Vail" <[EMAIL PROTECTED]> wrote... :

> 
> I know how to load extensions if they are not included in PHP.ini (dl
> function), but how do I gain access to PEAR?
> 
> I can see the directory /apache/php/pear/ on my test machine, but when I try
> to reference via
> 
> include_once("DB.php");
> 
> not found on include list error, can I dynamically change include list,
> and what kind of security hole would that represent?  my test machine is
> windows, and my production machine is Redhat Linux, so I need to find a way
> to gain access to pear in both environments.
> 
> Warren Vail
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP vs Perl for system scripts (non-web)

2003-01-28 Thread Maxim Maletsky

Paul Chvostek <[EMAIL PROTECTED]> wrote... :

> 
> I have to write a swath of code to manage system-related stuff based on
> database content.  Scripts will be run as root by cron, and determine
> what they have to do via user interaction and SQL lookups.  Functions
> will include manipulation of system configuration files, legacy text
> file configs, and some signalling with posix_kill.  On some of the
> machines in question, there won't even be an httpd installed, so I'd be
> building a php as a standalone binary, and running it with shell magic
> and a -q option.  I've done this kind of stuff in the past in smaller
> environments, and it seems to work nicely.

PHP can easily do all that, probably even easier that with Perl. Perl is
somewhat too painful to write scripts in. For my needs, i whether use
PHP or Ruby for stand-alone apps. Ruby is less flexible than PHP but its
"pure" OOP and I often need to resort to it.

> I'm more comfortable writing stuff in PHP.  I use PHP alot more, and I
> find the resultant code more readable and easier to maintain.  

You answered yourself again - if you are more comfortable with PHP then
why hassle with painful Perl?

> Aside
> from Perl's ubiquity and the dubious advantage of future flexibility by
> using Perl's DBI interface to talk to different SQL servers (I'm using
> MySQL at the moment), are there any compelling reasons I should write
> system stuff in Perl rather than PHP?

PHP natively works quite well with mySQL, thus its another reason to use
it.

--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] HELP session cache limiters

2003-01-28 Thread Maxim Maletsky

this means that somewhere (on line 19 of 
/home/sisource/public_html/stage/administration/config.php)
there is an output. For sessions to work, session_start() should be
*before* any output was created. Even a new line or a whitespace would
break it.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Didier McGillis" <[EMAIL PROTECTED]> wrote... :

> I dont know where this came from.  The site was working fine, unless someone 
> else on my team made a fix in this file.
> 
> Any thoughts on this error?
> 
> Warning: Cannot send session cache limiter - headers already sent (output 
> started at /home/sisource/public_html/stage/administration/config.php:19) in 
> /home/sisource/public_html/stage/administration/phpSecurePages/checklogin.php 
> on line 134
> 
> 
> 
> 
> 
> 
> 
> 
> _
> Tired of spam? Get advanced junk mail protection with MSN 8.  
> http://join.msn.com/?page=features/junkmail
> 
> 
> -- 
> 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] multiple entry forms !!

2003-01-28 Thread Maxim Maletsky

Create the 7 steps, or 7 pages.
Create a session to contain all the answers you need from the user
Submit a form on each step and register each data-set into the session
respectively to the their locations.
Fill up the whole session this way and proceed on the 7th step to the
actual injection into the DB.

That is the most elegant way, IMO.


--
Maxim Maletsky
[EMAIL PROTECTED]



"scott" <[EMAIL PROTECTED]> wrote... :

> hi
> 
> looking for some advice
> 
> I have a site in progress. user to it have to enter a LOT of information (it
> will contain a club directory)
> 
> in order to try and make it a less unpleasant experience for the user, I
> want to give them 7 smaller input forms, each one following the other
> 
> what would be the correct way to do this, one very large, complex coded php
> conditional form that does everything, or several smaller ones ?
> 
> if I use one form, it will conatin rather a lot of code, but execution would
> all be handled by the form itself
> 
> but if I use multiple smaller forms, each form would need to process the
> previous forms input, and then display it's inputs for entry
> 
> I am also using sessions, which adds a little to complexity
> 
> any general good coding practice tips/links would be helpful
> 
> thanks
> 
> _scott
> 
> 
> 
> -- 
> 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] help needed with session variables

2003-01-28 Thread Maxim Maletsky
pass it one value at the time:

session_register("valid_user");
session_register("firstname");
session_register("lastname");

Another recommended method is to use superglobal variable $_SESSION. You
can then simply do:

$_SESSION['valid_user'] = $login;
$_SESSION['firstname']  = $first_name;
$_SESSION['lastname']   = $last_name;  

and the three variables will be available on the next pages.

remember to start sessions before hand:

session_start();


--
Maxim Maletsky
[EMAIL PROTECTED]



Pushpinder Singh Garcha <[EMAIL PROTECTED]> wrote... :

> hello,
> 
> I am making use of sessions in my PHp/MySQL Database application. When 
> the user is successfully authenticated against the database, a session 
> is created in following manner:
> 
> 
> session_register("valid_user","firstname","lastname");
> 
> $valid_user = $login;
> $firstname  = $first_name;
> $lastname   = $last_name;  
> 
> While I  am able to use the $valid_user variable all thru the sesion , 
> when I try to use the $valid_user it works fine (i.e. I am able to 
> access the value) throughout the session, however when I try to use the 
> other two registered session variables i.e firstname and lastname,  I 
> am not able to extract the value.  Can you suggest what might be going 
> wrong. Note I am locally testing the setup on my Mac.
> 
> Many Thanks
> Pushpinder Singh Garcha
> _
> Web Architect


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




Re: [PHP] Help with Filesize

2003-01-28 Thread Maxim Maletsky

Try fstat() function on the file pointer - it will return you the various
results, including its size.


--
Maxim Maletsky
[EMAIL PROTECTED]



Rodrigo Corrêa <[EMAIL PROTECTED]> wrote... :

> 
> How do i use the function filesize, because i´m using like:
> 
> I just want associate the variable $body with a html file
> 
> $file_name = 'c:/templates/resp_rep_efetiva_contrato.php';
> $fd = fopen($file_name,"r");
> line 27   $size = filesize($file_name);  / Dá erro aqui
> $body = fread($fd, $size);
> $mail = mail($address, $subject, $body, $header); 
> it keeps saind that:
> 
> Warning: stat failed for c://templates/resp_rep_efetiva_contrato.php (errno=2 - No 
>such file or directory) in line 27
> 
> but, the file exists because the fopen function works ok, I don´t known what to do
> 
> 
> 
> Thanks in advance
> 
> 
> 
> Equipe Pratic Sistemas
> Rodrigo Corrêa
> Fone: (14) 441-1700
> [EMAIL PROTECTED]
> [EMAIL PROTECTED] 
>  
> 
> 


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




Re: [PHP] phpMyAdmin for Microsoft SQL

2003-01-28 Thread Maxim Maletsky
There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL
initially and then some volunteers like you made postreSQL and Oracle
versions of it. So, you might want to try one on your own on SourceForge
:)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Joshua E Minnie" <[EMAIL PROTECTED]> wrote... :

> Hey all,
> 
> Does any body know of anything similar to phpMyAdmin for MS SQL?  I have been doing 
>some googling and haven't come across anything that would help me out.  I have also 
>checked out www.sourceforge.net and can't seem to come across anything either.  I am 
>looking for something that will be easy enough for my client to utilize to 
>update/manipulate a database, rather than having me re-create the wheel so-to-speak.
> 
> -- 
> Joshua Minnie
> Advantage Computer Services, LLC
> Senior Project Manager
> [EMAIL PROTECTED]
> www.advantagecomputerservices.com
> Tel: 269.276.9690
> Fax : 269.342.8750


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




Re: [PHP] Do php extension need to be thread-safe?

2003-01-28 Thread Maxim Maletsky
Absolutely yes. Take a look at the current extensions there to see how
it can be controlled.


--
Maxim Maletsky
[EMAIL PROTECTED]



Joshua Moore-Oliva <[EMAIL PROTECTED]> wrote... :

> Do php extension need to be thread-safe?  I am running php on apache2.  I 
> would guess that since it's compiled in as a module, it would need to be 
> thread-safe correct?
> 
> Josh.
> 
> -- 
> 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] Found a PHP bug!!!!!!!!!

2003-01-28 Thread Maxim Maletsky

Your bug is this:

inconsistency of types.

You split a formatted string into smaller strings and compare the
integers to it. In order to do this correctly, you will need to take
your integers and convert them into the strings, format of which you
already know and used for deformatting the original string. Then compare.

That is the only way to be safe, other ways are "magic" because PHP
debugged them for you. It's really all about the programming logic. few
of you who are fluent with C or Java would dump into this.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Scott Fletcher" <[EMAIL PROTECTED]> wrote... :

> Found a PHP bug, I'm using PHP version 4.2.3.  I have been struggling with
> why PHP code failed to work with the month is August or September, so I have
> been playing around it and found the problem.  I recently wrote a demo
> script for you all to play around with.  Let me know which PHP version does
> this bug not affected you  I'm going to file a PHP bug at
> http://bug.php.net..  I'll let you know where PHP bug # is it.  To tell
> you the truth, I don't know how to search for existing bug on this one if
> there is any because I don't know if it is an if-statement issue or if it is
> something else  Feel free to submit a patch if you know how.
> 
> Let me know what you found and post it here...
> 
> --clip--
> //Sample Code. ==
>$VARIABLE[0] = "2002-01";
>$VARIABLE[1] = "2002-02";
>$VARIABLE[2] = "2002-03";
>$VARIABLE[3] = "2002-04";
>$VARIABLE[4] = "2002-05";
>$VARIABLE[5] = "2002-06";
>$VARIABLE[6] = "2002-07";
>$VARIABLE[7] = "2002-08";
>$VARIABLE[8] = "2002-09";
>$VARIABLE[9] = "2002-10";
>$VARIABLE[10] = "2002-11";
>$VARIABLE[11] = "2002-12";
> 
>//Loop Code to check the variable ===
>for ($x=0;$x<12;$x++) {
>   $month = substr($VARIABLE[$x],5,2);
> 
>   echo "The # of month is ".$x."";
> 
>   if ($month == 01) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 02) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 03) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 04) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 05) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 06) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 07) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 08) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 09) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 10) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 11) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
>   if ($month == 12) { echo "It's a Match!!"; } else { echo "It's not
> a Match!!"; }
> 
>   echo "";
>}
> 
>//Strange Workaround to 08 and 09 ===
>echo "Strange Workaround to the Problem!!";
> 
>$month = substr($VARIABLE[7],5,2);
>echo "The # of month is 08";
>if (trim($month) == 8) {
>   echo "It's working!!!";
>}
> 
>$month = substr($VARIABLE[8],5,2);
>echo "The # of month is 09";
>if (trim($month) == 9) {
>   echo "It's working!!!";
>}
> 
>//Testing (Should this be working or not??) =
>echo "";
>$month = substr($VARIABLE[0],5,2);
>echo "The # of month is 1";
>if (trim($month) == 1) { //With "1" as an integer...
>   echo "It's working!!!";
>}
> 
>echo "";
>$month = substr($VARIABLE[0],5,2);
>echo "The # of month is 01";
>if (trim($month) == 01) { //With "01" as an integer
>   echo "It's working!!!";
>}
> 
>echo "";
>$month = substr($VARIABLE[0],5,2);
>echo "The # of month is 1";
>if (trim($month) == "1") { //With "1" as an integer...
>   echo "It's working!!!";
>}
> 
>echo "";
>$month = substr($VARIABLE[0],5,2);
>echo "The # of month is 01";
>if (trim($month) == "01") { //With "01" as an integer
>   echo "It's working!!!";
>}
> ?>
> --clip--
> 
> 
> 
> -- 
> 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] Found a PHP bug!!!!!!!!!

2003-01-28 Thread Maxim Maletsky
just try doing it with === (three equal signs) and you'll see what is
where


--
Maxim Maletsky
[EMAIL PROTECTED]



"Cal Evans" <[EMAIL PROTECTED]> wrote... :

> John.
> 
> > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an
> >integer and the two will compare as equal.
> 
> No they are not equal. Yes, PHP will do the conversion so that they are
> equal. That does not refute the fact that logically '08' != 8.
> 
> 
> > Someone already posted why the problem was happening, because the numbers
> > were being converted to invalid octal numbers and being set to zero.
> 
> I understand the problem at hand. (and did when I posted) However, if Scott
> had been doing the conversions manually, he would never have run across this
> problem.  It is a bad idea to rely on the language (whatever the language)
> to do automatic variable conversions.
> 
> =C=
> 
> 
> -- 
> 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] Evaluate PHP var in stored sql statement?

2003-01-25 Thread Maxim Maletsky
no, much less instead

---
Maxim Maletsky
[EMAIL PROTECTED]


On Sat, 25 Jan 2003 09:18:47 -0800 "Noah" <[EMAIL PROTECTED]> wrote:

> Thanks for your help Maxim.
> 
> I've got quite a bit to learn.  PHP is far more challenging than Cold
> Fusion.
> 
> --Noah
> 
> - Original Message -
> From: "Maxim Maletsky" <[EMAIL PROTECTED]>
> To: "Noah" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, January 24, 2003 11:02 AM
> Subject: Re: [PHP] Evaluate PHP var in stored sql statement?
> 
> 
> >
> > eval takes the string and executes PHP in that string. So,
> >
> > eval("\$myrow[2] = \"$myrow[2]\";");
> >
> > is equivalent to:
> >
> > $myrow[2] = "$myrow[2]";
> >
> > I'd reccomend you using single quotes and then escape only backslashes
> > and single quotes within a string
> >
> > --
> > Maxim Maletsky
> > [EMAIL PROTECTED]
> >
> >
> >
> > "Noah" <[EMAIL PROTECTED]> wrote... :
> >
> > > Don't quite understand why this works, but it does:
> > >
> > > /* Escape quotes in sql_query so our header_id gets evaluated */
> > > eval("\$myrow[2] = \"$myrow[2]\";");
> > >
> > > What's the deal with the leading backslash in ' eval("\$myrow[2] '?
> > >
> > > Does eval() tell php to evaluate the string as php code; i.e. text
> without
> > > quotes?
> > >
> > > Thanks for the help...
> > >
> > > --Noah
> > >
> > >
> > > - Original Message -
> > > From: "Maxim Maletsky" <[EMAIL PROTECTED]>
> > > To: "CF High" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Friday, January 24, 2003 9:59 AM
> > > Subject: Re: [PHP] Evaluate PHP var in stored sql statement?
> > >
> > >
> > > >
> > > > use eval()
> > > >
> > > > www.php.net/eval
> > > >
> > > >
> > > > --
> > > > Maxim Maletsky
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > > "CF High" <[EMAIL PROTECTED]> wrote... :
> > > >
> > > > > Hey all.
> > > > >
> > > > > I need to find out how to get PHP to evaluate a PHP variable stored
> in
> > > our
> > > > > MySql database.
> > > > >
> > > > > Currently the variable is being read as a string; i.e. select * from
> > > table
> > > > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a
> > > variable.
> > > > >
> > > > >
> > > > > The SQL statement is retrieved in the first call to dbConnect (see
> code
> > > > > below)
> > > > >
> > > > >
> > > > >
> > > > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers
> WHERE
> > > > > section_id = $_REQUEST[section_id] order by header");
> > > > >
> > > > >   $set = $result;   /* Give initial result set a unique name */
> > > > >
> > > > >   while ($myrow = mysql_fetch_row($set)) {
> > > > >
> > > > > echo(Display the header title here);
> > > > >
> > > > >
> > > > >   dbConnect($myrow[2]);  /*  $myrow[2] is the sql_query
> > > gotten
> > > > > from the first dbConnect() call  */
> > > > >
> > > > >  $set1 = $result;/* Give next result set a unique
> name
> > > */
> > > > >
> > > > > while ($myrow = mysql_fetch_row($set1)) {
> > > > >
> > > > > echo(Display category rows here);
> > > > >
> > > > > }
> > > > >
> > > > >   }
> > > > >
> > > > > --
> > > > >  Any leads/suggestions much appreciated..
> > > > >
> > > > > --Noah
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> 


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




Re: [PHP] Evaluate PHP var in stored sql statement?

2003-01-24 Thread Maxim Maletsky

eval takes the string and executes PHP in that string. So,

eval("\$myrow[2] = \"$myrow[2]\";");

is equivalent to:

$myrow[2] = "$myrow[2]";

I'd reccomend you using single quotes and then escape only backslashes
and single quotes within a string

--
Maxim Maletsky
[EMAIL PROTECTED]



"Noah" <[EMAIL PROTECTED]> wrote... :

> Don't quite understand why this works, but it does:
> 
> /* Escape quotes in sql_query so our header_id gets evaluated */
> eval("\$myrow[2] = \"$myrow[2]\";");
> 
> What's the deal with the leading backslash in ' eval("\$myrow[2] '?
> 
> Does eval() tell php to evaluate the string as php code; i.e. text without
> quotes?
> 
> Thanks for the help...
> 
> --Noah
> 
> 
> - Original Message -
> From: "Maxim Maletsky" <[EMAIL PROTECTED]>
> To: "CF High" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, January 24, 2003 9:59 AM
> Subject: Re: [PHP] Evaluate PHP var in stored sql statement?
> 
> 
> >
> > use eval()
> >
> > www.php.net/eval
> >
> >
> > --
> > Maxim Maletsky
> > [EMAIL PROTECTED]
> >
> >
> >
> > "CF High" <[EMAIL PROTECTED]> wrote... :
> >
> > > Hey all.
> > >
> > > I need to find out how to get PHP to evaluate a PHP variable stored in
> our
> > > MySql database.
> > >
> > > Currently the variable is being read as a string; i.e. select * from
> table
> > > where column = $myrow[0] -- instead of evaluating $myrow[0] as a
> variable.
> > >
> > >
> > > The SQL statement is retrieved in the first call to dbConnect (see code
> > > below)
> > >
> > >
> > >
> > > dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE
> > > section_id = $_REQUEST[section_id] order by header");
> > >
> > >   $set = $result;   /* Give initial result set a unique name */
> > >
> > >   while ($myrow = mysql_fetch_row($set)) {
> > >
> > > echo(Display the header title here);
> > >
> > >
> > >   dbConnect($myrow[2]);  /*  $myrow[2] is the sql_query
> gotten
> > > from the first dbConnect() call  */
> > >
> > >  $set1 = $result;/* Give next result set a unique name
> */
> > >
> > > while ($myrow = mysql_fetch_row($set1)) {
> > >
> > > echo(Display category rows here);
> > >
> > > }
> > >
> > >   }
> > >
> > > --
> > >  Any leads/suggestions much appreciated..
> > >
> > > --Noah
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Evaluate PHP var in stored sql statement?

2003-01-24 Thread Maxim Maletsky

use eval()

www.php.net/eval


--
Maxim Maletsky
[EMAIL PROTECTED]



"CF High" <[EMAIL PROTECTED]> wrote... :

> Hey all.
> 
> I need to find out how to get PHP to evaluate a PHP variable stored in our
> MySql database.
> 
> Currently the variable is being read as a string; i.e. select * from table
> where column = $myrow[0] -- instead of evaluating $myrow[0] as a variable.
> 
> 
> The SQL statement is retrieved in the first call to dbConnect (see code
> below)
> 
> 
> 
> dbConnect("SELECT header_id, header, sql_query FROM cat_headers WHERE
> section_id = $_REQUEST[section_id] order by header");
> 
>   $set = $result;   /* Give initial result set a unique name */
> 
>   while ($myrow = mysql_fetch_row($set)) {
> 
> echo(Display the header title here);
> 
> 
>   dbConnect($myrow[2]);  /*  $myrow[2] is the sql_query gotten
> from the first dbConnect() call  */
> 
>  $set1 = $result;/* Give next result set a unique name */
> 
> while ($myrow = mysql_fetch_row($set1)) {
> 
> echo(Display category rows here);
> 
> }
> 
>   }
> 
> --
>  Any leads/suggestions much appreciated..
> 
> --Noah
> 
> 
> 
> -- 
> 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] Has This Been Done?

2003-01-24 Thread Maxim Maletsky

Pear has an interesting installer. Try checking it out


--
Maxim Maletsky
[EMAIL PROTECTED]



"Stephen" <[EMAIL PROTECTED]> wrote... :

> Just a question but has something like ever been done?
> 
> A PHP script that would create an installation form for any other PHP script 
>developed by the user. It would create the install form and make the configuration 
>file.
> 
> If it has, where can I find it?
> 
> Thanks,
> Stephen Craton
> http://www.melchior.us
> 
> "What's the point in appearance if your true love, doesn't care about it?" -- 
>http://www.melchior.us


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




Re: [PHP] File Permissions

2003-01-24 Thread Maxim Maletsky

try this:

echo "you " . ( is_writable("testfile2.php")? 'can ' : 'cannot' ) . " write";

the function is_writable() will tell you in advance whether the file is
writable or not. 

--
Maxim Maletsky
[EMAIL PROTECTED]



"Don Mc Nair" <[EMAIL PROTECTED]> wrote... :

> Sorry if this is not really PHP related but I can't get it to work.
> 
> I am using fopen and I get the following:
> 
> Warning: fopen("testfile2.php", "w") - Permission denied in
> /usr/local/psa/home/vhosts/complementarymedicines.net/httpdocs/reg/regformte
> st.php on line 411
> 
> I have tried setting this particular folder, it's parent folder and the
> folder where the file will be created to 777 but I still get the error. I
> know it is probably simple but it is driving me nuts.
> 
> Any help is appreciated.
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
> 
> 
> 
> -- 
> 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] Page doesn't load..

2003-01-23 Thread Maxim Maletsky

Guess what,
if you'll try another browser the whole thing will work :) This is IE's
problem


--
Maxim Maletsky
[EMAIL PROTECTED]



Marek Kilimajer <[EMAIL PROTECTED]> wrote... :

> Do you get the message from apache? If so, check apache logs. If it is 
> the exploder's default error page, turn user friendly messages off (in 
> IE), or try another browser
> 
> Borut Kovacec wrote:
> 
> >Hello ..
> >
> >I don't know if this is the right question for this mailing list .. but I'm having 
>some problems with loading some php pages, localy on my computer (win XP, apache 
>1.3,Mysql) ..
> >
> >The prioblem is that certain page doesnt load ... I get "The page doesn't exist" 
>message .. but it's there... 
> >And then if I press refresh button couple of times, then sometimes it works .. but 
>if I hit refresh aggain it doesn't work aggain...
> >
> >Would anybody maybe have an idea of what could be wrong?
> >
> >Thanx in advance
> >B.
> >
> >  
> >
> 
> 
> -- 
> 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] Executing Shell Commands.

2003-01-23 Thread Maxim Maletsky

Use the execution operator backtricks (``)


';
echo `ls -la`;
?>

will throw you the shell's ls -la to the browser

--
Maxim Maletsky
[EMAIL PROTECTED]



scott <[EMAIL PROTECTED]> wrote... :

> Hello,
> 
> Does anybody know how to execute a shell command from PHP on a Linux
> system?
> 
> Thanks,
> Scott
> 
> 
> 
> -- 
> 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] Word Count

2003-01-23 Thread Maxim Maletsky
words, for a programming language, are nothing more than just the spaces.
So, as previousely was shown - could the mount of spaces in the string
to get the amount of `words' in between them.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Craig" <[EMAIL PROTECTED]> wrote... :

> Is there a way to count the number of words in a string?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Re: Php's future with Asp .NET?

2003-01-16 Thread Maxim Maletsky

"Brian McGarvie" <[EMAIL PROTECTED]> wrote... :

> The 'problem' with ASP is that it really requires a Windows platform... 

Depends where. C# has a Linux platform called `mono'. It is not as good
as MS' native enviroment, but can work.

> and
> while Unix is still primarily the OS of choice for web-servers then ASP &
> PHP will 'co-exist' there will always be a PHP and ASP camp... 

Microsoft now works hard on porting their applicaytions to Linux
enviroment. Guess why? Because Linux is a better server for web while
ASP has some tricks that many would like to pay and use. At that point
MS decided to also work on Linux.

> I have very little ASP experiance, but that has cost me the oppertinity to
> apply for several well-paying jobs, as there is very few PHP positions
> around - I'm speaking for the UK market here.

Not that few, even in UK (as far as I know).


--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread Maxim Maletsky

"Dhaval Desai" <[EMAIL PROTECTED]> wrote... :

> Hello ppl,
> 
> I have read many articles by Php guys who think Asp.Net is the 
> future. 

What PHP guys?

> If that's the true case...is it really worth sticking to Php at all?

Definitely yes, unless you love paying the licenses for every single
form you add to your pages :)

--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] Speed concerns with OOP and PHP4

2003-01-16 Thread Maxim Maletsky

"John Wells" <[EMAIL PROTECTED]> wrote... :

> I'm working on a large VB/Sql Server to Php/Postgresql conversion (approx.
> 60k lines of code).

First of all, VB is precompiled and PHP is not. This will already be
slower. So, you gonna need to create a logic that loads only the
necessary classes for every request. In VB you wouldn't probably need it.

> I'd like to design this thing as OO as possible, because I think
> ultimately it leads to better, more extendable and readable software. 

Good idea.

> However, since php does the whole copy thing with objects, I'm a little
> concerned.
>
> Is this "deficiency" on the part of PHP 4 something I should be concerned
> about?

Depends al on the logic you will give to it.

> If I have a 60k loc fully object-oriented php app with a large
> amount (approx. 500 or so) queries to a db, am I making a mistake by going
> OO? 

500 queries wan't really matter because it has few to do with OO/PHP.
60k of code, if all together on the same request will be definitely slow.
So, make sure that *only* the required classes are loaded on each
execution.


--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Send email when some action

2003-01-15 Thread Maxim Maletsky

mail() function @ http://php.net/mail


--
Maxim Maletsky
[EMAIL PROTECTED]



"Miguel Brás" <[EMAIL PROTECTED]> wrote... :

> Hi gents,
> 
> i have a script to manage the registered users on my site.
> have also a table with id, name, uname, passwrd, email, datejoined, level
> and status
> 
> my question is...
> it there any possibility to inform a member by mail that his (let'say)
> current status changed from inactive to active, or from active to inactive?
> I mean, whenever a change occur on member's details, a mail is sent to him
> telling what was changed. Any posssibility?
> 
> Miguel
> 
> 
> 
> -- 
> 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] phpBB

2003-01-15 Thread Maxim Maletsky

http://sf.net/projects/phpbb


--
Maxim Maletsky
[EMAIL PROTECTED]



Félix García Renedo <[EMAIL PROTECTED]> wrote... :

> Hi,
> 
> How could I download phpBB?
> I tryed in http://www.phpbb.com/index.php but I couldn't.
> 
> Thanks.
> Un saludo.
> 
> Félix García Renedo ( [EMAIL PROTECTED] )


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




Re: [PHP] PHP not executing files in subdirectories

2003-01-10 Thread Maxim Maletsky

"Jacob" <[EMAIL PROTECTED]> wrote... :

> Hey All.
>  
> The subject line pretty much says it all.
>  
> I have php-nuke installed in the / directory and it works
> fine.
> However, when I try to run the gallery or netjuke software
> (also php)
> They just return the source code of the file. (not exactly
> what you want)
>  
> I am using Apache 2.0 and php 4.3 (compiled from sources) on
> a redhat 8.0 box.
>  
>  
> If needed I will include the configs, but I don't want to waste
> bandwidth.

what are the extensions of these files? You might need to add them to
your httpd.conf or .htaccess files. 

--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Mysql/php database performance question

2003-01-10 Thread Maxim Maletsky

"keeping those 5 columns with a lot of empty cells in the last columns"
is better as it is means exactly for that. Just don't make it a not null
field.

--
Maxim Maletsky
[EMAIL PROTECTED]



"Khalid El-Kary" <[EMAIL PROTECTED]> wrote... :

> the thing that may make difference in performance (as i think) is whether 
> you make it a fixed -CHAR- or a variable -VARCHAR- it's preferable that you 
> make separate char columns, so that PHP will not have to explode every 
> record!
> 
> Regards,
> Khalid Al-Kary,
> 
> 
> >
> >Hi,
> >
> >I got a question about using Mysql databases.
> >I load textdata in VARCHAR colums up to size 50. I have about 5 of those
> >columns.
> >The last columns often contain empty cells. (data are wordmeanings, many
> >words have only a 1 or 2meanings)
> >
> >What would be faster/better:
> >- putting everything in a big varchar column (size 5x50) and PHP parsing
> >them by comma after
> >   fetching
> >
> >  or
> >
> >- keeping those 5 columns with a lot of empty cells in the last columns?
> >
> >Thanks,
> >Simon
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> _
> The new MSN 8 is here: Try it free* for 2 months 
> http://join.msn.com/?page=dept/dialup
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP/Oracle Command line Segmentation Fault

2003-01-10 Thread Maxim Maletsky

Are you saying that OCILogoff gives you the segfault?
It's very strange because OCILogoff is actually an "empty" function -
all the contents of that function is commented and is there only for the
backwards compatibility reasons. Zend API ends OCI sessions
automatically as script's execution ends.

Do what, try removing the last function from your script and run again.
If the segfault happens again submit a bug report at http://bugs.php.net
with all the possible details (server log, script, system etc) and I
will take over the bug myself (I maintain the OCI8 extension)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Christopher Ditty" <[EMAIL PROTECTED]> wrote... :

> Anyone?
> 
> CDitty
> 
> >>> "Christopher Ditty" <[EMAIL PROTECTED]> 01/09/03 04:04PM >>>
> I have successfully installed oracle 8.1.7 w/ php and have it
> configured
> to run from the command line.  When I run a simple script that
> connects,
> and selects records from the database, the last line is a segmentation
> fault error.  This does not seem to happen when the same script is run
> through the browser.  
> 
> Can anyone offer any help or advice?  The code is listed below.
> 
> CDitty
> 
> #!/usr/bin/php
>  function oci8Connect(){
>  $db_conn = ocilogon("usrname","pwd", "dbase");
>  if (!$db_conn){
>   echo "Help";
> exit ();
>  }
>  echo "Connected";
>  return ($db_conn);
> }
> 
> $conn = oci8Connect();
> 
> $stmt = ociparse($conn,"select * from US_MSTR");
>   ociexecute($stmt);
> 
>   $i=0;
>   $row = array();
> 
>   while(OCIFetchInto($stmt, &$row, OCI_ASSOC)){
>   # do stuff with $row...
>   echo $row['US_ID'] . " $i";
>   $i++;
>   }
> 
>   ocifreestatement($stmt);
>   ocilogoff($conn);
> ?>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Medium to Large PHP Application Design

2003-01-10 Thread Maxim Maletsky
organized on the
server should be once agreed and never changed. It is too expensive to
change even a simple .htaccess file - take one hour from 70 people to
explain what happened and you ended up with 70 hours (2 weeks of
amployee's time) lost. There can be no mistakes.


So, in conclusion I'd say - language doesn't really make a big deal out
of itself when this is a BIG project, what matter is the professionality
and knowledge of people. PHP can do almost all of it, so as long as the
management is good, times are not idiotically strict and people are
enough - you can do it just fine.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] something annoying about includes/relative paths.

2003-01-10 Thread Maxim Maletsky

"Sean Malloy" <[EMAIL PROTECTED]> wrote... :

> Moving to PHP from an ASP backgroun, I always found one thing really
> annoying about PHP.
> 
> With ASP, you could have a file structure such as:
> 
> SYSTEM
> |--HTML
> |  |--header.asp
> |
> |--LOGIC
> |  |--engine.asp
> |
> |--core.asp
> 
> in default.asp, you would
> 
> in core.asp, engine.asp would be included as such
> 
> in engine.asp, header.asp would be included as such
> 
> 
> 
> Its a bad example. However, it demonstrates that the relative path for each
> include changed depending on what file was being included.
> 
> PHP doesn't do that. Which is kind of annoying, but you get used to it.. But
> I've come up with a work around.

Wrong. PHP doesn't care that much about these paths themselves, both ASP
and PHP need the path to give it to the filesystem and to retrieve the
file pointer. Which means, on the same system both PHP and ASP would
behave the same way to get the same files from the same locations.

Difference stays in the fact that you can also configure it in the
php.ini file. For instance, if you add '.' in php.ini then every file
request will be relative to your current location (check it, it might
not be set for you - include_path directive). 

> htdocs/index.php
> include('./system/core.php');

dot `.' is the current directory *relative* to the current directory -
makes not much sense in many cases.

> htdocs/system/core.php
> define('CORE_PATH', str_replace('core.php', '', __FILE__));

a cute way to accomplish the above is:
define('CORE_PATH', dirname(__FILE__) . '/');

> include(CORE_PATH.'logic/engine.php');
> 
> htdocs/system/logic/engine.php
> include(CORE_PATH.'html/header.php');
> 
> and so on and so forth. searching for __FILE__, and removing the filename
> from the output, gives you a sort of relative path hack.
> 
> Hope someone finds that useful


--
Maxim Maletsky
[EMAIL PROTECTED]

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




Re: [PHP] searching for string inside document

2003-01-10 Thread Maxim Maletsky

Martin Hudec <[EMAIL PROTECTED]> wrote... :

> Hello,
> 
> i have document in html and i want to get out string between 
> tags to put it into another variable..
> 
> i am wondering if i could use eregi() herebut how? I cant figure
> out any possible way... same with strchr() and strstr()

all these functions can work. Though, you will need to get the
document's contents into a variable of your script so you can perform a
preg_match()/ereg()/strstr() on that string variable. I believe this is
what you missed out.

--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] Converting Excel Spreadsheet to MySQL table ...

2003-01-10 Thread Maxim Maletsky

Excel on its own is a compiled document. However, I think there was some
way to do that. I remember I had to do it for MS Aceess files (Access ->
mySQL) and i used a tool made by a brasilian guy, (someone remind me the
name). I have the feeling that this is accomplisheable. Not sure if
directly on Linux box...


--
Maxim Maletsky
[EMAIL PROTECTED]



"Adam Ferguson" <[EMAIL PROTECTED]> wrote... :

> Hello ...
> 
> I was wondering if anyone had a good resource or code sample for opening ( or 
>accessing ) an excel spreadsheet using php.  I need to be able to convert a 
>spreadsheet of products and info to a table of products in a mysql database.  Also 
>... I need to be able to perform this on a Linux machine.  Any help would be great.
> 
> Thanks guys!
> Adam Ferguson


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




Re: [PHP] Is this possible with php?

2003-01-10 Thread Maxim Maletsky

[EMAIL PROTECTED] wrote... :

> I would like to know if the follwing function can be implemneted
> in php with help of other tools:

in PHP distribution? PHP is the programming language, not a
client/server tool. This is definitely something to be an integrated
part of something else.

> using MS Word in windows, 

MS Word for editing PHP files? That is very, very bad ... You will never
find a job if ever mention it to an employer. Search the archives of
this list for "PHP Editors". I recommend Edit Plus for plain-text
programming. If you want a whole IDE then Zend Studio is probably the
best for you.

> when a file is saved, can it be AUTOMATICALLY
> uploaded (via http POST or other mechanism) to a server?
>
> Currently I need to first save it on my desktop, then upload that copy
> to a php-supported server.

Oh well, there are four ways to accomplish this.


1. Professional way:

Using CVS. CVS (cvshome.org) is a system that allows you to version your
files. This, in two words, works this way: in CVS, you `checkout'
(update) a file, edit it, and save it (if somebody else edited that file
while you edited yours both changes will merge). CVS is the most
professional solution for this thing.


2. Simplest way:

Use a mapped networking like Samba. This will mean that you will see
your server just as it was a hard disk on your windows. You drag&drop
files there and the same will occur remotely. Not a very secure way,
though.


3. FTP integrated tool:

Get a good editor that has some FTP integration. It will means that when
you `save' a file in your editor, it will automatically FTP that file on
the server. A very tool-dependent way but can work. Very cruel when
something goes wrong, though. Again, Zend IDE and Edit Plus can do that.


4. The Geeky way:

Edit all your files in a simple VIM or other fancy directly on the
server by logging there with telnet or SSH.


Have fun.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] fsockopen() to remote URL: what if remote URL "times out"?

2003-01-10 Thread Maxim Maletsky

"Phil Powell" <[EMAIL PROTECTED]> wrote... :

> I have a question about the usage of fsockopen() to open and "scrape" the contents 
>of a remote URL: if the contents take a very long time to load on the remote URL 
>either due to server or coding issues, is there a way for the socket on the PHP end 
>to time out, that is, quit trying to "scrape" contents from the remote site and post 
>a default message instead?


Yes, it is the last parameter of the fsockopen() function. Normally, it
will be set to something like 30 seconds, you might adjust it to
whatever you like. After that time you will get error 110 which means
"Connection timed out". Additionally, if you set anything over 30
seconds, you might also consider altering the execution time limit for
the php script itself.



--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] version switch problem

2003-01-10 Thread Maxim Maletsky
Please, when posting a new message - MAKE IT A *NEW* MESSAGE and not
reply to something on the list changing the body and the subject - we
notice it because that breaks threading of most email clients
(Reference header)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Christian Stalberg" <[EMAIL PROTECTED]> wrote... :

> redhat linux 7.3
> apache 1.3.27
> mysql 3.23.49
> php 4.0.4pl1 (static install)
> mod_ssl-2.8.12
> 
> the box had php 4.2.3 installed on it originally.
> we had a mysql application that would only run
> with php version 4.0.4pl1 so we installed that
> version of php and everything worked.
> 
> later we ran autorpm with the 'interactive' setting
> (just downloading and not auto installing) and the 
> php-dependent application broke. when we run 
> debug_phpinfo it says version 4.2.3. we have 
> reinstalled php version 4.0.4pl1 and 
> debug_phpinfo still says version 4.2.3 and the app. 
> remains broken. yes we copied the php.ini file 
> after the reinstall of the old version
> 
> we checked the new php binary and its definitely
> version 4.0.4pl1. we're pulling our hair out.
> what are we doing wrong/do we have yet to do?
> 
> thanks!
> 
> -- 
> 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] how can I use an external 'template' file and still use PHP variables?

2003-01-10 Thread Maxim Maletsky

Check out Smarty:

http://smarty.php.net

it does exactly what you need.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Daevid Vincent" <[EMAIL PROTECTED]> wrote... :

> I've posted this a few weeks ago with no response. I want to use an
> external
> "email template" as it were, so that the sales guys can edit it as they
> like and simply shuffle the variables around that they need
> $username and $password (either with or without the  tags).
> 
> I don't want them mucking around in my code and potentially screwing it
> up. Not to mention having a huge 'email' text in between those
> HTMLMESSAGE markers is ugly as hell and ends up making the color-coding
> in HomeSite all kinds of whack at the end of it.
> 
> I tried to use:
> 
> $message = <<   include("/pathto/customer_email.php");
> HTMLMESSAGE;
> 
> But $message has the literal string
> ''include("/pathto/customer_email.php");'' instead of including the
> file. Grr.. (wouldn't it make sense that an include() should be parsed
> FIRST with the contents put in place basically? This seems like a 'bug'
> not a feature.
> 
> I also tried:
> 
> $filename = "/pathto/customer_email.php";
> $fd = fopen ($filename, "r");
> $message = fread ($fd, filesize ($filename));
> fclose ($fd);
> 
> But all the $username, etc. are treated as literals and if I use
>  in the customer_email.php the field is blank (like it's
> being parsed but doesn't have a value for it or something), instead of
> being converted to their actual PHP values. I also tried to put the
> "global" keyword in the customer_email.php file at the top.
> 
> Ideally I would like to set things up so we have varoius form letter
> emails and I can switch them around based upon say a "special order
> code", where the $user/$pw is always the same (depending on the database
> user of course), but the email content is different formats.
> 
> Is there no way to accomplish this? Am I not being clear on what it is
> I'm trying to accomplish?
> 
> My final thought is to use some regex to search for  in
> $message after it's all been read in, and replace it with the variable
> $username or make up my own tag codes like [!username!] or something
> like that. This seems like such a hack, when PHP should be able to do
> this natively somehow.
> 
> Surely somebody out there has had to do this type of thing?
> 
> 
> 
> 
> -- 
> 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] Zend IDE vs. PhpEd

2003-01-07 Thread Maxim Maletsky

"John Wells" <[EMAIL PROTECTED]> wrote... :

> Thanks for the reply.  I'm also impressed with Zend's autocompletion...I
> can't even get PHPEd to autocomplete on objects.
> 
> Finally, one frustrating thing on the part of both editors is the
> inability to autocomplete on arrays of object references...but I suppose
> that's a little difficult with a dynamically typed language.

Isn't it a little bit too much of paranoia for autocompletion? In
programming schools they make you writing the programs on paper so you
understand it better :)

I, personally, only care about the code highlighting. Autocompleting
often exposes you to make silly mistakes (not always, of course) and
these are the hardest ones to debug. Copying, pasting and replacing is
much "safer", IMHO.

For that, I prefer EditPlus on win32 - simple autocompletion (I wrote
one for them - only functions), very fast, stable and "pleasureful" to
use.  Also, EditPlus is a generic editor so I can use it for PHP as well
as for Python, Java, C/C++, C#, SQL, PL/SQL etc... Though, it doesn't
handle projects well at all and is quite limited on PHP...

But, that's my own preference. Should I need an IDE I'd choose Zend
because it seems to me more affordable and better integrated with PHP.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] regular expression help

2003-01-07 Thread Maxim Maletsky

Here is your answer:

http://www.phpbuilder.com/columns/ying2718.php3?page=2

--
Maxim Maletsky
[EMAIL PROTECTED]



"adrian [EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote... :

> I'm a bit useless at regular expressions so i thought i ask.
> i need to turn all
> [link url=http://www.site.com] link to site [/link]
> 
> in a string into html
> 
>  
> and back again.
> thanks
> adrian
> 
> 
> 
> 
> -- 
> 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] groupware tool in PHP for PostgreSQL

2003-01-07 Thread Maxim Maletsky

Miguel González Castaños <[EMAIL PROTECTED]> wrote... :

>  I have been looking around during more than one month, and the best
> that I have found seems to be phpGroupware, PHProjekt and TuTOS but I am
> hoping to get some comments/suggestions from you guys.

probably phpGroupWare.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] Redirect opening in a new window

2002-11-30 Thread Maxim Maletsky

isn't there an only module you could modify? Do you really need to edit
2000 pages? I am not NUKE fan, but I am sure there is an easier way
-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Sat, 30 Nov 2002 12:09:33 -0800 "Troy May" <[EMAIL PROTECTED]> wrote:

> That easy solution is not so easy for me.  This portal system is PHP-Nuke.
> There's different themes, pages, etc.  It would take me 3 weeks to find and
> edit all the links in a 2000 file directory.
> 
> I just need to be able to do this from the called module itself, and that
> would take care of all the pages/themes in one shot.
> 
> 
> 
> -Original Message-
> From: Jeffrey B.Ferland [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 30, 2002 12:02 PM
> To: Troy May
> Subject: Re: [PHP] Redirect opening in a new window
> 
> 
> On Saturday 30 November 2002 02:55 pm, you wrote:
> > Hello,
> >
> > I'm playing with a portal system now and I need to edit a module to
> > redirect to another site/page.  I have done this with a header()
> > redirection, but it takes the current window.
> >
> > How can I do this and have it open a new window for the redirect?
> 
> Displayed Link
> 
> 
> -Jeff
> SIG: HUP
> 
> 
> -- 
> 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] login_script_help needed.

2002-11-30 Thread Maxim Maletsky

what is on your line 22?

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Sat, 30 Nov 2002 20:46:12 -0800 "Karl James" <[EMAIL PROTECTED]> wrote:

> http://www.ultimatefootballleague.com/Create_Account.phps
>  
> hey people
>  
> I was wondering if anyone can tell me why I cant get this script to
> work.
>  
> Or do you have an easier one I can use..
>  
> Thanks
> Karl


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




Re: [PHP] File handling

2002-11-29 Thread Maxim Maletsky

loop through the file line by line explode()ing every line with "TEXt"
in it. Then, if retrning array count is bigger than one, unset() the key
one and break the loop. All read OVERWRITE in the original file.

Sorry, too lazy writing the code here :)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Jeff" <[EMAIL PROTECTED]> wrote... :

> Quick one, how do i read a file for a key word, say "TEXt", and the delete
> the rest of the remaining file?
> 
> 
> 
> 
> 
> -- 
> 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] Help with the PHP

2002-11-29 Thread Maxim Maletsky

Try this:

http://www.sourceforge.net/projects/phptriad and dowload there "phptriad".
It is a simplified distribution of PHP.

Also, try reading the articles on the web. You might want to start from
PHP Beginner (www.phpbeginner.com). There are also some installtion
tutorials for you.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Ted Frank" <[EMAIL PROTECTED]> wrote... :

> Hello,
> 
> I am trying to make my free home page and my friend told me to download the 
> php because it is for the web and i want to make a web page. so i downloaded 
> the php with the flash plugin and i put it on my desktop and nothing showed 
> up - i just want to make the free home page but the php does not work - i 
> double click and noting happens
> 
> i have the windows 95 with internet exploerer with a pentium 100 drive
> 
> what do i do?
> 
> Ted
> 
> _
> Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] file creation date

2002-11-29 Thread Maxim Maletsky
How would you know about a file on someone's system before it was
implicitly sent you by user? Take a look at JavaScript, but I doubt
there will be a "sure" solution for it. Nothing is "sure" with
JavaScript except for it's cross-browser incompatibility :)


--
Maxim Maletsky
[EMAIL PROTECTED]



Research and Development <[EMAIL PROTECTED]> wrote... :

> Is it possible to get the creation date of a file that is going to be 
> uploaded? I saw a function that returns the file creation date once on 
> the server, but is it possible to get that information from a file that 
> is not yet on the server?
> 
> Thanks in advance.
> 
> 
> -- 
> 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] Help with login/redirect/insert to dbase

2002-11-29 Thread Maxim Maletsky
I think you better describe your question here and wait for the world to
answer.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Karl James" <[EMAIL PROTECTED]> wrote... :

> Hello guys
>  
> Happy thanksgiving!!!
>  
> My question is 
> I'm Trying to apply this code to what I have done already on my site
> http://robouk.mchost.com/tuts/tutorial.php?tutorial=login1
>  
>  
> my site is this.
> http://www.ultimatefootballleague.com
> <http://www.ultimatefootballleague.com/> 
>  
> Im trying to do with login and if login is good 
> It takes you to the team page.
>  
> But I have some questions on this and need to talk to someone online
> If possible, I can meet via MSN and IRC 
>  
> Please email if interested in helping.
>  
>  


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




Re: [PHP] FAQ a good idea?

2002-11-22 Thread Maxim Maletsky
there is a bunch of info everywhere on the web. One should have better
means to find these, but at the end, that is what others do here -
answer questions :)

I don't think this will ever happen


--
Maxim Maletsky
[EMAIL PROTECTED]



"Noodle Snacks" <[EMAIL PROTECTED]> wrote... :

> I think this group should have a regularly posted faq that outlines common
> problems such as register globals.
> 
> I would be glad to help write it etc if anyone else would like an input.
> 
> I wrote this in response to the millions of register global questions and
> the message with the subject "Be Nice to Newbies".
> 
> Reply on list if you think it would be a good idea and we can use this
> thread to discuss it...
> 
> --
> JJ Harrison
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP Version of Outlook????

2002-11-22 Thread Maxim Maletsky

What does outlook have to do with PHP?

No, there is nothing official has been made. There are some similar apps
though, very good ones actually.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Craig" <[EMAIL PROTECTED]> wrote... :

> Does Any one of a web based version of Microsoft Outlook/MSN Hotmail address
> book and scheduler
> 
> 
> 
> 
> 
> -- 
> 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] Post Problem

2002-11-18 Thread Maxim Maletsky

I think you should comment on this bug:

http://bugs.php.net/bug.php?id=18648


provide the details about your system configurations and everything else
that might help us to fix it. Though, it seems to be an Apache2 problem,
so try upgrading that as well.

--
Maxim Maletsky
[EMAIL PROTECTED]



"Ford, Mike   [LSS]" <[EMAIL PROTECTED]> wrote... :

> > -Original Message-
> > From: Dave J. Hala Jr. [mailto:[EMAIL PROTECTED]]
> > Sent: 18 November 2002 17:30
> > 
> > I'm running php-4.2.2-8.0.5 on Redhat 8.0
> > 
> > Lately I've noticed that when doing a form, listbox variables 
> > have funky
> > values in certain situations.  Unfortunately, I haven't been to
> > determined what the certain situation is.
> > 
> > Here's an example.
> > 
> > Here is the listbox in the form:
> > 
> > 
> > 4
> > 6
> > 
> > 
> > 
> > After clicking submit, when I echo the variable in the post 
> > script,I get
> > the following results:
> > SQN=4
> 
> I was sure I'd seen this reported as a bug on http://bugs.php.net/, so I did
> a quick search and came up with this: http://bugs.php.net/bug.php?id=18648
> -- this only seems to apply if you're also running Apache 2, but so far it's
> my best guess.
> 
> Cheers!
> 
> Mike
> 
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 
> 
> -- 
> 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] testing

2002-11-18 Thread Maxim Maletsky
just mail: [EMAIL PROTECTED] :) You succeded though :)


--
Maxim Maletsky
[EMAIL PROTECTED]



[EMAIL PROTECTED] wrote... :

> 
> 
> not sure how to post
> 
> -- 
> 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] echoing date of first and last day of current week.

2002-11-18 Thread Maxim Maletsky
probably, what you tried is the most elegant way. But, you got me: "mathematically"
I did *this* for you:


\n";
print_r($res);

?>

Cheers, and thank my curiousity :)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Noodle Snacks" <[EMAIL PROTECTED]> wrote... :

> I want to get the unix timestamps of the first and last days of this week...
> 
> Currently I have this:
> 
>  echo 'Words for the week from '.date('jS F Y',strtotime("last sunday")).'
> to '.date('jS F Y',strtotime ("next saturday")).'.';
> 
> on saturday this showed the 10th to 23rd... Is there a good way to do this
> mathematically (for speed) or can someone think of a better string to parse?
> 
> 
> --
> JJ Harrison
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] decode

2002-11-18 Thread Maxim Maletsky

where is that coming from? What encoding is that? Any info of the "b abbab abbab 
baaba"
part?


--
Maxim Maletsky
[EMAIL PROTECTED]



"Roman Duriancik" <[EMAIL PROTECTED]> wrote... :

> Please Help me !
> This is not a php problem but if someone knows how to decode this :
> I have document in encryption type : B*C*N**N but I don't know how do
> decode.
> for example : b abbab abbab baaba
> 
> thanks
> 
>   roman
> 
> 
> -- 
> 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] sunrise/sunset programs?

2002-11-18 Thread Maxim Maletsky
I saw some similar code once... But PHP does not have it installed by
default.

Try searching on Google, HotScripts and SourceForge... I'm sure you will
come up with something


--
Maxim Maletsky
[EMAIL PROTECTED]



"Adam" <[EMAIL PROTECTED]> wrote... :

> Does anyone know if PHP has the capabilities of being able to calculate
> sunrise/sunset times by entering longitude/latitude values if someone was
> smart enough to write code for it? If not, is there any
> programs/applications around that allow for times to be entered into php
> after values have been worked out by the program/app?
> 
> Thanks for any help.
> Adam.
> 
> 
> 
> -- 
> 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] Browsing directory

2002-11-18 Thread Maxim Maletsky

look at here:

www.php.net/dir


--
Maxim Maletsky
[EMAIL PROTECTED]



Helen Muller <[EMAIL PROTECTED]> wrote... :

> 
> I would like to create a web page which allow people to browse the directory 
>structure and the files listed in every directory. If you have experience about that, 
>could you kindly give me some advice or references? Thanks in advance.
> 
> Cheers,
> 
> Helen
> 
>  
> 
> 
> 
> 
> -
> Get a bigger mailbox -- choose a size that fits your needs.


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




Re: [PHP] PHP Newbie question

2002-11-18 Thread Maxim Maletsky

Steps:

1. Install PHP. Already installed?
2. make a file accessible via browser and call it test.php
3. put this into it:

";
phpinfo();
?>

4. Now, access that file.

If you see "Hello World" outputted followed by a long blue-gray table
with lots of server data - means everything worked and you could go to
the sites like PHP Beginner (www.phpbeginner.com) or many others to read
some tutorials and still code to keep testing.

If you get asked to download a .php file then make sure you installed
your PHP with Apache right (requires some editing of httpd.conf, read
the manual)

Cheers,

--
Maxim Maletsky
[EMAIL PROTECTED]



Bryan Cassidy <[EMAIL PROTECTED]> wrote... :

> This might sound stupid but what the hell. I am running Red Hat 8.0
> with Apache. I have apache working fine right now. I am wanting to
> learn some php but really don't know where to start/look or anything
> to tell the truth. I do "everything" from my FreeBSD 4.6.2 box but
> Apache runs on Red Hat. With me? Could someone give me a very "basic"
> PHP script or whatever they are called, tell me where I "should" or
> "need" to put it on my Red Hat 8.0 box and what else I need to do to
> see the script on my webpage? Put it like this. I will make a html
> file in /var/www/html/ called php and inside php i will make a file
> named php.ini ( i think it should be .ini right?) and I will edit my
> index.html file, add a link and point it to the php.ini file and see
> what happens. I just want to get a very basic idea of php, what it
> does, where to put the php file and how to get started on the web. I
> really hope this e-mail doesn't get ignored so could someone just help
> me out a lil bit here? I would appreciate it.


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




Re: [PHP] Help with variables in email

2002-11-18 Thread Maxim Maletsky

add single quote ['] before and after every dot [.] :


/* message */
$message = '


 Products Purchased:


Customer Information:

 
  Name
  '.$name.'
 
 
  Title
  '.$title.'
 
 
  Email
  '.$email.'
  
  .
  .
  ..
  .
  ...

--
Maxim Maletsky
[EMAIL PROTECTED]



"Clint Tredway" <[EMAIL PROTECTED]> wrote... :

> I am trying to send an email with form vars inside it but I cannot seem
> to get the vars to be parsed.
> 
> Here is my code:
> /* message */
>   $message = '
>   
>   
>Products Purchased:
>   
>   
>   Customer Information:
>   
>
> Name
> {$name}
>
>
> Title
> .$title.
>
>
> Email
> .$email.
>
>
> Company
> .$company.
>
>
> Phone
> .$phone.
>
>
> Fax
> .$fax.
>
>
> Address
> .$address.
>
>
> City
> .$city.
>
>
> State
> .$state.
>
>
> Postal Code
> .$postalcode.
>
>
> Country
> .$country.
>
>
>  
>
>
> Billing Information
>
>
> Card Type
> .$methodofpay.
>
>
> Card Name
> .$cardname.
>
>
> Exp Date
> .$cardexp.
>
>   
>   
>   
>   ';
> 
> This outputs this:
> Customer Information:
> 
> Name {$name} 
> Title .$title. 
> Email .$email. 
> Company .$company. 
> Phone .$phone. 
> Fax .$fax. 
> Address .$address. 
> City .$city. 
> State .$state. 
> Postal Code .$postalcode. 
> Country .$country. 
>   
> Billing Information 
> Card Type .$methodofpay. 
> Card Name .$cardname. 
> Exp Date .$cardexp. 
> 
> Please help me figure this out. I know its simple, but I cannot see it
> ;)
> 
> Thanks,
> Clint
> 
> 
> -- 
> 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] Problems with Caching

2002-11-18 Thread Maxim Maletsky

try calling implicitly flush() function:


Example code:
Working...


--
Maxim Maletsky
[EMAIL PROTECTED]



"Adam Humphrey" <[EMAIL PROTECTED]> wrote... :

> When I upgraded to 4.2.3 from 4.2.2 I no longer am able to see HTML before
> PHP code that takes a while to process.
> 
> I made sure that I've set "output_buffering =off" but I still have this
> problem.
> 
> When I hit the page with the following code on my server, it will wait 10
> secs before it displays any of the HTML on the page.  I want it to display
> the HTML at the top and then execute the code after the PHP block when the
> PHP has finished.  This code worked in 4.2.2 but no longer. :-(
> 
> Example code:
> Working...
>  sleep ( 10 );
> ?>
>  
> DONE!
> 
> <!--
>  show.style.display='';
>  hide.style.display='none';
> //-->
> 
> 
> Does anyone know what setting has caused this code to no longer work like it
> did in 4.2.2?
> 
> Any input would be helpful.
> 
> Thanks,
> 
> Adam
> 
> 
> 
> -- 
> 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] Undefined variables?

2002-11-18 Thread Maxim Maletsky

set error reporting to 55


--
Maxim Maletsky
[EMAIL PROTECTED]



"Martin Magnusson" <[EMAIL PROTECTED]> wrote... :

> I installed php 4.2.3 on Apache2.
> 
> When I write  I get an error message telling me that
> I have an undefined variable $anyvariable. Is this something new that one
> must declare all variables?
> 
> In my previous version of php the expression above would return an empty
> string - no error messages...
> 
> Hope you understand my problem...
> 
> Martin Magnusson
> 


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




Re: [PHP] PHP/Flash

2002-11-14 Thread Maxim Maletsky

wanna write an article for PHP Beginner? We'd be looking for something
like this some time next month...

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Mon, 4 Nov 2002 15:46:12 -0600 "Clint Tredway" <[EMAIL PROTECTED]> 
wrote:

> I have a small example of using Flash/PHP if anyone wants it..
> 
> Clint
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] Re: Authentication with PHP and HTTP

2002-11-14 Thread Maxim Maletsky

using this method for a production environment is incredibly vulnerable.
Just think of having a link on that page to some other site (or even having
a third-party banner displayed) on which there is a hit counter (and on
90% there are) those can simply read the link in their logs.

Never ever use it if security is of a minimum importance or you're
completely sure you know what you do.

-- 
Maxim Maletsky
[EMAIL PROTECTED]


On Tue, 5 Nov 2002 02:04:52 +0100 "silver" <[EMAIL PROTECTED]> wrote:

> hi - I'm not quite sure if this will help you, but lets give it a try:
> 
> you could use this URL syntax:
>  http://user:password@;www.site.com to automatically log your user in to the
> htaccess protected area. the bad thing about it is that user / password show
> up in the URL, but you could hide this information with using frames...
> are PHP/MySQL usernames + passwords the same like in Apache/HTTP?
> 
> greets,
> _andi
> 
> 
> 
> 
> 
> 
> "Phillip Erskine" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:F13i7M4BAyxJMXehYSo4e46@;hotmail.com...
> >
> > I have a site that uses PHP/MySQL authentication for one section and
> > Apache/HTTP authentication for another.  Eventually I would like to use
> only
> > PHP and MySQL for authenticating users, but in the meantime, I have to use
> > both.
> >
> > First, users will log in to the main section of the site and I will use
> PHP
> > session variables to maintain state for that section.  What I would like
> to
> > be able to do is allow users to click a link that would redirect them to
> the
> > other section of the site and automatically log them in.
> >
> > The section of the site that users will be redirected to uses .htaccess
> and
> > .htpassword files to enforce HTTP authentication.
> >
> > Is this possible?  If so, how?
> >
> >
> > =
> > http://www.pverskine.com/
> >
> >
> >
> >
> > _
> > Protect your PC - get McAfee.com VirusScan Online
> > http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> >
> 
> 
> 
> -- 
> 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] phpMyAdmin 2.2.6

2002-11-14 Thread Maxim Maletsky
On Sun, 12 Nov 2000 22:25:59 - "Iguider" <[EMAIL PROTECTED]> wrote:

> I am running normally a phpMyAdmin 2.2.6, until yesterday it shows me :

So it works now?

I will assume no... Describe your system to the list and what could
have possibly be changed yesterday. You might have an solution soon.

-- 
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] Oracle 7 support

2002-11-12 Thread Maxim Maletsky

Well, I will spread some light - I maintain OCI8 extension :)

Your machine does not need Oracle Server installed, it needs Oracle
Client installed. These are two completely different things.

So, try this in your command prompt:

echo $ORACLE_HOME

if you get a result, means the client is there and you can recompile php
--with-oci8=$ORACLE_HOME

That will compile the OCI8 extension with all the required headers.

Cheers,


--
Maxim Maletsky
[EMAIL PROTECTED]



"@ Edwin" <[EMAIL PROTECTED]> wrote... :

> Hello,
> 
> First, let me just say that I'm no Oracle guru. :) But while we're waiting
> for them...
> 
> "Ford, Mike [LSS]" <[EMAIL PROTECTED]> wrote:
> 
> > > -Original Message-
> > > From: Dan Field [mailto:danf@;ceredigion.gov.uk]
> > > Sent: 12 November 2002 13:39
> 
> ...[snip]...
> 
> > > That is great news, thanks Mike. My second problem then lies with my
> > > current PHP Setup. I have been using the binary RPMs from RedHat up to
> > > now, which do not sem to have been compiled with the Oracle
> > > functionality included. If I recompile PHP, will I need the Oracle
> > > headers on the machine also? If so this could be a problem as
> > > the Oracle
> > > server I wish to use is not on the same machine as the webserver.
> >
> > Sorry, I can't help with this one as I'm not the administrator of our main
> Unix
> > server, and my test server is Windows so I used the pre-compiled binaries.
> >
> > But hopefully one of the Oracle gurus on this list will spring to your
> aid!
> >
> 
> *I think* you need to have Oracle installed even if you wouldn't really
> connect to it but instead connect to a different server. Since I installed
> Oracle with most of the Linux installations that I did, I haven't really
> tried enabling Oracle support in PHP without Oracle on the same server. In
> other words, I haven't really tried configuring --with-oci8 without
> supplying the path (e.g.  --with-oci8=/path/to/oracle/ ).
> 
> PHP will look for the needed file when configuring so I don't think you can
> really get away without installing Oracle first. (Of course, you can just
> try to find out what files are needed, ask a friend to give you a copy,
> "trick" php that it exists, etc.--it might not work though...)
> 
> Anyway, if you need Oracle, try the OTN site. There's one that you can use
> for development.
> 
> - E
> 
> 
> -- 
> 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] Oracle 7 support

2002-11-12 Thread Maxim Maletsky
Your machine will need the Oracle headers which are included in Oracle
Client. So, in two words - your machine needs Oracle client installed.

Try doing:

echo $ORACLE_HOME

in your command prompt


--
Maxim Maletsky
[EMAIL PROTECTED]



Dan Field <[EMAIL PROTECTED]> wrote... :

> On Tue, 2002-11-12 at 13:03, Ford, Mike [LSS] wrote:
> > > -Original Message-
> > > From: Dan Field [mailto:danf@;ceredigion.gov.uk]
> > > Sent: 12 November 2002 12:18
> > > 
> > > Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ?
> > 
> > Yes.
> >  
> > > I have found functions specific to Oracle 8i and some more generic
> > > functions (are these only for Oracle 9?).
> > 
> > No -- the OCI8 functions are actually recommended for Oracle 7 upwards.  The
> > ora_* functions are older and do not use the newer OCI methodology.
> 
> That is great news, thanks Mike. My second problem then lies with my
> current PHP Setup. I have been using the binary RPMs from RedHat up to
> now, which do not sem to have been compiled with the Oracle
> functionality included. If I recompile PHP, will I need the Oracle
> headers on the machine also? If so this could be a problem as the Oracle
> server I wish to use is not on the same machine as the webserver.
> 
> Cheers
> 
> -- 
> Dan Field
> Systems Development Officer - Social Services Dept.
> Ceredigion County Council.
> 
> 
> 
> 
> Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi,
> yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato.
> Pe  dderbynioch y neges hon mewn camgymeriad, byddwch
> mor garedig a rhoi gwybod i'r rheolwr system.
> 
> Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi
> cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
> 
> 
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] PHP seg faulting

2002-11-12 Thread Maxim Maletsky

Try posting this on bugs.php.net onto the appropriate category. Add the
output too. There you will have more chances to know why this happens.


--
Maxim Maletsky
[EMAIL PROTECTED]



Mike Hall <[EMAIL PROTECTED]> wrote... :

> Afternoon:
> 
> I'm having problems with PHP CGI crashing and I have no idea why. The
> script I'm running hasn't changed, nor has the server setup. It ran fine
> for several weeks and then started crashing. I rebooted the server
> (FreeBSD 4.6) and it was fine for a couple of days... now its crashing
> again.
> 
> I was running PHP 4.2.1. I upgraded to 4.2.3 and its still doing it.
> 
> Here is a backtrace, but its all greek to me. Can anyone explain what on
> earth all this means?
> 
> Thanks
> 
> Mike
> 
> #0  0x28353386 in localeconv () from /usr/lib/libc.so.4
> #1  0x28364ee1 in strtod () from /usr/lib/libc.so.4
> #2  0x8127ac1 in is_numeric_string (str=0x81fe224 "SELECT", length=6, 
>lval=0xbbc00164, dval=0xbbc00158, allow_errors=0 '\000')
> at zend_operators.h:94
> #3  0x81276fa in zendi_smart_strcmp (result=0xbbc00348, s1=0xbe84f24, s2=0x82bd4fc) 
>at zend_operators.c:1653
> #4  0x8126346 in compare_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) 
>at zend_operators.c:1128
> #5  0x8126c2a in is_equal_function (result=0xbbc00348, op1=0xbe84f24, op2=0x82bd4fc) 
>at zend_operators.c:1276
> #6  0x814d64f in execute (op_array=0x82b9d24) at ./zend_execute.c:1114
> #7  0x8150337 in execute (op_array=0x82ca224) at ./zend_execute.c:1638
> #8  0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #9  0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> 
>  (another 59,052 of these) ...
> 
> #59061 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #59062 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #59063 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #59064 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #59065 0x8150337 in execute (op_array=0x82065a4) at ./zend_execute.c:1638
> #59066 0x8150337 in execute (op_array=0x8206b24) at ./zend_execute.c:1638
> #59067 0x81208b3 in call_user_function_ex (function_table=0x821a698, 
>object_pp=0x81fcc30, function_name=0x81fdd24,
> retval_ptr_ptr=0xbfbfd810, param_count=3, params=0x826bc64, no_separation=1, 
>symbol_table=0x0) at zend_execute_API.c:517
> #59068 0x812019d in call_user_function (function_table=0x81ac040, 
>object_pp=0x82a6b60, function_name=0x821eae4,
> retval_ptr=0x826bda4, param_count=3, params=0xbfbfd8a8) at zend_execute_API.c:373
> #59069 0x80f1f21 in xml_call_handler (parser=0x82a6b24, handler=0x821eae4, argc=3, 
>argv=0xbfbfd8a8) at xml.c:375
> 
> 
> 
> #59070 0x80f2922 in _xml_startElementHandler (userData=0x82a6b24, name=0x81f3a40 
>"event", attributes=0x82a6c10) at xml.c:657
> #59071 0x80f7b53 in doContent (parser=0x81bfc00, startTagLevel=0, enc=0x816ebc0,
> s=0x82e617a "price=\"SP\" id=\"31,PAI370676\" saddlecloth=\"1\" />id=\"31,PAI370677\" saddlecloth=\"2\" />"...,
> end=0x82e9779 "",
> nextPtr=0x0) at xmlparse.c:1659
> #59072 0x80f705a in contentProcessor (parser=0x81bfc00,
> start=0x82e504a "date=\"20021112 13:05:00\" venue=\"Huntingdon\">id=\"31,PAI370737\" saddlecloth=\"1\" />saddlecloth=\"2\""...,
> end=0x82e9779 "", endPtr=0x0) at xmlparse.c:1349
> #59073 0x80f9ee2 in doProlog (parser=0x81bfc00, enc=0x816ebc0,
> s=0x82e504a "13:05:00\" venue=\"Huntingdon\">saddlecloth=\"1\" />end=0x82e9779 "",
> tok=29,
> next=0x82e504a "date=\"20021112 13:05:00\" venue=\"Huntingdon\">id=\"31,PAI370737\" saddlecloth=\"1\" />saddlecloth=\"2\""..., nextPtr=0x0)
> ---Type  to continue, or q  to quit---
> at xmlparse.c:2687
> #59074 0x80f9a54 in prologProcessor (parser=0x81bfc00,
> s=0x82e5024 "password=\"good9top\">price=\"SP\" id=\"31,PAI370737\" saddlecloth=\"1\" /> nextPtr=0x0) at xmlparse.c:2523
> #59075 0x80f99ea in prologInitProcessor (parser=0x81bfc00,
> s=0x82e5024 "password=\"good9top\">price=\"SP\" id=\"31,PAI370737\" saddlecloth=\"1\" /> nextPtr=0x0) at xmlparse.c:2512
> #59076 0x80f68c8 in php_XML_Parse (parser=0x81bfc00,
> s=0x82e5024 "password=\"good9top\">price=\"SP\" id=\"31,PAI370737\" saddlecloth=\"1\" />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] Oracle 7 support

2002-11-12 Thread Maxim Maletsky
OCI 7 does not need any modification to support 8 and 9 but they aren't
as powerful, thus should only be used for Oracle 7.

OCI8 is the 8th OCI and fully supports Oracle 8 with and Oracle 9. For
Oracle 9 there are a few thing that are missing, but overall can be
safely used on high level production environments.

We interface 3.5 Terrabytes Oracle 8 database framework for an
e-government project using PHP's OCI8 extension.


--
Maxim Maletsky
[EMAIL PROTECTED]



"Ford, Mike   [LSS]" <[EMAIL PROTECTED]> wrote... :

> > -Original Message-
> > From: Dan Field [mailto:danf@;ceredigion.gov.uk]
> > Sent: 12 November 2002 12:18
> > 
> > Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ?
> 
> Yes.
>  
> > I have found functions specific to Oracle 8i and some more generic
> > functions (are these only for Oracle 9?).
> 
> No -- the OCI8 functions are actually recommended for Oracle 7 upwards.  The
> ora_* functions are older and do not use the newer OCI methodology.
> 
> Cheers!
> 
> Mike
> 
> -
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 
> 
> -- 
> 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] Oracle 7 support

2002-11-12 Thread Maxim Maletsky

Dan Field <[EMAIL PROTECTED]> wrote... :

> Can anyone tell me if Oracle 7 is supported by PHP 4.2.2 ? 

Yes, it is. Oracle extension is supporting Oracle 7th version, while OCI8
is primarily for 8 and 9th versions, they might be also working for
Oracle 7.

> I have found functions specific to Oracle 8i and some more generic
> functions (are these only for Oracle 9?).

Generic (ora_*) are for Oracle 7 and up, OCI8 is for 8 and 9.

> Also, is there a doc containing all levels of support for 3rd party
> products? save me pestering the list in future. I couldn't locate it
> myself though.

Official manual has a list of PHP extension - that is what one should
read.

--
Maxim Maletsky
[EMAIL PROTECTED]




> Many thanks,
>  
> -- 
> Dan Field
> Systems Development Officer - Social Services Dept.
> Ceredigion County Council.
> 
> 
> 
> 
> Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi,
> yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato.
> Pe  dderbynioch y neges hon mewn camgymeriad, byddwch
> mor garedig a rhoi gwybod i'r rheolwr system.
> 
> Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi
> cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper.
> 
> 
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> 
> 
> 
> 
> -- 
> 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




  1   2   3   4   5   6   7   >