php-general Digest 19 Aug 2006 17:33:30 -0000 Issue 4302

2006-08-19 Thread php-general-digest-help

php-general Digest 19 Aug 2006 17:33:30 - Issue 4302

Topics (messages 240887 through 240897):

Re: Dhtml/javasript layer tips or software (0.T)
240887 by: Peter Lauri
240888 by: Peter Lauri
240889 by: Larry Garfield
240891 by: Robert Cummings
240893 by: Peter Lauri
240895 by: Ryan A
240896 by: Ryan A

Re: Can a PHP 5 Object Be Persisted Past Script End?
240890 by: Richard Lynch

Re: OT alternate website authentication methods
240892 by: Satyam
240894 by: Peter Lauri

dynamic variable usage
240897 by: Hiren Parmar

Administrivia:

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

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

To post to the list, e-mail:
php-general@lists.php.net


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

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

2006-08-19 Thread Robert Cummings
On Sat, 2006-08-19 at 12:32 +0700, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

Keep it Simple Stupid. Generally a reminder not to over engineer
something :)

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] OT alternate website authentication methods

2006-08-19 Thread Satyam
For method 1) I can tell that it wouldn't work for me.  When I'm at home 
with my mouse, I can draw in a predictable way but if I'm on a plane, I 
cannot use the mouse so I have to rely on the touchpad, and then I wouldn't 
be able to draw anything, in fact, when not using my usual mouse I start 
using keyboard shortcuts as much as possible.  If I'm on a borrowed computer 
then all bets are off.  Though option 2) is less sensitive to this, it would 
still take me lots of time to accurately hit the right spots when not using 
my own mouse and I would rather have any keyboard entry alternative to any 
mouse option.


Satyam




- Original Message - 
From: Chris W. Parker [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Friday, August 18, 2006 11:08 PM
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




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 18/08/2006

--
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-19 Thread Richard Lynch
On Fri, August 18, 2006 11:39 am, Bruce Bailey wrote:
 Interesting.  Could you expand a little bit about what you mean by
 'message
 / distribution handler'?  My PHP isn't terribly good -- just enough to
 write
 test scripts for C/C++ extensions for others to use.

?php
  $socket = socket_create(...);
  socket_bind($socket, ...);
  while (true) { //loop forever, getting input
$data = socket_listen($socket, ...);
$parts = explode(,, $data);
$destination = $parts[0];
switch ($destination){
  //Hand off message for $destination to another process/script to
do something
  //This is kind of how Apache works...

  //Or maybe just deal with $data here, and then sit back and
listen for more stuff to do
  //This is kind of how MySQL server works
}
  }
?

The trick is in finding a suitable way to break down the requests
quickly and efficiently, and either deal with them super fast or route
them to somebody else to deal with so that main loop that runs forever
can always be sucking data in as fast as it comes, and getting it out
of the main loop being a CPU hog.

You don't want to fork in a web environment, almost for sure, but if
you can break down the tasks by a good taxonomy where any given task
can be dealt with WITHOUT needing to look up anything from other
tasks, you've won the battle.  This is why HTTP is the way it is.

If you can make your object data live in that main script above, it
will just be there all the time...

-- 
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-19 Thread Peter Lauri
I am a KISSER! :)

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 1:26 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 12:32 +0700, Peter Lauri wrote:
 Now I get interested, what is KISS? :)

Keep it Simple Stupid. Generally a reminder not to over engineer
something :)

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] OT alternate website authentication methods

2006-08-19 Thread Peter Lauri
1. Why not a scanner that scans your fingerprint and use that as
authentication method? Then you do not need any username or password, you
are who you are :)

2. Ten multiple choice questions where you have to preset the system with 5
of your dreams that only you know about, and then you have to be able to
tell witch one is bogus about you or not (the rest of the 10 are standard
bogus things coming from other users in the system).

3. Voice recognition, you have your username and password, just record them
and you are ready to go.

About your (2): Is there any real difference with a pin number on an ATM for
that?

I like the idea of having other then characters and numbers to do it with.
However, I do not think we will see it. Maybe we will get small security box
where you have to access it by your fingerprint, the rest will be done the
traditional way:

