[PHP] SDO_DAS_Relational limitations

2006-08-18 Thread Jeroen Olthof
Hi,

I'm looking into the SDO implementations and walked into the limitations 
very quickly.

Limitations:
- No composite key possible
- Only one Foreign key per table
- No way of setting up a many to many relationschip

My models violates mostly and most likely all of this limitations. So I ask 
myself. Is it usefull or don't I understand the stratergy?

what to do with the many to many relationships, the composite keys and 
multiple foreignkeys per table ???

kind regards

Jeroen Olthof 

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



RE: [PHP] I need an array of state abbrev to names...

2006-08-18 Thread tedd

At 8:55 PM -0700 8/17/06, Daevid Vincent wrote:


Excellent Thanks!


Glad to actually help (this time).  :-)


Oh, and also that you have to be careful and use the 'save as' feature on
windows machines so as not to get funky \r\n instead of \n and then the
parser won't work. :)


Windows? Not in my world, I'm Windows challenged.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] Re: Session issues

2006-08-18 Thread Al

Dave Goodchild wrote:

Hi all, I am currently writing a web application that has a 3-stage form
process as part of its functionality. The values passed in are placed in 
the

session array after validation and once the user has completed and supplied
all required values the relevant session values are inserted into the
database. I have tested it on three different machines in FF, IE and Opera
and all expected values were entered ok.

However, a remote user has started testing and all values are blank,
suggesting the session is not being populated. I noticed it at their office
last week when data values were not showing up when the user went back one
page (ie fields are pre-populated with existing session values).

Anyone had this problem before?



$i= 0; first time.  Then $i++; so you can see the increment.  Or instead of $i, include something unique in your code 
for each pass.


Try putting a var_dump($_SESSION, $i) at the top of your page. That will show 
you what is happening.

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



[PHP] RELEASE ANNOUNCEMENT: PhpDocumentor 1.3.0 *stable*

2006-08-18 Thread Greg Beaver
RELEASE ANNOUNCEMENT
PhpDocumentor 1.3.0 *stable*
August 18, 2006
Download:
pear upgrade PhpDocumentor
http://pear.php.net/PhpDocumentor
http://sourceforge.net/project/showfiles.php?group_id=11194package_id=10450release_id=440432
Information and documentation:
http://www.phpdoc.org


The PhpDocumentor team would like to announce the release of
PhpDocumentor version 1.3.0.  This is the first stable release since
2003, and marks a dramatic step up from previous releases.

This release adds in:
 - full PHP 5 support, including knowledge of internal classes
   for PHP version 5.1.0+ using the Reflection extension.
 - highlighting of tutorial XML
 - beautifying of output from the XML:DocBook/peardoc2:default
   converter

In addition, the release fixes more than 100 bugs found since version
1.2.3.  Output from source highlighting is much more efficient,
resulting in slightly smaller file size for option sourcecode=on.
Multi-national characters are now allowed in a package name, although
internationalization support is not fully complete.

PhpDocumentor is the standard automatic documentation solution for PHP
written in PHP.  Originally inspired by JavaDoc, PhpDocumentor has over
6 years of battle-testing and is bundled in popular IDEs such as Zend
Studio, PHPEdit, PhpEd, and others.

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



Re: [PHP] pear constants

2006-08-18 Thread Javier Ruiz

thank you for the link, I'm already subscribed to the pear general list and
I sent the same email to that list, but I got no any answer yet... I just
sent it to the PHP list in case anybody in this list has or had the same
problem...

I put here the problem I'm having:

I have a problem with some pear constants. I made a new installation of
php + pear + propel (http://propel.phpdb.org) and now in my scripts the
constant PEAR_INSTALL_DIR is not defined when in my previous
installation it used to be...

Other constants like the error ones (PEAR_ERROR_DIE,
PEAR_ERROR_RETURN ...) are defined correctly

Am I missing anything in the new installation?

thanks a lot!



On 8/17/06, Chris [EMAIL PROTECTED] wrote:


JRuiz wrote:
 Hi All,

 I have a problem with some pear constants.

The pear lists live here: http://pear.php.net/support/lists.php

--
Postgresql  php tutorials
http://www.designmagick.com/



[PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Hello,
I am working on a php project that needs a little
extra JS/DHTML solution. I am sure some of you might
have come to use something like this before, please
recommend a solution (commerial solutions are fine /
willing to pay)

Basically, I will have a page with around 10 questions
for students and then two buttons for [HINT] and
[SOLUTION]

When either of these buttons/text is clicked the
resulting text should be displayed in the side/bottom
cell, the user should also be able to 'close' this
resulting explanation.

Note, on each page there will be around 10 questions,
so each of these questions will have a hint  solution
button/text.

Thanks in advance,
Ryan

--
- 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!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] Re: Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Jo�o C�ndido de Souza Neto
Hi.

There´s many ways to do it, could you suply us with more information about 
that to led us in a straight line of thinking?

Thanks.

-- 
João Cândido de Souza Neto
Curitiba Online
[EMAIL PROTECTED]
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br

Ryan A [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)

 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]

 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.

 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

 Thanks in advance,
 Ryan

 --
 - 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!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com 

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



Re: [PHP] Re: Session issues

2006-08-18 Thread Richard Lynch
On Thu, August 17, 2006 12:56 pm, Dave Goodchild wrote:
 How does the user go back one page?  If it by using the browser's
 back-button, the php script has no way of knowing it.

 Yes, but the session variables have already been set, and are
 configured to
 display in the form fields.

Ah, but some browsers just don't work like that.

They assume that the user wants to re-use the values THEY entered, not
the ones that were the original default.

That's what an input type=reset / was designed for into the HTML
spec in the first place, after all.

You can get them to switch to a browser that behaves like they expect.

You can educate them to understand that their browser is supposed to
work that way.

You can give them a reset form button to put things back the way
they were.

But you can't change the browser to misbehave from the way that
particular browser manufacturer thinks browsers should work.  Sorry.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] dynamic case statements?

2006-08-18 Thread Tom Cruickshank
Hello,
Would anyone know if it's possible to have dynamic case statements?

For example.

Theform = new form();

$temp = $_POST['var1'];
   switch ($temp) {
case status:
$theform-status();
break;

  case $temp:
$theform-form($temp);
break;
}

This keeps giving me  Call to undefined method form::form() in
/usr/local/www/data-dist/form.php on line 38

Line 38 is right after case $temp:

If I have case temp: error goes away, so I get the feeling case doesn't
like the variable $temp.

