php-general Digest 14 Oct 2004 09:35:50 -0000 Issue 3052

2004-10-14 Thread php-general-digest-help

php-general Digest 14 Oct 2004 09:35:50 - Issue 3052

Topics (messages 199424 through 199462):

Installing PHP 5.0.2 on Fedora Core 2
199424 by: Don
199436 by: Greg Donald

Re: ezmlm-sub or alternative
199425 by: Mark Hubert
199447 by: Jason Wong

hy problems with php 5.01 installation !
199426 by: Nicolae Serban
199437 by: Greg Donald

deleting multiple items from a database
199427 by: Adil
199434 by: Jay Blanchard
199438 by: Robby Russell
199440 by: Curt Zirzow

.htaccess and .htpasswd
199428 by: Afan Pasalic
199429 by: Matthew Sims
199430 by: Matt M.
199431 by: Afan Pasalic
199432 by: John Nichel
199433 by: Afan Pasalic
199461 by: Mulley, Nikhil

Re: php err msg/issue...
199435 by: Curt Zirzow

rename() on NT
199439 by: Jed R. Brubaker

question about mkdir() and ownership permissions
199441 by: Jason FB
199448 by: Jason Wong

Re: mail problems - phpinfo information
199442 by: Jason Wong

Re: Security patch from 4.3.8 to 4.3.9
199443 by: Jason Wong
199453 by: Steve Brown

Determine variable with the lowest value?
199444 by: BOOT
199445 by: Greg Donald
199446 by: Jason Wong
199457 by: BOOT

Re: Image upload not working correctly
199449 by: Jason Wong

Re: Form Validation
199450 by: Mattias Thorslund

Re: Working out the image path...partly solved, please have a look at my code
199451 by: Mag

Adding TEXT over an Image
199452 by: GH
199454 by: Mattias Thorslund
199455 by: GH
199458 by: Thomas Goyne
199460 by: GH

' (Single Quotes) in user inputs
199456 by: Ben
199459 by: John Holmes

Help with sessions problem please
199462 by: Graham Cossey

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
Hi,
 
I'm getting an error trying to install PHP 5.0.2 on a fresh Fedora Core 2
installation:
 
Sorry, I cannot run apxs
apxs was not found
 
I verified this by searching the drive, it is not there.  Is Apache
installed by default without using --enable-so ?
 
If so, what can I do?
 
Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 10/12/2004
 
---End Message---
---BeginMessage---
On Wed, 13 Oct 2004 15:55:46 -0400, Don [EMAIL PROTECTED] wrote:
 I'm getting an error trying to install PHP 5.0.2 on a fresh Fedora Core 2
 installation:
 
 Sorry, I cannot run apxs
 apxs was not found
 
 I verified this by searching the drive, it is not there.  Is Apache
 installed by default without using --enable-so ?
 
 If so, what can I do?

Search the mailing list archives, a very similar if not exact issue
was discussed just last week:

http://marc.theaimsgroup.com/?l=php-general


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/
---End Message---
---BeginMessage---
Thanks so much for the insight which is a much simpler way.
I successfully set up a test page (a form) that takes email to, from, 
subject and body and sends it.

?php
$emailto=$_GET['emailto'];
$emailfrom=$_GET['emailfrom'];
$emailsub=$_GET['emailsub'];
$emailbody=$_GET['emailbody'];
$headers = From: $emailfrom\r\n;
$headers .= Return-Path: $emailfrom\r\n;
if(mail($emailto, $emailsub, $emailbody, $headers)) {
echoEmail Sent;
exit;
}
echo Email Error;
?
However, when I send a message to subscribe to the EZMLM list, it sends 
ok, but doesn't get added to the list. When I send a test message to 
myself I noticed that the Return-path in the email sent is not what I 
set in my script, but that of the apache user. I wonder if that is 
where the EZMLM-sub gets the address for submission and is sending the 
confirmation to the dead mailbox.

Any insight?
Thanks,
Mark

On Oct 11, 2004, at 8:55 PM, James McGlinn wrote:
Hi Mark,
 I'm writing a little script (my 3rd) that takes name (first, last) 
and email address
and writes it to txt file and submits the email address to an EZMLM 
list server.

All is well but I'm not sure where to go for the submission.
The command line - ezmlm-sub works (from the shell)... if the user is 
root or vpopmail.

 Is there a safe way to run the shell command via a php script?
Or can someone suggest another way to submit an address to ezmlm.
You can make use of the public interface to ezmlm-sub by sending an 
email to listname[EMAIL PROTECTED]

You'll need to set the 'From:' header of your emails to the address of 
your subscriber.

You can find information on the mail() function at 
http://www.php.net/mail

James 

RE: [PHP] .htaccess and .htpasswd

2004-10-14 Thread Mulley, Nikhil
Can I know the platform on which you are running apache.

-Original Message-
From: Matthew Sims [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 1:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] .htaccess and .htpasswd


 # .htaccess
 AuthType Basic
 AuthName Restricted Area
 AuthUserFile /www/html/path/to/file/admin/.htpasswd
 require valid-user

 # .htpasswd
 Admin:ChqaxtiTH1e0E

 Both files are in same directory.

 Why it doesn't work?

 Can I use as AuthUserFile .htpasswd since they are in the same
 directory?

 I know its not smart but let's get this working and I'll move .htpasswd
 later to upper level :)



 -afan


Dude...do you know what mailing list you're on?

http://httpd.apache.org/lists.html

-- 
--Matthew Sims
--http://killermookie.org

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

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



[PHP] Help with sessions problem please

2004-10-14 Thread Graham Cossey

I'm having a bad day with sessions which hopefully someone can help me with.

A user logs in to my 'site' (script1.php) and I store relevant details in a
session, all fine. I redirect to another page (script2.php) which checks and
retrieves certain session values, all fine. My problem is with script3.php
which happens to be within an iframe in script2.php. When the user is
automatically passed to that page, from log in, the session details are not
available but if the user makes a (menu) selection the session values are
available to script3.php within the iframe. help !

Simplified code:

script1.php
?php
  session_start();
  [some code]
  $_SESSION['user'] = $_POST['user'];
  [some code]
  $hdr = Location: script2.php?.SID;
  header($hdr);
?

script2.php
?php
  session_start();
  if (!isset($_SESSION['user']))
  Header(Location: ../index.htm);  Does not redirect.
  [some code]
  iframe name=content src=script3.php
Your browser does not support the use of frames.
  /ifame
  [some code]
?

script3.php
?php
  session_start();
  print_r($_SESSION);  outputs Array()
  [some code]
?

If you need any specific info on my config just ask and I'll try and supply
it.

TIA
Graham

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



Re: [PHP] Help with sessions problem please

2004-10-14 Thread Jason Wong
On Thursday 14 October 2004 17:35, Graham Cossey wrote:

 A user logs in to my 'site' (script1.php) and I store relevant details in a
 session, all fine. I redirect to another page (script2.php) which checks
 and retrieves certain session values, all fine. My problem is with
 script3.php which happens to be within an iframe in script2.php. When the
 user is automatically passed to that page, from log in, the session details
 are not available but if the user makes a (menu) selection the session
 values are available to script3.php within the iframe. help !

 Simplified code:

 script1.php
 ?php
   session_start();
   [some code]
   $_SESSION['user'] = $_POST['user'];
   [some code]
   $hdr = Location: script2.php?.SID;
   header($hdr);
 ?

Use an absolute URL for header redirects.

You're passing the session id (SID) onto script2 but not to script3, if that's 
the only method by which you're propagating the session id then script3 is 
not going to have a session.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I appoint you ambassador to Fantasy Island!!!
*/

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



Re: [PHP] Help with sessions problem please

2004-10-14 Thread John Holmes
Graham Cossey wrote:
I'm having a bad day with sessions which hopefully someone can help me with.
A user logs in to my 'site' (script1.php) and I store relevant details in a
session, all fine. I redirect to another page (script2.php) which checks and
retrieves certain session values, all fine. My problem is with script3.php
which happens to be within an iframe in script2.php. When the user is
automatically passed to that page, from log in, the session details are not
available but if the user makes a (menu) selection the session values are
available to script3.php within the iframe. help !
Simplified code:
script1.php
?php
  session_start();
  [some code]
  $_SESSION['user'] = $_POST['user'];
  [some code]
  $hdr = Location: script2.php?.SID;
  header($hdr);
?
script2.php
?php
  session_start();
  if (!isset($_SESSION['user']))
  Header(Location: ../index.htm);  Does not redirect.
  [some code]
  iframe name=content src=script3.php
Your browser does not support the use of frames.
  /ifame
  [some code]
?
script3.php
?php
  session_start();
  print_r($_SESSION);  outputs Array()
  [some code]
?
If you need any specific info on my config just ask and I'll try and supply
it.
You need to use full URLs in your header() redirects, first of all.
header('Location: http://www.example.org/script2.php?.SID);
Is a session cookie being set at all? You redirect to script2 and pass 
the SID in the URL, so that's why the session persists. You're not 
passing the SID in the URL for the source of the iframe leading to 
script3, so the script doesn't know what session to pick up.

Try: iframe name=content src=script3.php??=SID?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help with sessions problem please

2004-10-14 Thread Chris Shiflett
--- Jason Wong [EMAIL PROTECTED] wrote:
 Use an absolute URL for header redirects.

Glad to see someone else preaching the good HTTP gospel. :-)
 
 You're passing the session id (SID) onto script2 but not to
 script3, if that's the only method by which you're propagating
 the session id then script3 is not going to have a session.

