OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 14 Oct 2004 22:08:20 -0000 Issue 3053

php-general-digest-helplists.php.net
Date: Thu Oct 14 2004 - 17:08:20 CDT


php-general Digest 14 Oct 2004 22:08:20 -0000 Issue 3053

Topics (messages 199463 through 199540):

Re: Help with sessions problem please
        199463 by: Jason Wong
        199464 by: John Holmes
        199465 by: Chris Shiflett
        199466 by: Chris Shiflett
        199467 by: Chris Dowell

Re: Help with sessions problem please [SOLVED]
        199468 by: Graham Cossey

Re: Quick imageSize question
        199469 by: Ford, Mike

Table Creation Time Stamp.....
        199470 by: Mulley, Nikhil
        199471 by: Jay Blanchard
        199480 by: Mulley, Nikhil

looking for a few php partners/developers....
        199472 by: bruce
        199473 by: Jay Blanchard
        199475 by: bruce
        199477 by: Robby Russell

Re: .htaccess and .htpasswd
        199474 by: Afan Pasalic

Re: Determine variable with the lowest value?
        199476 by: Eric McGrane
        199487 by: BOOT
        199490 by: Matt M.
        199491 by: ApexEleven
        199493 by: Greg Donald

Re: Security patch from 4.3.8 to 4.3.9
        199478 by: Federico Petronio
        199479 by: Federico Petronio
        199482 by: Curt Zirzow

Knowledgebase/Troubleshooter
        199481 by: Lee Standen
        199483 by: pete M
        199501 by: Lee Standen

PHP 5 compile time configure options
        199484 by: Don
        199485 by: Jason Wong
        199486 by: Greg Donald

Re: Image upload not working correctly
        199488 by: Dave Grant
        199489 by: Dave Grant
        199535 by: Jason Wong

dbm choices - advice?
        199492 by: Jed R. Brubaker
        199494 by: Greg Donald

User Defined Forms
        199495 by: Shaun
        199496 by: Jay Blanchard
        199498 by: Greg Donald
        199499 by: bbonkosk.tampabay.rr.com
        199500 by: Shaun
        199508 by: Ed Lazor
        199509 by: Graham Cossey
        199510 by: Shaun
        199515 by: Dan Joseph

intenger
        199497 by: Juan Pablo Herrera
        199502 by: bbonkosk.tampabay.rr.com
        199503 by: John Nichel
        199505 by: ApexEleven
        199506 by: Dan Joseph
        199507 by: Ed Lazor
        199512 by: Jay Blanchard

include()ing into a variable
        199504 by: Mag
        199511 by: ApexEleven
        199514 by: Gerard Samuel
        199516 by: Jesse Castro
        199517 by: Curt Zirzow
        199520 by: Simas Toleikis
        199529 by: Mag

Re: Tutorials for Maintenance of State
        199513 by: GH

new connection with pg_pconnect
        199518 by: Jonathan Villa
        199524 by: Pablo Gosse
        199532 by: Greg Donald
        199539 by: Jonathan Villa
        199540 by: Pablo Gosse

Referring Page
        199519 by: Ben
        199521 by: Pablo Gosse
        199522 by: Jonathan Villa
        199523 by: bbonkosk.tampabay.rr.com
        199525 by: Matt M.
        199527 by: John Nichel
        199528 by: John Nichel
        199530 by: Jonathan Villa
        199531 by: Jonathan Villa
        199533 by: Jonathan Villa
        199534 by: Ben
        199536 by: Greg Donald
        199537 by: Jason Wong
        199538 by: Matt M.

PHP 5.02 and Fedora Core 2 Installation question
        199526 by: Don

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


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!!!
*/

attached mail follows:


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

attached mail follows:


--- Jason Wong <php-generalgremlins.biz> 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 2004 http://httphandbook.org/

attached mail follows:


--- John Holmes <holmes072000charter.net> 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 2004 http://httphandbook.org/

attached mail follows:


No

I think it's more likely that one of his tentacles slipped

Chris Shiflett wrote:

> --- John Holmes <holmes072000charter.net> 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 2004 http://httphandbook.org/
>