Any help would be appreciated. Thanks!

Tom


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.2/422 - Release Date: 8/17/2006
 

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



Re: [PHP] PHPSESSID used sporatically

2006-08-18 Thread Richard Lynch
On Wed, August 16, 2006 8:44 pm, Michael B Allen wrote:
 Searching through the logs and browsing my site (see sig) I sometimes
 see
 PHPSESSID is used as opposed to cookies. I know it's not simply that
 the
 client doesn't support cookies because I can see the same IP
 transition
 to and from using PHPSESSID. Can someone explain why this is
 happening?

Your assumption that the same IP is the same session is one
explanation...

IP in general is useless for identification, much less authentication.

Unless you KNOW those specific IPs are static, and only used by one
person on one browser, then you need to do much more research to see
if people really are switching from Cookie to PHPSESSID (presumably
via GET).

A simple error_log in your script should get you started:
error_log(session_id() .  $_COOKIE[PHPSESSID] $_GET[PHPSESSID]);

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] How can one run libapache-mod-php5 and pgp-cgi in the same time on the same physicaly Server

2006-08-18 Thread Michelle Konzack
Hello Geeks and Nerds,

How can one run libapache-mod-php5 and pgp-cgi in the same
time on the same physicaly Server?

I am using Debian GNU/Linux 3.1 (Sarge) and a php5 backport.  

This problem is generaly the su-php problem, but now it seems
the there is an exclusion between the libapache-mod-php5 and
pgp-cgi that it can not be used parallel.

If this mean, it can not be used paralel on the same machine
I have to buy a new server (~23.000 Euro) and run into IP
address problems since I have only 256 which are entirely used.
(I am waiting of 80 NEW blocks but it take to much time)

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



[PHP] Downloading of PgSQL data for use local (crappy subject line)

2006-08-18 Thread Michelle Konzack
Hello,

I have:   1)  PostgreSQL 7.4/8.1
  2)  PHP5
  3)  Apache 1.3

The client have   1)  A web browser
  2)  PHP4/5
  3)  PostgreSQL X.XX

The clients can surf my website/database and collect data for
Off-Line working, exactly, I want, that they can download a
file containing the requested data and importing it into there
local database using a http://localhost/ Intranet Interface.

Since $USER is generaly not a Geek/Nerd/Freek or something like
this all must be done easyly...

Now my question:

What is the best format to transfer such data?

I was thinking, that I create from each $ROW selected from the
Database a PHP.include which contain the data in a array

array[serno]=;
array[foo]=...;
array[bar]=...;

which then can be imported and read from a PHP script.

Additonaly I want to encrypt (the $USER must upload his/her public
GPG key) this file because some of the stupid $USER can lost one
(should not, but it allredy happen).

Any suggestions?


Greetings
Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ray Hauge
On Friday 18 August 2006 10:30, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)

 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]

 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.

 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

 Thanks in advance,
 Ryan

 --
 - 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!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

I find that the Yahoo User Interface Library is pretty nice.

http://developer.yahoo.com/yui/index.html

I'm not sure that you really need a library to do what you want though.  It 
could be as simple as using a div, and then the buttons change text with 
innerHTML (as long as you're not expecting to use that text after the 
submit).

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



[PHP] Re: suphp problem

2006-08-18 Thread Michelle Konzack
Am 2006-08-12 17:04:45, schrieb Richard Lynch:

  I need suphp only on those 7 VHosts, since the must write to some
  files OUTSIDE of the $DOCUMENTROOT but in the USERSPACE of the VHost.
 
 suphp should allow this, in theory, as I understand it...

Right it is described on several websites and wikis...

 But I don't think the Apache User/Group settings inside of VHost is
 the way to make suphp to work, as I don't think Apache will allow that
 in the first place, which I think is causing your 500 error.

I have read that I MUST give the UID/GID to the VHost.
Maybe I ask on users@httpd.apache.org too.

Greetings
Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



Re: [PHP] Creating User Friendly URLS

2006-08-18 Thread Richard Lynch
As a general rule, if you want to see everything useful that is
available to you in your script:

http://php.net/phpinfo

In particular, this will show you the PATH_INFO if it's there, and the
REQUEST_URI if that's there, and...

If neither of those are available, I don't think you'll be able to do
what you want...

It could just be a server configuration issue.

PHP doesn't really decide what to put in $_SERVER.

Your web server puts a bunch of stuff in the environment SERVER
variable, and PHP just passes the buck on to you to do something
useful with it.

Or so I understand it.

On Thu, August 17, 2006 9:43 am, Dave M G wrote:
 PHP List,

 My goal is to create user and search engine friendly URLs like:
 mysite.com/my_web_page_title

 Instead of:
 mysite.com/index.php?pageID=1

 I asked about this before:
 http://marc.theaimsgroup.com/?l=php-generalm=113597988027012w=2

 And there is this helpful tutorial:
 http://agachi.name/weblog/archives/2005/01/30/rewriting-dynamic-urls-into-friendly-urls.htm


 Both of which refer to a variable called $_SERVER['PATH_INFO'].

 But, in the php.net manual, in the predefined variables page,
 'PATH_INFO' is only obliquely referenced in the $_SERVER variable
 description, under the 'PATH_TRANSLATED' element.

 When I've tried echoing out the contents of $_SERVER['PATH_INFO'], I
 get
 nothing.

 I'm trying to set it so that pages are named according to their title
 in
 my MySQL database. So my script will pull my_web_page_title out of
 the
 URL, match that against the database, and then display the appropriate
 contents.

 I thought I could do this by simply making my link into:
 a href=index.php/my_web_page_titleMy Web Page Title/a

 And then stripping out the index.php, and using the remainder  for
 both the URL and the database lookup.

 But, while I'm sure there are more steps than that, I'm halted
 initially
 because I'm not sure where in the $_SERVER array my URL is being
 stored.

 Any advice on how to proceed here would be greatly appreciated. Thank
 you.

 --
 Dave M G

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-18 Thread Richard Lynch
Set your session time out to, oh, 2 years or less (as in the spec,
they are gonna ignore you if you try more than 2 years).

You could even set *ONE* cookie with all the values serialized in an
array, and probably stay under the 4K limit.

Then you get people like me who, if a cookie value looks TOO funky,
I'll reject it, on the assumption that you are exposing my personal
info to your advertising sites for user-tracking.

Buh-bye.

Try to think about your cookies from the perspective of a paranoid
media-believing moron.

Like that movie with Mel Gibson, sort of...

