Robert Cummings wrote:
>On Wed, 2006-11-15 at 20:36 -0600, Larry Garfield wrote:
>
>
>>I've run into this sort of issue a few times before, and never found a good
>>solution. Now a client has been hit with it and is asking for a solution,
>>and I'm not convinced there is one. :-)
>>
>>Client
On Wed, 2006-11-15 at 20:36 -0600, Larry Garfield wrote:
> I've run into this sort of issue a few times before, and never found a good
> solution. Now a client has been hit with it and is asking for a solution,
> and I'm not convinced there is one. :-)
>
> Client has a large MS SQL database wit
I've run into this sort of issue a few times before, and never found a good
solution. Now a client has been hit with it and is asking for a solution,
and I'm not convinced there is one. :-)
Client has a large MS SQL database with lots of data. Some of that data
includes "smart quotes", aka cu
At 11/15/2006 02:06 PM, Børge Holen wrote:
Oh this was good.
I added a while loop to insert extra strings "0"
in front of the number to add
if the string is less than 5 chars short.
I forgot to mentinon that the string actually could be shorter (just found
out) and the code didn't work with fe
Robert Cummings wrote:
On Thu, 2006-11-16 at 10:47 +1100, Chris wrote:
Børge Holen wrote:
Oh this was good.
I added a while loop to insert extra strings "0" in front of the number to add
if the string is less than 5 chars short.
sprintf is your friend here, no need to use a loop.
sprintf('%0
On Thu, 2006-11-16 at 10:47 +1100, Chris wrote:
> Børge Holen wrote:
> > Oh this was good.
> > I added a while loop to insert extra strings "0" in front of the number to
> > add
> > if the string is less than 5 chars short.
>
> sprintf is your friend here, no need to use a loop.
>
> sprintf('%0
Børge Holen wrote:
Oh this was good.
I added a while loop to insert extra strings "0" in front of the number to add
if the string is less than 5 chars short.
sprintf is your friend here, no need to use a loop.
sprintf('%05d', '1234');
--
Postgresql & php tutorials
http://www.designmagick.com
bruce wrote:
hi chris...
for the initial post, it does/did matter for register_globals to be on/off.
in your reply, you use a $_GET[..] for the $path var. in the initial post
that i saw, (which i replied to), the $path var was simply used, without the
$_GET[..]. it's my understanding (recollect
Oh this was good.
I added a while loop to insert extra strings "0" in front of the number to add
if the string is less than 5 chars short.
I forgot to mentinon that the string actually could be shorter (just found
out) and the code didn't work with fewer than 5 char strings.
But now is rocks.
well, there are more reasons you should use cURL ..
- control and flexibility of the output,
- post variables,
- can interact with secure servers (ssl - supports certificates)
- can use with proxys (http/socks)
- set timeouts
- easily modify headers :)
- use different ip`s of the server when it`s
On 11/15/06, Philip Thompson <[EMAIL PROTECTED]> wrote:
Hi.
I've been doing some reading trying to figure out why I would want to
use cURL. I have not found a solid reason yet. Does anyone have a
useful example on why you would want to use cURL?
Thanks,
~Philip
--
PHP General Mailing List (htt
Philip Thompson wrote:
I've been doing some reading trying to figure out why I would want to
use cURL. I have not found a solid reason yet. Does anyone have a
useful example on why you would want to use cURL?
It allows significant configurability and flexibility over PHP's more
direct function
You would use cURL to achieve the things cURL is built to achieve?
Hi.
I've been doing some reading trying to figure out why I would want to
use cURL. I have not found a solid reason yet. Does anyone have a
useful example on why you would want to use cURL?
Thanks,
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.
On 15/11/06, Programmer <[EMAIL PROTECTED]> wrote:
Problem solved: the reason print($url) caused the program to work is because
the page calling Secure_Login no longer existed and therefore the print
forced a die--I assume. I included a die in the redirect function and all
was well. Including d
Thanks Jon - You put me on the right track. Apparently audio/x-mp3 is
what iTunes wants to see, and it seems to work with browsers. :)
On Nov 15, 2006, at 10:06 AM, Jon Anderson wrote:
Brian Dunning wrote:
header('Content-Type: application/octet-stream');
What should I change?
I thi
Problem solved: the reason print($url) caused the program to work is because
the page calling Secure_Login no longer existed and therefore the print
forced a die--I assume. I included a die in the redirect function and all
was well. Including die in the redirect function made sure the page that
w
Brian Dunning wrote:
header('Content-Type: application/octet-stream');
What should I change?
I think you should use a content type more specific to MP3s. My install
of firefox seems to think the appropriate content type for those is
"audio/mpeg" - try that, and see what happens.
jon
I'm trying to route all my MP3 requests through a brief PHP script to
log the downloads to a database, and then I want to output the MP3
exactly as if the browser had requested it normally. So far I haven't
found headers that will serve it normally; it either wants to
download it as an atta
hi chris...
for the initial post, it does/did matter for register_globals to be on/off.
in your reply, you use a $_GET[..] for the $path var. in the initial post
that i saw, (which i replied to), the $path var was simply used, without the
$_GET[..]. it's my understanding (recollection) that if t
The following function is a basic user auth prep procedure for multiple
pages. If the url desired is different than the default a url is supplied.
This function works most of the time flawlessly; except, on some pages when
the url has a value that was passed, the function still thinks url is NULL
John Pillion wrote:
Very nifty Brad,
One addition though, so she/you can work back from any point:
$i = 0;
$start = strtotime("2006-10-05 12:05am");
while(count($img_array) < 5) {
$year = date("Y", strtotime("-$i minutes", $start));
$month= date("m", strtotime("-$i minutes"
At 8:18 AM -0700 11/15/06, Ashley M. Kirchner wrote:
I have files that are named in the following manner:
file..jpg (where is an hhmm timestamp [hour and minutes])
What's the best way to take the current hhmm timestamp and run
backwards finding the previous 5 files, and check
Stut wrote:
mall, minor, insignificant point If I have less than 5 files this
loop will never end. But you all knew that right?
Yup. I break out of the loop if $i reaches 10 for some weird reason.
Also, depending on the frequency of files (i.e. are there months-worth
of gaps or minutes
TemuriI wrote:
class baseForm {
private $_id = 10;
function __get($member)
{
echo "Accessing member \"{$member}\" : \n";
return $this->$member;
}
function checkID()
{
echo $this->_id."\n";
}
}
class inputText extends baseForm
{
function display()
{
class baseForm {
private $_id = 10;
function __get($member)
{
echo "Accessing member \"{$member}\" : \n";
return $this->$member;
}
function checkID()
{
echo $this->_id."\n";
}
}
class inputText extends baseForm
{
function display()
{
Hi Edward,
What I am trying to do is to write a set of classes that generate HTML
code for HTML form elements (input type=text, textarea, hidden, buttons,
etc).
Now I thought I'd define a base class that would have properties common
to all form elements, like: value, name, id, title, css cla
TemuriI wrote:
> Hi all, here is the code I am having problem with:
>
>
>
> class baseForm {
>private $_id = 10;
>
>function __get($member)
>{
>echo "Accessing member \"{$member}\" : \n";
>return $this->$member;
>}
>
Very nifty Brad,
One addition though, so she/you can work back from any point:
$i = 0;
$start = strtotime("2006-10-05 12:05am");
while(count($img_array) < 5) {
$year = date("Y", strtotime("-$i minutes", $start));
$month= date("m", strtotime("-$i minutes", $start));
$d
Surely it would be simpler to store all this info in a database table? e.g.
id : int
created : timestamp
filename : varchar
Only files that actually existed would be in the DB, plus you could do all
your sorting on the 'created' timestamp column. Querying the DB should be
much simpler a
On Tue, 14 Nov 2006 15:11:56 -0500, Brad Fuller wrote:
>
>
> $prevminute = sprintf('%02s', date("i")-1);
Or, $prevminute = str_pad(date("i")-1, 2, '0', STR_PAD_LEFT);
It's a little more code - don't ask me about the speed :)
Ivo
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
Barry,
that did not work.
Look, you said that $_id is of type private and that's why it cannot be
accessed. However, I am trying to access it from checkID() that is a
method of the same base class.
Any clue why it does not work?
Thx,
Temuri
Barry wrote:
TemuriI schrieb:
just a small idea
> From what I see, the __get() accessor function is triggerred only from
> OUTSIDE the class.
>
>From my understanding of OOP, that is how it should behave. __get and __set
methods are there to abstract away the actual member variables and provide a
consistent interface to other classes. When ca
TemuriI schrieb:
just a small idea.
public function __get() {...}
Might work *untested*
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Ashley,
Are all the files called file..jpg or could they have other names such
as clouds.1123.jpg, field.2034.jpg etc?
If they all have the same name, you could use something like scandir() and
then just use the first 5 items in the returned array.
You could also loop through the director
Hi, thanks for the response.
But the thing with __get() & _set() is that the members should either be
*not* declared or be of private type to trigger accessor functions.
That's the reason I have _id as private (also to trigger some other
action when __set() fires up).
Now, it gets inherited
$img_array = array();
$i = 0;
while(count($img_array) < 5) {
$year = date("Y", strtotime("-$i minutes"));
$month= date("m", strtotime("-$i minutes"));
$day = date("d", strtotime("-$i minutes"));
$hour = date("H", strtotime("-$i minutes"));
$hhmm = date
TemuriI schrieb:
Hi all, here is the code I am having problem with:
class baseForm {
private $_id = 10;
function __get($member)
{
echo "Accessing member \"{$member}\" : \n";
return $this->$member;
}
function checkID()
Hi all, here is the code I am having problem with:
class baseForm {
private $_id = 10;
function __get($member)
{
echo "Accessing member \"{$member}\" : \n";
return $this->$member;
}
function checkID()
{
echo $th
$img_array = array();
$i = 0;
while(count($img_array) < 5) {
$hhmm = date("Hi", strtotime("-$i minutes"));
$filename = "file.$hhmm.jpg";
if(file_exists("/path/to/$filename")) {
$img_array[] = $filename;
}
$i++;
}
print_r($img_ar
test
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Edward Kay wrote:
Are all the files called file..jpg or could they have other names such
as clouds.1123.jpg, field.2034.jpg etc?
They are all the same exact file name with the only difference being
the timestamp.
Alternatively, you could get the OS to do the work through an exec call t
one solution could probably be made using: glob(), sort() and/or filemtime().
btw: I assume your aware that the filenames are not very unique (i.e. twice a
day, everyday a given file will potentially be overwritten) and that this
is intentional
Ashley M. Kirchner wrote:
>
>I have files that
sorry, clicked on send too fast ;)
i'd extract the minues and seconds , generate an array of timestamps and
sort that array "desc"
--
View this message in context:
http://www.nabble.com/Checking-file-existence-tf2636778.html#a7359891
Sent from the PHP - General mailing list archive at Nabble.co
Ashley M. Kirchner wrote:
>
>
> I have files that are named in the following manner:
>
> file..jpg (where is an hhmm timestamp [hour and minutes])
>
> What's the best way to take the current hhmm timestamp and run
> backwards finding the previous 5 files, and checking w
I have files that are named in the following manner:
file..jpg (where is an hhmm timestamp [hour and minutes])
What's the best way to take the current hhmm timestamp and run
backwards finding the previous 5 files, and checking whether they
actually exist? There's a possibil
Ed Lazor wrote:
I'm reading a book on CSS and how you can define different style sheets
for different visitors. I'm wondering how you guys do it. The book
recommends using Javascript functions for identifying the user's browser
and matching them with the corresponding style sheets. Anyone us
At 11:02 PM + 11/14/06, Tom Chubb wrote:
Posts like this are what makes this list so great!
It's better to read this here than experience it first hand!
Thanks Tedd, for highlighting the problem.
Tom
Tom:
You're welcome, but I never have a problem showing my ignorance. --
that just comes
hmmm, this reply turned into something that resembles a rant about halfway
thru...
still ... maybe it's helpful in some way.
Ed Lazor wrote:
> I'm reading a book on CSS and how you can define different style sheets
> for different visitors. I'm wondering how you guys do it. The book
> recommend
Chris wrote:
David Tulloh wrote:
Dotan Cohen wrote:
If I have to perform 30 LIKE searches for different keywords in a
varchar field, which strategy would be recommended:
1) 30 searches, one for each keyword
2) To select the varchar field from all the rows, and search through
them with php's arr
John Meyer wrote:
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
I think something like this might be possible using lookbehind
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Okay, what I am referring to is cryptograms, where one letter is
substituted for another. I would like to be able to list all the words
in a dictionary that have that arrangement of their letters. Later on,
I would like to be able to do an entire cry
On Wednesday 15 November 2006 12:42, Robin Vickery wrote:
> On 15/11/06, Aaron Koning <[EMAIL PROTECTED]> wrote:
> > Assuming var1 and var2 only ever use the last four numbers (untested):
> >
> > $length = strlen($number); // get string length
> > $var1 = substr($number,0,$length-4); // get number
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
preg_,match('/^(\w){1}\w\w\1$/');
would match the above on a single line for example,
On Wednesday 15 November 2006 06:24, you wrote:
> At 11/14/2006 03:17 PM, Børge Holen wrote:
> >$number = 123456789
> >
> >should print as following:
> >var1: 12345 (and it is this lengt witch varies)
> >var2: 67
> >var3: 89.
>
> You can also do this with a regular expression:
>
> $iNumber = '123
Darrell Brogdon wrote:
> Can you elaborate a little? Do you mean that you want certain letters
> to have a numeric representation?
>
> -D
no, what I was meaning was in relationship to each other, whether they
are the same letter or not.
--
PHP General Mailing List (http://www.php.net/)
To uns
On 15/11/06, Aaron Koning <[EMAIL PROTECTED]> wrote:
Assuming var1 and var2 only ever use the last four numbers (untested):
$length = strlen($number); // get string length
$var1 = substr($number,0,$length-4); // get number until only 4 numbers are
left
$var2 = substr($number,$length-4,2); // get
FYI - the problem with mysql.sock has been an support issue at
apple.com before.
http://docs.info.apple.com/article.html?artnum=301457
/frank
15 nov 2006 kl. 11.03 skrev Roman Neuhauser:
# [EMAIL PROTECTED] / 2006-11-14 18:56:01 -0500:
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-11-
Good responses here - I tend to use MS conditional comments as I only resort
to hacks when there (seems) to be no other way, and although conditional
comments are proprietary they are ignored as comments by other browsers and
are hence pretty harmless.
Yes, for example Opera identifies itself as
# [EMAIL PROTECTED] / 2006-11-14 18:56:01 -0500:
> Roman Neuhauser wrote:
> ># [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
> >
> >>On 11/14/06, James Tu <[EMAIL PROTECTED]> wrote:
> >>
> >>>I'm running a php script from the command line (I'm on OS X) and I'm
> >>>getting ...
> >>>
> >>>War
60 matches
Mail list logo