Re: [PHP] looking for a solid/good basic registration/login app/script

2004-08-07 Thread Robby Russell
On Sat, 2004-08-07 at 10:43, bruce wrote:
> hi...
> 
> i'm looking for a good/solid login/registration script that's in the open
> source domain.
> 
> it can have it's own db/table structure. i can always rearchitect...
> 
> i'd like it to have an admin function, and the ability to verify users via
> email, etc...
> 
> anybody have a favorite/good app that they've used/implemented.
> 
> i've look through lots of scripts, and decided to check here for additional
> input.
> 
> thanks
> 
> -bruce

There is Pear::Auth. I've had good experiences working with it.

http://pear.php.net/package/Auth

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] Holding links in a database

2004-08-07 Thread Robby Russell
On Sat, 2004-08-07 at 08:19, Shaun wrote:
> Hi,
> 
> I have a table in my database that holds links for individual pages on my
> site:
> 
> mysql> DESCRIBE Page_Links;
> +---+--+--+-+-++
> | Field | Type | Null | Key | Default | Extra  |
> +---+--+--+-+-++
> | Link_ID   | int(11)  |  | PRI | NULL| auto_increment |
> | PHP_SELF  | varchar(100) |  | | ||
> | Action| varchar(100) |  | | ||
> | Link  | varchar(255) |  | | ||
> | Link_Text | varchar(100) |  | | ||
> +---+--+--+-+-++
> 5 rows in set (0.00 sec)
> 
> The links that appear on each page depend on PHP_SELF i.e./users/index.php
> and $_GET[action] variable i.e. add_user.
> 
> This all works well until there is a problem with the form validation, for
> example if I am on the add_user.php page and I click to add a user I am
> taken back to the users list, the action is insert_user and I display the
> links accordingly. However if there is a problem with the submission i.e.
> the user leaves a field blank then they are redirected to the add_user.php
> page, the action is still insert_user but I would not want the same links to
> appear on this page.
> 
> Any help on this matter would be greatly appreciated

The method in which you described your issue is rather confusing. Can
you provide some example code and perhaps explain it a bit clearer? 

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] Local version works - production breaks

2004-08-07 Thread Robby Russell
On Sat, 2004-08-07 at 17:55, Andre Dubuc wrote:
> Hi,
> 
> I have re-written a very basic website to use sessions (switching to https)  
> for login to special areas of a site. After testing the site thoroughly 
> locally, I uploaded the whole shebang to a unix server that runs Apache 1.3.x 
> + PHP 4.3.4 + mysql. 
> 
> Almost all code broke - sessions would load, but almost every page was so 
> messed up that -- well, I'm flabbergasted!
> 
> I'm wondering, after reading a few threads on my local config whether the 
> problem might lie with the Apache2 server I use locally (Mandrake special 
> with Extranet). I also use an older version of PHP 4.3.1.
> 
> I've examined both configs for differences, but can see nothing that would 
> account for such an extremely messed up site. It loads locally beautifully 
> (and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads with 
> errors to mysql db in all others but Konqueror which does not even display 
> the opening page (yet I can view source).
> 
> Maybe this isn't the forum to ask -- but seeing that all db access is through 
> PHP -- I wonder whether anyone can point where i can start looking for the 
> culprit(s).
> 
> Any ideas, suggestions, or advice will be greatly appreciated.
> 
> Tia,
> Andre

It's very doubtful that it's from Apache 2. 

Somethings that you might want to consider. 

Do you have all the libraries that you are using on your local
development machine on the production machine? Are your includes paths
pointed to the proper directories? Did you use http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Local version works - production breaks

2004-08-07 Thread Robby Russell
On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
> It could be that you have local error reporting set to none.  It could also
> be that you're using full paths when referencing files which then breaks
> when moving files to a new server.  Basically, there's a lot of
> possibilities and I'm not going to have much luck helping unless you include
> error messages.  My guess is that resolving a few errors will address a core
> problem and everything will start working.
> 
> -Ed

Yes, it's very possible that he isn't getting errors locally because his
errors aren't on. 

Andre,

You might check your error settings on your local server. You might even
consider upgrading php on your local server to the same version and
debugging. 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



[PHP] annoying autoreplies

2004-08-07 Thread Robby Russell
To all those who have auto-replys set for their email, please turn them
off. ;-)

We shouldn't have to opt-in to 3 different peoples spam email sites so
that we can post to the list. heh.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] no select()-function?

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 07:35, Marten Lehmann wrote:
> Hello,
> 
> I'm missing the select-function in PHP. It's a low-level function call 
> to the same-called C-function and also available in Perl. I need this 
> for nonblocking socket calls. Which function within PHP do I have to use 
> instead?
> 
> Regards
> Marten Lehmann

Try this?

http://us4.php.net/manual/en/function.socket-select.php

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] Working with a new design client

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 07:58, charles kline wrote:
> Hi all,
> 
> I have a new client (a design company). They have never developed a 
> dynamic website at all and do all their HTML editing using Dreamweaver.
> 

Are opposed to using something different for their general HTML editing?

You might be able to convinced them that if they used something like
http://kupu.oscom.org/ that they could be anywhere and modify their
site...then you just store the data in a db..and if you use something
like Smarty, their site will be pretty flexible.

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] MAIL function sends as anonymouse@mydomain.com instead of what I specify in php.ini?

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 08:56, BOOT wrote:
> I am sure that this is a problem with my MTA configuration not PHP itself,
> but any help would be appreciated.
> 
> PHP is set to use sendmail (although I understand that my server may be
> using qmail and not really sendmail?)
> 
> It seems that whatever SMPT settings I place in php.ini ignores. (SMTP
> servername, FROM) and all e-mail is sent from [EMAIL PROTECTED]
> 
> Thanks for any help!

What does your mail() command look like?

-Robby
-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



RE: [PHP] Working with a new design client

2004-08-09 Thread Robby Russell
heh, think you missed the point. It's not for designing the site, it's
for your clients who don't know HTML markup and can edit their pages. 

-Robby