- Login to box with fingerprint
- Submit username to web site
- Get a question (usually a number)
- Submit into box that generates answer (usually a number)
- Submit answer to web site, web site checks if answer match with number
according to the public/private key constraints.

Back to work :)




-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 19, 2006 4:08 AM
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



Re: [PHP] xmlrpc_decode vs. xmlrpc_decode_request

2006-08-19 Thread Richard Lynch
On Thu, August 17, 2006 4:10 pm, Shu Chow wrote:
 Hi, I have a question that's been bugging me for a while.  What's the
 difference between xmlrpc_decode and xmlrpc_decode_request?  _request
 takes an extra parameter, $method, but I can't figure out what kind of
 effect it has.  I can pass a totally bogus parameter to it.

 What's the difference between these two functions, and what does the
 $method parameter do?

Since the second parameter, $method, is actually $method, it probably
doesn't matter what you pass *IN* to it -- It's probably going to have
something interesting in it after the function is called.

It's kind of like having a second, optional, return value that you can
use to see what happened.

A documented example of this usage is in 'exec':
http://php.net/exec
As you can see, the $output and $error parameters are optional and
$arg indicates that PHP will be altering whatever is in them.

Given that your mystery parameter is called $method, I'm guessing that
you will be told what method of decoding, if any, was done on the
data.

//Try something like this:
$data = xmlrpc_decode_request($xml, $method);
echo Method returned was: $methodhr /\n;
echo pre; var_dump($data); echo /pre\n;

Once you figure it out, please add a User Contributed Note, so
everybody else will know.

And then maybe somebody can promote your notes into the actual docs
and call it done. :-)

-- 
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-19 Thread Ryan A
Hey Rob,

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

The simple solution is exactly what i needed, it may
not have a lot of bells and whistles but thats the
whole point. Easy to add and update. No points/scores
to keep track of so no was AJAX needed.

I didnt mind going in for a commerical solution as
they tend to have a better GUI output (for example
look at the dhtml popup softwares... a whole lot of
options ready for you with a single click, things that
would take you hours if not days to do by hand
coding), I am still interested if I can find something
like that otherwise your solution is perfect
alternative. 

Just need to figure out how to change the cells
background color when the hint is shown and change it
back when the hint is hidden again.

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] Re: dynamic variable usage

2006-08-19 Thread Hiren Parmar

hi,

I think this will make more clearance about the problem..

actully i want to compare 2 files which has all most same variable's but the
values are diffrant  for e.g.

1 file has username=abc and other has username = bcd ...

my actul code is like ...
my first file contains ... file1.php
php Code:


  1. ?php
  2. DEFINE http://www.php.net/define('_EZ_USERNAME','Username');
  3. DEFINE http://www.php.net/define('_EZ_PASSWORD','Password');
  4. ?

my second file contains ... file2.php
php Code:


  1. ?php
  2. DEFINE http://www.php.net/define('_EZ_USERNAME','Gebruikersnaam');
  3. DEFINE http://www.php.net/define('_EZ_PASSWORD','Wachtwoord');
  4. ?

and third file has code like ...
php Code:


  1. function  comp_file ($Filename){
  2. include( $Filename);
  3.
  4.$fpEng = /file1.php;
  5. $lines = file http://www.php.net/file($fpEng);
  6. foreach ($lines as  $line_num = $line) {
  7. $line = str_replace
http://www.php.net/str_replace(?php,,$line);
  8. $line = trim http://www.php.net/trim($line);
  9. if ($line == ){
  10. next http://www.php.net/next($lines);
  11. }
  12. elseif($line == ?){
  13. next http://www.php.net/next($lines);
  14. }
  15. else {
  16. $line = str_replace
http://www.php.net/str_replace(DEFINE(',,$line);
  17. $line = str_replace
http://www.php.net/str_replace(',',,,$line);
  18. $line = str_replace
http://www.php.net/str_replace(');,,$line);
  19. list http://www.php.net/list($fieldNm,
$caption) = explode http://www.php.net/explode(,, $line );
  20. /*$$fieldNm = $fieldNm;
  21. $tmp =  $fieldNm ;
  22. //eval($fieldNm)
  23. eval(\$tmp = \$tmp\;);*/
  24.echo http://www.php.net/echo $caption ;
  25.echo http://www.php.net/echo
'input name=?php echo $fieldNm ;? value=?php //here i want
value form($Filenamefile ) ; ? type=text size=70' ;
  26. }
  27. }
  28. }
  29. comp_file(file2.php);