I think Jason hit the nail on the head with this one, but you might not
understand the answer. While script3.php might seem to be within
script2.php, due to the visual layout you're providing with the iframe,
this is completely independent of the technical implementation, which is
that each is a separate resource.

If that's confusing, think of an iframe as a little embedded browser. If
it fails to properly identify itself (via cookie or URL), then there is no
existing session to resume. Your call to session_start() will actually
create a new session every time script3.php is requested.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming December 2004http://httphandbook.org/

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



Re: [PHP] Help with sessions problem please

2004-10-14 Thread Chris Shiflett
--- John Holmes [EMAIL PROTECTED] wrote:
 header('Location: http://www.example.org/script2.php?.SID);

He is human after all. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming December 2004http://httphandbook.org/

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



Re: [PHP] Help with sessions problem please

2004-10-14 Thread Chris Dowell
No
I think it's more likely that one of his tentacles slipped
Chris Shiflett wrote:
--- John Holmes [EMAIL PROTECTED] wrote:
header('Location: http://www.example.org/script2.php?.SID);

He is human after all. :-)
Chris
=
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming December 2004http://httphandbook.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Help with sessions problem please [SOLVED]

2004-10-14 Thread Graham Cossey
Thanks guys for the help, adding SID to my iframe src solved my immediate
problem.

Am I correct in thinking then that the SID is automatically passed on
relative URLs only within the same browser/[i]frame/window when
use_trans_sid is enabled?

Graham

 -Original Message-
 From: Chris Shiflett [mailto:[EMAIL PROTECTED]
 Sent: 14 October 2004 11:03
 To: Jason Wong; [EMAIL PROTECTED]
 Subject: Re: [PHP] Help with sessions problem please


 --- Jason Wong [EMAIL PROTECTED] wrote:
  Use an absolute URL for header redirects.

 Glad to see someone else preaching the good HTTP gospel. :-)

  You're passing the session id (SID) onto script2 but not to
  script3, if that's the only method by which you're propagating
  the session id then script3 is not going to have a session.

 I think Jason hit the nail on the head with this one, but you might not
 understand the answer. While script3.php might seem to be within
 script2.php, due to the visual layout you're providing with the iframe,
 this is completely independent of the technical implementation, which is
 that each is a separate resource.

 If that's confusing, think of an iframe as a little embedded browser. If
 it fails to properly identify itself (via cookie or URL), then there is no
 existing session to resume. Your call to session_start() will actually
 create a new session every time script3.php is requested.

 Hope that helps.

 Chris

 =
 Chris Shiflett - http://shiflett.org/

 PHP Security - O'Reilly HTTP Developer's Handbook - Sams
 Coming December 2004http://httphandbook.org/

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



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



RE: [PHP] Quick imageSize question

2004-10-14 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 13 October 2004 16:12, Mag wrote:

 Hey,
 
 Dont worry about talking crap, I took that risk when I
 started this thread :-) I was hopeing that maybe the
 image would have the info incoded in it which php
 could read before going through the uploador
 something like that.

Your PHP script doesn't even get started until *after* all file uploads have
been completed, so that line of thought is a complete non-starter.  The only
place you're going to have a chance of checking the image size before it
gets uploaded is in the browser using JavaScript (or an embedded applet in
some other language such as Java).

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Table Creation Time Stamp.....

2004-10-14 Thread Mulley, Nikhil
Hi Guys ,
 
How do we get the time_stamp of a Table creation ,
 
I  know something like this would work ...
 
SHOW TABLE STATUS LIKE 'table name' ; 
 
But How do I get only the column of time stamp column.
 
Thanks,
Nikhil.


RE: [PHP] Table Creation Time Stamp.....

2004-10-14 Thread Jay Blanchard
[snip]
How do we get the time_stamp of a Table creation ,
 
I  know something like this would work ...
 
SHOW TABLE STATUS LIKE 'table name' ; 
 
But How do I get only the column of time stamp column.
[/snip]


There is no specific way to get that column using just a query (just ask
a SQL list). But you could do the query, explode the returned data and
get the right colun from the returned array.

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



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

2004-10-14 Thread bruce
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]


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

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

2004-10-14 Thread Jay Blanchard
[snip]
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..???
[/snip]


This is one place, you can also go to http://www.phpcommunity.org

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



Re: [PHP] .htaccess and .htpasswd

2004-10-14 Thread Afan Pasalic
Thanks but problem is already solved
:)
-afan
Mulley, Nikhil wrote:
Can I know the platform on which you are running apache.
-Original Message-
From: Matthew Sims [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 1:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] .htaccess and .htpasswd

# .htaccess
AuthType Basic
AuthName Restricted Area
AuthUserFile /www/html/path/to/file/admin/.htpasswd
require valid-user
# .htpasswd
Admin:ChqaxtiTH1e0E
Both files are in same directory.
Why it doesn't work?
Can I use as AuthUserFile .htpasswd since they are in the same
directory?
I know its not smart but let's get this working and I'll move .htpasswd
later to upper level :)

-afan

Dude...do you know what mailing list you're on?
http://httpd.apache.org/lists.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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

2004-10-14 Thread bruce
Hi.

We're currently working on a project and need a few php developers to really
ramp up the creation of the application/system. 

We're building an overall system to allow college students to buy/sell used
books online. The systems to support this effort have a number of components
that have to be fleshed out/created. The role of the developer will be to
essentially create the support apps. As a developer, you will be part of the
team, with a sweat equity position. We do not look at this as being a full
time commit, nor do we believe that the initial implementation should take a
great deal of time.

While we could do the development ourselves, we need to greatly accelerate
the process!!

I've intentionally kept this short, as I don't want to abuse the bandwidth.
If you're interested, drop me a line, and we can discuss what we're doing,
and how we're going to get there...

Thanks for reading!

-Bruce Douglas
[EMAIL PROTECTED]



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

[PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread Eric McGrane
Why use the min function?  Just sort the array and then grab the first
element in the sorted array.  No random picking required.

E

Paul [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks guys. Yes I figured using an array and the MIN function would be a
 start.

 Now the random part.




 Boot [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Any help with this would be appreciated.
 
  I am trying to come up with something that will find which variable(s)
 have
  the lowest value and inidicate which variable this is. In the event that
  variables have an equally low value then it is to randomly pick one of
the
  variables and idicate which this is.
 
  I have been able to do this by means of if comparisons but the more I
  variables I add then the more complicated and messy it becomes. There
has
 to
  be a simpler way. If it makes any difference, the variables could just
as
  easily be array elements.
 
  example:
 
  $a = 2
  $b =2
  $c= 4
  $d= 5
  $e=6
  $f =7
 
  the code should determine that $a and $b have the lowest value, and
 randomly
  pick one of them. if $a was = 1 instead then it would just pick $a
 
 
  Thanks for any suggestions!

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



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] Security patch from 4.3.8 to 4.3.9

2004-10-14 Thread Federico Petronio
Jason Wong wrote:
On Thursday 14 October 2004 00:55, Jay Blanchard wrote:
Looking at http://www.php/net/downloads I do not see one.

Maybe that's why the OP asked? Anyway I don't see the reason why one would 
want a patch. Surely bandwidth can't be an issue? And applying a patch would 
most certainly mean taking the webserver offline briefly as would a full 
upgrade.
That's true, but the reason is that I had an issue last time I upgrade 
(from 4.3.4 to 4.4.8), not a big one, but enough to force the rollback 
and retry after analyzing and solving the cause. It was a change in the 
values accepted by open_basedir that triggered my problem.

Well.. that's why I prefer patching to upgrading.
Looking in the CVS I found this, but I am not sure if that is ALL the 
change needed to fix the security bug.

http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.45.2.6r2=1.45.2.7ty=u
Saludos!
Federico Petronio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Security patch from 4.3.8 to 4.3.9

2004-10-14 Thread Federico Petronio
Steve Brown wrote:
Hello, I would like to know if there is a patch just for the security
fix from PHP-4.3.8 to PHP-4.3.9 and where can I found it.

4.3.8 - 4.3.9 is not a security fix, i.e. there are no security holes
closed in 4.3.9.  From the 4.3.9 announce:
PHP Development Team is proud to announce the immediate release of
PHP 4.3.9.  This is a maintenance release that in addition to over 50
non-critical bug fixes, addresses a problem with GPC input
processing.
According to these:
http://secunia.com/advisories/12560/
http://www.securityfocus.com/bid/11334
http://www.securityfocus.com/bid/11190
There are security bugs in 4.3.9 and, at least Secunia, reports that are 
solved in 4.3.9.

the addresses a problem with GPC input processing is related to one of 
the bugs.

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


RE: [PHP] Table Creation Time Stamp.....

2004-10-14 Thread Mulley, Nikhil
 Yeah I did it, But asked for any specic statement , any way Thanks :)

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 5:53 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Table Creation Time Stamp.


[snip]
How do we get the time_stamp of a Table creation ,
 
I  know something like this would work ...
 
SHOW TABLE STATUS LIKE 'table name' ; 
 
But How do I get only the column of time stamp column.
[/snip]


There is no specific way to get that column using just a query (just ask
a SQL list). But you could do the query, explode the returned data and
get the right colun from the returned array.

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

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



[PHP] Knowledgebase/Troubleshooter

2004-10-14 Thread Lee Standen
Hi Guys,
I was wondering if anyone knows of a project for creating a 
troubleshooting wizard, much like in the Microsoft help.  I've managed to 
make something which kind of works myself, but the problem is writing an 
interface to add/remove/add/manage the questions and steps.

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


Re: [PHP] Security patch from 4.3.8 to 4.3.9

2004-10-14 Thread Curt Zirzow
* Thus wrote Federico Petronio:
...
 
 Well.. that's why I prefer patching to upgrading.
 
 Looking in the CVS I found this, but I am not sure if that is ALL the 
 change needed to fix the security bug.
 
 http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.45.2.6r2=1.45.2.7ty=u
 

I'd strongly discourage applying random patches on files. A fix for
a file may be due to a result of another  change elsewhere, which
could potentially cause more problems.


Curt
-- 
Quoth the Raven, Nevermore.

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



[PHP] Re: Knowledgebase/Troubleshooter

2004-10-14 Thread pete M
goto
sourceforge.net
there's tons of stuff there.. No need to reinvent the wheel ;-)))
pete
Lee Standen wrote:
Hi Guys,
I was wondering if anyone knows of a project for creating a 
troubleshooting wizard, much like in the Microsoft help.  I've managed 
to make something which kind of works myself, but the problem is writing 
an interface to add/remove/add/manage the questions and steps.

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


[PHP] PHP 5 compile time configure options

2004-10-14 Thread Don
The link: HYPERLINK
http://www.php.net/manual/en/install.configure.phphttp://www.php.net/manua
l/en/install.configure.php no longer functions.  Where can I get a list of
all the PHP 5 configure options at compile time as well as documentation and
what they do?

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 10/12/2004
 

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



Re: [PHP] PHP 5 compile time configure options

2004-10-14 Thread Jason Wong
On Thursday 14 October 2004 23:24, Don wrote:
 The link: HYPERLINK
 http://www.php.net/manual/en/install.configure.phphttp://www.php.net/manu
a l/en/install.configure.php no longer functions.  Where can I get a list of
 all the PHP 5 configure options at compile time as well as documentation
 and what they do?

  ./configure --help

usually tells you all you need to know. Plus it will always be current and 
specific for whatever version of PHP you happen to be using.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You will always have good luck in your personal affairs.
*/

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



Re: [PHP] PHP 5 compile time configure options

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 11:24:41 -0400, Don [EMAIL PROTECTED] wrote:
 The link: HYPERLINK
 http://www.php.net/manual/en/install.configure.phphttp://www.php.net/manua
 l/en/install.configure.php no longer functions.  Where can I get a list of
 all the PHP 5 configure options at compile time as well as documentation and
 what they do?

./configure --help


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread BOOT
OK thanks but I guess I didn't explain what I am trying to do properly.

I need to be able to identify the variable name as well as pick the variable
with the lowest value.

Something like this:

Whose turn is it to take out the garbage?

Mike has done it 3 times
Bob has done it 2 times
Jane has done it 5 times
etc...

Therefore its Bob's turn.


Eric McGrane [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Why use the min function?  Just sort the array and then grab the first
 element in the sorted array.  No random picking required.

 E

 Paul [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Thanks guys. Yes I figured using an array and the MIN function would be
a
  start.
 
  Now the random part.
 
 
 
 
  Boot [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   Any help with this would be appreciated.
  
   I am trying to come up with something that will find which variable(s)
  have
   the lowest value and inidicate which variable this is. In the event
that
   variables have an equally low value then it is to randomly pick one of
 the
   variables and idicate which this is.
  
   I have been able to do this by means of if comparisons but the more I
   variables I add then the more complicated and messy it becomes. There
 has
  to
   be a simpler way. If it makes any difference, the variables could just
 as
   easily be array elements.
  
   example:
  
   $a = 2
   $b =2
   $c= 4
   $d= 5
   $e=6
   $f =7
  
   the code should determine that $a and $b have the lowest value, and
  randomly
   pick one of them. if $a was = 1 instead then it would just pick $a
  
  
   Thanks for any suggestions!

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



Re: [PHP] Image upload not working correctly

2004-10-14 Thread Dave Grant
Thanks for the reponse.  Yes, the destination paths look fine and the PHP 
error log displays no errors.  Any other ideas?

Thanks.


Jason Wong [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Thursday 14 October 2004 02:40, Dave Grant wrote:

 echo Thumb image uploaded to .$thumbPath.br /\n;
 echo Full image uploaded to .$fullPath.br /\n;

 Do these look OK?

 Everything works fine, except that the images are simply not there when 
 we
 go look for them.  The best explanation I can come up with is that they 
 are
 not moved, but I have no idea why.  I've done this with no problem on my
 personal site.  Is it a problem with the move_uploaded_file function? 
 Any
 ideas?

 What does the PHP error log say?

 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Faith goes out through the window when beauty comes in at the door.
 */ 

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



Re: [PHP] Image upload not working correctly

2004-10-14 Thread Dave Grant
Just to clarify, everything looks like it works fine except for moving the 
images to the destination path.  The images upload, the server recognizes 
them, but they don't get moved to the destination path.

Thanks.


Jason Wong [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Thursday 14 October 2004 02:40, Dave Grant wrote:

 echo Thumb image uploaded to .$thumbPath.br /\n;
 echo Full image uploaded to .$fullPath.br /\n;

 Do these look OK?

 Everything works fine, except that the images are simply not there when 
 we
 go look for them.  The best explanation I can come up with is that they 
 are
 not moved, but I have no idea why.  I've done this with no problem on my
 personal site.  Is it a problem with the move_uploaded_file function? 
 Any
 ideas?

 What does the PHP error log say?

 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Faith goes out through the window when beauty comes in at the door.
 */ 

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



Re: [PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread Matt M.
On Thu, 14 Oct 2004 10:52:20 -0500, BOOT [EMAIL PROTECTED] wrote:
 OK thanks but I guess I didn't explain what I am trying to do properly.
 
 I need to be able to identify the variable name as well as pick the variable
 with the lowest value.
 
 Something like this:
 
 Whose turn is it to take out the garbage?
 
 Mike has done it 3 times
 Bob has done it 2 times
 Jane has done it 5 times
 etc...
 
 Therefore its Bob's turn.


$arr['Mike'] = 3;
$arr['Bob'] = 2;
$arr['Jane'] = 5;

foreach ($arr as $key = $value) {
echo $key.' has done it '.$value.' timesbr /';
}
asort($arr);
print 'It is '.key($arr).'\'s turn';

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



Re: [PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread ApexEleven
/* Untested Code */

$arr[0]['id'] = 3;
$arr[0]['name] = 'Mike';
$arr[1]['id'] = 2;
$arr[1]['name'] = 'Bob';
$arr[2]['id'] = 5;
$arr[2]['name'] = 'Jane';

array_multisort($arr['id'],$arr['name']);

print It's .$arr[0]['name'].'s Turn To Take Out The Garbage!;

/* End Untested Code */


On Thu, 14 Oct 2004 11:26:56 -0500, Matt M. [EMAIL PROTECTED] wrote:
 On Thu, 14 Oct 2004 10:52:20 -0500, BOOT [EMAIL PROTECTED] wrote:
  OK thanks but I guess I didn't explain what I am trying to do properly.
 
  I need to be able to identify the variable name as well as pick the variable
  with the lowest value.
 
  Something like this:
 
  Whose turn is it to take out the garbage?
 
  Mike has done it 3 times
  Bob has done it 2 times
  Jane has done it 5 times
  etc...
 
  Therefore its Bob's turn.
 
 
 $arr['Mike'] = 3;
 $arr['Bob'] = 2;
 $arr['Jane'] = 5;
 
 foreach ($arr as $key = $value) {
echo $key.' has done it '.$value.' timesbr /';
 }
 asort($arr);
 print 'It is '.key($arr).'\'s turn';
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



[PHP] dbm choices - advice?

2004-10-14 Thread Jed R. Brubaker
Hi all - I am looking at using a dbm-style cache system and was wondering if 
anyone has any recommendations from the plethora of systems listed here:
http://us2.php.net/manual/en/ref.dba.php
Is there a favorite?

I know if probably depends on what I want to do, so in short, I am looking 
to create a temporary table that will be a composite of a ton of MySQL 
queries (hence the reason I am not just querying). I have thought about just 
creating a new database table to push my query results into, but I would 
love to make it faster if possible. Am I hopelessly misguided?

I would love any feedback! 

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



Re: [PHP] Re: Determine variable with the lowest value?

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 10:52:20 -0500, BOOT [EMAIL PROTECTED] wrote:
 OK thanks but I guess I didn't explain what I am trying to do properly.
 
 I need to be able to identify the variable name as well as pick the variable
 with the lowest value.
 
 Something like this:
 
 Whose turn is it to take out the garbage?
 
 Mike has done it 3 times
 Bob has done it 2 times
 Jane has done it 5 times
 etc...
 
 Therefore its Bob's turn.

$a = array(3 = 'Mike', 2 = 'Bob', 5 = 'Jane');
sort($a);
echo $a[0];


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] dbm choices - advice?

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 10:46:02 -0600, Jed R. Brubaker
[EMAIL PROTECTED] wrote:
 Hi all - I am looking at using a dbm-style cache system and was wondering if
 anyone has any recommendations from the plethora of systems listed here:
 http://us2.php.net/manual/en/ref.dba.php
 Is there a favorite?
 
 I know if probably depends on what I want to do, so in short, I am looking
 to create a temporary table that will be a composite of a ton of MySQL
 queries (hence the reason I am not just querying). I have thought about just
 creating a new database table to push my query results into, but I would
 love to make it faster if possible. Am I hopelessly misguided?
 
 I would love any feedback!

Sounds like you want views and functions.  Postgres has those.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] User Defined Forms

2004-10-14 Thread Shaun
Hi,

I am creating a site where users record details of their clients and record
their progress. The whole point of the system is to reduce the amount of
paper work and store everything online.

The problem here is that each user will have their own forms to fill in on
their clients, some will record different data to others and some will have
more forms than others. Therefore I believe I am correct in saying this
would be impossible to store in a database as each user would require their
own fields etc. One other solution I have thought of is to have each user
create a set of PDF forms when they sign up and each time they fill one in
they upload it to the server for storage.

I would be most grateful for anyone's input on this before I dive in head
first!

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



RE: [PHP] User Defined Forms

2004-10-14 Thread Jay Blanchard
[snip]
I am creating a site where users record details of their clients and
record
their progress. The whole point of the system is to reduce the amount of
paper work and store everything online.
[/snip]


How much time have you spent with the users? How well do you understand
their needs? Have you done a flowchart or any other modeling?

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



[PHP] intenger

2004-10-14 Thread Juan Pablo Herrera
Please, i need output a intenger, what function can i use for this?.
Print?, echo?

Thank you.
JP

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



Re: [PHP] User Defined Forms

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 18:01:48 +0100, Shaun [EMAIL PROTECTED] wrote:
 I am creating a site where users record details of their clients and record
 their progress. The whole point of the system is to reduce the amount of
 paper work and store everything online.

Like project management?  Know about Dotproject and it's many plugins
and add-ons?

http://www.dotproject.net/

 The problem here is that each user will have their own forms to fill in on
 their clients, some will record different data to others and some will have
 more forms than others. Therefore I believe I am correct in saying this
 would be impossible to store in a database as each user would require their

Anything can be stored in a database.  You can have tables like:
forms, users, and fields.  forms relate to users, and fields relate to
forms.

 own fields etc. One other solution I have thought of is to have each user
 create a set of PDF forms when they sign up and each time they fill one in
 they upload it to the server for storage.
 
 I would be most grateful for anyone's input on this before I dive in head
 first!


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] User Defined Forms

2004-10-14 Thread bbonkosk
Create some format to store the info for the form contents...

like off the top of my head...
TEXT:Name:20:RADIO:Sex:Option1:Option2:CHECKBOX:State:Option1:Option2:...:PASSWORD:Password:20:
Just an example, but doable to store in a database, then you create parsing functions 
to handle this string

You can also search for form automation, or form abstraction, or creation on 
google/sourceforge/freshmeat/etc... to see what turns up...

- Original Message -
From: Shaun [EMAIL PROTECTED]
Date: Thursday, October 14, 2004 1:01 pm
Subject: [PHP] User Defined Forms

 Hi,
 
 I am creating a site where users record details of their clients 
 and record
 their progress. The whole point of the system is to reduce the 
 amount of
 paper work and store everything online.
 
 The problem here is that each user will have their own forms to 
 fill in on
 their clients, some will record different data to others and some 
 will have
 more forms than others. Therefore I believe I am correct in saying 
 thiswould be impossible to store in a database as each user would 
 require their
 own fields etc. One other solution I have thought of is to have 
 each user
 create a set of PDF forms when they sign up and each time they 
 fill one in
 they upload it to the server for storage.
 
 I would be most grateful for anyone's input on this before I dive 
 in head
 first!
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] User Defined Forms

2004-10-14 Thread Shaun

Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I am creating a site where users record details of their clients and
record
their progress. The whole point of the system is to reduce the amount of
paper work and store everything online.
[/snip]


How much time have you spent with the users? How well do you understand
their needs? Have you done a flowchart or any other modeling?

Hi Jay,

I have interviewed a few users and it has become instantly apparent that
they all work differently and record slightly different information about
their clients making it impossible to produce a general set of forms that
would encompass all users. I haven't done any other forms of modelling as
yet.

Thanks for your help

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



Re: [PHP] Re: Knowledgebase/Troubleshooter

2004-10-14 Thread Lee Standen
Thanks Pete,
I've already spent about 45 minutes trying to find a project which does 
this, to no avail...


On Thu, 14 Oct 2004, pete M wrote:
goto
sourceforge.net
there's tons of stuff there.. No need to reinvent the wheel ;-)))
pete
Lee Standen wrote:
Hi Guys,
I was wondering if anyone knows of a project for creating a troubleshooting 
wizard, much like in the Microsoft help.  I've managed to make something 
which kind of works myself, but the problem is writing an interface to 
add/remove/add/manage the questions and steps.

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

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


Re: [PHP] intenger

2004-10-14 Thread bbonkosk
Start here...
http://us2.php.net/manual/en/language.types.php

- Original Message -
From: Juan Pablo Herrera [EMAIL PROTECTED]
Date: Thursday, October 14, 2004 1:19 pm
Subject: [PHP] intenger

 Please, i need output a intenger, what function can i use for this?.
 Print?, echo?
 
 Thank you.
 JP
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] intenger

2004-10-14 Thread John Nichel
Juan Pablo Herrera wrote:
Please, i need output a intenger, what function can i use for this?.
Print?, echo?
Thank you.
JP
Why not try them both, and see which one works.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] include()ing into a variable

2004-10-14 Thread Mag
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
variable like this:

$a=include(th-file.php);

Will this give me any extra problems later on? or is
this resource intensive?

The reason I am doing this is because I want to put
whole pages into a variable then write the contents of
the variable to a static html file...

eg:
$a=include(header.php);
$a .= all the results from my database queries and
calcalutions etc here;
$a .= include footer.php;
-fopen and write $a to newfile: something.html


Thats the idea anyway this is the first time I am
experimenting with this approach, so I want to know is
this legal in php and if I should be expecting any
problems. The final pages to output can be around 100k
I guess and I will be outputting every 3-60 mins.

Thanks,
Mag


=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Re: [PHP] intenger

2004-10-14 Thread Dan Joseph
 Please, i need output a intenger, what function can i use for this?.
 Print?, echo?

$i = 12;

echo $i;

-Dan Joseph

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



RE: [PHP] intenger

2004-10-14 Thread Ed Lazor
Do you mean an integer?  As in

$i = 5;

Print $i;

?

 

 -Original Message-
 From: Juan Pablo Herrera [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, October 14, 2004 10:19 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] intenger
 
 Please, i need output a intenger, what function can i use for this?.
 Print?, echo?
 
 Thank you.
 JP
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP] User Defined Forms

2004-10-14 Thread Ed Lazor
 I have interviewed a few users and it has become instantly 
 apparent that
 they all work differently and record slightly different 
 information about
 their clients making it impossible to produce a general set 
 of forms that
 would encompass all users. I haven't done any other forms of 
 modelling as
 yet.

Create a global list of information that your users want to record about
their clients.  Review it and generalize information as much as possible.
Divide the information into groups based on who uses it.  Hopefully you'll
end up with sets of information that are common to all with only a few sets
that are user specific.  Work with your customers a lot here, because it
sounds like they are generally confused on how to organize their
information.  Ie. They are relying on your help for that.  Also keep in mind
that, in many cases, there is general information that everyone wants to
record about their clients and that anything else is usually considered
notes.  So, for example, if you create a table for the client's name,
address, phone, etc. and then create a notes section, you've captured a
majority of the information that your users want to track for their clients.

Ultimately, after all of that and if someone's willing to pay for the
development time, you could theoretically setup a series of forms where the
first form prompts for general detail and then, based on who's logged in,
you could present additional forms.  You could even design the logic behind
forms to respond based on information that's entered.  For example, if the
first form asks for the client's city, follow-up forms may prompt for data
specific to that city.

Hope this helps,

-Ed

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



RE: [PHP] User Defined Forms

2004-10-14 Thread Graham Cossey
I think the problem here will be in the database design.

You certainly could store PDFs or the like, but then someone is going to
want to run queries, produce reports, make updates etc etc.

The problem (I think) is to come up with a db design that is not fixed to a
given form structure. Using the relational model this is going to be tricky.
I'm sure someone somewhere has done something along these lines but to what
level of success I've no idea. I have (in the past) been involved with
non-relational data models that could possibly overcome the db design issue,
but you are then looking at having to use technologies that are maybe new to
you and possibly costly. For example using Java/XSLT with a non-open source
database server. However, having said all that the PHP-General mailing list
is probably not the place to be discussing this.

Graham

 -Original Message-
 From: Shaun [mailto:[EMAIL PROTECTED]
 Sent: 14 October 2004 18:23
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] User Defined Forms



 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 [snip]
 I am creating a site where users record details of their clients and
 record
 their progress. The whole point of the system is to reduce the amount of
 paper work and store everything online.
 [/snip]


 How much time have you spent with the users? How well do you understand
 their needs? Have you done a flowchart or any other modeling?

 Hi Jay,

 I have interviewed a few users and it has become instantly apparent that
 they all work differently and record slightly different information about
 their clients making it impossible to produce a general set of forms that
 would encompass all users. I haven't done any other forms of modelling as
 yet.

 Thanks for your help

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



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



Re: [PHP] User Defined Forms

2004-10-14 Thread Shaun

Ed Lazor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  I have interviewed a few users and it has become instantly
  apparent that
  they all work differently and record slightly different
  information about
  their clients making it impossible to produce a general set
  of forms that
  would encompass all users. I haven't done any other forms of
  modelling as
  yet.

 Create a global list of information that your users want to record about
 their clients.  Review it and generalize information as much as possible.
 Divide the information into groups based on who uses it.  Hopefully you'll
 end up with sets of information that are common to all with only a few
sets
 that are user specific.  Work with your customers a lot here, because it
 sounds like they are generally confused on how to organize their
 information.  Ie. They are relying on your help for that.  Also keep in
mind
 that, in many cases, there is general information that everyone wants to
 record about their clients and that anything else is usually considered
 notes.  So, for example, if you create a table for the client's name,
 address, phone, etc. and then create a notes section, you've captured a
 majority of the information that your users want to track for their
clients.

 Ultimately, after all of that and if someone's willing to pay for the
 development time, you could theoretically setup a series of forms where
the
 first form prompts for general detail and then, based on who's logged in,
 you could present additional forms.  You could even design the logic
behind
 forms to respond based on information that's entered.  For example, if the
 first form asks for the client's city, follow-up forms may prompt for data
 specific to that city.

 Hope this helps,

 -Ed

Hi Ed,

User data like name age address etc will probably apply to all cases but
that is where it will end. The site is intended for use by Personal Trainers
and each personal trainer has their own way of recording information,
creating programs for gym users etc...

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



Re: [PHP] include()ing into a variable

2004-10-14 Thread ApexEleven
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.


On Thu, 14 Oct 2004 10:35:15 -0700 (PDT), Mag [EMAIL PROTECTED] wrote:
 Hi,
 I have never done this before (but in my first test it
 seems to work), I am include()ing a file into a
 variable like this:
 
 $a=include(th-file.php);
 
 Will this give me any extra problems later on? or is
 this resource intensive?
 
 The reason I am doing this is because I want to put
 whole pages into a variable then write the contents of
 the variable to a static html file...
 
 eg:
 $a=include(header.php);
 $a .= all the results from my database queries and
 calcalutions etc here;
 $a .= include footer.php;
 -fopen and write $a to newfile: something.html
 
 Thats the idea anyway this is the first time I am
 experimenting with this approach, so I want to know is
 this legal in php and if I should be expecting any
 problems. The final pages to output can be around 100k
 I guess and I will be outputting every 3-60 mins.
 
 Thanks,
 Mag
 
 =
 --
 - The faulty interface lies between the chair and the keyboard.
 - Creativity is great, but plagiarism is faster!
 - Smile, everyone loves a moron. :-)
 
 ___
 Do you Yahoo!?
 Declare Yourself - Register online to vote today!
 http://vote.yahoo.com
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



RE: [PHP] include()ing into a variable

2004-10-14 Thread Jesse Castro

[snip]
$a=include(th-file.php);
[/snip]

Mag,

I have never seen this approach before.
This is the way I would do something like 
that.


$file=./th-file.php;
if (!($fp = fopen($file,r))){
echo Could not open .$file;
exit();
}
$a = fread($fp, filesize($file));
fclose($fp);

See the following page for reference:
http://us2.php.net/manual/en/function.fopen.php

Cheers,
-jesse-

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



Re: [PHP] include()ing into a variable

2004-10-14 Thread Curt Zirzow
* Thus wrote Mag:
 Hi,
 I have never done this before (but in my first test it
 seems to work), I am include()ing a file into a
 variable like this:
 
 $a=include(th-file.php);
 
 Will this give me any extra problems later on? or is
 this resource intensive?
 
 The reason I am doing this is because I want to put
 whole pages into a variable then write the contents of
 the variable to a static html file...

Writing everything to a variable doesn't make much sense to me, I'd
write a little wrapper for Output Buffering  to use:

class SaveToFile {
  function open($file)  {
//open file...
  }
  function write($buf) {
//write to file...
  }
  function close() {
//close file
  }
}
$obSaveFile = new SaveToFile();
$obSaveFile-open('/path/to/file.html');
ob_start(array($obSaveFile, 'save'), 1024);

/* do your stuff  here */

ob_end_flush();
$obSaveFile-close();


Curt
-- 
Quoth the Raven, Nevermore.

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



[PHP] new connection with pg_pconnect

2004-10-14 Thread Jonathan Villa
I'm trying to add some new features to an existing project.  The project
uses pg_pconnect and sets it into a global var...

What I'm trying to do is to create a new database class which connects to
a different database on the same server.  By the time my code gets
reached, the pg_pconnect global var $conn has already been initialized.

When I try :

$dbconn = pg_pconnect(connections vars);

nothing happens...no errors, nothing... as a matter of fact if I do a few
echo sadfsadf;
echo cn48c43vc;
or even syntax errors

echo dsafdds;

nothing will happen... no errors are outputted to the screen at
all...(this is not my issue)

I'm assuming that I need to close the persistent connection before I can
open a new one, but from my understanding, persistent connections cannot
be closed...

Is the persistent connection open only to the database in which it was
opened for?  How can I choose a different database?

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



[PHP] Referring Page

2004-10-14 Thread Ben
I am trying to set up a script that will do different things based on the 
reffering page, without having to include the information in the URL.  Does 
PHP have a built in variable or function that would tell the rest of the 
script what page the user came from?  Any help is much appreciated.

Ben

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



RE: [PHP] intenger

2004-10-14 Thread Jay Blanchard
[snip]
Do you mean an integer?  As in

$i = 5;

Print $i;

?
[/snip]

That would be the one(1)

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



Re: [PHP] Tutorials for Maintenance of State

2004-10-14 Thread GH
I found it interesting... you did a good job. 

However I am running confused laps in my brain on what do I do to
actually set it up...  I know about sessions... but I am even more
concerened now about the use of cookies but I am not 100% sure on how
to accomplish this

when I was dabbling in ColdFusion a few years ago... this was my main
co(ld)nfusion...  I know i am probably rambiling so

Any advice or starting points would be great



On Tue, 12 Oct 2004 14:12:37 -0700 (PDT), Chris Shiflett
[EMAIL PROTECTED] wrote:
 
 
 --- GH [EMAIL PROTECTED] wrote:
  I would like to know if someone out there has or knows of a tutorial
  on Maintenance of State that allows only users who have logged in to
  successfully visit view pages?
 
 You might find this helpful, if I'm interpreting your question correctly:
 
 http://shiflett.org/articles/the-truth-about-sessions
 
 Hope that helps.
 
 Chris
 
 =
 Chris Shiflett - http://shiflett.org/
 
 PHP Security - O'Reilly HTTP Developer's Handbook - Sams
 Coming December 2004http://httphandbook.org/


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



Re: [PHP] include()ing into a variable

2004-10-14 Thread Simas Toleikis
ApexEleven wrote:
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.
If you use *return* on global scope in include file that value will be 
returned to $a.

-- test.php --
$test = Hello;
return $test;
-
$a = include test.php;
// $a is Hello now
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] include()ing into a variable

