[PHP] Automatic .htaccess Authentication?

2003-02-27 Thread Nick Oostveen
I'm looking for a way to have php automatically log a user into an htaccess 
protected directory.

My problem is as follows.  I currently have a large number of php scripts 
which use a database authentication system.  Unfortunately, there are also 
a number of old CGI scripts which need to be protected by an .htaccess file.

What I'm looking for is a way to allow php to perform the .htaccess 
authentication in the background when the user first logs into the DB based 
authentication so that when they go to access the cgi scripts they are not 
prompted for another login.

Any Ideas?

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


[PHP] Medium to Large PHP Application Design

2003-01-09 Thread Nick Oostveen
As PHP becomes more accepted in the corporate world, it is only logical 
that larger and more complex applications are going to be developed using 
it.  While there is an abundance of information out there about making 
specific things work, there seems to be a shortage regarding the big picture.

As such, my question is this: What methods and techniques can be used to 
help design and build complex, medium to large PHP applications that are 
not only scalable, but maintainable and extensible?  I'm looking for online 
references, personal experience and opinion and even examples of open 
source code which you think demonstrate the above criteria on this one.  I 
think an extended discussion on this topic could be of great benefit to 
everyone.

Obviously separating application and business logic from interface code is 
a given, but what about other things? Are the object orientated facilities 
of PHP currently worth really trying to take advantage of? If so, what are 
you doing to take advantage of them? Are design concepts such as design 
patterns relevant at this level?  What frameworks, if any, currently exist 
to assist in rapid, structured development, and what specific benefits do 
they bring to the table?

These are just some of the questions that I'd like to see expanded upon, 
I'm sure there are others out there who can add more to the list.

Nick Oostveen


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



[PHP] Domain Security Restrictions

2002-11-10 Thread Nick Oostveen
Our company is currently running a server which is responsible for hosting 
numerous domains.  As a web development firm, traditionally our server has 
been set up so that only our developers have access to run scripts on 
it.  Recently some of our clients have been looking for FTP access to their 
sites, mostly static, so that they can make additions directly, and as such 
we are looking for a way to securely offer them this service.

Essentially, I am looking for a way to do one or all of the following:

1) Enable safe mode on a domain by domain basis.
2) Disable the use of specific functions on a domain by domain basis.
3) Disable php entirely on a domain by domain basis.

Any help or advice with any of the above would be greatly appreciated.

Nick Oostveen



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



[PHP] Php | Architect Magazine?

2002-11-09 Thread Nick Oostveen
Has anyone taken a look at this magazine yet (www.phparch.com)? I came 
across mention of it on Slashdot earlier today and it looks interesting.  I 
am considering subscribing but wouldn't mind some feedback about the 
overall quality of the publication beforehand.

Nick Oostveen


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



[PHP] PHP Shopping Carts

2002-10-15 Thread Nick Oostveen

I'm currently looking for a basic, php based shopping cart solution which 
is flexible (preferably using a template system of some sort), customizable 
and will allow me to get up and running in a minimum amount of time.

I know that there are literally dozens of free or cheap (less than $200) 
products out there and would appreciate hearing your experiences and 
recommendations so that I can filter out the good from the bad.

Thanks,

Nick Oostveen


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




Re: [PHP] Persistant Connections

2002-08-14 Thread Nick Oostveen

Persistent connections are typically a good thing to use on high traffic 
sites as they offer better performance than opening and closing connections 
for each database request. The reason for this is the overhead used in 
opening a database connection is actually quite high.

While keeping them open when they are no longer needed may seem 
counter-intuitive, the connection isn't being saved for a particular user 
or page, instead it remains open and will automatically be used by any page 
requiring database connectivity on your site.  If there are no free 
connections when a page request comes in, a new one is open.  Conversely if 
a connection has not been utilized for a specific period of time (usually a 
couple minutes) it will be closed.

At 02:46 PM 8/14/2002 +0100, John Wards wrote:
I am running a website which generates around 100,000 pageviews a day and I
am wondering if I stop using persistent conections to the database and use
normal open and close conections this would reduce the load onto my server?

Most conections are either made through my main file or the phorum message
board system.

Thanks in advance
John Wards



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

2002-08-14 Thread Nick Oostveen

If you are just trying to access a classes functions without creating an 
instance of it you're probably looking to use the scope resolution operator 
::.  For this to work all you have to do is ensure that the definition for 
the class you wish to use is included into the file containing the class 
you are trying to call the functions from.

You would then call the functions as follows:

ClassName::FunctionName();

At 02:43 PM 8/14/2002 -0400, you wrote:
Hello,  To begin.. i'm new to the list...

I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
to OOP in general, but I've done quite a bit of reading and playing around
with it in the past couple of months.

What I'm trying to figure out is the proper way to call a class from a
class.  I dont mean by extending the class, but actaully just getting the
functions...

For instance...

I'm trying to connect to a Database (database class) from my gen_XML class.
Do I include the database class in the gen_XML constructor?  Do I set a
gen_XML variable as a database object (i.e. $this-mydb)?

I hope my question makes some sense...

Your help is appreciated...

Mark Armendariz