so now when i do read file2 i got $caption = 'UserName' ... and $fieldNm =
'_EZ_USERNAME' by using this $fieldNm ' s value i want to use the variable
of file2 

i think this will help you more in help me out

On 8/19/06, Hiren Parmar [EMAIL PROTECTED] wrote:


Hi ,

i have one problem regarding variable's access ...

i hv defined some varibale like

DEFINE('_xx_USERNAME','Username');

in one file ...

and in another file , i got this variable (_xx_USERNAME) as a value of
another variable ... like

$filedValue = '_xx_USERNAME' ;

now , the problem is i want the value of _xx_USERNAME in the second file
...
that is *Username*...  by using variable $filedValue ...

how could i do this ?


--
Hiren Parmar
--
http://www.i3brains.com/





--
Hiren Parmar
--
http://www.i3brains.com/


Re: [PHP] OT alternate website authentication methods

2006-08-19 Thread tedd

At 2:08 PM -0700 8/18/06, Chris W. Parker wrote:

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

Chris.


Chris:

I've done a little on this, see:

http://xn--ovg.com/captcha

The main problem in all visual security measures is dealing with the 
disabled. To draw an image or to see the typical CAPTCHA is simply 
not possible. That's one of the reasons I wrote an audio CAPTCHA.


To bad someone hasn't found another way.

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



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

2006-08-19 Thread Robert Cummings
On Sat, 2006-08-19 at 08:09 -0700, Ryan A wrote:

 Just need to figure out how to change the cells
 background color when the hint is shown and change it
 back when the hint is hidden again.

Just set the bckground colour of the div that contains the hint.

div style=background: #ff; padding: 15px;

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] dynamic variable usage

2006-08-19 Thread Hiren Parmar

Hi ,

i have one problem regarding variable's access ...

i hv defined some varibale like

DEFINE('_xx_USERNAME','Username');

in one file ...

and in another file , i got this variable (_xx_USERNAME) as a value of
another variable ... like

$filedValue = '_xx_USERNAME' ;

now , the problem is i want the value of _xx_USERNAME in the second file ...

that is *Username*...  by using variable $filedValue ...

how could i do this ?


--
Hiren Parmar
--
http://www.i3brains.com/


Re: [PHP] e-Commerce password standards?

2006-08-19 Thread tedd

At 2:45 PM -0500 8/18/06, Richard Lynch wrote:

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.


Richard:

I'm sure you Googled for this, but password strength brought up 
some interesting results. The most interesting/informative for me was:


http://www.securitystats.com/tools/password.php

I think the site is a bit dated, but it's good information.

To force your users to have a secure password, you could provide 
tools to help them, such as a password generator (one that would suit 
your security concerns) or provide a strength meter and then only 
accept those with the appropriate strengths.


I have code, but some might refer to it as kiddy-script caliber.

Please let me know if I can help.

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



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

2006-08-19 Thread tedd

Just need to figure out how to change the cells
background color when the hint is shown and change it
back when the hint is hidden again.

Thanks!
Ryan


Use the DOM, Luke.

Or, use a style switcher, like:

http://www.sperling.com/examples/styleswitch/

Using css is a good way to accomplish this.

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



Re: [PHP] dynamic case statements?

2006-08-19 Thread Richard Lynch
On Fri, August 18, 2006 11:58 am, Tom Cruickshank wrote:
 Would anyone know if it's possible to have dynamic case
 statements?

Almost for sure...

I *know* you can use switch(true) and put *ANY* expression you want
for a case.

switch (true) {
  case $temp === 'status':
$theform-status();
  break;
  case $temp:
$theform-form($temp);
  break;
}

 Theform = new form();

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

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

This, however, is probably better handled with a 'default:' instead of
case $temp...

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

Then your class form probably does not have a function named form...

In fact, if it does, then in PHP4 that was the constructor, so you
probably can't use that for ANYTHING other than saying:
new form;

And form() gets called on 'new' and only on 'new'

-- 
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] Shopping cart