2004-10-14 Thread Gerard Samuel
Mag wrote:
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
variable like this:
$a=include(th-file.php);
Will this give me any extra problems later on? or is
this resource intensive?
I've seen other people do something similar to this,
but if you look at the documentation, include doesnt return data, it 
just evaluates the file.
My personal opinion is to find another way to do what you want, because, 
not all setups will work as you may expect.
Maybe look along the lines of ob_get_contents() 
http://us2.php.net/manual/en/function.ob-get-contents.php

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


Re: [PHP] User Defined Forms

2004-10-14 Thread Dan Joseph
   I have interviewed a few users and it has become instantly
   apparent that
   they all work differently and record slightly different
   information about
   their clients making it impossible to produce a general set
   of forms that
   would encompass all users. I haven't done any other forms of
   modelling as
   yet.
 
 User data like name age address etc will probably apply to all cases but
 that is where it will end. The site is intended for use by Personal Trainers
 and each personal trainer has their own way of recording information,
 creating programs for gym users etc...

Kind of sounds like you need to develop a form builder for them to
customize their forms.  You'd want to make a table that holds the name
and type for each field.  Then you'd want to make a table that would
house the fields each form wants to include.  A final table that would
hold the name of the form, and the user who has rights to use it. 
This doesn't sound real difficult, but time consuming.