--
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 warning with 4.2

2002-08-08 Thread Nick Oostveen

You should be able to fix this by changing the function DECLARATION for the 
argument in question to take the variable by reference instead of by value 
(which is the default).

So it should be something like:

OCIFetchInto ( $var1, $rvar2, $var3  )

What you are currently doing is specifying at call-time that I want you to 
accept this variable by reference, even if you are expecting it to be 
passed by value.  This can be very dangerous from a data corruption point 
of view, which is likely why it is being deprecated.

At 11:13 AM 8/8/2002 -0700, PHP List wrote:
Hi, after upgrading to 4.2, I seem to be getting this warning:

PHP Warning:  Call-time pass-by-reference has been deprecated - argument 
passed by value;  If you would like to pass it by reference, modify the 
declaration of [runtime function name]().  If you would like to enable 
call-time pass-by-reference, you can set allow_call_time_pass_reference to 
true in your INI file.  However, future versions may not support this any 
longer.

on this line:
OCIFetchInto ( $GLOBALS[oracle_statement], $row, OCI_NUM + 
OCI_RETURN_NULLS  )

if I can't use $row anymore, what do I do? The warning says that future 
versions may not support this, so will this function be fixed? Or will 
this function be dissappearing?

Thanks for any help.


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




Re: [PHP] Why Protect PHP coding?

2002-08-02 Thread Nick Oostveen

Check out the Zend Encoder at http://www.zend.com to generate encoded php 
files.  It is, however, a bit pricey.

At 12:47 AM 8/2/2002 -0400, php  banana wrote:
Just out of curiosity when and why?

 Is there any method to encrypt PHP files.
 
 Nyon
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


--__-__-__
eat pasta
type fasta


--
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:Using PHP to reboot the linux server

2002-08-02 Thread Nick Oostveen

Does the user apache is running as have access to reboot the server?

At 07:18 PM 8/2/2002 +, you wrote:
I am using the below command in the php page to reboot the linux server. 
But nothing happens . Where am i wrong or do i have to give a path or 
nething . Please help.


$output = shell_exec(`reboot`);
echo $output;



_
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.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] Oracle 8i SQL Problem..

2002-07-28 Thread Nick Oostveen

I could be wrong on this but I believe that Oracle 8i uses a proprietary 
join syntax.  This support has been added in the latest version of Oracle, 
but with 8i I believe you're out of luck using the left join keywords.

Check out 
http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for 
more info on this.

At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote:
Hi,
This really isn't a PHP issue..sorry.

I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL
which works for MSSQL 2K and seems correct for Oracle... but keeps
giving me a Error.. ORA-00933 SQL command not properly ended on the
following query...

SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2,
usergrp.userid, users.userdescrip
 FROM grp
 LEFT JOIN usergrp
 ON grp.grp=usergrp.grp
 LEFT JOIN users
 ON usergrp.userid=users.userid
 ORDER BY grp.grp

The error keeps pointing at the first LEFT JOIN. Anybody know why?

--
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] calling user-defined php functions from a href tag

2002-07-26 Thread Nick Oostveen

Check out http://www.faqts.com/knowledge_base/view.phtml/aid/277/fid/40

Essentially you'll want to use this this combined with get variables hard 
coded into your url.  For example:

a href=script.php?action=function1function 1/a
a href=script.php?action=function2function 2/a

At 11:13 PM 7/26/2002 -0400, Bob Lockie wrote:
--Original Message Text---
From: Michael
Date: Fri, 26 Jul 2002 21:09:13 -0500 (EST)


Hi, everyone.

There MUST be some creative way to call a user-defined PHP function from
an a href tag. Does anyone have any suggestions?

For example:

==
 Click here to start function joe().
==

So, if the user clicks on the link, he'll see:  The result of this
function is: 20

Any ideas? Any help would be VERY much appreciated. Thanks!

-- Michael


It is not possible to do it in one step.
The web server parses ALL the PHP code, generates HTML, sends it to the 
browser.


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




Re: [PHP] Parse error - new set of eyes?

2002-07-25 Thread Nick Oostveen

Ok, I noticed a couple things.

One: There's no } ending your elseif statement.

Two (and the big one): Why all the opening brackets before your isset() 
functions? I'm not sure if you're trying to do some nested logic in there, 
but if so it will be much more readable if you use nested if statements 
instead of a single huge statement.  If you quickly count you'll see that 
you've got 8 opening brackets and only 5 closing ones.  That's where your 
problem lies.

At 02:40 PM 7/25/2002 -0600, you wrote:
I am getting a parse error on line 14, I am trying to make sure session vars
are being set before rendering the page.  This is lines 12,13,14  15.  Any
help is appreciated.
Jas

if ((!$u_name) || (!$p_word)){
  header(Location: index.php);
  session_destroy();
  exit; }