2006-08-19 Thread Ryan A
Hey,
I have been long enough on this list to know this
shopping cart question comes up real often and
irritates a lot of folks, but sorry, I have checked
google and hotscripts and it has come down to a
recommendation from YOU guys as they are SO many
options out there with each cart most of which i will
never need.

Feel free to mention commercial products as I have
been looking at them too, but if i go in for a
commercial solution I will have to cut somewhere else
as this is for myself and i'm starting out...budgets
low and am trying to do everything myself, but dont
have time to make this myself.

Will be selling spare parts.

I dont want a cart to do a million things, just around
10 :)

1. Admin panel where i enter quantity and it keeps
track of inventry
2. Should be *fast* (php+mysql solution)
3.Intergrate with paypal+2checkout anything more is a
bonus
4. Easy to template
5. Calculates shipping (not vital, but bonus if it
does)
6. Should be able to give discounts based on price and
accept discount codes.
7. Should offer the customers who bought this also
bought feature
8. Easy to maintain 

OSC is the first cart that comes to mind, followed by
Zen, xcart (xcart out of my budget though)

Am leaning towards OSC for the price but its got an
overload of bulk and speed problems... 

Please recommend, even a link to any site and a go to
that f***ing site (the = of a RTFM) would be
appreciated.

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



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

2006-08-19 Thread Ryan A
  Just need to figure out how to change the cells
  background color when the hint is shown and change
 it
  back when the hint is hidden again.



 
 Just set the bckground colour of the div that
 contains the hint.
 
 div style=background: #ff; padding: 15px;


DUH! Of course... am totally duh! this week, 9 hour
working days and 4 company meetings + 2 presentations.

Thanks again,
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-19 Thread Ryan A


--- tedd [EMAIL PROTECTED] wrote:

 Just need to figure out how to change the cells
 background color when the hint is shown and change
 it
 back when the hint is hidden again.
 
 Thanks!
 Ryan
 
 Use the DOM, Luke.
 
 Or, use a style switcher, like:
 
 http://www.sperling.com/examples/styleswitch/
 
 Using css is a good way to accomplish this.
 
 tedd

If I'm Luke, who are you?

Yoda? ;D

Thanks for the tip, I have already used the tip that
Rob gave me, so for now am happy and wont touch
anything!

cheers!

--
- 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-19 Thread Ryan A
Hey!

 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.


Sorry for not explaining this earlier guys, this is
not for any test, its to teach young kids (ages 10-14)
maths in Swedish, the kids are from other countries
where Swedish is not their own language.

No testing, no keeping points or scores.

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



Re: [PHP] Shopping cart

2006-08-19 Thread Larry Garfield
OSCommerce is crap.  Don't bother.

obligatory plug

The Drupal CMS has a complete suite of ecommerce modules that work with it.  
I've not worked with it recently, but if you just need a straightforward 
shopping cart it should be fine.

http://drupal.org/
http://drupal.org/project/ecommerce

All GPLed.

/obligatory plug

On Saturday 19 August 2006 10:37, Ryan A wrote:
 Hey,
 I have been long enough on this list to know this
 shopping cart question comes up real often and
 irritates a lot of folks, but sorry, I have checked
 google and hotscripts and it has come down to a
 recommendation from YOU guys as they are SO many
 options out there with each cart most of which i will
 never need.

 Feel free to mention commercial products as I have
 been looking at them too, but if i go in for a
 commercial solution I will have to cut somewhere else
 as this is for myself and i'm starting out...budgets
 low and am trying to do everything myself, but dont
 have time to make this myself.

 Will be selling spare parts.

 I dont want a cart to do a million things, just around
 10 :)

 1. Admin panel where i enter quantity and it keeps
 track of inventry
 2. Should be *fast* (php+mysql solution)
 3.Intergrate with paypal+2checkout anything more is a
 bonus
 4. Easy to template
 5. Calculates shipping (not vital, but bonus if it
 does)
 6. Should be able to give discounts based on price and
 accept discount codes.
 7. Should offer the customers who bought this also
 bought feature
 8. Easy to maintain

 OSC is the first cart that comes to mind, followed by
 Zen, xcart (xcart out of my budget though)

 Am leaning towards OSC for the price but its got an
 overload of bulk and speed problems...

 Please recommend, even a link to any site and a go to
 that f***ing site (the = of a RTFM) would be
 appreciated.

 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