Does that make sense?

-Dan Joseph

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



RE: [PHP] Referring Page

2004-10-14 Thread Pablo Gosse
[snip]
 I am trying to set up a script that will do different things based on
 the reffering page, without having to include the information in the
 URL.  Does PHP have a built in variable or function that would tell
 the rest of the script what page the user came from?  Any help is
 much appreciated. 
[/snip]

http://ca3.php.net/manual/en/reserved.variables.php#reserved.variables.s
erver

But be warned, they're not that reliable as some firewalls block/muck
with them, and they can also be easily spoofed.

Cheers,
Pablo

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



Re: [PHP] Referring Page

2004-10-14 Thread Jonathan Villa

$referrer = $_SERVER['REFFERER'];
something like that...

then you can do something like

if ($referrer == 'whatever')
$sdaf = whatever;

I usually do something like

if (strpos($referrer,'pagename.php'))
  //execute code


 I am trying to set up a script that will do different things based on
the reffering page, without having to include the information in the
URL. Does
 PHP have a built in variable or function that would tell the rest of the
script what page the user came from?  Any help is much appreciated.

 Ben

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



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



Re: [PHP] Referring Page

2004-10-14 Thread bbonkosk
Yes,
write a script with: 
?php
phpinfo();
?
and you will find all the wonderous variables at your disposal...
-B