On Mon, 2004-08-09 at 13:16, Scott Hyndman wrote:
> I would kill myself if I ever had to use a web-based app to design a
> site. Gross!
> 
> (sorry I sent it to just you, I still haven't got used to this thing)
> 
> -----Original Message-
> From: Robby Russell [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 09, 2004 11:15 AM
> To: charles kline
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Working with a new design client
> 
> On Mon, 2004-08-09 at 07:58, charles kline wrote:
> > Hi all,
> > 
> > I have a new client (a design company). They have never developed a 
> > dynamic website at all and do all their HTML editing using
> Dreamweaver.
> > 
> 
> Are opposed to using something different for their general HTML editing?
> 
> You might be able to convinced them that if they used something like
> http://kupu.oscom.org/ that they could be anywhere and modify their
> site...then you just store the data in a db..and if you use something
> like Smarty, their site will be pretty flexible.
> 
> -Robby
> 
> 
> -- 
> /***
> * Robby Russell | Owner.Developer.Geek
> * PLANET ARGON  | www.planetargon.com
> * Portland, OR  | [EMAIL PROTECTED]
> * 503.351.4730  | blog.planetargon.com
> * PHP/PostgreSQL Hosting & Development
> /
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] PHP/MySQL based webmail?

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 14:28, Alex Shi wrote:
> Hi All,
> 
> Can any one recommend a strong/stable PHP/MySQL based web 
> mail system? It must support large mail transfer, some times may be 
> more than 10 MB for a single message.
> 
> Alex

The message size limit is controlled by your mailer. (postfix, sendmail,
qmail, etc).

Squirrelmail is a nice php-based interface.

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] PHP5 - OOP Question

2004-08-09 Thread Robby Russell
On Mon, 2004-08-09 at 19:29, Hardik Doshi wrote:
> Hello Group,
> 
> I would like to know which one is the most appropriate
> way to implement the following scenario.
> 
> For example, I want to display a products catalogue of
> 100 products. I do have a base class of product which
> contains all the basic property of the product
> (Product title, product description, product price
> etc)and constructor basically pulls the information
> about the product from the DB based on the product
> identifier (Primary key). 
> 
> Now i have two ways to display catalogue.
> 
> 1. I can write only one query to pull all 100 products
> information and store product information to each
> product object (With out passing product id to the
> constructor) into the collection and later i iterate
> that collection to display product catalogue.
> (Advantage: less communication with database server
> and disadvantage: memory consumption is higher)
> 

You can do both. You can create an object for products and have it
designed to give you details for a specific product, and then you can
have a function that will return products based on a filter...
(sometimes your users want to search for products)..so the same query
can be used but append a filter to it.


> 2. I can initiate an individual product object by
> passing product id into the constructor and
> constructor will pull an individual product
> information from the DB and at the same time i can
> display it (Disadvantage: Lots of communication with
> database server and Advantage: memory consumption is
> less) If you think about inheritance then eventually
> this approach will have lots of database calls.
> 
> Please guide me as i am stuck up which way to go.
> 
> Let me know if you need more information.
> 
> Thanks,
> Hardik
> 
> 
>   
> __
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] SQL Functions

2004-08-10 Thread Robby Russell
On Tue, 2004-08-10 at 08:33, John Nichel wrote:
> John W. Holmes wrote:
> >
> > Change that to:
> > 
> > $array = array();
> > $results  = mysql_query( $sql, DB::connect() );
> > while($data = mysql_fetch_array($result))
> > { $array[] = $data; }
> > 
> > return $array;
> 
> Would there be any speed/performance issuse with using something like...
> 
> array_push ( $array, $data );
> 
> vs.
> 
> $array[] = $data;


Run some tests and let us know. ;-)
I'd be interested in knowing as well.


-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] hosting provider won't enable ftp_connect()

2004-08-10 Thread Robby Russell
http://www.planetargon.com/hosting/

;-)

On Tue, 2004-08-10 at 07:41, Brian Anderson wrote:
> I am trying to get a hosting provider(Godaddy.com) to enable the ftp_connect
> extensions to php. They tell me that they cannot do so for security reasons.
> Is this really such a security issue?
> 
> At php.net I read the advice:
> 
> "for ftp to work you must do ./configure --enable-ftp in php4"
> 
> ...and from phpcollab.com:
> 
> "You should ask your hosting provider to install those for you, probably
> they will do without much problem. Or, if they don't want to, you should
> consider choosing another provider."
> 
> If it is an issue, does anyone know of a hosting provider that allows these
> extensions?
> 
> -Brian Anderson
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] Global persistent variables

2004-08-10 Thread Robby Russell
On Tue, 2004-08-10 at 08:36, Jean-Yves Jourdain wrote:
> Hi,
> 
> Is there a way to have global persistent variable with PHP? I would like 
> to reproduce the use of the ASP  
> possibility. The variable "name" will be available to every users...
> 
> Thank-you in advance,
> 
> Kind regards.
> 
> Jean-Yves

This is where you would probably want to put that value in the database
somewhere. 

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/

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



Re: [PHP] MySQL & PHP Examples & Training Providers Required

2004-08-10 Thread Robby Russell
Not to start a SQL war, but have you consider PostgreSQL as well in your
decisions?

PostgreSQL has more features that are more comparable to MSSQL and
Oracle. Just making sure you make the right decision. ;-)

-Robby


On Tue, 2004-08-10 at 16:06, Harlequin wrote:
> Hi all.
> 
> This might sound like a strange request but here goes.
> 
> I'm looking for some examples of sites that are purely MySQL and PHP running
> on Unix and that contain a few thousand records preferably held in
> relational databases.
> 
> Rationale:
> 
> I need to justify PHP as a tool of choice over say vb.net or Oracle. My
> recommendation, despite my limited knowledge of MySQL and PHP is that even
> if we have 10-15 databases holding upwards of 10,000 records each PHP and
> MySQL are the tools of choice and I doubt that there are any functions
> missing that you'd find in VB.Net. I could be wrong and if so, please let me
> know.
> 
> My other question is that I am looking for training in the UK, preferably in
> the North. I have no idea about accreditation or certification requirements
> and wondered if anyone could provide any recommendations...?
> 
> Thanks for your time guys.
> 
> -- 
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Variable just not Behaving Itself.

2004-08-10 Thread Robby Russell
On Tue, 2004-08-10 at 16:36, Harlequin wrote:
> I have the following:
> 
> [SNIP]
> ...
> $Emp_Status_Rqmt=$row["Emp_Status_Rqmt"];
>}
>if( $Emp_Status_Rqmt == 'Permanent' )
>{
>$UserStatus = 'Permanent';
>}
>if( $Emp_Status_Rqmt == 'Contractor' )
>{
>$UserStatus = 'Contractor';
>}
>else
>{
>$UserStatus == 'Flexible';
>}
> [SNIP]
> 
> which echoes OK until I change the value to something other than Permanent
> or Contractor. It simple echoes resource ID #n
> 
> what's wrong with me...? the code I mean...?

You can build a bunch of if statements or your switch()...and I'm not
sure why you would keep creating variables with the same value. ;-)

Example:

$Emp_Status_Rqmt = $row["Emp_Status_Rqmt"];

switch ($Emp_Status_Rqmt) {
case "Permanent":
$UserStatus = "Permanent";
break;
case "Contractor":
$UserStatus = "Contractor";
break;
default:
   $UserStatus = "Flexible";
}

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Variable just not Behaving Itself.

2004-08-10 Thread Robby Russell
On Tue, 2004-08-10 at 17:41, Jordi Canals wrote:
> Harlequin wrote:
> 
> > I have the following:
> > 
> > [SNIP]
> > ...
> > $Emp_Status_Rqmt=$row["Emp_Status_Rqmt"];
> >}
> >if( $Emp_Status_Rqmt == 'Permanent' )
> >{
> >$UserStatus = 'Permanent';
> >}
> >if( $Emp_Status_Rqmt == 'Contractor' )
> >{
> >$UserStatus = 'Contractor';
> >}
> >else
> >{
> >$UserStatus == 'Flexible';
> 
> $UserStatus = 'Flexible';
> 
> >}
> > [SNIP]
> > 
> > which echoes OK until I change the value to something other than Permanent
> > or Contractor. It simple echoes resource ID #n
> > 
> > what's wrong with me...? the code I mean...?
> > 
> 
> More easy:
> 
> $Emp_Status_Rqmt=$row["Emp_Status_Rqmt"];
> $UserStatus = $Emp_Status_Rqmt;
> 
> Regards,
> Jordi.

more more easy. ;-)

$UserStatus = $row["Emp_Status_Rqmt"];

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] PHP/MySQL based webmail?

2004-08-11 Thread Robby Russell
On Wed, 2004-08-11 at 10:38, Justin Patrin wrote:
> On Wed, 11 Aug 2004 10:15:00 -0700 (PDT), Matthew Sims
> <[EMAIL PROTECTED]> wrote:
> [snip]
> > >
> > > Yes.  But both Squirrel and Horde must speak IMAP to the mail server,
> > > whether on localhost or remote.  IMAP's nontrivial and introduces more
> > > load on the web app server than -- say -- a POP-based mail GUI. Or
> > > static web pages.
> > 
> > There's a difference between what POP and IMAP does. Basically, do you
> > want your users to view mail from one computer only (laptops, desktops)
> > with no worries about disk space or from any computer (terminals all
> > around the area) with email stored on the mail server.
> > 
> > http://www.cit.cornell.edu/computer/email/imap-pop.html
> > 
> [snip]
> 
> Quick comment. POP does not *have* to download the messages locally
> *only*. It can also leave the messages on the server, behaving much
> like IMAP. Of course, POP by default will not leave the message on the
> server and it much more lightweight (less features) than IMAP. It all
> depends on what you and your app need.
> 

POP does not have folders. So, aside from that it stores messages on a
server it is nothing like IMAP. 

With IMAP, you can use any IMAP client and see your folder/message
structure the same way, where as with POP, you get an INBOX and cannot
store your SENT, etc messages on the server unless you CC/BCC yourself.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] php+iptables

2004-08-12 Thread Robby Russell
On Thu, 2004-08-12 at 01:31, Joel n.solanki wrote:
> Dear all Gurus,
> 
> I have read little manul from www.php.net
> I want to create web based firewall with php+iptables . Can any one give
> me some documentation or guides or Examples ??I am using redhat linux
> ..all things are installed.
> I have little understood that i need to use shell_exec and exec to run
> linux command. I am very newbie to php even dont know html so i m having
> tough days with php.
> if any one could help me out.
> any docs.

Unlike the other responses, I'll give you a different approach.

Are you attempting to build a web based 'interface' to iptables? So you
can add/edit/drop rules for iptables?

If I were to build such an app, this is how I would build it.

I would build 3 layers to this app.

- a database (postgresql or mysql)
  - store all your rules, comments, timestamps, etc

- web based interface
  - an interface that allows you to add, edit, modify the data in the
database
  - give this interface only the necessary ability to do this, nothing
more so that your firewall configuration remains fairly secure.

- cron script
  - a script on the server (written in php, perl, python, whatever) 
  - performs a lookup in the database and checks for any new changes
since its last run
  - gets the changes and builds the necessary iptables configuration
script and writes to a file on the server.
  - add a row that records when you did this so that next time you know
when to look for new records from.

You *could* use exec here to run iptables or you could have another cron
script that is just a bash script that runs the iptables config file
that you write with the cron script.

This is how *I* would approach this. This allows for flexibility of each
piece of the code. For example, one day you might want to pick up python
and build a cross platform GUI application that will allow you to manage
the rules like you did in the web interface. If this might even be the
case then you might want to consider PostgreSQL and building your
database structure and building server side functions (plperl, plPHP,
etc) that allow you to perform simple queries to add/edit/modify data.

example: SELECT blockIP('192.168.1.100');

...is a little cleaner than:
  INSERT INTO tablename (ip_address, block) VALUES ('192.168.1.100', t);

This way all your system logic is stored in your database schema and not
in your code. Then a new interface is a breeze to develop and deply.

Once again, this is just one approach and might seem like more work but
after doing this kind of thing for the last several years I'm growing
weary of typing the same logic over and over to new interfaces. heh. 


Happy coding!

your local PostgreSQL advocate,

Robby Russell


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Page Referer question

2004-08-12 Thread Robby Russell
On Thu, 2004-08-12 at 13:34, Jed R. Brubaker wrote:
> Hello all. I am looking to create script will detect the page from which the
> user just came so that after they do something on the current page (login)
> it will send them back to the page they wanted. I was thinking about
> $_SERVER['HTTP_REFERER'], but php.net says:
> 
> 'HTTP_REFERER'
> 
> The address of the page (if any) which referred the user agent to the
> current page. This is set by the user agent. Not all user agents will set
> this, and some provide the ability to modify HTTP_REFERER as a feature. In
> short, it cannot really be trusted.
> 
> Is this a big problem? Is there another technique I could use?
> 
> Thank you all!

If a user takes the time to modify this, should it be a concern? If I
don't want you to know where I came from and made sure you didn't know,
what else can you possibly do aside from snoop? ;-)

I'd bet that 99.99% of the people who surf the net do not modify this so
the exception is very minimal.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Page Referer question

2004-08-12 Thread Robby Russell
On Thu, 2004-08-12 at 13:55, Justin Patrin wrote:
> On Thu, 12 Aug 2004 13:43:04 -0700, Robby Russell <[EMAIL PROTECTED]> wrote:
> > On Thu, 2004-08-12 at 13:34, Jed R. Brubaker wrote:
> > > Hello all. I am looking to create script will detect the page from which the
> > > user just came so that after they do something on the current page (login)
> > > it will send them back to the page they wanted. I was thinking about
> > > $_SERVER['HTTP_REFERER'], but php.net says:
> > >
> > > 'HTTP_REFERER'
> > >
> > > The address of the page (if any) which referred the user agent to the
> > > current page. This is set by the user agent. Not all user agents will set
> > > this, and some provide the ability to modify HTTP_REFERER as a feature. In
> > > short, it cannot really be trusted.
> > >
> > > Is this a big problem? Is there another technique I could use?
> > >
> > > Thank you all!
> > 
> > If a user takes the time to modify this, should it be a concern? If I
> > don't want you to know where I came from and made sure you didn't know,
> > what else can you possibly do aside from snoop? ;-)
> > 
> > I'd bet that 99.99% of the people who surf the net do not modify this so
> > the exception is very minimal.
> > 
> 
> Except for those with a firewall that blocks this
> 

Ok, so maybe 97.99% ;-p


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] PHP templates

2004-08-14 Thread Robby Russell
On Sat, 2004-08-14 at 14:02, Octavian Rasnita wrote:
> Hi all,
> 
> I have seen that there are many templating systems for PHP. Which is the
> most used and the best you have found?
> Can you recommend me a free and good templating system?
> 

I use Smarty on a very frequent basis. It's very flexible and very easy
to add your own function within it. One of my favorite PHP based
projects..it has definitely saved me a lot of coding time and as a
result my clients a whole lot of money.

http://smarty.php.net/

-Robby


-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


[PHP] forum suggestions

2004-08-14 Thread Robby Russell
I have an existing web application with a fairly large user base, so it
has it's own user authentication already. I am looking for a message
board/forum that I can tie into the system and not need to do too much
hacking to get it to authenticate against my existing system. Something
with threaded comments and such, nothing super complicated like phpbb,
but with some of the functionality.

Any suggestions?

Thanks,

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Upload problems

2004-08-15 Thread Robby Russell
On Sun, 2004-08-15 at 13:01, Kim Steinhaug wrote:
> Just a quick question,
> 
> Did you alter the upload_max_filesize to 500MB
> and the post_max_size to say 510MB and you succesfully
> upload 500MB files from one machine to the server?
> 
> I never testes with filesizes that large, but It would be nice to
> hear if it accually works without tweaking to much.
> 
> I would also think that the general 30sec timout would need to
> be altered as moving a 500MB file from /var/ to the users homedirectory
> and then do some filechecking on it and such would easilly need
> some extra seconds. Not to think of the overhead if many people
> upload large files at a time.
> 
> Ok, its a vague post this, just looking for some input here, :D
> 
> Its like the needle and the haystack, dont know what im exatcly looking
> for here, but you never know. I work with large files myself on some
> systems, and its always nice to get feedback whatever it is from other
> people working with the same stuff.
> 
> -- 
> Kim Steinhaug
> -
> There are 10 types of people when it comes to binary numbers:
> those who understand them, and those who don't.
> -
> www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
> -

500 mb upload? Make sure you have enough tmp space available for that.
When you get that big you might want to consider a different form of
uploading... ala sftp/ftp.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] [OFF] - Fraudulent web orders - any ideas?

2004-08-16 Thread Robby Russell
On Mon, 2004-08-16 at 07:26, Brian Dunning wrote:
> Hi all,
> 
> I have a simple PHP store, and it appears that someone is using it to 
> test credit card numbers. I'm getting a very high number of small 
> orders every day, but a lot more declines. My merchant provider 
> suggests blocking that person's IP address, but that's not practical 
> since it's dynamic. I'll get a lot of orders from one IP address for a 
> few hours, but then the address changes.
> 
> I wonder if anyone has any experience with this, and if so, can you 
> suggest a way to deal with it?
> 
> - Brian

Well, if they are trying multiple times you could add some logic in your
code that redirects them to a "We have been monitoring you" type of
message. ;-)

Are you tracking the IP addresses in the database? Might consider
building something that checks each new IP and see if the same IP has
tried this a few times..and if so display a warning page. Might be
enough to scare the person off. The other options is to collect a list
of known IPs and contact the proper authorities with logs of this issue.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] SSH Authentication using php

2004-08-16 Thread Robby Russell
On Mon, 2004-08-16 at 08:39, Teren wrote:
> Hi, what my goal is is to be able to authenticate a user by they SSH acount on the 
> system using php. I tried looking on google, but didn't see anything with ssh. What 
> i've tried to do is use the exec() and just do:
> 
> exec("ssh [EMAIL PROTECTED]".escapleshellard("password"));
> 

You can try setting up authorized_keys for this. Then you don't need to
pass it the password.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] SSH Authentication using php

2004-08-16 Thread Robby Russell
On Mon, 2004-08-16 at 10:15, Michal Migurski wrote:
> > > Hi, what my goal is is to be able to authenticate a user by they SSH
> > > acount on the system using php. I tried looking on google, but didn't
> > > see anything with ssh. What i've tried to do is use the exec() and
> > > just do:
> > >
> > > exec("ssh [EMAIL PROTECTED]".escapleshellard("password"));
> > >
> >
> > You can try setting up authorized_keys for this. Then you don't need to
> > pass it the password.
> 
> ...but you'd still need to provide the ssh passphrase, or have an instance
> of ssh-agent running. Teren, what are you trying to do exactly? Is ssh
> actually necessary, or are you really just trying to authenticate users by
> their unix accounts?

You can go without using the passphrase as well.



-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] SSH Authentication using php

2004-08-16 Thread Robby Russell
Ah, you should try to authenticate differently then. You're going about
this the wrong wa. :-)

> The PEAR::Auth package provides methods for creating an authentication
> system using PHP.
> 
> Currently it supports the following storage containers to read/write
> the login data:
> 
> * All databases supported by the PEAR database layer
> * All databases supported by the MDB database layer
> * All databases supported by the MDB2 database layer
> * Plaintext files
> * LDAP servers
> * POP3 servers
> * IMAP servers
> * vpopmail accounts
> * RADIUS
> * SAMBA password files
> * SOAP
> 

hth,

Robby


On Mon, 2004-08-16 at 10:33, Teren wrote:
> Ok, here's the whole project, I have an openbsd box using authpf which uses
> authentication via ssh login. So, i'm trying to create a weblogin using php
> so people just have to enter their username/password (which would be a
> restricted unix account) to gain access to the internet. I have authpf all
> setup, but I'd like to add a web login to make it more user friendly. Thanks
> 
> Teren
> 
> 
> - Original Message - 
> From: "Michal Migurski" <[EMAIL PROTECTED]>
> To: "Robby Russell" <[EMAIL PROTECTED]>
> Cc: "Teren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, August 16, 2004 1:15 PM
> Subject: Re: [PHP] SSH Authentication using php
> 
> 
> > > > Hi, what my goal is is to be able to authenticate a user by they SSH
> > > > acount on the system using php. I tried looking on google, but didn't
> > > > see anything with ssh. What i've tried to do is use the exec() and
> > > > just do:
> > > >
> > > > exec("ssh [EMAIL PROTECTED]".escapleshellard("password"));
> > > >
> > >
> > > You can try setting up authorized_keys for this. Then you don't need to
> > > pass it the password.
> >
> > ...but you'd still need to provide the ssh passphrase, or have an instance
> > of ssh-agent running. Teren, what are you trying to do exactly? Is ssh
> > actually necessary, or are you really just trying to authenticate users by
> > their unix accounts?
> >
> > -
> > michal migurski- contact info and pgp key:
> > sf/cahttp://mike.teczno.com/contact.html
> >
> >
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] tpl editor

2004-08-18 Thread Robby Russell
On Wed, 2004-08-18 at 08:26, Naty wrote:
> Hello!
> I'm using eclipse and phpeclipse to manage my php project, but still I have
> problems trying to edit for example tpl files. Threre is some possible way
> to see this files in a graphic way with eclipse, like for example macromedia
> dreamweaver ?
> Regards
> 
> Natalia

I haven't used eclipse myself, but I don't believe that it is a WYSIWYG
editor..which Dreamweaver is. I am under the impression that all you can
do with eclipse is edit the php files in the standard code view. 

-Robby

-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] WAS: PHP HTML text editor issues... NOW:{Magic Quotes}

2004-08-18 Thread Robby Russell
On Wed, 2004-08-18 at 10:16, Kevin Rosenthal wrote:
> HI Jason, 
> 
> OK, I am real new to all this so please bare with me. Can you explain what
> the Magic Quotes do? 
> 
> Thanks,
> Kevin

http://us4.php.net/manual/en/function.get-magic-quotes-gpc.php

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Get Value

2004-08-25 Thread Robby Russell
On Wed, 2004-08-25 at 21:11, Syed Ghouse wrote:
> Hi All
> 
> Will anybody tell me how to extract the value (say Google)
>  from the code below:
> 
> Google(value to extract)
> 
> Thanks and Regards
> 
> Syed

You can use regular expressions for this.

$in = 'meep';

preg_match("|>(.*)|", $in, $out);

$foo = $out[1];

print $foo;

...prints: meep

This is just a quick and dirty example of how this can be done.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] trying to do too much with functions?

2004-09-02 Thread Robby Russell
On Thu, 2004-09-02 at 07:11, Justin French wrote:
> I have a few functions with way too many parameters in them, or 
> functions which have a non-obvious order of parameters which I 
> constantly have to refer to as I'm working.  Since I'm using PHP as my 
> templating language (none smarty here!) as well as the programming 
> language.  So I've been looking for some alternatives...
> 
> My main objectives:
> 
>1.  have all parameters optional
>2.  have a mixed order for the paramaters
> 
> Other languages seem to do this well (Ruby, or perhaps RubyOnRails 
> seems good at it), but in PHP I can only see a few options... I'm 
> hoping someone might offer a few more ideas.
> 
> '123','b'=>'456'); echo doStuff($params); ?>
> '123','b'=>'456'))?>
> 
> 
> 
> 
> So, is that it?  Have I thought of all possible options?
> 
> 

/**
* pass an array..so as long as you pass one thing...
*/
function doStuff($args) 
{
  // do something 
  print_r($args);
}

/**
* this arg is optional as it has a default value
*/
function doSomething($x=0)
{
  return $x;
}


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Capturing an Image of a web page

2004-09-14 Thread Robby Russell
On Tue, 2004-09-14 at 17:45, Vail, Warren wrote:
> Has anyone run across a tool available to PHP that can render an image of a
> entire webpage from a URL, so that it can be reduced to a thumbnail and
> stored in a database?
>  
> Warren Vail
>  

This would require that PHP act as a web browser..which it doesn't do.
I've seen things like this before..but I believe they are using real
browsers to do this.. perhaps looking into building a way to connect to
the mozilla api or something... don't think PHP is going to be much help
with you for this one.

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] PHP and extern link

2004-09-19 Thread Robby Russell
On Sun, 2004-09-19 at 02:29, Martin Justra wrote:
> Hi,
> > Did you want to
> >
> > a) redirect the user to https://www.domain.com/...
> >
> > or
> >
> > b) display the contents of https://www.domain.com/...?
> >
> I want to redirect the user. But as soon as I try with fopen (https://) 
> I get the following error:
> 
>  Warning: 
> fopen(https://tto.deutschepost.de/nexttonline/jsp/direct_access.do?v_benutzer=xxx&v_passwort=xxx&v_ic=xxx&v_spr=deu):
>  
> failed to open stream: No such file or directory in 
> /var/www/catalog/blubb.php on line 2
> 
> It seems that fopen is not able to open it, because it is not redirected to 
> a file...
> 
> Any solutions ?
> 
> Martin 

try
http://domain.com/";);
?>

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Best way to save preferences?

2004-09-26 Thread Robby Russell
On Sun, 2004-09-26 at 10:00, Victor SpÃng Arthursson wrote:
> Which is the best way to save preferences (for a site) to make them 
> easily accessable for changes?
> 
> What I want is a way to save arrays and read them in again without 
> having to use a databaseâ
> 
> Thankful for suggests,
> 
> sincerely
> 
> Victor

http://www.sqlite.org/ perhaps?


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Sessions and Mozilla (Firefox)

2004-10-12 Thread Robby Russell
On Wed, 2004-10-13 at 01:26 +, Matthew Weier O'Phinney wrote:
> * Pablo Gosse <[EMAIL PROTECTED]>:
> > I just noticed that if I open up a Mozilla window, log into my CMS, then
> > open another Mozilla window (not by ctrl-n, but by selecting it from my
> > programs menu) and bring up the login page in that new window, then it
> > detects the session from the other window and redirects right to the CMS
> > control panel.
> >
> > In IE, this will happen if I ctrl-n a new window, but not if I start a
> > new instance of the browser from the program list.
> >
> > Is the correct behavior for sessions in Mozilla?
> >
> > I've searched the lists but I couldn't find anything which seemed to
> > answer this.
> 
> My understanding is that if you have a session of Mozilla open, if you
> run the executable again, it searches for a running session and, if one
> is found, uses it to spawn a new window without actually running another
> copy.
> 

The way around this is to use profiles in mozilla.


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


[PHP] php4 objects

2004-10-12 Thread Robby Russell
A friend of mine asked me if I knew if this was possible in PHP4.


class foo
{
var $bar = NULL;

function foo()
{
$this->bar = new bar();
}

function getBar()
{
return $this->bar;
}

}


class bar
{
var $thing = NULL;

function bar()
{
$this->thing = "Hello World!";
}

function getThing()
{
return $this->thing;
}

}


he wants to do something like this:

$obj =& new foo;

print $foo->getBar()->getThing();

is this possible in PHP4?

I know that he can do a:

print $obj->bar->getThing();

..but he wants it to run some stuff in the functions that he is calling
and wants to do it in one command if possible.

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] time

2004-10-13 Thread Robby Russell
On Wed, 2004-10-13 at 10:31 -0400, Jerry Swanson wrote:
> I want to send email every 24. What time format you recomend to use? 
> In what format the data should be store in mysql?
> 
> TH
> 

every 24? hours? minutes?

Are you going to be running a script all the time to do this?
You might want to consider using CRONTAB (if in the *nix
environment)...which would call a script to send your email.

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] deleting multiple items from a database