attached mail follows:


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:shiflettphp.net]
> Sent: 14 October 2004 11:03
> To: Jason Wong; php-generallists.php.net
> Subject: Re: [PHP] Help with sessions problem please
>
>
> --- Jason Wong <php-generalgremlins.biz> 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 2004 http://httphandbook.org/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


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 upload....or
> 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: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


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.

attached mail follows:


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

attached mail follows:


 Yeah I did it, But asked for any specic statement , any way Thanks :)

-----Original Message-----
From: Jay Blanchard [mailto:jay.blanchardniicommunications.com]
Sent: Thursday, October 14, 2004 5:53 PM
To: php-generallists.php.net
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

attached mail follows:


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
bedouglasearthlink.net

attached mail follows:


[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

attached mail follows:


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
bedouglasearthlink.net

attached mail follows:


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
> bedouglasearthlink.net
>

craigslist.org too.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBboGM0QaQZBaqXgwRAkepAKCF2QiY+CkhN6AqVfcGPrx1EtS/WgCgxwJF
R1dobjK5OTkwJF7kmPt3700=
=ZAKP
-----END PGP SIGNATURE-----

attached mail follows:


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:mattkillermookie.org]
> Sent: Thursday, October 14, 2004 1:57 AM
> To: php-generallists.php.net
> 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
>

attached mail follows:


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" <pfineof-law.com> wrote in message
news:20041014032015.69904.qmailpb1.pair.com...
> Thanks guys. Yes I figured using an array and the MIN function would be a
> start.
>
> Now the random part.....
>
>
>
>
> "Boot" <pfineof-law.com> wrote in message
> news:20041013221858.60629.qmailpb1.pair.com...
> > 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!

attached mail follows:


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" <emcgraneanacomp.com> wrote in message
news:20041014133835.32752.qmailpb1.pair.com...
> 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" <pfineof-law.com> wrote in message
> news:20041014032015.69904.qmailpb1.pair.com...
> > Thanks guys. Yes I figured using an array and the MIN function would be
a
> > start.
> >
> > Now the random part.....
> >
> >
> >
> >
> > "Boot" <pfineof-law.com> wrote in message
> > news:20041013221858.60629.qmailpb1.pair.com...
> > > 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!

attached mail follows:


On Thu, 14 Oct 2004 10:52:20 -0500, BOOT <pfineof-law.com> 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.' times<br />';
}
asort($arr);
print 'It is '.key($arr).'\'s turn';

attached mail follows:


/* 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. <h.dudenessgmail.com> wrote:
> On Thu, 14 Oct 2004 10:52:20 -0500, BOOT <pfineof-law.com> 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.' times<br />';
> }
> 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
------------------------------------------------------->>

attached mail follows:


On Thu, 14 Oct 2004 10:52:20 -0500, BOOT <pfineof-law.com> 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/

attached mail follows:


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.6&r2=1.45.2.7&ty=u

Saludos!

                                        Federico Petronio

attached mail follows:


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.

attached mail follows:


* 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.6&r2=1.45.2.7&ty=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."

attached mail follows:


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.

attached mail follows:


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.

attached mail follows:


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

attached mail follows:


The link: HYPERLINK
"http://www.php.net/manual/en/install.configure.php"http://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
 

attached mail follows:


On Thursday 14 October 2004 23:24, Don wrote:
> The link: HYPERLINK
> "http://www.php.net/manual/en/install.configure.php"http://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.
*/

attached mail follows:


On Thu, 14 Oct 2004 11:24:41 -0400, Don <donprolclnav.com> wrote:
> The link: HYPERLINK
> "http://www.php.net/manual/en/install.configure.php"http://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/

attached mail follows:


Thanks for the reponse. Yes, the destination paths look fine and the PHP
error log displays no errors. Any other ideas?

Thanks.

"Jason Wong" <php-generalgremlins.biz> wrote in message
news:200410140641.02411.php-generalgremlins.biz...
> 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.
> */

attached mail follows:


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" <php-generalgremlins.biz> wrote in message
news:200410140641.02411.php-generalgremlins.biz...
> 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.
> */