-- 
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] Session issues

2006-08-19 Thread Richard Lynch
If the problem is that their browser is not accepting the cookies,
then turning on trans-sid will fix it -- as the session ID is then
passed in the URL as GET argument.

Only problem there is that users are more likely to forward a link
that exposes their session ID to somebody else, so unless you are
careful about logging them out after a time-out and re-authenticating
whenever they do something crucial, they can end up leaking their own
privacy.

On Fri, August 18, 2006 11:25 am, Dave Goodchild wrote:
 Does enabling transparent session ids solve the cookie issue? I
 visited
 plenty of sites that use cookies and sessions on the same setup and
 none
 caused the same issue.

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

 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





 --
 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] Creating User Friendly URLS [SOLVED]

2006-08-19 Thread Dave M G

PHP List,

Thank you to everyone who helped out.

I'm happy to report that the issue is solved, mainly with the help of my 
local LUG. I am getting nice friendly URLs, so mod_rewrite seems to be 
working.


The solution was almost entirely to do with getting Apache working. Once 
I had the URLs correctly pointing to my index.php file, then 
manipulating $_SERVER['REQUEST_URI'] was a snap.


The trickiest part for me was that on my own Apache server, mod_rewrite 
was not enabled.


In any case, for my own reference as well as others, although the path 
to the answer was a little stumbly, here are the steps that I think 
ultimately lead to getting everything to work. This is entirely to do 
with setting up Apache to handle friendly URLS, but hopefully will be of 
use to PHP developers.


1. # sudo a2enmod rewrite

2. Confirm that the rewrite.load file is in /etc/apache2/mods-enabled

Currently I have the following files in that directory:
cgi.load  php5.conf  php5.load  rewrite.load

3.  # sudo gedit /etc/apache2/sites-available/default

Find where it says:
   Directory /var/www/
   Options Indexes FollowSymLinks MultiViews
   AllowOverride None
   Order allow,deny
   allow from all

And change AllowOverride None to AllowOverride all. (I noticed that 
None was in upper case, and all was lowercase. Don't know if case is 
important, but this is the way that it worked for me).


Some sites said to edit /etc/apache2/sites-enabled/000-default, or 
sometimes default-000, but they are just symlinks to 
/etc/apache2/sites-available/default (at least in my case).


4. #  sudo gedit /etc/apache2/httpd.conf

Add the following lines:
IfModule mod_rewrite.c
RewriteEngine On
/IfModule

No other editing of httpd.conf was necessary, despite some sites that 
said to use LoadModule.
It should be noted, though, that even though mod-rewrite is working, it 
isn't listed when I run /usr/sbin/apache2 -l. I don't know if that's 
odd behaviour or not, just that it seemed like it was supposed to be 
listed there.

5. Reload the apache modules and restart Apache.

# sudo /etc/init.d/apache2 force-reload
# sudo /etc/init.d/apache2 restart

6. Create an .htaccess file (if there isn't one already) in the 
directory where one wants to create user friendly URLS, and add the 
following:


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

These rules say that if the file or directory named in the URL is real, 
then go there. Otherwise, go to the index file for processing. At least 
that's what it seems to do. I didn't write it, so I can't assure anyone 
of the correctness of the syntax.


It should be noted, though, that even though mod-rewrite is working, it 
isn't listed when I run /usr/sbin/apache2 -l. I don't know if that's 
odd behaviour or not, just that it seemed like it was supposed to be 
listed there.


If anyone can see problems in the above, or if I've misunderstood some 
part, please let me know.


Thanks to the PHP list for their ever-present help and support.

--
Dave M G

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



[PHP] number list

2006-08-19 Thread Bigmark
Hi, can anyone help me with this at all.

i have a table leaderboard with username points etc and can echo the scores
in asc order ok but what i want is to grab the scores and display a users
position using their session ID.

So if the scores are for example:
36 user3
22 user1
18 user4
12 user2

How do i show user 1's position on the leaderboard on their user login page.
here are the fields in table 'leaderboard'
ID
user_id
username
points
comp_id
email

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