Because SOME of your visitors are that weird, self included.

:-)

You can store a Cookie to ID me with something I know is me, and
then you know who I am for the next 2 years.  That should be good
enough.

Read the PHP session pages, and the setcookie page, and work out
what's best for you, with the paranoid user visitor mentality above.

On Thu, August 17, 2006 9:20 am, [EMAIL PROTECTED] wrote:

 On Wed, August 16, 2006 9:00 am, [EMAIL PROTECTED] wrote:
 Does IE6 limit somehow/somewhere the number of cookie variables I
 can
 create and store?

 Richard Lynch responded:
 Yes.

 Read the Cookie spec.

 There's no need for any site to ever send more than ONE Cookie
 anyway.

 Just use session_start() and you can store all the stuff in
 $_SESSION
 and it's all tied to the one Cookie.

 Users like me who set the browser to prompt for Cookies will often
 LEAVE a site that is being stupid and sending too many cookies,
 unless
 we really really really need your content, which is unlikely.

 So you're calling my app stupid, Richard?? lol

 To clarify, the app is for a small group of known users on an
 intranet, and
 yes, they really really need the content. There are 24 check boxes,
 and
 each selection triggers a graphical display of radiation levels in a
 specific area over the last hour. Since the active areas - 12 to 15
 usually
 -  don't change all that much over time, I thought it would make sense
 to
 have the app remember which boxes had been checked at last launch. I
 didn't like the idea of using cookies, so I actually have a database
 solution in place. But I've not dealt much with cookies, and I had
 some
 time and tried to use them to solve the problem. That's when I ran
 into the
 20 cookie limit with IE (Having just read the spec, I'm surprised that
 Microsoft has actually followed it).

 Unless there's something basic about $_SESSION variables I've missed,
 I
 don't believe they would work here. I need to track and remember which
 boxes are checked between sessions, not within a single session.
 Someone
 please correct me if I'm mistaken.

 Thanks again to Adam Zey for suggesting I serialize the cookie data.
 That
 solved the problem.

 David





-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] active directory and PHP

2006-08-18 Thread Richard Lynch
Active Directory is a bastardized LDAP with goofy idiosyncracies to
drive you crazy.

If you Google for Active Directory LDAP PHP you should find
solutions fairly easily...

Or so I'm told...

Never use AD myself.

On Thu, August 17, 2006 5:14 am, Alain Roger wrote:
 Hi,

 I'm new to PHP, so sorry if my question looks like stupid.

 I have a web application which use authorization and authentication
 process
 to log-in.
 I would like to know if it exists a way to synchronize the
 authentication
 with our Active Directory domain ?
 Something like a single side-on.

 In fact, i want from my web application users to make them remember
 only
 their login/pwd from Active directory to use my application.

 thanks a lot,

 Alain



-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Can a PHP 5 Object Be Persisted Past Script End?

2006-08-18 Thread Richard Lynch
On Thu, August 17, 2006 12:14 pm, Bruce Bailey wrote:
 In order to improve performance for a socket-based PHP 5 object, I
 would
 like to persist an object beyond the end of a script.  Is there any
 way to
 make this work?  Will PHP 5 automatically destroy the object sometime
 after
 the script ends?

Pretty sure the object will not exist when the script ends.

You can serialize it and store it and bring it back (after require'ing
the class definition, or using autoload) but the serialize/unserialize
has a penalty...

If you are already mucking with sockets and such, you could go
whole-hog and consider writing your own message / distribution
handler, so that your socket-based script never actually ends, so the
object never goes away.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Session issues

2006-08-18 Thread Richard Lynch
Configure the problem browser to prompt you when it gets a cookie.

You'll probably find that it's rejecting the cookies, so it's not
preserving the state of the session, so you get a new session every
page hit.

On Thu, August 17, 2006 12:35 pm, Dave Goodchild wrote:
 Hi all, I am currently writing a web application that has a 3-stage
 form
 process as part of its functionality. The values passed in are placed
 in the
 session array after validation and once the user has completed and
 supplied
 all required values the relevant session values are inserted into the
 database. I have tested it on three different machines in FF, IE and
 Opera
 and all expected values were entered ok.

 However, a remote user has started testing and all values are blank,
 suggesting the session is not being populated. I noticed it at their
 office
 last week when data values were not showing up when the user went back
 one
 page (ie fields are pre-populated with existing session values).

 Anyone had this problem before?

 --
 http://www.web-buddha.co.uk
 http://www.projectkarma.co.uk



-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Downloading of PgSQL data for use local (crappy subject line)

2006-08-18 Thread Richard Lynch
For LARGE datasets, CSV or tab-delimited transfers are probably going
to be easiest to suck in to the DB.

Another option is to just use pg_dump, if you want whole tables.

Otherwise, honestly, I'd suggest you just export your data to RSS or
XML and let the user choose how to open it up.

Even CSV export is better than PHP arrays, since they can open the
stuff up in Excel if they want to.

On Wed, August 16, 2006 6:00 pm, Michelle Konzack wrote:
 Hello,

 I have:   1)  PostgreSQL 7.4/8.1
   2)  PHP5
   3)  Apache 1.3

 The client have   1)  A web browser
   2)  PHP4/5
   3)  PostgreSQL X.XX

 The clients can surf my website/database and collect data for
 Off-Line working, exactly, I want, that they can download a
 file containing the requested data and importing it into there
 local database using a http://localhost/ Intranet Interface.

 Since $USER is generaly not a Geek/Nerd/Freek or something like
 this all must be done easyly...

 Now my question:

 What is the best format to transfer such data?

 I was thinking, that I create from each $ROW selected from the
 Database a PHP.include which contain the data in a array

 array[serno]=;
 array[foo]=...;
 array[bar]=...;

 which then can be imported and read from a PHP script.

 Additonaly I want to encrypt (the $USER must upload his/her public
 GPG key) this file because some of the stupid $USER can lost one
 (should not, but it allredy happen).

 Any suggestions?


 Greetings
 Michelle Konzack


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant
 #
 Michelle Konzack   Apt. 917  ICQ #328449886
50, rue de Soultz MSM LinuxMichi
 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Re: Looking for caveats to the following code

2006-08-18 Thread Ford, Mike
On 17 August 2006 23:28, Adam Zey wrote:

 
 Better to do this:
 
 if ( ($result = do_something('hello')) !== false )
 {
// do something with $result
 }
 else
 {
// do some other stuff
 }
 
 The result of an assignment like $result = do_something('hello') is
 itself the result you assigned, so you can still compare on that. The
 reason I put it in more brackets was just for readability. I
 don't think
 you actually need the extra set, but I'm not sure.