- Original Message -
From: Ben [EMAIL PROTECTED]
Date: Thursday, October 14, 2004 3:37 pm
Subject: [PHP] Referring Page

 I am trying to set up a script that will do different things based 
 on the 
 reffering page, without having to include the information in the 
 URL.  Does 
 PHP have a built in variable or function that would tell the rest 
 of the 
 script what page the user came from?  Any help is much appreciated.
 
 Ben
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



RE: [PHP] new connection with pg_pconnect

2004-10-14 Thread Pablo Gosse
[snip]
I'm trying to add some new features to an existing project.  The project
uses pg_pconnect and sets it into a global var...

What I'm trying to do is to create a new database class which connects
to a different database on the same server.  By the time my code gets
reached, the pg_pconnect global var $conn has already been initialized.

...

Is the persistent connection open only to the database in which it was
opened for?  How can I choose a different database?
[/snip]

Yes, a persistent connection will only be used when all the connection
parameters are the same.  Ergo a new database requires a new connection.

That said, I would also like to point out that there is a bug which can
be found with php and persistent postgres connections.

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

The solution is to use non-persistent connections.

I'd had a problem over the past few months wherein users of my CMS were
getting logged out for no reason, and yesterday I was finally able to
trace it to this.

Switched to non-persistent connections and not one error has occurred
since, so this might be something to keep in mind.

Cheers and HTH,

Pablo

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



Re: [PHP] Referring Page

2004-10-14 Thread Matt M.
 I am trying to set up a script that will do different things based on the
 reffering page, without having to include the information in the URL.  Does
 PHP have a built in variable or function that would tell the rest of the
 script what page the user came from?  Any help is much appreciated.

there is $_SERVER['HTTP_REFERER']

but it is unreliable

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



[PHP] PHP 5.02 and Fedora Core 2 Installation question

2004-10-14 Thread Don
Has anyone had any luck installing  with the --with-imap configuration
option.  IMAP doesn't seem to be installed (nor imap-devel) and the c
library specified in the docs at php.net does not compile.
 
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.776 / Virus Database: 523 - Release Date: 10/12/2004
 

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



Re: [PHP] Referring Page

2004-10-14 Thread John Nichel
Ben wrote:
I am trying to set up a script that will do different things based on the 
reffering page, without having to include the information in the URL.  Does 
PHP have a built in variable or function that would tell the rest of the 
script what page the user came from?  Any help is much appreciated.

Ben
Ah, in the manual
http://us2.php.net/reserved.variables
Don't rely on it.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Referring Page

2004-10-14 Thread John Nichel
Jonathan Villa wrote:
$referrer = $_SERVER['REFFERER'];
Will return nothing.
$_SERVER['HTTP_REFERER']
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] include()ing into a variable

2004-10-14 Thread Mag
Hi Curt,
Thanks for replying.


 class SaveToFile {
   function open($file)  {
 //open file...
   }
   function write($buf) {
 //write to file...
   }
   function close() {
 //close file
   }
 }
 $obSaveFile = new SaveToFile();
 $obSaveFile-open('/path/to/file.html');
 ob_start(array($obSaveFile, 'save'), 1024);
 
 /* do your stuff  here */
 
 ob_end_flush();
 $obSaveFile-close();


Problem is, I have not really learnt classes as yet, I
know how to use them but I really have no idea as to
how to make them. Looking at your above code I see you
are calling open() and close() of the class but not
write() is that a mistake or just my lack of
understanding of classes? (No idea what this:
$obSaveFile 
means either)
Also I have heard that outbuffering can be quite
complicated, would you mind filling in your example a
bit more and I can make add to it and work from there?

Thanks,
Mag

=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Re: [PHP] Referring Page

2004-10-14 Thread Jonathan Villa
 I am trying to set up a script that will do different things based on
 the
 reffering page, without having to include the information in the URL.
 Does
 PHP have a built in variable or function that would tell the rest of the
 script what page the user came from?  Any help is much appreciated.

 there is $_SERVER['HTTP_REFERER']

 but it is unreliable


Can I ask why?

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



Re: [PHP] Referring Page

2004-10-14 Thread Jonathan Villa
Can't be put any more plainly than that, thanks...




 Ben wrote:
 I am trying to set up a script that will do different things based on
 the
 reffering page, without having to include the information in the URL.
 Does
 PHP have a built in variable or function that would tell the rest of the
 script what page the user came from?  Any help is much appreciated.

 Ben


 Ah, in the manual

 http://us2.php.net/reserved.variables

 Don't rely on it.

 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]

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



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



Re: [PHP] new connection with pg_pconnect

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 14:30:18 -0500 (CDT), Jonathan Villa [EMAIL PROTECTED] wrote:
 I'm assuming that I need to close the persistent connection before I can
 open a new one, but from my understanding, persistent connections cannot
 be closed...

That is true for all persistant db connection functions, pg_pconnect,
mysql_pconnect, etc.

http://www.php.net/manual/en/features.persistent-connections.php is a
pretty good read.

 Is the persistent connection open only to the database in which it was
 opened for?  How can I choose a different database?

For Postgres you have to create a new (2nd) connection, since the
database is selected when the connection occurs.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Referring Page

2004-10-14 Thread Jonathan Villa

*typo

 Jonathan Villa wrote:
 $referrer = $_SERVER['REFFERER'];

 Will return nothing.

 $_SERVER['HTTP_REFERER']


 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]

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



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



RE: [PHP] Referring Page

2004-10-14 Thread Ben Miller
Thanks all.  That did it perfectly.