/* Check for missing session vars */
elseif ((!isset($HTTP_SESSION_VARS['clk']) ||
(!isset($HTTP_SESSION_VARS['holy_cow']) ||
(!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) {
  /* Begin logging of client info to database table since session vars are
not present */
  require '/path/to/connection/class/db.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




[PHP] GIF Manipulation

2002-07-16 Thread Nick Oostveen

I'm currently developing a site which needs the ability to do server-side 
image cropping and resizing.  I currently have a current version of GD 
installed with PHP, however the lack of support for GIFs is causing endless 
headaches.

Is there any way to support GIFs in PHP without reverting to an older 
version of GD (and loosing PNG support in the process)?

Nick Oostveen


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




Re: [PHP] Development Tools

2002-07-10 Thread Nick Oostveen

A good, well designed, development tool can provide a huge productivity 
boost over an editor if it's used properly.  And I don't mean 
auto-generated code by this either.

Right off the bat, any good development tool will have code completion 
abilities, which are basically the programmers version of nix consoles tab 
completion.  This little feature alone helps save time by reducing the 
amount of typing required, not to mention can virtually eliminate type-o's 
in function or variable names.

Another basic feature any good IDE will have is a built in library of all 
php functions so that you can view the function along with all its 
arguments while your typing.  Need to use a rare function and can't 
remember the order of the arguments it requires? Having this feature 
eliminates the need for you to go look up the function to check this 
trivial item.  Additionally a good IDE will automatically read in the 
definitions for functions and classes you have defined in the current 
project and automatically add them to the above mentioned items.

These first two things are immediately obvious to even first time users and 
will speed things up, but the real benefits come from other items such as a 
integrated debugging tools, performance analyzers, a good class browser, 
and built in database connectivity.  If you're working in a team 
environment having an IDE which has built-in support for a content 
verification system can also be a huge advantage.  Again, these features 
will only benefit someone who knows how to use them.

Unfortunately I have yet to find a truly good PHP IDE.  The two best I've 
found to date are NuSphere's PHPEd 3.0.0 (which unfortunately has dozens of 
minor, but annoying bugs) and the Zend IDE (which is very nice, but it 
crawls on anything but the fastest systems).  If either of these fix the 
for-mentioned issues I'd be the first in line to purchase them.

At 06:07 PM 7/10/2002 +0200, Uwe Birkenhain wrote:
I think that - on windows - nothing is better than textpad
(www.textpad.com).
Simply the best editor the world has seen so far!

What makes development tools better than a good editor? (serious question)

Uwe



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

2002-07-10 Thread Nick Oostveen

While I can't speak for others, in our office we use template files which 
contain all HTML and then parse content generated from php scripts into 
them about 90% of the time.  Not only does separating your code from your 
HTML make it easier to change the look of a site, but it also makes the 
code much easier to maintain.  If you're interested I would recommend 
checking out the FastTemplate class for an example of how this works.

At 02:42 PM 7/10/2002 -0700, you wrote:
I'm definitely curious and want to check out the debugging tools,
performance analyzer, and database connectivity tools provided by PHPEd.

I get the impression most developers do not integrate coding and content.
Is this correct?

-Ed


-Original Message-
These first two things are immediately obvious to even first time users and
will speed things up, but the real benefits come from other items such as a
integrated debugging tools, performance analyzers, a good class browser,
and built in database connectivity.  If you're working in a team
environment having an IDE which has built-in support for a content
verification system can also be a huge advantage.  Again, these features
will only benefit someone who knows how to use them.

Unfortunately I have yet to find a truly good PHP IDE.  The two best I've
found to date are NuSphere's PHPEd 3.0.0 (which unfortunately has dozens of
minor, but annoying bugs) and the Zend IDE (which is very nice, but it
crawls on anything but the fastest systems).  If either of these fix the
for-mentioned issues I'd be the first in line to purchase them.


This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.

--
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] File Uploading Question

2002-07-10 Thread Nick Oostveen

I've got a (hopefully) simple question which is indirectly related to php.

I'm currently developing an application which includes functionality to 
allow users to upload image files.  Does anyone here know of a way to 
customize the look of the HTML file input type? By this I mean changing 
the browse button to a graphic, hiding the text field, etc.

Any help with this would be greatly appreciated.



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




Re: [PHP] PHP code optimization

2002-07-09 Thread Nick Oostveen

I could be wrong, but I seem to remember reading somewhere that using ? 
text ? is actually just shorthand for echo  text ; as far as the php 
engine itself is concerned.

Again I'm not positive, but if this is the case it would coincide with the 
comment made earlier that they are in fact the same speed, but that 
outputting a large amount of text through a single ? ? would be slightly 
faster than using numerous echo commands.

At 06:39 PM 7/9/2002 -0500, Chris Shiflett wrote:
Peter Thoenen wrote:

Question on optimizing code for quicker runtimes. Which is quicker (this 
is on a webpage also..NOT
commandline)?

?php if ($a){ echo 'abc'; } ?

OR

?php if ($a) { ? abc ?php } ?

Because the difference is going to be undetectable, this would probably be 
a question that only someone really familiar with the engine would be able 
to answer with any sort of assurance.

My bet is that the second method is faster in theory, because switching 
in/out of PHP is likely marginally faster than executing the echo 
function. Maybe if you create some scripts that loop through these 
statements 10,000 times each and measure the time with microtime(), you 
can get a more affirmative answer and let the list know your results.

Happy hacking.

Chris


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