Of course you do -- without them, it's the equivalent of:

if ( $result = (do_something('hello') !== false) )

which will only assign TRUE or FALSE to $result.

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 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Robert Cummings
On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)
 
 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]
 
 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.
 
 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

Will you have two buttons for each question? So that you get the
hint/solution on a question by question basis? The solution is quite
simple:

html
head
script language=javascript type=text/javascript

var hints = new Array();
hints[1] = 'Hint for question 1';
hints[2] = 'Hint for question 2';
hints[3] = 'Hint for question 3';
hints[4] = 'Hint for question 4';
//...

var solutions = new Array();
solutions[1] = 'Solution for question 1';
solutions[2] = 'Solution for question 2';
solutions[3] = 'Solution for question 3';
solutions[4] = 'Solution for question 4';
//...

function showHint( id )
{
hideSolution();

var h = document.getElementById( 'questionHint' );
h.innerHTML = hints[id];
h.style.display = '';
}

function hideHint()
{
var h = document.getElementById( 'questionHint' );
h.style.display = 'none';
}

function showSolution( id )
{
hideHint();

var s = document.getElementById( 'questionSolution' );
s.innerHTML = solutions[id];
s.style.display = '';
}

function hideSolution()
{
var s = document.getElementById( 'questionSolution' );
s.style.display = 'none';
}
/script
/head
body
pblah blah blah blah blah blah/p

p
Question 1 ...
input type=submit value=Get Hint onclick=showHint( 1 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 1 );
return false; /
/p
p
Question 2 ...
input type=submit value=Get Hint onclick=showHint( 2 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 2 );
return false; /
/p
p
Question 3 ...
input type=submit value=Get Hint onclick=showHint( 3 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 3 );
return false; /
/p
p
Question 4 ...
input type=submit value=Get Hint onclick=showHint( 4 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 4 );
return false; /
/p
p.../p

p id=questionHint style=display: none;
/p

p id=questionSolution style=display: none;
/p

/body
/html


I'll leave it to you as an exercise to adapt it properly in PHP using
variables and loops instead of harded coded content :) BTW, this is not
PHP, but I'm feeling benevolent today ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Re: Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Peter Lauri
Some might suggest using JavaScript and storing the hint and solution with
that. However, then it is easy for the student to cheat. You could use AJAX
for this to load the info from the server upon request and put it into an
alert or into a div with a specific id using innerHTML (JS).

/Peter



Ryan A [EMAIL PROTECTED] escreveu na mensagem 
news:[EMAIL PROTECTED]
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)

 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]

 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.

 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

 Thanks in advance,
 Ryan

 --
 - 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!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com 

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

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



Re: [PHP] Re: Session issues

2006-08-18 Thread Dave Goodchild

Don't be sorry, that's not what I meant. The fields are completed by the
user, they submit and the cleaned and validated values are put into the
session. So when they go back their entered values are displayed. I made
sure of it by making sure these pages are never cached.

That issue is resolved. Now the only problem is that when the client
completes the cycle blank or default values are entered into the db, whereas
the other 4 remote testers have entered the data without issue.

On 18/08/06, Richard Lynch [EMAIL PROTECTED] wrote:


On Thu, August 17, 2006 12:56 pm, Dave Goodchild wrote:
 How does the user go back one page?  If it by using the browser's
 back-button, the php script has no way of knowing it.

 Yes, but the session variables have already been set, and are
 configured to
 display in the form fields.

Ah, but some browsers just don't work like that.

They assume that the user wants to re-use the values THEY entered, not
the ones that were the original default.

That's what an input type=reset / was designed for into the HTML
spec in the first place, after all.

You can get them to switch to a browser that behaves like they expect.

You can educate them to understand that their browser is supposed to
work that way.

You can give them a reset form button to put things back the way
they were.

But you can't change the browser to misbehave from the way that
particular browser manufacturer thinks browsers should work.  Sorry.

--
Like Music?
http://l-i-e.com/artists.htm






--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


RE: [PHP] active directory and PHP

2006-08-18 Thread Richard Lynch
On Fri, August 18, 2006 3:42 pm, Chris W. Parker wrote:
 Richard Lynch mailto:[EMAIL PROTECTED]
 on Friday, August 18, 2006 9:47 AM said:

 Active Directory is a bastardized LDAP with goofy idiosyncracies to
 drive you crazy.

 And you're speaking from experience?

No, from the umpteen questions on this list about why AD doesn't work
right in LDAP.

I've never used Oracle either, but I can still parrot the answer to
ora_logon after seeing it a few thousand times here...

PutEnv(ORA_HOME=/path/to/your/oracle/homedir);

[shrug]

Nobody says you can't just kill-file me ;-v

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] select colum in array.

2006-08-18 Thread John Nichel

Adam Zey wrote:

I must say


So you've said.  Three times now.  ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] select colum in array.

2006-08-18 Thread Richard Lynch
On Thu, August 17, 2006 9:02 am, João Cândido de Souza Neto wrote:
 I´m not sure if it´s the right place to get such answer, but if
 someone
 know, please, help me.

 In a select id,name,picture1,picture2,picture3 from product where
 id=10 i
 get an array with each colum in each element like this $result (id
 =
 10, name = name of product, picture1 = pic1.gif,
 picture2 =
 pic2.gif, picture3 = pic3.gif).

 Is there any way in select to get something like this:

 $result (id = 10, name = name of product, pictures =
 array(
 pic1 = pic1.gif, pic2 = pic2.gif, pic3 = pic3.gif) ).

If your database (MySQL? PostgreSQL? SQL Server? Oracle? Sybase?
Informix? DB?) has an array datatype, or, I guess, any datatype that
gets mapped to an array by the database-client + PHP implementation,
then, in theory, you could compose a SELECT that would work for that
particular database...

You'd be better off, however, to munge the data in your PHP, in my
opinion as that will be much more portable, and unless you are getting
thousands of rows at once, not much slower.

These functions will be very useful:
http://php.net/array_slice
http://php.net/array_splice

I think this is correct for your example:
$pictures = array_slice($result, 3);
$results = array_splice($result, 3, 3, $pictures);

The first line grabs everyting from the 3rd element on (the 3 pictures)

The second line replaces everything from element 3 through 6 (the
second 3 is a length parameter) with your new array.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] select colum in array.