-Original Message-
From: Matt M. [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 2:21 PM
To: Ben
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Referring Page


 I am trying to set up a script that will do different things based on the
 reffering page, without having to include the information in the URL.
Does
 PHP have a built in variable or function that would tell the rest of the
 script what page the user came from?  Any help is much appreciated.

there is $_SERVER['HTTP_REFERER']

but it is unreliable

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

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



Re: [PHP] Image upload not working correctly

2004-10-14 Thread Jason Wong
Please do not top-post.

On Thursday 14 October 2004 23:52, Dave Grant wrote:
 Thanks for the reponse.  Yes, the destination paths look fine and the PHP
 error log displays no errors.  Any other ideas?

move_uploaded_file() _will_ spit out an error if there are any problems. So if 
you're _positive_ FULL error reporting is enabled  logged and the error log 
shows nothing then I would be inclined to assume that the 
move_uploaded_file() operation was executed successfully. In that case, are 
you positive you're looking in the correct place for the destination file?

If you're still having problems, post some self-contained, concise[1] code to 
illustrate your problem.

[1] concise meaning the bare minimum, eg in your case code to handle either 
thumb image or full image but not both, etc.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The Heineken Uncertainty Principle:
You can never be sure how many beers you had last night.
*/

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



Re: [PHP] Referring Page

2004-10-14 Thread Greg Donald
On Thu, 14 Oct 2004 16:47:08 -0400, John Nichel [EMAIL PROTECTED] wrote:
 Will return nothing.
 
 $_SERVER['HTTP_REFERER']

Just an FYI..  Some versions of IE do not report this info.  And some
of the newer home firewall software applications scrub it out under
the guise of privacy, Norton Personal Firewall for example.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Referring Page

2004-10-14 Thread Jason Wong
On Friday 15 October 2004 05:03, Jonathan Villa wrote:
  there is $_SERVER['HTTP_REFERER']
 
  but it is unreliable

 Can I ask why?

archives.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A shapely CATHOLIC SCHOOLGIRL is FIDGETING inside my costume..
*/

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



Re: [PHP] Referring Page

2004-10-14 Thread Matt M.
  I am trying to set up a script that will do different things based on
  the
  reffering page, without having to include the information in the URL.
  Does
  PHP have a built in variable or function that would tell the rest of the
  script what page the user came from?  Any help is much appreciated.
 
  there is $_SERVER['HTTP_REFERER']
 
  but it is unreliable
 
 
 Can I ask why?

 
not sure if you are asking me, but like someone already said in this
thread But be warned, they're not that reliable as some firewalls
block/muck with them, and they can also be easily spoofed.

I also even turn them off when I am using mozilla/firefox.  

Just not a reliable variable

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



RE: [PHP] new connection with pg_pconnect

2004-10-14 Thread Jonathan Villa
 [snip]
 I'm trying to add some new features to an existing project.  The project
 uses pg_pconnect and sets it into a global var...

 What I'm trying to do is to create a new database class which connects
 to a different database on the same server.  By the time my code gets
 reached, the pg_pconnect global var $conn has already been initialized.

 ...

 Is the persistent connection open only to the database in which it was
 opened for?  How can I choose a different database?
 [/snip]

 Yes, a persistent connection will only be used when all the connection
 parameters are the same.  Ergo a new database requires a new connection.

 That said, I would also like to point out that there is a bug which can
 be found with php and persistent postgres connections.

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

 The solution is to use non-persistent connections.

 I'd had a problem over the past few months wherein users of my CMS were
 getting logged out for no reason, and yesterday I was finally able to
 trace it to this.

 Switched to non-persistent connections and not one error has occurred
 since, so this might be something to keep in mind.

 Cheers and HTH,

 Pablo


thanks for help...

I mentioned something in my original post, and it seems that it is a
problem...

there's the structure of my page

app-config.inc is prepended via apache
within app-config.inc there is a another file included which does the
initial persistent db calls and such.

I then have the page main.php which has

?php
global $sys_dbhost,$sys_dbuser,$sys_dbpasswd;
$dbconn = pg_connect(user=$sys_dbuser dbname=bisprojects host=$sys_dbhost
password=$sys_dbpasswd);
echo '-'.$dbconn.'-';
?

the scripts just dies whenever I include the pg_connect function... if I
change

echo '-'.$dbconn.'-';
to
echo '-==='.$dbconn.'-';

I'll still see -- on my page
if I remove the pg_connect function, I'll see
-===-;

Basically, no changes to the page take effect when I have the pg_connect
function in place... it just dies or something...

here are the versions  of php, apache, and postgresql I'm running...

Server: Red Hat Linux Advanced Server release 2.1AS
php-pgsql-4.1.2-2.1.6
php-manual-4.1.2-2.1.6
asp2php-gtk-0.75.17-1
php-mysql-4.1.2-2.1.6
php-devel-4.1.2-2.1.6
php-imap-4.1.2-2.1.6
php-odbc-4.1.2-2.1.6
php-ldap-4.1.2-2.1.6
asp2php-0.75.17-1
php-4.1.2-2.1.6
apacheconf-0.8.1-1
apache-manual-1.3.27-6.ent
apache-1.3.27-6.ent
apache-devel-1.3.27-6.ent
postgresql-python-7.1.3-5.rhel2.1AS
postgresql-tcl-7.1.3-5.rhel2.1AS
postgresql-server-7.1.3-5.rhel2.1AS
postgresql-libs-7.1.3-5.rhel2.1AS
postgresql-devel-7.1.3-5.rhel2.1AS
postgresql-contrib-7.1.3-5.rhel2.1AS
postgresql-jdbc-7.1.3-5.rhel2.1AS
postgresql-tk-7.1.3-5.rhel2.1AS
postgresql-7.1.3-5.rhel2.1AS
postgresql-perl-7.1.3-5.rhel2.1AS
postgresql-docs-7.1.3-5.rhel2.1AS
postgresql-odbc-7.1.3-5.rhel2.1AS

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



RE: [PHP] new connection with pg_pconnect

2004-10-14 Thread Pablo Gosse
[snip]
I then have the page main.php which has

?php
global $sys_dbhost,$sys_dbuser,$sys_dbpasswd;
$dbconn = pg_connect(user=$sys_dbuser dbname=bisprojects
host=$sys_dbhost password=$sys_dbpasswd); echo '-'.$dbconn.'-'; ?

the scripts just dies whenever I include the pg_connect function... if I
change

echo '-'.$dbconn.'-';
to
echo '-==='.$dbconn.'-';

I'll still see -- on my page
if I remove the pg_connect function, I'll see
-===-;

Basically, no changes to the page take effect when I have the pg_connect
function in place... it just dies or something...
[/snip]

Hmmm, strange.

I used your code, exactly as it is above (but with my username,
password, db and server info) and it works fine.

Check your error logs and see if there's anything showing up there and
let us know what you find.

Pablo

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



Re: [PHP] include()ing into a variable

2004-10-14 Thread Curt Zirzow
* Thus wrote Mag:
 Hi Curt,
 Thanks for replying.
 
  $obSaveFile = new SaveToFile();
  $obSaveFile-open('/path/to/file.html');
  ob_start(array($obSaveFile, 'save'), 1024);
  
  /* do your stuff  here */
  
  ob_end_flush();
  $obSaveFile-close();
 
 
 Problem is, I have not really learnt classes as yet, I
 know how to use them but I really have no idea as to
 how to make them. Looking at your above code I see you
 are calling open() and close() of the class but not
 write() is that a mistake or just my lack of
 understanding of classes? (No idea what this:
 $obSaveFile 
 means either)

Oops, yeah the ob_start should have been:
  ob_start(array($obSaveFile, 'write'), 1024);

The $ in $obSaveFile uses a reference instead of a copy of the
object (an old php4 trick, see more on references)

What will happen is anytime PHP's output buffer decides to write
the contents of the buffer, in this case I told it to do it when
ever 1024 bytes where collected, it will call:

  $obSaveFile-write($contents_of_buffer);

Then your write() class method will write the buffer contents to
the file handle you opened in open().

the ob_end_flush() forces the rest of the buffer (1024) to get sent too to
your write() class method, ensuring everything is written.


 Also I have heard that outbuffering can be quite
 complicated, would you mind filling in your example a
 bit more and I can make add to it and work from there?

Here is the class in full (w/o error checking):

class SaveToFile {
  var $file_handle;

  function open($file)  {
$this-file_handle = fopen($file, 'w');
  }
  function write($buf) {
fwrite($this-file_handle, $buf);
  }
  function close() {
fclose($this-file_handle);
  }
}

Curt
-- 
Quoth the Raven, Nevermore.

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



Re: [PHP] Help with sessions problem please

2004-10-14 Thread John Holmes
Chris Shiflett wrote:
--- John Holmes [EMAIL PROTECTED] wrote:
header('Location: http://www.example.org/script2.php?.SID);
He is human after all. :-)
That's just a rumour' I started...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] For how long session exist

2004-10-14 Thread Jerry Swanson
For what period of time a session can exist? Or session exist as soon
as browser is open?
TH

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



Re: [PHP] Form Validation

2004-10-14 Thread Jerry Swanson
On what percent browsers Javascript is enabled?



On Wed, 13 Oct 2004 15:48:51 -0700, Mattias Thorslund
[EMAIL PROTECTED] wrote:
 There are several JavaScript solutions for validating forms on the
 client side. Search on hotscripts.com and google.com.
 
 Client-side validation (in the browser) is useful, but you shouldn't
 depend on it to guarantee that the data that your users submit is
 valid.  You should also validate the data in your PHP script as you
 process the form.
 
 Oh, and there are several PHP-based list managers available, for
 instance phplist, so you may not need to program it yourself.
 
 /Mattias
 
 Huang, Ou wrote:
 
 I am currently working on a newsletter mailing list project and
 developed a form in php. I would like to validate before it is
 submitted. What would be the best way to validate a form? Write your own
 routines or using a form validator. I just started learning PHP, so
 don't have much experience on this. I am thinking using a form validator
 but not sure where I can get it.
 
 Any suggestions would be appreciated!
 
 Thanks.
 
 
 
 
 -- 
 More views at http://www.thorslund.us
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] For how long session exist

2004-10-14 Thread John Holmes
Jerry Swanson wrote:
For what period of time a session can exist? Or session exist as soon
as browser is open?
1. For as long as the user is active
2. Depends on what page the browser opens
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Ask for help on a mysql problem

2004-10-14 Thread Teng Wang
I wanna setup a tree structure. Each node in this tree is a
table. Each table has a link field. For each record, the
data in this field is a pointer to another table or null.

I read mysql manual but don't find any clues that SQL
supports such a link field. Does anyone has an idea about
that?

Thanks a lot!



eruisi
10/14/2004
21:01:16

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



Re: [PHP] For how long session exist

2004-10-14 Thread Dan Joseph
  For what period of time a session can exist? Or session exist as soon
  as browser is open?
 
 1. For as long as the user is active
 2. Depends on what page the browser opens

I'm gonna elaborate a bit...

In your php.ini there is a session idle timeout setting.  The
inactivity John mentioned is set there.  Otherwise, yes, as soon as
the browser is closed.

-Dan Joseph

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



[PHP] problem with array

2004-10-14 Thread Dale Hersowitz
Hi guys,
Recently, I had to reformat one of the web servers and now I have
encountered an unusual problem. I am not sure whether this is an issue which
can be fixed in the .ini file or whether its specific to the version of php
I am using.

Here is the problem:
   $query=SELECT * FROM customizeViewClients WHERE employeeNum =
$employeeNum;
   $results=mssql_query($query, $connection) or die(Couldn't execute
query);
   $numRows=mssql_num_rows($results);

if($numRows0)
   {
 $row=mssql_fetch_array($results);
}

 $selectedCol=$row[selectedCol];
  echo $selectedCol;
 $selectedColName=$row[$selectCol];   //--- PLEASE NOTE THIS SPECIFIC
ROW


For some reason, on the last row, I am not unable to reference a particular
index in the array using a php variable. This has been working for almost 12
months and now the coding is breaking all over the place. I don't have an
answer. Any feedback would be greatly appreciated.

Thx.
Dale

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



[PHP] replacing characters in a string

2004-10-14 Thread Mark Hubert
This should be simple but having never have done it before and at 
deadline...help please.

Need to change:
 [EMAIL PROTECTED]
to;
user=domain
Thank you!
Mark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] replacing characters in a string

2004-10-14 Thread Dan Joseph
 This should be simple but having never have done it before and at
 deadline...help please.
 
 Need to change:
 
  [EMAIL PROTECTED]
 
 to;
 
 user=domain

