|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 19 Aug 2006 17:33:30 -0000 Issue 4302
php-general-digest-help
lists.php.net
Date: Sat Aug 19 2006 - 12:33:30 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 19 Aug 2006 17:33:30 -0000 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:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
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:robert
interjinn.com]
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>
<p>blah 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
attached mail follows:
Now I get interested, what is KISS? :)
-----Original Message-----
From: Robert Cummings [mailto:robert
interjinn.com]
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
attached mail follows:
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:robert
interjinn.com]
> 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
larry
garfieldtech.com 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
attached mail follows:
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. |
`------------------------------------------------------------'
attached mail follows:
I am a KISSER! :)
-----Original Message-----
From: Robert Cummings [mailto:robert
interjinn.com]
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. |
`------------------------------------------------------------'
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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
attached mail follows:
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" <cparker
swatgear.com>
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
attached mail follows:
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:cparker
swatgear.com]
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
attached mail follows:
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/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]