attached mail follows:


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.
*/

attached mail follows:


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!

attached mail follows:


On Thu, 14 Oct 2004 10:46:02 -0600, Jed R. Brubaker
<jrb21398hotmail.com> 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/

attached mail follows:


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!

attached mail follows:


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

attached mail follows:


On Thu, 14 Oct 2004 18:01:48 +0100, Shaun <shaunthornburghhotmail.com> 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/

attached mail follows:


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 <shaunthornburghhotmail.com>
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
>
>

attached mail follows:


"Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
news:C8F323573C030A448F3E5A2B6FE2070B03522B92nemesis...
[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

attached mail follows:


> 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

attached mail follows:


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:shaunthornburghhotmail.com]
> Sent: 14 October 2004 18:23
> To: php-generallists.php.net
> Subject: Re: [PHP] User Defined Forms
>
>
>
> "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
> news:C8F323573C030A448F3E5A2B6FE2070B03522B92nemesis...
> [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
>
>

attached mail follows:


"Ed Lazor" <Ed.Lazord20news.com> wrote in message
news:php.general-199508news.php.net...
> > 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...

attached mail follows:


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

attached mail follows:


Please, i need output a intenger, what function can i use for this?.
Print?, echo?

Thank you.
JP

attached mail follows:


Start here...
http://us2.php.net/manual/en/language.types.php

----- Original Message -----
From: Juan Pablo Herrera <juampilinuxeducativo.com.ar>
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
>
>

attached mail follows:


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
johnkegworks.com

attached mail follows:


settype($var,int);

On Thu, 14 Oct 2004 14:19:28 -0300 (ART), Juan Pablo Herrera
<juampilinuxeducativo.com.ar> wrote:
> 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
>
>

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

attached mail follows:


> Please, i need output a intenger, what function can i use for this?.
> Print?, echo?

$i = 12;

echo $i;

-Dan Joseph

attached mail follows:


Do you mean an integer? As in

$i = 5;

Print $i;

?

 

> -----Original Message-----
> From: Juan Pablo Herrera [mailto:juampilinuxeducativo.com.ar]
> Sent: Thursday, October 14, 2004 10:19 AM
> To: php-generallists.php.net
> 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
>

attached mail follows:


[snip]
Do you mean an integer? As in

$i = 5;

Print $i;

?
[/snip]

That would be the one(1)

attached mail follows:


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

attached mail follows:


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 <genphpyahoo.com> 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
------------------------------------------------------->>

attached mail follows:


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

attached mail follows:


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

attached mail follows:


* 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."

attached mail follows:


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

attached mail follows:


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

attached mail follows:


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
<shiflettphp.net> wrote:
>
>
> --- GH <GaryHotkogmail.com> 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 2004 http://httphandbook.org/
>

attached mail follows:


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 "dsaf"dds;

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?

attached mail follows:


[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

attached mail follows:


On Thu, 14 Oct 2004 14:30:18 -0500 (CDT), Jonathan Villa <jvillae37.net> 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/

attached mail follows:


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

attached mail follows:


[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

attached mail follows:


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

attached mail follows:


[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

attached mail follows:


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

attached mail follows:


Yes,
write a script with:
<?php
phpinfo();
?>
and you will find all the wonderous variables at your disposal...
-B

----- Original Message -----
From: Ben <benipmillercomcast.net>
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
>
>

attached mail follows:


> 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

attached mail follows:


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
johnkegworks.com

attached mail follows:


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

Will return nothing.

$_SERVER['HTTP_REFERER']

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
johnkegworks.com

attached mail follows:


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

attached mail follows:


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
> johnkegworks.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


*typo

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

attached mail follows:


Thanks all. That did it perfectly.

-----Original Message-----
From: Matt M. [mailto:h.dudenessgmail.com]
Sent: Thursday, October 14, 2004 2:21 PM
To: Ben
Cc: php-generallists.php.net
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

attached mail follows:


On Thu, 14 Oct 2004 16:47:08 -0400, John Nichel <johnkegworks.com> 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/

attached mail follows:


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..
*/

attached mail follows:


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

attached mail follows:


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