2006-08-18 Thread Richard Lynch
On Fri, August 18, 2006 1:32 pm, Adam Zey wrote:
 I must say, I'm of the opinion that as much data processing should be
 done in the database server possible.

I agree with you 100% in principle...

But in this case, we're talking about structuring the data in a
PHP-specific data structure for easier application development.

Last I checked, SQL has not yet Standardized on an Array datatype,
much less all the major players actually IMPLEMENTED that Standard...

If you didn't detect the dripping sarcasm laden in the preceding
sentence, you haven't looked at SQL Standards versus actual
implementation much... :-)

 For one thing, munging data in
 PHP
 means you MUST have a complete copy of the result set in memory,
 instead
 of processing it row by row.

No, no, no.

We're just re-arranging the elements of the same result set from a 1-D
array into a nested array!

We're certainly not snarfing down the whole table and letting PHP sort
it out!

 PHP's 8MB memory limit can sometimes pose
 a
 problem if that munging involves several copies of the data floating
 around.

Yes -- But if you are loading in enough elements of a result set that
the difference between the $result and the spliced $result matters,
then you've got problems already.

Also, the default 8M went up to 16M yesterday in 5.2.0RC2 and 6.0.*
because you can't even [mumble mumble install PECL? mumble mumble]
with 8M...

At any rate, you're not quite envisioning the right thing here...

 Further, database servers are, in my opinion, easier to distribute
 than
 web servers if load is an issue. While your single script could easily
 connect properly to a database cluster, distributing the PHP scripts
 involves somehow getting the client to the right one, either by
 roundrobin DNS, or some sort of redirection mechanism.

Actually, in this case, I'm pretty sure we're not looking at an N-tier
architecture...

If we are, you'd have to rsync the PHP scripts, but that's about it.

There's no heavy lifting going on in PHP -- Just splicing an extra
array super-structure into part of an existing single result row.

BEFORE:
$result = mysql_fetch_row();

AFTER:
$result = mysql_fetch_row();
$pictures = array_slice($result, 3);
$result = array_splice($result, 3, 3, $pictures);

I suppose you could unset($pictures) to free up a single array of 3
strings, if you want to get real anal about the RAM...

 I also tend to think that the database would be faster. Perhaps the
 PHP
 script would only a few milliseconds longer than the database to
 process
 the data, but when you have multiple requests per second, those few
 milliseconds can REALLY add up. I'd rather spend the processor time on
 the webserver gzipping the data as it goes out. Of course, I have no
 benchmarks telling me that PHP would be slower than a database server
 for messing with data, I'm just making an assumption.

Your assumption is correct, in general.

The DB should do any FILTERING / SORTING of large-scale data.

But there's no way you're going to construct a SELECT query to get
back an array of SOME fields from a single row pre-populated in PHP
that will work across SQL platforms, and even if you get it to work in
one specific DB, it's going to be a close call as to whether there's
any savings at all in the DB building an array so that PHP can detect
that array and build that array in C, and a couple calls to
array_s[p]lice to build that array in PHP code.

NOTE:
The issue of having 3 fields named 'picture1', 'picture2', and
'picture3' being a sure indicator of a badly-designed
not-so-relational database schema is being completely ignored here,
until now... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] active directory and PHP

2006-08-18 Thread Chris W. Parker
Richard Lynch mailto:[EMAIL PROTECTED]
on Friday, August 18, 2006 9:47 AM said:

 Active Directory is a bastardized LDAP with goofy idiosyncracies to
 drive you crazy.

And you're speaking from experience?

 Never use AD myself.

Oh wait, I guess not... :/





Chris.

p.s. I'm just having fun.

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



Re: [PHP] Looking for caveats to the following code

2006-08-18 Thread Richard Lynch
On Thu, August 17, 2006 5:19 pm, Chris W. Parker wrote:
 The issue is whether or not this is a safe test. My initial thought is
 that it is safe since I'm simply checking for true/false-ness. I
 either
 check for '!== false' explicitly or (in the case of the latter
 example)
 check that something other than 'false' is returned.

It would probably be better to check:
if (do_something('hello') !== false){
}

 It's slightly less readable but it seems more efficient (if nothing
 more
 than to save on the number of lines typed).

Really, though, the question is more about 'hello' and where it comes
from than anything else.

If you have already scrubbed and validated 'hello' and you know it
does not start with the digit 0, and it's not an array, and...

Actually, to be correct, you should be able to say what 'hello' *IS*
rather than what it is not.

The rest of the code all hinges on the question of what's in the REAL
world for 'hello'

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Hey Ray/Tedd,
Thanks for replying guys.


Ray, Checked out the Y! library, not really to my
needs and I really doubt I need a whole library to do
this.

Tedd,
 
 Ryan:
 
 You said:
 
 ... willing to pay.
 
 Music to my ears.
 

Happy to have helped ;D



 This does not do what you want, but I am sure it can
 be modified to do so.
 
 http://www.webbytedd.com/c1/
 

Problem is, it didnt work in FF, I checked in IE and
there was no problem.

What I need is real simple, possible just a DIV
tag as Ray pointed out, but with a little
functionality to close/show the hints and
suggestions.. and should look decent.
The reason I dont mind going in for a commerical
solution is they tend to have some better display
options and the code is totally generated, new
question new code generated, simple as that. When
things go wrong its a b1t*h to debug of course!

Thanks!
Ryan

--
- 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!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[PHP] OT alternate website authentication methods

2006-08-18 Thread Chris W. Parker
Hello,

Last night I was reading Chris Shiflett's PHP Security book from
O'Reilly and got to thinking about ways to authenticate a user other
than using a password.

Ideas:

1. Use flash to allow the user to draw an image. If the original image
created during signup is within an acceptable range of the image used to
authenticate, let them in.

2. (I saw this somewhere else... don't remember where or what it's
called.) Use flash (again) to allow the user to click on an image in
certain places. I think it was that you clicked the image in three
places and then when you later authenticated you were supposed to click
in those same places plus one more (to throw off anyone looking over
your shoulder I think). As long as three of the 4 places clicked matched
your original points (within a certain tolerance) you were
authenticated.


I'm not sure that these systems are any more SECURE than a simple
username/password combo (keep in mind though, you'll also need some kind
of username) but at the very least it seems that it could be more
usable.


I'd be interested in hearing your thoughts as well as any links for
further reading.



Chris.

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



[PHP] e-Commerce password standards?

2006-08-18 Thread Richard Lynch
My boss has asked me to seek out any reputable Standards-based
documentation for end-user passwords for an e-commerce site.