2004-10-13 Thread Robby Russell
On Wed, 2004-10-13 at 16:11 -0400, Adil wrote:
> function deleteFiles() {
> foreach($_POST['stack'] as $i) {//This should work but I
> can't
> tell if it is or isn't
>  mysql_query("DELETE FROM uploads WHERE upload_id =" . "$i");
> }
>header("Location: http://"; . $_SERVER['PHP_SELF']);//forces
> a
> page refresh to show the file list without the items that were
> deleted.
> }

For sanity of your mysql database, you might consider making this one
query.

Something like
DELETE FROM table WHERE id IN (32,34,46,432,35);

generating your list of numbers/ids from your array...

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] looking for a few php partners/developers....

2004-10-14 Thread Robby Russell
On Thu, 2004-10-14 at 05:55 -0700, bruce wrote:
> hi...
> 
> i'm curious.. if i'm putting together a project, and am looking for a few
> php developers as sweat equity partners, is this an appropriate place to
> post my request..???
> 
> thanks
> 
> -bruce
> [EMAIL PROTECTED]
> 

craigslist.org too.



-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] replacing characters in a string

2004-10-14 Thread Robby Russell
On Thu, 2004-10-14 at 21:04 -0500, Mark Hubert wrote:
> This should be simple but having never have done it before and at 
> deadline...help please.
> 
> Need to change:
> 
>   [EMAIL PROTECTED]
> 
> to;
> 
> user=domain

