php-general Digest 8 Jul 2010 02:00:54 -0000 Issue 6835
Topics (messages 306730 through 306744):
Re: window.open access parent's JS?
306730 by: Skip Evans
Multiple Access Question
306731 by: tedd
306732 by: Robert Cummings
306733 by: Shawn McKenzie
306742 by: Paul M Foster
Creating image on-the-fly
306734 by: Karl DeSaulniers
306736 by: Marc Guay
306738 by: Ashley Sheridan
306740 by: Daevid Vincent
306741 by: Ashley Sheridan
State and City Database
306735 by: tedd
306737 by: Marc Guay
Date Test...
306739 by: Don Wieland
interface name file
306743 by: Augusto Flavio
306744 by: Hans Ã
hlin
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Yup, window.opener it is.
Much thanks. I was surprised how much Googling I did and
didn't find that.
On 07/07/2010 04:31 AM, Ashley Sheridan wrote:
Not really anything to do with PHP there :p
Well, given the breadth the topics I've seen discussed on this
list I thought it would slide by.
But for my penance I'll ask the following:
"Is there a way to have a window opened with window.open()
inherit the parent windows JS environment... when it resides
in a much larger PHP/MySQL application?"
How's that for a qualifier! :)
Skip
--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
Hi gang:
I have *my way* of handling this problem, but I would like to hear
how you guys do it.
Here's the problem -- let's say you have a database containing names
and addresses and you want "approved" users to be able to access the
data. As such, a user must login before accessing an editing script
that would allow them to review and edit the data -- nothing
complicated about that.
However, let's say you have more than one user accessing the editing
script at the same time and you want to make sure that any changes
made to the database are done in the most efficient manner possible.
For example, if two users access the database at the same time and
are editing different records, then there's no real problem. When
each user finishes editing they simply click submit and their changes
are recorded in the database. However, if two (or more) users want to
access the same record, then how do you handle that?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
tedd wrote:
Hi gang:
I have *my way* of handling this problem, but I would like to hear
how you guys do it.
Here's the problem -- let's say you have a database containing names
and addresses and you want "approved" users to be able to access the
data. As such, a user must login before accessing an editing script
that would allow them to review and edit the data -- nothing
complicated about that.
However, let's say you have more than one user accessing the editing
script at the same time and you want to make sure that any changes
made to the database are done in the most efficient manner possible.
For example, if two users access the database at the same time and
are editing different records, then there's no real problem. When
each user finishes editing they simply click submit and their changes
are recorded in the database. However, if two (or more) users want to
access the same record, then how do you handle that?
I would provide read access whatever the case. For write access I would
place a lock on the data for the first user to make the edit request.
The lock would have an expiry time, and the user in possession of the
lock could reset it if they need more time. Other users would be alerted
that another user is currently editing the data and that the lock will
expire in X minutes. If the user completes their edit before the timer
expires, then the timer will be automatically cleared upon commit of the
changes. Optionally, the user who doesn't get the lock could be alerted
to what user currently has the lock. Additionally, if we get complicated
we could allow a higher authority to steal the lock and alert the user
making edits.
Cheers,
Rob.
--- End Message ---
--- Begin Message ---
On 07/07/2010 11:59 AM, tedd wrote:
> Hi gang:
>
> I have *my way* of handling this problem, but I would like to hear how
> you guys do it.
>
> Here's the problem -- let's say you have a database containing names and
> addresses and you want "approved" users to be able to access the data.
> As such, a user must login before accessing an editing script that would
> allow them to review and edit the data -- nothing complicated about that.
>
> However, let's say you have more than one user accessing the editing
> script at the same time and you want to make sure that any changes made
> to the database are done in the most efficient manner possible.
>
> For example, if two users access the database at the same time and are
> editing different records, then there's no real problem. When each user
> finishes editing they simply click submit and their changes are recorded
> in the database. However, if two (or more) users want to access the same
> record, then how do you handle that?
>
> Cheers,
>
> tedd
I would load up the current db values at the beginning of the edit form
and store them in the session. Then on the processing page look them up
again and see if they match the session values. If not, then load the
edit form again with a message that says the record has recently been
updated by someone else.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
On Wed, Jul 07, 2010 at 12:59:30PM -0400, tedd wrote:
> Hi gang:
>
> I have *my way* of handling this problem, but I would like to hear
> how you guys do it.
>
> Here's the problem -- let's say you have a database containing names
> and addresses and you want "approved" users to be able to access the
> data. As such, a user must login before accessing an editing script
> that would allow them to review and edit the data -- nothing
> complicated about that.
>
> However, let's say you have more than one user accessing the editing
> script at the same time and you want to make sure that any changes
> made to the database are done in the most efficient manner possible.
>
> For example, if two users access the database at the same time and
> are editing different records, then there's no real problem. When
> each user finishes editing they simply click submit and their changes
> are recorded in the database. However, if two (or more) users want to
> access the same record, then how do you handle that?
Use a DBMS? I'm sorry if that seems flippant, but a DBMS handles this by
queuing the requests, which is one of the advantages of a client-server
DBMS.
So maybe I don't understand your question.
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Hello,
I was wondering if there was any way I can create an image from some
text with php?
For Eg: I have a text box that will have a number/letter combo,
I want it to dynamically gen the num/lett combo,
then create say a transparent png of that number/letter combo then
display it to the user.
Can I take this text box and make it a png?
Any pointers or insight appreciated.
If anyone happens to knows of a javascript equiv., that would work too.
TIA
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---
--- Begin Message ---
> I was wondering if there was any way I can create an image from some text
> with php?
Something like this?
http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php
--- End Message ---
--- Begin Message ---
On Wed, 2010-07-07 at 16:05 -0400, Marc Guay wrote:
> > I was wondering if there was any way I can create an image from some text
> > with php?
>
> Something like this?
>
> http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php
>
One thing to bear in mind is that this introduces extra server load if
the image is generated dynamically for each visit to a page. It's best
to save the image once it's first created and use that file if it exists
the next time round.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ashley Sheridan [mailto:[email protected]]
> Sent: Wednesday, July 07, 2010 1:22 PM
> To: Marc Guay
> Cc: php-general
> Subject: Re: [PHP] Creating image on-the-fly
>
> On Wed, 2010-07-07 at 16:05 -0400, Marc Guay wrote:
>
> > > I was wondering if there was any way I can create an
> image from some text
> > > with php?
> >
> > Something like this?
> >
> > http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php
> >
>
>
> One thing to bear in mind is that this introduces extra server load if
> the image is generated dynamically for each visit to a page. It's best
> to save the image once it's first created and use that file
> if it exists
> the next time round.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
Some folks call this a "cache" ;-)
http://en.wikipedia.org/wiki/Cache
--- End Message ---
--- Begin Message ---
On Wed, 2010-07-07 at 13:43 -0700, Daevid Vincent wrote:
>
> > -----Original Message-----
> > From: Ashley Sheridan [mailto:[email protected]]
> > Sent: Wednesday, July 07, 2010 1:22 PM
> > To: Marc Guay
> > Cc: php-general
> > Subject: Re: [PHP] Creating image on-the-fly
> >
> > On Wed, 2010-07-07 at 16:05 -0400, Marc Guay wrote:
> >
> > > > I was wondering if there was any way I can create an
> > image from some text
> > > > with php?
> > >
> > > Something like this?
> > >
> > > http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php
> > >
> >
> >
> > One thing to bear in mind is that this introduces extra server load if
> > the image is generated dynamically for each visit to a page. It's best
> > to save the image once it's first created and use that file
> > if it exists
> > the next time round.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
>
> Some folks call this a "cache" ;-)
> http://en.wikipedia.org/wiki/Cache
>
>
Yeah, well if ya wanna get all tek-nik-all! :p
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hi gang:
Does anyone have a source for a US State and City database?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
> Does anyone have a source for a US State and City database?
This is a monster but seems to contain what you need: http://www.geonames.org/.
Marc
--- End Message ---
--- Begin Message ---
Hello all,
I am processing an array to build an INSERT string in PHP. The code
below I build an a separate array for the TARGET fields and the VALUES.
I am trying to trap for a NULL ENTRY in a Date Input Field. Date
fields are identified with: $ffield['s']=='/'
I tried to add the "&& !empty($fval)" to the test but it is giving my
an unexpected results. In my case, I have a Data of Birth field that
keeps populating in the future: So 1941-06-16 inserts in the DB as
2041-06-16.
foreach($form_fields as $ffield){
$fval = is_array($ffield['f'])?joinFields($ffield['s'],
$ffield['f']):$_POST[$ffield['f']];
$query_values[] = "'".mysql_real_escape_string($ffield['s']=='/'
&& !empty($fval) ?date('y-m-d',strtotime($fval)):$fval)."'";
}
Will anyone point out the problem with this CODE?
Don Wieland
--- End Message ---
--- Begin Message ---
Hi,
I want to know which file name is appropriate for a interface. Today, for a
PHP class I use: NAME.class.php. What about a interface? Is there a
definition about it ?
Thanks
Augusto Morais
--- End Message ---
--- Begin Message ---
*.api
Application Programming Interface
http://en.wikipedia.org/wiki/Application_Programming_Interface
**********************************************
Hans Åhlin
Tel: +46761488019
icq: 275232967
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
2010/7/8 Augusto Flavio <[email protected]>:
> Hi,
>
>
> I want to know which file name is appropriate for a interface. Today, for a
> PHP class I use: NAME.class.php. What about a interface? Is there a
> definition about it ?
>
>
>
>
>
> Thanks
>
>
>
> Augusto Morais
>
--- End Message ---