In particular, this site allows users to login with username/password
and order food with their credit card on file.

So we want to force them to use suitable passwords on their accounts.

I've searched some of the obvious candidates, found nothing much, and
am in the process of determining at least some of the basic rules
for other similar sites.

Of course, some of the rules might be like:
If they haven't logged in for over 6 months then blah blah blah.

I'm not going to be able to determine that in a realistic time-frame.

Is there any sort of guide-line documentation maintained out there for
specifc use-cases?

Obviously the use-case of the password matters a great deal -- an
ecommerce site minimum standard is hopefully more stringent than some
stupid blog or something...

But surely the Banks aren't all just making up their own rules as they
go, are they?...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Hey Tedd,

 Would this be something that would select
 questions/hints/and 
 solutions from a larger dB?

No db, this page would be generated via a DB query but
the answers have to already be on the local page and
accessable to the JS, I dont want to complicate
matters using AJAX either

 
 Also, would pop-ups? work -- I know you said you
 wanted data to the 
 side or below, but that requires a refresh of some
 type (ajax). 

Nope, I have little choice in the matter, this has
already been decided to have to show up in cell at the
side or bottom, no popups as this window itself will
be a popup.

 You might also look into tool-tips via css -- I
 think that would work.

Thanks, will do

 
 If you need any help, just ask.

Thanks, but thats always the case with you!

Cheers!
Ryan

--
- 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!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Ryan A
Thanks Rob, 
I think thats exactly what was/is needed. Its real
simple and easy to modify.

 BTW, this is not PHP, 

Never said it was, didnt you notice my off topic (O.T)
in the subject? Theres enough spam on the list and I
didnt want to offend anyone so made sure I put it
there.

Will come back if I face problems, thanks for your
help once again.

Cheers!
Ryan


--- Robert Cummings [EMAIL PROTECTED] wrote:

 On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
  Hello,
  I am working on a php project that needs a little
  extra JS/DHTML solution. I am sure some of you
 might
  have come to use something like this before,
 please
  recommend a solution (commerial solutions are fine
 /
  willing to pay)
  
  Basically, I will have a page with around 10
 questions
  for students and then two buttons for [HINT] and
  [SOLUTION]
  
  When either of these buttons/text is clicked the
  resulting text should be displayed in the
 side/bottom
  cell, the user should also be able to 'close' this
  resulting explanation.
  
  Note, on each page there will be around 10
 questions,
  so each of these questions will have a hint 
 solution
  button/text.
 
 Will you have two buttons for each question? So that
 you get the
 hint/solution on a question by question basis? The
 solution is quite
 simple:
 
 html
 head
 script language=javascript
 type=text/javascript
 
 var hints = new Array();
 hints[1] = 'Hint for question 1';
 hints[2] = 'Hint for question 2';
 hints[3] = 'Hint for question 3';
 hints[4] = 'Hint for question 4';
 //...
 
 var solutions = new Array();
 solutions[1] = 'Solution for question 1';
 solutions[2] = 'Solution for question 2';
 solutions[3] = 'Solution for question 3';
 solutions[4] = 'Solution for question 4';
 //...
 
 function showHint( id )
 {
 hideSolution();
 
 var h = document.getElementById(
 'questionHint' );
 h.innerHTML = hints[id];
 h.style.display = '';
 }
 
 function hideHint()
 {
 var h = document.getElementById(
 'questionHint' );
 h.style.display = 'none';
 }
 
 function showSolution( id )
 {
 hideHint();
 
 var s = document.getElementById(
 'questionSolution' );
 s.innerHTML = solutions[id];
 s.style.display = '';
 }
 
 function hideSolution()
 {
 var s = document.getElementById(
 'questionSolution' );
 s.style.display = 'none';
 }
 /script
 /head
 body
 pblah blah blah blah blah blah/p
 
 p
 Question 1 ...
 input type=submit value=Get Hint
 onclick=showHint( 1 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 1 );
 return false; /
 /p
 p
 Question 2 ...
 input type=submit value=Get Hint
 onclick=showHint( 2 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 2 );
 return false; /
 /p
 p
 Question 3 ...
 input type=submit value=Get Hint
 onclick=showHint( 3 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 3 );
 return false; /
 /p
 p
 Question 4 ...
 input type=submit value=Get Hint
 onclick=showHint( 4 ); return
 false; /
 input type=submit value=Get Solution
 onclick=showSolution( 4 );
 return false; /
 /p
 p.../p
 
 p id=questionHint style=display: none;
 /p
 
 p id=questionSolution style=display: none;
 /p
 
 /body
 /html
 
 
 I'll leave it to you as an exercise to adapt it
 properly in PHP using
 variables and loops instead of harded coded content
 :) BTW, this is not
 PHP, but I'm feeling benevolent today ;)
 
 Cheers,
 Rob.
 -- 

..
 | InterJinn Application Framework -
 http://www.interjinn.com |

::
 | An application and templating framework for PHP.
 Boasting  |
 | a powerful, scalable system for accessing system
 services  |
 | such as forms, properties, sessions, and caches.
 InterJinn |
 | also provides an extremely flexible architecture
 for   |
 | creating re-usable components quickly and easily. 
 |

`'
 
 


--
- 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!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] simple scrip to stop email injection

2006-08-18 Thread Richard Lynch
On Thu, August 17, 2006 2:20 am, Ivo F.A.C. Fokkema wrote:

 if (preg_match(/\r\n/, array($fname, $sname, $email, $subject))){
   die(Spammer!);

 preg_match(/[\r\n]/, ...

You are absolutely correct.

Sorry.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Re: call_user_func_array on STATIC method

2006-08-18 Thread Greg Beaver
steve wrote:
 Does anyone know of a way to call a static method with an array of objects?
 
 I thought for sure this would work, but it does not:
 
 $v = call_user_func_array($class::$method,$params);
 
 Do I have to resort to eval()???

$v = call_user_func_array(array($class, $method), $params);

Greg

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



Re: [PHP] call_user_func_array on STATIC method

2006-08-18 Thread Chris

It's similar to the non-static method call:


$v = call_user_func_array(array($class,$method),$params);


steve wrote:
Does anyone know of a way to call a static method with an array of 
objects?


I thought for sure this would work, but it does not:

$v = call_user_func_array($class::$method,$params);

Do I have to resort to eval()???



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



Re: [PHP] Looking for caveats to the following code

2006-08-18 Thread Jochem Maas
Chris W. Parker wrote:
 Hello,



 
 ?php
 
 if($result = do_something('hello'))
 {
   // do something with $result
 }
 else
 {
   // do some other stuff
 }
 
 ?
 

nothing wrong with this. like Adam mentioned you can check the expression to see
if it is exactly false - and if you don't need $result you can also do it like 
so:

if (do_something('hello') !== false) {

}

or

// some consider this safer because accidentally assigning
// to a literal will cause an error - so you know right away when you made a 
type
if (false !== do_something('hello')) {

}

to make the 'safety' issue clearer consider these snippets:

if (false == $res) echo boo!;
if (false = $res) echo boo!;  // typo with fatal!

if ($res == false) echo boo!;
if ($res = false) echo boo!;  // typo with no error but your logic is 
silently borked!


 The issue is whether or not this is a safe test. My initial thought is
 that it is safe since I'm simply checking for true/false-ness. I either
 check for '!== false' explicitly or (in the case of the latter example)
 check that something other than 'false' is returned.
 
 It's slightly less readable but it seems more efficient (if nothing more
 than to save on the number of lines typed).

readable is probably a question of preference and what your acustomed to; in
situations where you don't need $result you can save on creating a variable by 
testing
directly on the return result of the given function.

 
 Thoughts?
 
 
 Chris.
 

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



Re: [PHP] PHPSESSID used sporatically

2006-08-18 Thread Richard Lynch
On Wed, August 16, 2006 10:56 pm, Michael B Allen wrote:
 On Thu, 17 Aug 2006 12:06:08 +1000
 Chris [EMAIL PROTECTED] wrote:

 Michael B Allen wrote:
  Searching through the logs and browsing my site (see sig) I
 sometimes see
  PHPSESSID is used as opposed to cookies. I know it's not simply
 that the
  client doesn't support cookies because I can see the same IP
 transition
  to and from using PHPSESSID. Can someone explain why this is
 happening?

 Is session.use_trans_sid switched on?

 Yes. It is. After reading about it I can't quite see what benifit it
 provides. Should I just turn it off?

If your userbase has been convinced by the idiot Media that Cookies
are Evil, you should just leave it on.

If you think COOKIES are somehow safer than GET args for data
transmission, turn it off. [*]

* Based on your Active Directory post, I'll assume you know COOKIE is
as amenable to sniffing as GET, and that the only potential differenes
are:
1. Users seldom export and forward Cookies, but often send URLs to
their friends.
2. The dumbest of the dumb can munge a URL. Altering a Cookie require
poking around in the Options... in current browsers, or editing text
files in older browsers.
3. Cookies can be set to be transmitted ONLY via SSL, which is good.
4. In PHP 5, with browsers that support it, Cookies can be sent only
over HTTP...  Though any Real Hacker (tm) could work around this
anyway, so it seems kinda pointless to me...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] select colum in array.

2006-08-18 Thread Adam Zey

Richard Lynch wrote:

On Thu, August 17, 2006 9:02 am, João Cândido de Souza Neto wrote:

I´m not sure if it´s the right place to get such answer, but if
someone
know, please, help me.

In a select id,name,picture1,picture2,picture3 from product where
id=10 i
get an array with each colum in each element like this $result (id
=
10, name = name of product, picture1 = pic1.gif,
picture2 =
pic2.gif, picture3 = pic3.gif).

Is there any way in select to get something like this:

$result (id = 10, name = name of product, pictures =
array(
pic1 = pic1.gif, pic2 = pic2.gif, pic3 = pic3.gif) ).


If your database (MySQL? PostgreSQL? SQL Server? Oracle? Sybase?
Informix? DB?) has an array datatype, or, I guess, any datatype that
gets mapped to an array by the database-client + PHP implementation,
then, in theory, you could compose a SELECT that would work for that
particular database...

You'd be better off, however, to munge the data in your PHP, in my
opinion as that will be much more portable, and unless you are getting
thousands of rows at once, not much slower.

These functions will be very useful:
http://php.net/array_slice
http://php.net/array_splice

I think this is correct for your example:
$pictures = array_slice($result, 3);
$results = array_splice($result, 3, 3, $pictures);

The first line grabs everyting from the 3rd element on (the 3 pictures)

The second line replaces everything from element 3 through 6 (the
second 3 is a length parameter) with your new array.


I must say, I'm of the opinion that as much data processing should be 
done in the database server possible. For one thing, munging data in PHP 
means you MUST have a complete copy of the result set in memory, instead 
of processing it row by row. PHP's 8MB memory limit can sometimes pose a 
problem if that munging involves several copies of the data floating around.


Further, database servers are, in my opinion, easier to distribute than 
web servers if load is an issue. While your single script could easily 
connect properly to a database cluster, distributing the PHP scripts 
involves somehow getting the client to the right one, either by 
roundrobin DNS, or some sort of redirection mechanism.


I also tend to think that the database would be faster. Perhaps the PHP 
script would only a few milliseconds longer than the database to process 
the data, but when you have multiple requests per second, those few 
milliseconds can REALLY add up. I'd rather spend the processor time on 
the webserver gzipping the data as it goes out. Of course, I have no 
benchmarks telling me that PHP would be slower than a database server 
for messing with data, I'm just making an assumption.


Regards, Adam.

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



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Robert Cummings
On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
 Robert,
 
 Isn't it to easy to cheat if you do like this? Just view the source and you
 have the answers. But, this is maybe not for examination, maybe just for
 learning. If it is examination, AJAX would be better, so that they can not
 find out the solution by just looking at the source.

I did it based on what he requested. The fact that there's a show
hint/solution button in the first place suggests that they can view the
information. I guess it depends on whether the questions are part of an
exam, or self quiz in which case the hint and solution can be condusive
to further learning.

As you say though, if it were a test, I'd use Ajax and register the show
hint/solution request. Probably incurring full point loss for show
solution and partial point loss for show hint.

As it were though, an Ajax solution is more involved and his request
didn't seem to indicate a need for it so I went with KISS :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Peter Lauri
Now I get interested, what is KISS? :)

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 12:14 PM
To: Peter Lauri
Cc: 'Ryan A'; 'php php'
Subject: RE: [PHP] Dhtml/javasript layer tips or software (0.T)

On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
 Robert,
 
 Isn't it to easy to cheat if you do like this? Just view the source and
you
 have the answers. But, this is maybe not for examination, maybe just for
 learning. If it is examination, AJAX would be better, so that they can not
 find out the solution by just looking at the source.

I did it based on what he requested. The fact that there's a show
hint/solution button in the first place suggests that they can view the
information. I guess it depends on whether the questions are part of an
exam, or self quiz in which case the hint and solution can be condusive
to further learning.

As you say though, if it were a test, I'd use Ajax and register the show
hint/solution request. Probably incurring full point loss for show
solution and partial point loss for show hint.

As it were though, an Ajax solution is more involved and his request
didn't seem to indicate a need for it so I went with KISS :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
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] call_user_func_array on STATIC method

2006-08-18 Thread steve

Does anyone know of a way to call a static method with an array of objects?

I thought for sure this would work, but it does not:

$v = call_user_func_array($class::$method,$params);

Do I have to resort to eval()???

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



RE: [PHP] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Peter Lauri
Robert,

Isn't it to easy to cheat if you do like this? Just view the source and you
have the answers. But, this is maybe not for examination, maybe just for
learning. If it is examination, AJAX would be better, so that they can not
find out the solution by just looking at the source.

/Peter


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 12:49 AM
To: Ryan A
Cc: php php
Subject: Re: [PHP] Dhtml/javasript layer tips or software (0.T)

On Fri, 2006-08-18 at 08:30 -0700, Ryan A wrote:
 Hello,
 I am working on a php project that needs a little
 extra JS/DHTML solution. I am sure some of you might
 have come to use something like this before, please
 recommend a solution (commerial solutions are fine /
 willing to pay)
 
 Basically, I will have a page with around 10 questions
 for students and then two buttons for [HINT] and
 [SOLUTION]
 
 When either of these buttons/text is clicked the
 resulting text should be displayed in the side/bottom
 cell, the user should also be able to 'close' this
 resulting explanation.
 
 Note, on each page there will be around 10 questions,
 so each of these questions will have a hint  solution
 button/text.

Will you have two buttons for each question? So that you get the
hint/solution on a question by question basis? The solution is quite
simple:

html
head
script language=javascript type=text/javascript

var hints = new Array();
hints[1] = 'Hint for question 1';
hints[2] = 'Hint for question 2';
hints[3] = 'Hint for question 3';
hints[4] = 'Hint for question 4';
//...

var solutions = new Array();
solutions[1] = 'Solution for question 1';
solutions[2] = 'Solution for question 2';
solutions[3] = 'Solution for question 3';
solutions[4] = 'Solution for question 4';
//...

function showHint( id )
{
hideSolution();

var h = document.getElementById( 'questionHint' );
h.innerHTML = hints[id];
h.style.display = '';
}

function hideHint()
{
var h = document.getElementById( 'questionHint' );
h.style.display = 'none';
}

function showSolution( id )
{
hideHint();

var s = document.getElementById( 'questionSolution' );
s.innerHTML = solutions[id];
s.style.display = '';
}

function hideSolution()
{
var s = document.getElementById( 'questionSolution' );
s.style.display = 'none';
}
/script
/head
body
pblah blah blah blah blah blah/p

p
Question 1 ...
input type=submit value=Get Hint onclick=showHint( 1 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 1 );
return false; /
/p
p
Question 2 ...
input type=submit value=Get Hint onclick=showHint( 2 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 2 );
return false; /
/p
p
Question 3 ...
input type=submit value=Get Hint onclick=showHint( 3 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 3 );
return false; /
/p
p
Question 4 ...
input type=submit value=Get Hint onclick=showHint( 4 ); return
false; /
input type=submit value=Get Solution onclick=showSolution( 4 );
return false; /
/p
p.../p

p id=questionHint style=display: none;
/p

p id=questionSolution style=display: none;
/p

/body
/html


I'll leave it to you as an exercise to adapt it properly in PHP using
variables and loops instead of harded coded content :) BTW, this is not
PHP, but I'm feeling benevolent today ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
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] Dhtml/javasript layer tips or software (0.T)

2006-08-18 Thread Larry Garfield
It is a small chocolate candy manufactured by the Hershey's corporation.

It's also the act of pressing one's lips against the body or lips of another, 
in a friendly, romantic, or sexual fashion.

It can also be a misspelling of a rock band that was popular a while back.

It is also an acronym for Keep It Simple, Stupid!

I leave the decision of which meaning was intended here as an exercise to the 
reader.

On Saturday 19 August 2006 00:32, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: Saturday, August 19, 2006 12:14 PM
 To: Peter Lauri
 Cc: 'Ryan A'; 'php php'
 Subject: RE: [PHP] Dhtml/javasript layer tips or software (0.T)

 On Sat, 2006-08-19 at 11:54 +0700, Peter Lauri wrote:
  Robert,
 
  Isn't it to easy to cheat if you do like this? Just view the source and

 you

  have the answers. But, this is maybe not for examination, maybe just for
  learning. If it is examination, AJAX would be better, so that they can
  not find out the solution by just looking at the source.

 I did it based on what he requested. The fact that there's a show
 hint/solution button in the first place suggests that they can view the
 information. I guess it depends on whether the questions are part of an
 exam, or self quiz in which case the hint and solution can be condusive
 to further learning.

 As you say though, if it were a test, I'd use Ajax and register the show
 hint/solution request. Probably incurring full point loss for show
 solution and partial point loss for show hint.

 As it were though, an Ajax solution is more involved and his request
 didn't seem to indicate a need for it so I went with KISS :)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

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



RE: [PHP] OT alternate website authentication methods

2006-08-18 Thread bruce
hi chris...

it's doable... it's actually quite secure depending on what your app is, and
what your user knowledge is...

check out www.passmarksecurity.com 

-


-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Friday, August 18, 2006 2:08 PM
To: php-general@lists.php.net
Subject: [PHP] OT alternate website authentication methods


Hello,

Last night I was reading Chris Shiflett's PHP Security book from
O'Reilly and got to thinking about ways to authenticate a user other
than using a password.

Ideas:

1. Use flash to allow the user to draw an image. If the original image
created during signup is within an acceptable range of the image used to
authenticate, let them in.

2. (I saw this somewhere else... don't remember where or what it's
called.) Use flash (again) to allow the user to click on an image in
certain places. I think it was that you clicked the image in three
places and then when you later authenticated you were supposed to click
in those same places plus one more (to throw off anyone looking over
your shoulder I think). As long as three of the 4 places clicked matched
your original points (within a certain tolerance) you were
authenticated.


I'm not sure that these systems are any more SECURE than a simple
username/password combo (keep in mind though, you'll also need some kind
of username) but at the very least it seems that it could be more
usable.


I'd be interested in hearing your thoughts as well as any links for
further reading.



Chris.

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

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