Did you try searching on the php site or google first?

http://www.google.com/search?q=php+replace+character+in+string

first result should find you your answer...and would take less time than
sending the email. ;-)

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] tool to check syntax

2004-10-08 Thread Robby Russell
On Fri, 2004-10-08 at 14:37 +0200, StÃphane THIBAUDEAU wrote:
> Hello,
> 
> I'm looking for a tool which checks php syntax the way CheckStyle does for
> Java for example.
> (http://checkstyle.sourceforge.net/)
> 
> I'd like such a tool to warn me when a PHPDoc comment doesn't document every
> parameters for a method, when there is no PHPDoc comment for a class or
> method, when a method contains too many lines and so on...
> 
> I couldn't find any tool like that on the internet. I hope it exists.
> 
> Thanks in advance,
> StÃphane
> 

What about phpxref?

http://phpxref.sourceforge.net/

I use it for documentation and forcing myself to stick to a standard.

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Quotes """ in form textarea fields

2004-10-08 Thread Robby Russell
On Fri, 2004-10-08 at 06:22 -0700, Sam Smith wrote:
> I swear I googled for an hour first.
> 
> 
> A user enters in a textarea field of FORM1.php:
> Bob is "high"
> 
> Submitted to FROM2.php we get:
> 
> Bob is \"high\"
> 
> In a hidden field in FROM2.php we store the value:  
> Then from FROM2.php we Submit BACK to FROM1.php and enter it back into the
> textarea field with:
>  
> and then back by putting this in FORM1.php:
> $APParea1 = $_POST['hidden'];
> $APParea1 = str_replace("[QT]","\"",$APParea1);
> 
> 
signature.asc
Description: This is a digitally signed message part


Re: [PHP] read aspx files

2004-10-08 Thread Robby Russell
On Fri, 2004-10-08 at 15:00 -0300, celso andrade wrote:
> hi all,
> 
> how do i setup a apache+php server to read aspx files
> as php files?
> 
> i need it to parse aspx files.
> 
> thank you

Do you mean run aspx files?
Or just read them? If so, you should just be able to read the contents
of yourfile.aspx on the local disk.

PHP doesn't run aspx files..

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Nested foreach ?

2004-10-17 Thread Robby Russell
On Sun, 2004-10-17 at 09:53 -0700, Stuart Felenstein wrote:
> I have 3 arrays.  3 for 3 fields in a table (all part
> of 1 record) 
> array1 - field1
> array2 - field2
> array3 - field3
> 
> What I've been doing which works good with one array: 
> if ( is_array( $_SESSION['foo'] ) ) {
>   foreach ( $_SESSION['foo'] as $x ) {
> sql .= "INSERT INTO TABLE (...
>  VALUES ($x)
> 
> Just can't seem to figure out how with three arrays.
> 
> help appreciated.
> 
> Stuart
> 

Can you provide a print_r() output of your $_SESSION['foo'] ?

I can help you more after that.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Nested foreach ?

2004-10-17 Thread Robby Russell
On Sun, 2004-10-17 at 12:40 -0700, Stuart Felenstein wrote:
> Robby
> 
> Here is the printout :
> Using-
> print_r ($skills);
> print_r ($skys);
> print_r ($slus);
> 
> 
> Array ( [0] => skillone [1] => skilltwo [2] =>
> skillthree [3] => [4] => ) Array ( [0] => 2 [1] => 3
> [2] => 4 [3] => [4] => ) Array ( [0] => [1] => [2] =>
> [3] => [4] => ) 1
> 
> FYI - The skills is a string, skys and slus ints. 
> Also I had only filled in 3 of the 5 for each.
> 
> Thank you 
> Stuart

Are these 3 arrays related somehow? are all the [0]'s related and all
the [1]'s related in each array?

If so, you might consider having an array of arrays

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Nested foreach ?

2004-10-17 Thread Robby Russell
On Sun, 2004-10-17 at 13:08 -0700, Stuart Felenstein wrote:
> They are related in the sense that they are part of
> one record in the database.  
> Fields
> Skill   YearsUsed   LastUsed
> 
> When you say array of arrays you are referring to a
> multi-dimensional ?  I'm not sure what you mean by 
> are the [0] related.
> 
> Thank you,
> Stuart

I guess that I am just trying to figure out what your issue is.

Can you explain what the issue is a bit more, in plain english and
perhaps I can help you from there.

All I can see right now is that you are having an issue with a nested
foreach, but didn't really explain what the issue was.

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] remote file existance when protected by a .htaccess

2004-10-20 Thread Robby Russell
On Wed, 2004-10-20 at 09:53 -0700, Mag wrote:
> > > which works great except I have been getting some
> > 403
> > > access denied errors for some sites, checking I
> > see
> > > that they are protected by a htaccess file (that
> > > checks the referrer) so i tried putting
> > > 
> > > header('referer: domain')
> > > 
> > > where domain is the parse_url['host'] of
> > $remote_file
> > > but that too has failed...
> > > 
> > > Any ideas?
> > 
> > 
> > might want to try
> > http://pear.php.net/package/HTTP_Client
> 
> Nope, no PEAR allowedany other options?

No PEAR allowed?

Why not? You can include the libraries in your own paths...

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] File Upload Problem

2004-10-20 Thread Robby Russell
On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote:
> This file upload problem has me very confused.
> 
> The code is:
> 
> $upload_dir = '/articles_store/';
> $uploadfile = $upload_dir . basename($_FILES['userfile']['name']);
> 
> if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {
> } else { die ("Cannot upload file");
> }
> 
> (this code is practically verbatim the example from php.net)
> 
> The directory '/articles_store' has permissions 777.  And the user is  
> and group are 'www' (the Apache user).

Are you sure that this is the correct path? Did you create a new path in
your root level as /articles_store ?

so, if I go on your machine and type in:
$ cd /
$ ls 

it'll show
/articles_store
/dev
/etc
/var

...etc?


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] File Upload Problem

2004-10-20 Thread Robby Russell
On Wed, 2004-10-20 at 17:00 -0700, Robby Russell wrote:
> On Wed, 2004-10-20 at 19:27 -0400, Nathan Mealey wrote:
> > This file upload problem has me very confused.
> > 
> > The code is:
> > 
> > $upload_dir = '/articles_store/';
> > $uploadfile = $upload_dir . basename($_FILES['userfile']['name']);
> > 
> > if (move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)) {
> > } else { die ("Cannot upload file");
> > }
> > 
> > (this code is practically verbatim the example from php.net)
> > 
> > The directory '/articles_store' has permissions 777.  And the user is  
> > and group are 'www' (the Apache user).
> 
> Are you sure that this is the correct path? Did you create a new path in
> your root level as /articles_store ?
> 
> so, if I go on your machine and type in:
> $ cd /
> $ ls 
> 
> it'll show
> /articles_store
> /dev
> /etc
> /var
> 

Basically, my first guess is that you are not understanding the
directory structures properly. You need to give it the full path if
you're going to have a / at the beginning of your directory path.

/foo != yousite.com/foo in the system level.

hth,

Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Passing the Array as Parameter to either the function or object/class???

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 09:57 -0400, Scott Fletcher wrote:
> Hi!
> 
> I wanted to know is can it be done by passing the array as a parameter
> to the function?
> 
> I also wanted to know is is it possible to pass around the array in the
> object-orientated feature like object/class stuffs?
> 

yes and yes.

ie:

function foo($bar)
{
  print_r($bar);
}

$myarray = array(1,2,3,4);

foo($myarray);

ouputs:

Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
)


cheers,

Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Strange Array Error

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 15:04 +0100, Graham Cossey wrote:
> Oh @#*!
> Thanks Greg, I always get that one wrong !
> 
> $test_array = array();
> 
> :)

a few less lines version:

$test_array = array();

for ($i=0; $i<7; $i++)
$test_array[$i] = $i;

print_r($test_array);

hth,

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Simple Time Question

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 08:48 -0600, Ben Miller wrote:
> Probably a stupid question, but hopefully has a simple answer.  Is there a
> way to get Grenwich Mean time?  time() and date() functions that I can see
> only seem to get date/time from the server, which knowing where that is,
> could easily figure out GM time, but would rather go the other way.
> 
> Thanks.
> 
> Ben
> 

You can set an environment variable for your project like so:

putenv("TZ=US/Pacific");

just find the proper GMT time zone format..

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Best practices for php application

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 13:47 -0300, abrea wrote:
> Dear list,
> Does anybody know of a url where I can find reading materials about best 
> practices to organize the filesystem and variable structure of a php 
> application? 
> Although application purposes probably vary widely, I imagine that in one 
> way or other most include adding, updating, deleting and displaying records, 
> so there might be some standard or preferred procedure.
> Thanks for any help
> Alberto Brea
> [EMAIL PROTECTED]

eh, it depends on how you were trained/taught/learned how to do it.

for good examples, head over to sourceforge and look at some of the
major php projects..and browse their CVS directories..see how they do it
for some examples.

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Re-compiling PHP

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 14:52 -0400, Mike R wrote:
> 
> 
> > Mike R wrote:
> > > I am trying to re-compile php, but keep getting erros that the mysql
> > > extensions are not installed.  I got the binary from php.net 
> > and included
> > > mysql in configure (following). What am I not doing correctly?
> > 
> > You're trying to compile the binaries?
> 
> Sorry, the tar'd file I should say.  ;p
> 

You probably need to do --with-mysql=/path/to/mysql/libs

It's not finding them by itself..so you my need to be a bit more
specific.

..you have mysql libs installed, right?

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Re-compiling PHP

2004-10-21 Thread Robby Russell
On Thu, 2004-10-21 at 16:05 -0400, Mike R wrote:
> > On Thu, 21 Oct 2004 15:35:09 -0400, Mike R
> > <[EMAIL PROTECTED]> wrote:
> > > Even after re-compiling with the location of the mysql headers, it still
> > > won't work. :\
> > >
> > > Pretty discouraging.  What version of PHP did they start dropping the
> > > libraries?  Maybe I need to just upgrade to that version..
> >
> > What does the --with-mysql portion of your ./configure command look like?
> >
> > Do you actually have any files on your system named libmysql* ?  A
> > quick check on two systems I have access to, Suse 9.1 and Debain
> > Sarge, they are in the same place: /usr/lib/libmysqlclient*.  that
> > means I would have installed PHP like --with-mysql=/usr .
> >
> > How is your MySQL installed?  From RPMs?  If so do you have the MySQL
> > development RPMs installed?  What OS are you running?
> 
> Redhat 7.3, I believe MySQL was installed with an RPM.  No, I don't have any
> development RPMs installed.  Should I maybe recompile MySQL first?
> 
> Thanks,
> 
> -Mike

find the mysql-devel package that matches the version you are running.

tip: download apt from freshrpms.net

http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/

install the rpm for apt... then run:
apt-get update
apt-get install mysql mysql-devel

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Re-compiling PHP

2004-10-22 Thread Robby Russell
On Fri, 2004-10-22 at 09:26 -0400, Mike R wrote:

> > 
> > find the mysql-devel package that matches the version you are running.
> > 
> > tip: download apt from freshrpms.net
> > 
> > http://ftp.freshrpms.net/pub/freshrpms/redhat/7.3/apt/
> > 
> > install the rpm for apt... then run:
> > apt-get update
> > apt-get install mysql mysql-devel
> 
> 
> This is what I got when I did that:
> 
> mysql is already the newest version.
> mysql-devel is already the newest version.
> 0 packages upgraded, 0 newly installed, 0 removed and 75 not upgraded.

Hmm. What version of PHP are you trying to install?

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Form containing 2 menus not returning anything

2004-10-23 Thread Robby Russell
On Sat, 2004-10-23 at 10:01 -0400, Ken Tozier wrote:
> I created an html form comprised of two menus but when the action 
> method for the form calls my "handler.php" script, neither of the menu 
> variables contain anything. Could someone point out what I'm doing 
> wrong?
> 
> Thanks,
> 
> Ken
> 
> 
> 
> Here's the relevant html:
> 
>align="center">
>   
>   Publication:
>   
>   
>   none
>   Ashland TAB
>   Canton Journal
>   
>   
>   
>   View:
>   
>   
>   none
>   Pub Status
>   Pub Notes
>   
>   
>   
>   
> 
> 
> And here's the PHP handler script:
>if ($view)
>   {
>   echo $publication."\n".$view;
>   }
>   else
>   {
>   echo "no values supplied";
>   }
> ?>
> 

Not sure where you learned how to handle form posts, but you might want
to spend some time reading the PHP site, specifically looking at how
global variables work.

Try changing $view to $_POST['view'];

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] phpBB alternatives?

2005-02-08 Thread Robby Russell
On Tue, 2005-02-08 at 17:16 -0800, Tony Di Croce wrote:
> Due to the recent vulnerabilities discovered in phpBB and the content
> of this page:
> http://www.phpbb.com/
> I have decided to consider other options for my forum needs... Does
> anyone have any reccomendations for a PHP based forum software?
> -- 
> Send REAL USPS letters from the Web!
> http://www.quickymail.com
> 


> e attacked phpbb.com did indeed use a vulnerability in awstats to gain
> entry to our server
> 

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Limit iterations on a foreach loop?

2005-02-11 Thread Robby Russell
On Thu, 2005-02-10 at 15:58 -0800, Brian Dunning wrote:
> I'm using an RSS feed that has WAY too much content, I only want the 
> first 10. I'm outputting the array with a foreach loop: is there a way 
> to limit it to only go through the first 10?
> 
> Thanks,
> 
> - Brian
> 

Is this data coming from a database? If so, just set a limit at the end
of your query...

example: SELECT * FROM blog ORDER BY id DESC LIMIT 10;

..will return the latest 10 entries.

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] need help parsing named.conf file

2005-02-13 Thread Robby Russell
On Sun, 2005-02-13 at 16:46 +0100, Torsten Rosenberger wrote:
> Hello
> 
> is there a way to parse the named.conf file with preg_match_all to get
> back an array which looks like
> 
> [options][directory] = '/var/lib/named'
> [options][forwoarder] = '192.168.0.2'
> [zone][mydomain.com][type] = 'master'
> [zone][mydomain.com][notify] = 'yes'
> [zone][domain2.com][type] = 'slave'
> .
> .

You might try googling for some existing classes that do this.

http://sourceforge.net/projects/phpbind/


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Delete all files in DIR every 20 days

2005-02-14 Thread Robby Russell
On Tue, 2005-02-15 at 02:12 +1030, Tim Burgan wrote:
> Hello,
> 
> How can I delete ALL files within a specified directory every 20 days?
> Does anyone know of any code-snippets that are around at the moment that
> are able to do this? (And where I can find them?)
> 
> Thanks
> 
> Tim
> 

What operating system?

In linux you'd use

rm -rf /path/to/dir

and add this to crontab.

-Robby

-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] help me

2005-02-17 Thread Robby Russell
On Thu, 2005-02-17 at 19:11 +0530, K Karthik wrote:
> > can u help me to use $_SERVER['remote_addr'] to find the IP address ?
> > i am new to php. i also want to find what page of my site he is viewing ?
> 

print_r($_SERVER);

what do you see?



-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] PHP security

2005-02-17 Thread Robby Russell
On Thu, 2005-02-17 at 20:47 -0600, .hG wrote:
> While back I read in an article that placing UN and PASSwords in a PHP was 
> not secure. couple of open source programs that I have seen they have for 
> example
> 
> $database = ;
> $username = ;
> $password = ;
> 
> It makes me wonder how secure in reallity it is to place your UN and 
> Passwords on a PHP file.
> 
> Thanks for your input
> 

Well, what do you suggest we do? We could ask the code you write to
guess the username and password?

>From the web, if you do it right, there is no way to really find out
what the user/pass is. Don't keep it in your webroot if you can help it
is a good way to avoid any issues. The only people who should have
access to the file are you and your webserver process. 

if you put a file in your directory called, db.inc.php and it looks like
so:



.. if php is properly configured, this will never be displayed
at /db.inc.php ... will just show a blank page


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Wierd PHP Problem

2005-02-23 Thread Robby Russell
On Wed, 2005-02-23 at 16:39 -0500, Will Beers wrote:
> Matthew Fonda wrote:
> > $HTTP_*_VARS is deprecated in PHP5, so if the server is running PHP5,
> > this code won't work. Instead, you should use $_POST
> 
> On this subject, is there anything 'wrong' with using $_REQUEST instead of 
> specifying between $_POST and $_GET?
> 
> Will Beers

It really depends on the circumstance. Typically, do not use it unless
you are totally okay with the data coming from $_GET or $_POST. For
security-minded people, it's best to not use this unless you really need
to.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] PHP Wiki

2005-02-25 Thread Robby Russell
On Thu, 2005-02-24 at 17:49 -0500, Randy Johnson wrote:
>Is there a Wiki site for PHP?   Is there a need for one?
>
>-Randy

The php.net site doesn't really need a wiki.

or did you mean is there a php-based wiki?

http://www.google.com/search?q=php+wiki


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Re: Getting PHP to work with MySQL 4.1.10 under Fedora Core 3

2005-02-28 Thread Robby Russell
On Mon, 2005-02-28 at 07:30 -0500, John Swartzentruber wrote:
>On 2/28/2005 2:47 AM M. Sokolewicz wrote:
>> well, for some reason it didn't compile in the mysql extension at all... 
>> even though it was configured to. That's strange, and I have no idea why 
>> it would do that. However, since you're using mysql 4.1.x, you should be 
>> using the mysqli interface anyway. Even phpmyadmin has the option to use 
>> mysqli instead of mysql; you just need to configure it that way (via 
>> config.inc.php)
>> 
>> - tul
>
>I'll try that, but I'd really like to know why it didn't compile in the 
>mysql extension. That was my impression as well, but I couldn't see why 
>that would be the case and am too new to know for sure that this was the 
>case.
>
>Where would I look for the mysqli interface documentation? Is it in the 
>MySQL documentation or the PHP documentation (or both or neither)?
>

Do you have mysql-devel installed? (since you installed via RPM). 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] function to resize images

2005-02-28 Thread Robby Russell
On Mon, 2005-02-28 at 10:34 -0500, Bosky, Dave wrote:
>Does anyone have a nice function that will resize an uploaded image to
>specific width/height dimensions?
>
>I wanted to find something that would work for only GIF and JPG image types.
>I've converted my shopping cart
>
>application from Cold Fusion to PHP and need to create thumbnails and reduce
>the size of large uploaded images.
>
> 
>
>I've already done a google search and found an example but can't get it to
>work for some reason and it includes a 
>
>bunch of other stuff that's not needed and too much trouble to remove.
>

Some info in this post might help you:

http://blog.planetargon.com/archives/44-Image-Watermarks-in-PHP.html


-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Catalog or cart

2005-03-02 Thread Robby Russell
On Wed, 2005-03-02 at 02:45 -0800, Ryan A wrote:
> Hey all,
> I have a client who has a computer store, now he wants to put all his stuff
> in one site.
> He does not want to do any selling from his site, but just list all his
> items.
> 
> After looking via google and the the usual script sites, agora cart looks
> pretty good and easy to maintain, other choices X-Cart,oscommerce,phpcatalog
> 
> I dont really want to build this from scratch as I am sure a lot of very
> very good solutions are already out there and i would rather use the time
> instead to either tweak the software to his particular needs/requests
> 
> 
> for example:
> he wants a few lines and a picture(optional) of his product (eg: a HP
> printer) and when clicked on it should pop up a window with that products
> details.
> 
> 
> or cleaning up his design, digital snaps etc
> 
> I've never really worked on a site like this before so I would appreciate
> any recommendations you have towards a cart or catalog system thats has
> worked really well for you, or you heard is good or you helped develop etc
> I would like a cart/catalog that is open source (does not have to be
> free..but not expensive) so i can play with the code if need be.
> The reason i was leaning towards a cart is, if he ever decides to sell
> online, i dont want to build a whole extra piece of software to go with the
> catalog.
> 
> Thanks in advance,
> Ryan
> 

Very flexible and runs on PostgreSQL. 

http://www.pgcart.com/

-Robby


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Catalog or cart

2005-03-02 Thread Robby Russell
On Wed, 2005-03-02 at 13:15 -0800, Robby Russell wrote:
> On Wed, 2005-03-02 at 02:45 -0800, Ryan A wrote:

> Very flexible and runs on PostgreSQL. 
> 
> http://www.pgcart.com/
> 

Oops, forgot to provide link for an example of it in production:

  - http://www.johnbenzart.com/

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] upload and resize image script

2005-03-04 Thread Robby Russell
On Fri, 2005-03-04 at 03:04 +0100, p80 wrote:
> hey all
> I'm looking for a simple script that would upload an image and resize it to 
> thumbnail using a form to upload the picture. anyone has a good script for 
> that?
> 

There is a function in this post for resizing:

http://blog.planetargon.com/archives/44-Image-Watermarks-in-PHP.html


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
/

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



Re: [PHP] Class/object storing itself in a database

2005-03-14 Thread Robby Russell
On Mon, 2005-03-14 at 14:07 -0600, Chris Boget wrote:
> I have the following Class:
> 
> class MyClass {
>   function store_myself() {
> $query = 'INSERT INTO mytable ( myfield ) VALUES ( ' . $this . ')';
> $result = mssql_query( $query );
>   }
> }
> 
> which works.  Kind of.  What I expected was a serialized copy of the
> object to be stored in the column myfield.  However, what I am actually
> seeing is simply the word 'Object'.
> 
> How can I get it so that the serialize copy is stored so that I can retrieve
> that copy later and use it as a PHP object?
> 
> thnx,
> Chris
> 

Try serializing it first.

What happens when you run:

echo $this;

..your query is going to save the same thing.

try serialize($this) instead.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyonrails.com/
/

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



Re: [PHP] PHP file as homepage?

2005-03-15 Thread Robby Russell
On Tue, 2005-03-15 at 11:10 -0500, Phil Neeb wrote:
> I've noticed that PHP.net uses index.php as its homepage and well, I'm 
> curious as to how that's possible.  Is it the server setup that allows 
> them to load a php file as their homepage or something else?
> 

Apache handles this... or your web server.

-Robby

-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyonrails.com/
/

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



Re: [PHP] What's the going rate for making websites ?

2005-04-03 Thread Robby Russell
On Sun, 2005-04-03 at 16:51 -0600, -{ Rene Brehmer }- wrote:
> Hi gang
> 
> Sorry for asking this question here, but I don't know where else to ask. 
> And Goole'ing didn't help me much.
> 
> My father-in-law has a friend in Alaska (and I'm in Canada) that needs a 
> website done. Not sure what kinda site he wants done yet, or how much he 
> needs me to do for him (like webspace, domain hosting, domain registration, 
> and such) but for now I've been asked what it'd cost to get it done.
> 
> I'm assuming it's something pretty simple, since it's just for a motorcycle 
> club, but he wants a price first ...
> 
> What do y'all charge when you do sites for people ??? ... In the past I've 
> only done pro-bono work (because they usually don't require much work, so 
> it's not a problem getting it done while working on other projects), but 
> I've never actually done paid work before... It's more that I just recently 
> moved to Canada (from Denmark) so I have no feeling with what the prices 
> and rates are overhere ...
> 

$x = What is your time worth?

$y = How long will it take you?

$cost = $x * $z


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyonrails.com/
/

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



Re: [PHP] file upload

2005-04-04 Thread Robby Russell
On Mon, 2005-04-04 at 17:07 +0300, William Stokes wrote:
> Hello,
> I might have asked this already but I am still ignorent ;-)
> 
> How to check if a same name file already exists in a upload directory when 
> uploading new file?
> 
> Thanks
> -Will 
> 

http://www.php.net/file_exists

-Robby

-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyonrails.com/
/

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



[PHP] virtual domain own php.ini

2004-04-22 Thread Robby Russell
Trying to use own php.ini file (rather than the one that the webserver 
sees by default) for a web site (on a box that has many websites that 
utilize the other) and used the following instructions, but it doesn't 
seem to notice my own php.ini file.

> When the PHP interpreter starts up, it behaves according to settings
> specified in any availabe php.ini file. The Web server will look for
> this file in the following locations and in the following order:
>
> 1. The directory from which the PHP script was called 2. The root of
> your Web directory  3. The Web server's default php.ini
Any thoughts?

--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
[EMAIL PROTECTED] | Telephone: (503) 667.4564
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Nested PHP

2004-02-01 Thread Robby Russell
Russell Shaw wrote:

Hi,
I have php code embedded in html, that is read by apache.
Is nested php code allowable such as:

\" ?>";
?>
...

...
  

  

Not sure what you're trying to do there.

You can do this:

hello world!\n";
?>

  

  

--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
[EMAIL PROTECTED] | Telephone: (503) 222.2783
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Thumbnail Page

2004-02-03 Thread Robby Russell
PETCOL typed this on 02/02/2004 03:47 PM:
I think I'm having a "Bad Hair Day"

I have a table in my database with all my thumbnail filenames in it.

My query pull that out, now I want to display the images in a table, I can
get it to go down the page row by row, but I want it to say do five columns
of different images and then go down the page with different images?  Maybe
even have Next and Previous at the bottom would be nice.
Anyone got a suggestion, other than a good night sleep ;-)

Col

I won't tell you how to specifically do it, as that's the fun of 
programming...but I'll give you a few tips.

Let's say you have 20 rocks. You want five columns of images, so you 
would have 4 rows by 5 images.

Essentially, you want a table that looks like so:
  x x x x x
  x x x x x
  x x x x x
  x x x x x
First you would build your recordset.
Then you would open up a table and begin your first row. How many rocks 
would you have to count, before you ended your row and started a new 
row? So, you would need a method of counting where you were in your 
recordset to know when to close the table row and when to open up a new 
one.

1 2 3 4 5
6 7 8 9 10
...


-Robby

--
#-----------
# Robby Russell,  |  Sr. Administrator / Lead Programmer
# Command Prompt, Inc.   |  http://www.commandprompt.com
# [EMAIL PROTECTED] | Telephone: (503) 667.4564
#---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Need a way to automate user logout

2004-02-05 Thread Robby Russell
Ben Ramsey typed this on 02/05/2004 01:55 PM:
Write the script in perl and chmod it to 755.  Then use cron to schedule 
it.  Here's a tutorial to show you how: 
http://www.unixgeeks.org/security/newbie/unix/cron-1.html


Why not do this in PHP cmdline instead? This is a PHP list right? :-p



--
#---
# Robby Russell,  |  Sr. Administrator / Lead Programmer
# Command Prompt, Inc.   |  http://www.commandprompt.com
# [EMAIL PROTECTED] | Telephone: (503) 667.4564
#---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] CSV download

2004-02-18 Thread Robby Russell
Roberts, Mark (Tulsa) typed this on 02/18/2004 10:33 AM:
I have an application that I need to add a function to that will
download a complete MySql Table in comma delineated format from a web
site to a local hard drive.  What is the best way to do this?
Is there a function in PHP that will do this? in MySql? or do I just
need to do something with fopen().
All you need to do is open a temporary file, write to it on the server, 
then send to the client browser for them to save.

-Robby

--
#---
# Robby Russell,  |  Sr. Administrator / Lead Programmer
# Command Prompt, Inc.   |  http://www.commandprompt.com
# [EMAIL PROTECTED] | Telephone: (503) 667.4564
#---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] running php3 files

2004-02-24 Thread Robby Russell
Ryan A typed this on 02/24/2004 10:45 AM:
Hi,
A small problem, a pal of mine is hosting with a company that has PHP
configured to run only
with the .php extention and not the .php3 extention...
Where will he have to make the changes so that his scripts will run if its
.php or .php3 ?


Are you running Apache?

in my /etc/httpd/conf/httpd.conf I have:

[snip]


AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps


AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps


AddType application/x-httpd-php .phtml

[/snip]



--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
[EMAIL PROTECTED] | Telephone: (503) 222.2783
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PEAR::SOAP

2004-03-30 Thread Robby Russell
I am trying to debug some xml issues with a SOAP/Client-based script.

	$sc = new SOAP_Client(...);

is there a way to display the XML it attempts to send the server when I 
perform a
	$sc->call(...)

*back to his google searches*



--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
[EMAIL PROTECTED] | Telephone: (503) 667.4564
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] running php in sequence

2004-03-30 Thread Robby Russell
Edward Peloke typed this on 03/31/2004 08:11 AM:
I am using php in combination with ant to create a small automated build
process.  Will php run sequentially?  What I mean is I have a series of
modules or tasks:
Example:
//check out files
include("modules/checkout.php")
//zip up the files
include ("modules/zip.php")
etc

Will php wait to execute the zip.php until the checkout.php has completed
because in my priliminary tests, it doesn't appear to do this.  If not,
what's the best way to execute it?
One way to test this would be to print time stamps at the top of each of 
your files.



--
Robby Russell,  |  Sr. Administrator / Lead Programmer
Command Prompt, Inc.   |  http://www.commandprompt.com
[EMAIL PROTECTED] | Telephone: (503) 667.4564
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] https://...

2004-10-27 Thread Robby Russell
On Wed, 2004-10-27 at 16:35 -0500, Afan Pasalic wrote:
> hi,
> how can I check using php that I use SSL?
> tried with
> REQUEST_URI
> HTTP_HOST
> PATH_INFO
> but any of these does show http://
> 
> Thanks!
> 
> -afan
> 

Have you looked at $_SERVER['SERVER_PORT'] and
$_SERVER['SERVER_PROTOCOL']
?

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
/



signature.asc
Description: This is a digitally signed message part


Re: [PHP] User Screen Resolution

2004-10-27 Thread Robby Russell
On Wed, 2004-10-27 at 15:25 -0700, Web Guy wrote:
> I am new to PHP and couldn't find any Globals for the User's Screen
> Resolution. (don't laugh at me please)
> 
> I used to use a Javascript function to pass the resolution using
> screen.width and screen.height.
> 
> What I am actually trying to do is make a page resize depending on screen
> resolution, in case that helps anyone.
> 

go back and find your javascript function. PHP is server side not client
side.

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 and PHP4 ---
/


signature.asc
Description: This is a digitally signed message part


RE: [PHP] Default value if parameter is not passed in

2004-10-27 Thread Robby Russell
On Wed, 2004-10-27 at 16:56 -0700, Quanah Gibson-Mount wrote:
> 
> --On Wednesday, October 27, 2004 4:53 PM -0700 "Vail, Warren" 
> <[EMAIL PROTECTED]> wrote:
> 
> > I notice that none of your variables use the PHP convention of $ preceding
> > the variable name, I also do not see you defining a value for
> > DEFAULT_VALUE, which by the upper case convention seems to be referring
> > to a global constant.  Is it not true (no pun intended) that if a
> > variable (or constant) has not been defined, that assigning the contents
> > of that variable (or value of the constant) will return a false (i.e. a
> > 1)?
> 
> This is inside the C source code for PHP.  C does not prefix variables with 
> a $.
> 
> The DEFAULT_VALUE was simply shorthand for what I'm setting it to, and is 
> not representative of an actual value, and that bit doesn't particularly 
> matter, since it was never getting executed (although it was for a global 
> constant from a header file).
> 
> --Quanah
> 

So, you're asking for help on modifications to the source code for PHP,
not how to help with modifications of PHP code, correct?

If so, you might want to try the PHP developers list. 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 and PHP4 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] PHP Compiler?

2004-10-27 Thread Robby Russell
On Wed, 2004-10-27 at 19:26 -0500, Bill McCuistion wrote:
> Sorry if this is an old question:  
> 
> Where can I find information on any plans to create a compiler for PHP,
> especially v5.x?
> 
> Barring that, is there a PHP syntax checker that would enforce some of the
> types of things that a compiler would find?  
> 
> I remember from back in my MS-DOS days the very good Clipper compiler for
> the dBase III language.  dBase III, not unlike PHP, was an interpretive
> language, and along the way some bright folks figured out how to write a
> true dBase language compiler, which then allowed for all sorts of nice
> things to happen.  One of the nicest things for me was that the compiler
> caught all sorts of "little" things before the same code in the interpreter
> would find them at run-time.
> 

I believe that there are some commercial products that can do this for
you.

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 and PHP4 ---
/


signature.asc
Description: This is a digitally signed message part


RE: [PHP] Newbie again: get no $QUERY_STRING

2004-10-27 Thread Robby Russell
On Thu, 2004-10-28 at 09:28 +0530, Zareef Ahmed wrote:
> Hi,
>What are you trying to do? If you want to get the values of query
> string they will be available in $_GET array.
> 
> Try
> 
> Print "";
> print_r ($_GET);
> Print "";
> 

Yeah, as a habit I usually have a function called something like debug()

function debug($arg)
{
  print "";
  print_r($arg);
  print "";
}

debug($_GET);

try not to use capitalized P in print...

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 and PHP4 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] https://...

2004-10-28 Thread Robby Russell
On Thu, 2004-10-28 at 11:01 -0500, Afan Pasalic wrote:
> Hi Robby,
> Yes, I looked at SERVER_PORT/SERVER_PROTOCOL. What I got is 80 and 
> HTTP/1.1 when I manually change http:// to https:// I'm getting 443 and 
> HTTP/1.1
> 
> I am not so good in this: you want to say that SSL use 443 port
> 
> -afan

There you go, the standard SSL port is 443. If you want to verify that
you are on 443, then you can use SERVER_PORT

-Robby


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now supporting PHP5 and PHP4 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Review: Function that measures the width of a text string in pixels.

2004-10-28 Thread Robby Russell
On Fri, 2004-10-29 at 00:11 +0200, Jacob Friis wrote:
> I have created a function that will measure the width of a text string 
> in pixels. It works ok.
> If you have optimizations, please let me know.
> Thanks,
> Jacob
> 
> function txt_width ($txt) {
>   $width = 0;
>   $txt_len = strlen($txt);
>   for ($n = 1; $n <= $txt_len; $n++) {
>   switch (substr($txt, $n, 1)) {
>   case 'l';
>   case '.';
>   case ' ';
>   case '-';
>   case 't';
>   $width += 3;
>   break;
>   default :
>   $width += 8;
>   break;
>   }
>   }
>   return $width;
> }
> 

..and how do you plan to account for things such as, font sizes on all
platforms, font types, etc?


-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] File uploads and handling

2004-10-28 Thread Robby Russell
On Thu, 2004-10-28 at 19:04 -0500, Philip Thompson wrote:
> On Oct 26, 2004, at 7:06 AM, Jason Wong wrote:
> 
> > On Tuesday 26 October 2004 03:45, Philip Thompson wrote:
> >
> >> I have a form to upload a file from a user's computer to the server. I
> >> want to then modify the file, and then let the user save it back.
> >> However, I am having troubles opening the file. It says it doesn't
> >> exist. Any suggestions?
> >>
> >> ---
> >> if (is_uploaded_file($_FILES['userfile']['name']))
> >>  $handle = fopen($_FILES['userfile']['name'], "r");
> >> else
> >>  echo $filename . " was not uploaded properly";
> >> ---
> >>
> >> I know the actual filename shows up...
> >
> > In the above you are only referencing the *filename* and not the actual
> > uploaded file itself.
> >
> >> but somehow it's not uploading.
> >> Ideas?
> >
> > Read
> >
> >   manual > Handling file uploads
> >
> > to see how it all works.
> 
> Yeah, that was not useful at all. That's what I originally looked at. 
> If anyone has some "code" that shows how to reference the actual file, 
> then that would be helpful. I have pulled my hair out long enough over 
> this one.
> 
> I did try this, but nothing changed (b/c it's just an array):
> 
> if (is_uploaded_file(_FILES['userfile']))
>  $handle = fopen($_FILES['userfile'], "r");
> 
> Tips would be wonderful. Thanks!

Here is an example:

http://blog.planetargon.com/index.php?/archives/26_Uploading_images_into_PostgreSQL.html

hth,

Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Gawd I hate those useless error messages...

2004-10-29 Thread Robby Russell
On Fri, 2004-10-29 at 16:28 +0200, -{ Rene Brehmer }- wrote:
> Hi gang
> 
> I do realise that this error means I've forgotten a curly brace or 
> semi-colon somewhere, but seriously ...
> 
> Parse error: parse error, unexpected $end in E:\web\Metalbunny\addguest.php 
> on line 274
> 
> where line 274 would be the last line, obviously (since it's always the 
> last line when it does this)...
> 
> now I'm lucky that this script in question has alot of HTML in it, so 
> there's only about 180 lines of actual code, but is there really not 
> something that can be done to PHP to make errors like these just a LITTLE 
> easier to debug ???
> 
> It's not that bad in this particular case ... but when we have scripts of 
> 500-800 lines code, or even more, it tends to be a rather not very helpful 
> message... and it gets worse when you jump in and out of PHP ...
> 
> the '$end' and the '$' error are by far the most annoying errors, so hard 
> to debug ... atleast with 'unexpected {' you have a slight chance as it 
> limits the part you have to search through ...
> 
> since this is the test-server, I run with all errors, alerts, and messages 
> on, but isn't there someway to make PHP just a little more helpful when 
> this happens ???
> 
> 

Yeah, don't make errors in your code. ;-)

Also, try to seperate your html and php code as much as possible. Use a
template system of some form. (ie. smarty)

Use a PHP editor with syntax highlighting..click on one curly brace and
then find where the other highlighted brace is and make sure that it
where it should end.

Learn how to debug your code. See how far it's getting for each
thing..add test messages and die() in different scopes of code.

Good luck,

Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Bug-Tracking-System in PHP ?

2004-10-29 Thread Robby Russell
On Fri, 2004-10-29 at 16:51 +0200, Michelle Konzack wrote:
> Am 2004-10-29 09:48:32, schrieb Reinhart Viane:
> > Dunno if this is ok:
> > http://www.mantisbt.org/
> 
> Nice features and 1.0 support postgresql
> (can not use MySQL because some tools conflicts with postgresql)


How do mysql and postgresql tools conflict? You should have no problem
running them side by side... or even several of each on the same
machine. They don't obsolete each other or cause dependancy issues.

-Robby

-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Re: Re: Bug-Tracking-System in PHP ?

2004-10-29 Thread Robby Russell
On Fri, 2004-10-29 at 12:04 -0500, Greg Donald wrote:
> On Fri, 29 Oct 2004 18:25:54 +0200, Michelle Konzack
> <[EMAIL PROTECTED]> wrote:
> > I have tools for postgresql installed which drives mysql crazy...
> 
> I must admit my curiosity here..  What tools?
> 
> Seems pretty impossible since both Postgres and MySQL are stand-alone
> databases and have nothing to do with each other.

I am curious too. I have never seen any conflicts of the sort.


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Emulation of Application object

2004-10-29 Thread Robby Russell
On Sat, 2004-10-30 at 00:55 +0300, Anakreon wrote:
> Hello all.
> 
> How could I emulate the functionality provided by the Application object in ASP
> with PHP?
> 
> Anakreon
> 

Rebuild it in PHP?

You can try asp2php...but don't expect much out of it.


-- 
/*******
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] image files - upload and managment

2004-10-30 Thread Robby Russell
On Sat, 2004-10-30 at 02:43 -0700, Jaskirat Singh wrote:
> Hi People,
> 
> I am writing a web app on LAMP.
> The app is sort of yellow pages where people can login and post
> advertisments with pictures.
> 
> App needs to allow users to upload pictures. (jpg and gif),
> needs to create thumbnails of those pictures
> and to store thumbnails and full pictures.
> 
> App needs to manage all those files - can be as much as 20K plus
> images.
> 
> I think image file size, file type and image dimensions restrictions
> should be easy to handle by using $_FILES array and  getimagesize
> function.
> 
> The issues that I am thinking of and need suggestions about are
> 
> 1) Storage and retrieval -  File system sounds like a better choice
> over database. We are talking about 20 thousand plus pictures.
> 

I would do it in the database (PostgreSQL in my case). The speed isn't
going to be much slower if you keep things optimized. You can even cache
your images if necessary on the filesystem (for high traffic images).

> 2) Thumbnails - Should I create those once and save it in a file when
> the image is uploaded for the first time. Looks like a faster option
> than creating them every time on the fly.
> 

I just recently finished working on a project where I knew that would
automatically create a thumbnail version of each image on upload... but
then I realized that I might one day want to change the default
thumbnail sizes.. so what I did was have it create a thumbnail on the
fly from the database. (this way I can control the thumbnail size in the
future). The speed difference was hardly noticed. I have done what I
mentioned above and am now caching images that get loaded frequently. 

> 3) Security issues - I believe I must have a world writable "666"
> permissions directory to keep images as users of the web app are
> uploading them. Does that create any security holes in my application?
> 

The database will help you add a nice layer of security.

> 4) Any thing else related to image uploads that one might need to take
> care of. Are there any tutorials on image upload issues.
> 

an example:
http://blog.planetargon.com/index.php?/archives/26_Uploading_images_into_PostgreSQL.html

and here is how you can display the images from the db. I am also using
mod_rewrite so that it looks like it's coming from the filesystem, for
example:

mydomain.com/images/mypic.jpg actually
calls ./image.php?filename=mypic.jpg

http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html


hth,

-Robbyu

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] image files - upload and managment

2004-10-30 Thread Robby Russell
On Sat, 2004-10-30 at 22:30 +, Matthew Weier O'Phinney wrote:
> * Robby Russell <[EMAIL PROTECTED]>:
> > On Sat, 2004-10-30 at 02:43 -0700, Jaskirat Singh wrote:
> > > App needs to allow users to upload pictures. (jpg and gif),
> > > needs to create thumbnails of those pictures
> > > and to store thumbnails and full pictures.
> > > 
> > > App needs to manage all those files - can be as much as 20K plus
> > > images.
> > > 
> > > I think image file size, file type and image dimensions restrictions
> > > should be easy to handle by using $_FILES array and  getimagesize
> > > function.
> > > 
> > > The issues that I am thinking of and need suggestions about are
> > > 
> > > 1) Storage and retrieval -  File system sounds like a better choice
> > > over database. We are talking about 20 thousand plus pictures.
> >
> > I would do it in the database (PostgreSQL in my case). The speed isn't
> > going to be much slower if you keep things optimized. You can even cache
> > your images if necessary on the filesystem (for high traffic images).
> 
> I have difficulty believing retrieving an image from a database will
> have similar speed performance as simply grabbing it from the
> filesystem... and if you're seeing a need to cache images on the
> filesystem anyways, that's certainly already an argument against it.
> 

I tend to stick as much in the database with strict restraints. I know
that in my database, an image cannot be deleted unless several rules are
met. In the filesystem, a number of things could accidently delete the
wrong file. I treat my images as another piece of data and that data is
kept there by constraints.  

> > > 2) Thumbnails - Should I create those once and save it in a file when
> > > the image is uploaded for the first time. Looks like a faster option
> > > than creating them every time on the fly.
> >
> > I just recently finished working on a project where I knew that would
> > automatically create a thumbnail version of each image on upload... but
> > then I realized that I might one day want to change the default
> > thumbnail sizes.. so what I did was have it create a thumbnail on the
> > fly from the database. (this way I can control the thumbnail size in the
> > future). The speed difference was hardly noticed. I have done what I
> > mentioned above and am now caching images that get loaded frequently. 
> 
> Thumbnailing on the fly may have decent performance, but it *is* slower
> than simply serving up an image. If you doubt that, try surfing from a
> T1 connection some time (dial-up users may not notice the extra time
> required to generate the image, but those on broadband will). In
> addition, if you generate a thumbnail every time the image is requested,
> you're making your server do extra work -- even if you're caching
> oft-requested images.
> 
> I understand the argument regarding a future change in thumbnail sizes.
> However, generating thumbnails on a filesystem of images is something
> that is easily scripted and can be performed on an as-needed basis.
> (ImageMagick is great for this sort of thing, and scripts in PHP using
> GD could also be used.)
> 

As I can do when I want it to be a thumbnail. Infact, in PostgreSQL, I
can use plPHP, plPerl, psycopg, etc and perform these tasks within
database functions. This isn't an issue at all. 

Here are a few reasons why storing in the DB can be more useful. 

http://www.oracle.com/technology/products/intermedia/htdocs/why_images_in_database.html

Also, Gallery 2, is moving to a database backend, one would wonder why
that would be a good move, considering the sole purpose of gallery is to
display images. 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] postgres-embedded images via php. two issues...

2004-11-02 Thread Robby Russell
On Tue, 2004-11-02 at 16:45 -0600, P. George wrote:
> i am storing images in a postgres database and i have set up a little 
> php file to retrieve them in such a way that i can do:
> 
> echo "";
> 
> ...from another php file.
> 
> it's working great, BUT i've noticed two things that bother me:
> 
> [1]  if someone wants to download an image, they can, but it will be 
> downloaded as "gif.php" instead of "whatever.gif".  even though 
> renaming the file solves the problem, users will be confused by this.
> 
> [2]  (and i think this may be related to the first problem) is that in 
> at least one of my browsers (camino/osx) the images are ALWAYS pulled 
> directly from the server.  they are never cached by the browser.  i 
> suppose all browsers may be behaving this way, but in camino, it is 
> blatantly and visually obvious as you watch the gif being slowly 
> downloaded/displayed over a slow connection.
> 
> anyone know what to do for either of these?  concerning [2], i'm 
> thinking maybe i can implant the local browser cache _manually_ instead 
> of depending on the browser to do it for me? if so, how would i go 
> about doing that?
> 
> thanks.
> 
> - philip
> 

My guess is that your browser isn't set to cache .php file output. If
it's caching images, you might need to trick it into thinking that it's
an image.

for example, look at the mod_rewrite rules at the bottom of this blog
post.

http://blog.planetargon.com/index.php?/archives/27_Displaying_image_from_PostgreSQL_large_object_with_PHP.html

I don't know if this *is* the issue, but it's my first guess.

-Robby



-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] postgres-embedded images via php. two issues...

2004-11-02 Thread Robby Russell
On Wed, 2004-11-03 at 10:20 +1000, Tom Rogers wrote:
> Hi,
> 
> Wednesday, November 3, 2004, 8:45:17 AM, you wrote:
> PG> i am storing images in a postgres database and i have set up a little 
> PG> php file to retrieve them in such a way that i can do:
> 
> PG> echo "";
> 
> PG> ...from another php file.
> 
> PG> it's working great, BUT i've noticed two things that bother me:
> 
> PG> [1]  if someone wants to download an image, they can, but it will be 
> PG> downloaded as "gif.php" instead of "whatever.gif".  even though 
> PG> renaming the file solves the problem, users will be confused by this.
> 
> 
> It does not matter what the extension is, it is the header that has more sway
> 
> 
> PG> [2]  (and i think this may be related to the first problem) is that in 
> PG> at least one of my browsers (camino/osx) the images are ALWAYS pulled 
> PG> directly from the server.  they are never cached by the browser.  i 
> PG> suppose all browsers may be behaving this way, but in camino, it is 
> PG> blatantly and visually obvious as you watch the gif being slowly 
> PG> downloaded/displayed over a slow connection.
> 
> The browser wont cache url's that have the ? in them so change your info passing
> scheme to echo "";
> then process the query string to extract the info
> 
> You could even add a dummy value at the end like
> src='gif.php/name=$picname/type.gif to make it look like a gif'
> 

In my .htaccess file, I have placed the following :

RewriteEngine On
RewriteRule ^images/([0-9]+)$ image.php?id=$1 [L]
RewriteRule ^images/(.*)$ image.php?filename=$1 [L]

This allows either: http://localhost/images/5 or
http://localhost/images/myimage.png to work. I prefer the filename as it
looks cleaner and appears to be more standard. So, in a webpage, I can
now add the following html code to show the image.

http://localhost/images/myimage.png"; />

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


Re: [PHP] image uploads - part 2

2004-11-06 Thread Robby Russell
On Sat, 2004-11-06 at 03:58 -0800, Jaskirat Singh wrote:
> 4) database + dedicated =  err.. stupid? ;)

I should have clarified this more as to why I prefer the DB storage
method. I don't expect that my web application will be the only
interface to the data that I am storing the database. For some clients,
we build pyton interfaces that clients run on their desktop. We also
replicate our databases across a few servers and it's much easier to
keep track of the database than it is to make sure a bunch of
filesystem-stored files are too. Some of our client database machines
don't have a webservers so we don't program with just the web in mind. 

With storing in the database, we get transaction support and we know
that an image will not be deleted if it is being referenced by another
piece of data. Speed versus data integrity is something we have to
juggle per client as to what is more important. If you know how to
optimize your database (a stock pgsql db can be rather slow..) then the
speed differences are not enough of a factor for us to know that our
data just a bit more safer. 

-Robby

-- 
/***********
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


  1   2   >