str_replace() is what you want...

$var = str_replace( @, =, $oldvar );

-Dan Joseph

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



Re: [PHP] problem with array

2004-10-14 Thread Jason Wong
On Friday 15 October 2004 09:58, Dale Hersowitz wrote:

 For some reason, on the last row, I am not unable to reference a particular
 index in the array using a php variable. This has been working for almost
 12 months and now the coding is breaking all over the place. I don't have
 an answer. Any feedback would be greatly appreciated.

echo()/print_r()/var_dump() every $variable that you use.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I love being married.  It's so great to find that one special person
you want to annoy for the rest of your life.
-- Rita Rudner
*/

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



Re: [PHP] problem with array

2004-10-14 Thread Minuk Choi
$selectedCol=$row[selectedCol];
 echo $selectedCol;
$selectedColName=$row[$selectCol];   //--- PLEASE NOTE THIS SPECIFIC
ROW
Please give me the output, what do you get from echo $selectedCol;?  If I 
had to guess, it looks like you're confusing key and value of an 
associatative array.

if
$row[selectedCol] = 12;
$row[12] does NOT equal SelectedCol.
In fact, even if you used mysql_fetch_array, you will not be able to do a 
reverse lookup like that.

Suppose you have the following :
$row['a'] = 1;
$row['b'] = 2;
$row['c'] = 1;
You can see that your approach is incorrect because what would $row[1] 
return?

If this is NOT your question, please post your output(errors and all).
- Original Message - 
From: Dale Hersowitz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 14, 2004 9:58 PM
Subject: [PHP] problem with array


Hi guys,
Recently, I had to reformat one of the web servers and now I have
encountered an unusual problem. I am not sure whether this is an issue 
which
can be fixed in the .ini file or whether its specific to the version of 
php
I am using.

Here is the problem:
  $query=SELECT * FROM customizeViewClients WHERE employeeNum =
$employeeNum;
  $results=mssql_query($query, $connection) or die(Couldn't execute
query);
  $numRows=mssql_num_rows($results);
   if($numRows0)
  {
$row=mssql_fetch_array($results);
   }
$selectedCol=$row[selectedCol];
 echo $selectedCol;
$selectedColName=$row[$selectCol];   //--- PLEASE NOTE THIS SPECIFIC
ROW
For some reason, on the last row, I am not unable to reference a 
particular
index in the array using a php variable. This has been working for almost 
12
months and now the coding is breaking all over the place. I don't have an
answer. Any feedback would be greatly appreciated.

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


[PHP] throw me a bone for a regexp please.

2004-10-14 Thread Robet Carson
need a regexp to get the contents of this marker or one very simular:

{!STATISTICS:starbucks!}

what I am looking for is to get the STATISTICS and starbucks into
an array() if possible.  I believe with the correct regexp this can be
accomplished using preg_split() or by getting the contents of the
marker and explode()'ing them.  also i am looking to grab several
strings for a marker like this, for instance.

{!STASTISTICS:starbucks:blended:chocolate!}

Also if someone could direct me to a site that explains how to use and
create regexp in a small minded manor since I have been unable to
grasp the concepts.

Thanks in advanced,
Robert

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



Re: [PHP] Ask for help on a mysql problem

2004-10-14 Thread John Nichel
Teng Wang wrote:
I wanna setup a tree structure. Each node in this tree is a
table. Each table has a link field. For each record, the
data in this field is a pointer to another table or null.
I read mysql manual but don't find any clues that SQL
supports such a link field. Does anyone has an idea about
that?
Did you happen to read about the MySQL mailing lists when you were 
reading the manual?

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


[PHP] PHP 5.0.2 LDAP SASL Binds (GSSAPI specifically)

2004-10-14 Thread Quanah Gibson-Mount
I see that php 5.0.2 has added the ldap_sasl_bind function.  I compiled 
php-5.0.2 against our OpenLDAP w/ SASL support libraries, and went ahead to 
give it a whirl:

#!/usr/local/bin/php
?php
$ds = ldap_connect(ldap-test3.stanford.edu);
if($ds) {
  $r = ldap_sasl_bind($ds);
} else {
 echo Unable to connect!;
}
?
However, what I get back is:
bWarning/b:  ldap_sasl_bind() [a 
href='function.ldap-sasl-bind'function.ldap-sasl-bind/a]: Unable to bind 
to server: Not Supported in 
b/afs/ir.stanford.edu/users/q/u/quanah/cgi-bin/test.cgi/b on line 
b5/bbr /

In looking at the php 5.0.2 code I see:
   if ((rc = ldap_sasl_interactive_bind_s(ld-link, NULL, NULL, NULL, 
NULL, LDAP_SASL_QUIET, _php_sasl_interact, NULL)) != LDAP_SUCCESS) {

This line seems a bit bogus to me -- All those nulls mean that a valid SASL 
Mechanism is never specified to bind as.

For example, in perl, I've used:
ldap_sasl_interactive_bind_s($self-{ld}, $dn, $pass,
   $self-{saslmech}, $self-{saslrealm},
   $self-{saslauthzid}, $self-{saslsecprops},
   $self-{saslflags});
(Note that for SASL/GSSAPI, the $dn  $pass can safely be ignored, as it is 
my K5 credentials that determine my DN anyhow).

Is this feature expected to work yet?
--Quanah
--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] throw me a bone for a regexp please.

2004-10-14 Thread Jason Wong
On Friday 15 October 2004 10:35, Robet Carson wrote:
 need a regexp to get the contents of this marker or one very simular:

 {!STATISTICS:starbucks!}

 what I am looking for is to get the STATISTICS and starbucks into
 an array() if possible.  I believe with the correct regexp this can be
 accomplished using preg_split() or by getting the contents of the
 marker and explode()'ing them.  also i am looking to grab several
 strings for a marker like this, for instance.

 {!STASTISTICS:starbucks:blended:chocolate!}

 Also if someone could direct me to a site that explains how to use and
 create regexp in a small minded manor since I have been unable to
 grasp the concepts.

A few tips for starting out with regex:

1) use PCRE, they are faster and ultimately more useful than the POSIX variety
2) Build up your regex step-by-step and test it at each step to see what is 
being matched and what isn't (and why it isn't)
3) Use parentheses () to enclose the bits you want to 'capture' (extract).
4) Practice
5) More practice


So for your first example, as a first draft you can just capture everything 
between the begin marker and the end marker:

  $doo = '{!STATISTICS:starbucks!}';
  preg_match('/\{!(.*)!\}/', $doo, $match)

$match[1] now contains: STATISTICS:starbucks

You can explode() it to get the constituent parts.

Or you can refine your regex:

  preg_match('/\{!(.*):(.*)!\}/', $doo, $match)

So basically your first draft would match a large chunk of stuff, your 
successive drafts would fine-tune it until eventually you're matching exactly 
what you need.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Today you'll start getting heavy metal radio on your dentures.
*/

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



Re: [PHP] dbm choices - advice?

2004-10-14 Thread Justin French
On 15/10/2004, at 2:46 AM, Jed R. Brubaker wrote:
Hi all - I am looking at using a dbm-style cache system and was 
wondering if
anyone has any recommendations from the plethora of systems listed 
here:
http://us2.php.net/manual/en/ref.dba.php
Is there a favorite?

I know if probably depends on what I want to do, so in short, I am 
looking
to create a temporary table that will be a composite of a ton of MySQL
queries (hence the reason I am not just querying). I have thought 
about just
creating a new database table to push my query results into, but I 
would
love to make it faster if possible. Am I hopelessly misguided?

I would love any feedback!
I've never done it, but I think serializing the result and inserting 
into a three column table with the query and a expiry date is pretty 
common.  If you were to write your own DB adapters and wrappers (rather 
than using mysql_* directly), you probably wouldn't even notice the 
extra code or whatever needed.

I don't think MySQL has anything built in.
Justin French
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem with MSSQL

2004-10-14 Thread Yusuf Tikupadang
Hi, 
I'm a new member in this mailing list.
I have a problem with large data in mssql (more than 100.000 record in
one table). If I want to browse it from record 10 until 19 (like when
I press next button), php have to read all data (select * from table).
Is it posible to read only the record that I need (from record x1
untuk x2), without stored procedure?
Thanks before.

Best Regards,
Yusuf Tikupadang

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



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


[PHP] How to optimize select of random record in DB ?

2004-10-14 Thread -{ Rene Brehmer }-
I made this code to pick a random record from a changeable number of 
records in a given table.
I'm just curious if any of the more awake coders out there can see a way to 
optimize this for better performance, since there's several other DB 
queries on the same page.

  $records = mysql_query(SELECT COUNT(*) AS count FROM persons) or 
die('Unable to get record countbr'.mysql_error());
  $totalcount = mysql_result($records,0) - 1;
  $rndrecord = rand(0,$totalcount);
  $personquery = mysql_query(SELECT personID FROM persons LIMIT 
$rndrecord,1) or die('Unable to get random recordbr'.mysql_error());
  $personID = mysql_result($personquery,0);
--
Rene Brehmer
aka Metalbunny

If your life was a dream, would you wake up from a nightmare, dripping of 
sweat, hoping it was over? Or would you wake up happy and pleased, ready to 
take on the day with a smile?

http://metalbunny.net/
References, tools, and other useful stuff...
Check out the new Metalbunny forums at http://forums.metalbunny.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >