Re: [PHP] Regular expression newbie question, convert this: [::word1\" word2 \" word3::] to : ".word1 " word2 " word3."

2002-06-16 Thread Lance

hi dan,

its because the html text is from user input. and i dont wanna spend too 
much time educating them on coding with php. sometime its a pain trying 
to get them to understand the codes. so i just wanna give them some 
simple commands in php whereby they can happily insert date formats on a 
page. something like what phpBB did on the [url] thingie.

lance

Analysis & Solutions wrote:
> Hi Lance:
> 
> On Sun, Jun 16, 2002 at 01:31:45AM +0800, Lance wrote:
> 
>>i was developing an application that will read in the content of a html 
>>file. and within this html file contains php variables which will be 
>>replaced using the eval() function with its required value. and within 
>>this html, i want to be able to run php functions.
>>... snip ...
>>eval("\$rs = \"".date("m d 
>>y")."$phpVar\";");
> 
> 
> Why not merge your PHP and HTML straight up like this?
> 
> 
> 
> Then, just have the whole HTML file parsed as PHP.
> 
> --Dan
> 


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




[PHP] Re: Code Structure/Errors

2002-06-16 Thread Dan Koken

Can simply set $i before the while.

I assume the $last_name is coming from the DB.

Not exactly sure what you want, but hope this helps.
good luck... Dan.
--
$i 
= 0;
while ($row = mysql_fetch_array($result)) {
extract($row);
if (($i % 5) == 0) print "\n";
$i++;
@$last_name .= '';
if($last_name <> '')

 else

...
if (($i % 5) == 0) print "\n";
}




Jason Soza wrote:

> I'm just curious if there's a way to restructure my code so as to avoid
> getting "Undefined Variable" errors. I keep getting them and I know they're
> nothing to worry about for the most part, I'd like to get rid of them
> without turning off error reporting if possible. In the following code, I
> get an undefined variable error for $i and for $last_name, is there anything
> I can do to actually define them? $last_name is a variable produced by my
> MySQL query, $i is just a counter:
> 
> while ($row = mysql_fetch_array($result)) {
>   extract($row);
>   $i++;
>   if($i=="1") {
>   print "\n";
>   }
> 
>   if($last_name) {
>   
>   } else {
>   
>   }
> ...
>   if ($i=="5") {
>print "\n";
>$i=0;
>}
>   }
> 
> Thanks!
> 
> Jason Soza
> 
> 


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




RE: [PHP] Re: Code Structure/Errors

2002-06-16 Thread Jason Soza

Figured it was something simple. Part of the learning process, I suppose.
Thanks for the help!

Jason Soza

-Original Message-
From: Dan Koken [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 15, 2002 11:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Code Structure/Errors


Can simply set $i before the while.

I assume the $last_name is coming from the DB.

Not exactly sure what you want, but hope this helps.
good luck... Dan.
--
$i
= 0;
while ($row = mysql_fetch_array($result)) {
extract($row);
if (($i % 5) == 0) print "\n";
$i++;
@$last_name .= '';
if($last_name <> '')

 else

...
if (($i % 5) == 0) print "\n";
}




Jason Soza wrote:

> I'm just curious if there's a way to restructure my code so as to avoid
> getting "Undefined Variable" errors. I keep getting them and I know
they're
> nothing to worry about for the most part, I'd like to get rid of them
> without turning off error reporting if possible. In the following code, I
> get an undefined variable error for $i and for $last_name, is there
anything
> I can do to actually define them? $last_name is a variable produced by my
> MySQL query, $i is just a counter:
>
> while ($row = mysql_fetch_array($result)) {
>   extract($row);
>   $i++;
>   if($i=="1") {
>   print "\n";
>   }
>
>   if($last_name) {
>   
>   } else {
>   
>   }
> ...
>   if ($i=="5") {
>print "\n";
>$i=0;
>}
>   }
>
> Thanks!
>
> Jason Soza


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




php-general Digest 16 Jun 2002 07:50:42 -0000 Issue 1408

2002-06-16 Thread php-general-digest-help


php-general Digest 16 Jun 2002 07:50:42 - Issue 1408

Topics (messages 102359 through 102382):

Re: Parsing Text File
102359 by: Nathan Taylor
102360 by: Stuart Dallas
102372 by: Analysis & Solutions

PHP LICENCE
102361 by: Kevin Waterson

printf()
102362 by: Gerard Samuel
102364 by: Danny Shepherd
102365 by: Gerard Samuel
102367 by: Danny Shepherd

Determine week
102363 by: Rosen
102370 by: John Holmes

Sharing form information
102366 by: Frank Kicenko
102368 by: Justin French

Re: Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to 
: ".word1 " word2 " word3."
102369 by: Analysis & Solutions
102380 by: Lance

Re: row pointer
102371 by: Analysis & Solutions

Passing value between 2 Flash movies
102373 by: J0s

Re: Apache/2.0.36 + Win98 + PHP4=Error(31)
102374 by: PHPGeek
102379 by: Prachait Saxena

Re: Can I use a template with this site?
102375 by: César Aracena

Re: Can't set a cookie? [SOLVED]
102376 by: C

Code Structure/Errors
102377 by: Jason Soza
102378 by: Pushkar Pradhan
102381 by: Dan Koken
102382 by: Jason Soza

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

This is all really straight forward stuff.  Here's some code that will get the file 
parsed to an array, what you do from there is up to you.



Note: if you have a precise structure for your lines you can say to read from point a 
to b using substr().  For example, let's say the first name is exactly 3 characters in 
from 0  and exactly 10 characters long so you could do substr($line_array[0], 3, 10);  
This is a really dirty way to handle this and I'm sure there are better ways so poke 
around a bit.  Also if you have your phone number located down to a specific location 
you can use an explode statement to get both area code and main number seperated.


- Original Message -
From: Jason D. Williard
Sent: Saturday, June 15, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parsing Text File

I am trying to input data from a text file into a MySQL database and would
like to be able to input the data using a single script.  What's the easiest
way to parse a line, such as below, and turn it into variables to be placed
in the database.  While I can simply place the data in by importing from a
file, it's not quite so easy.  I only need to place some of the data in,
plus I would like to split one of the fields.  Below is an example of a line
from the file, and then the variables that I need to enter.

Here is an example of a line from the file:
Number,City,State,Country,Provider,Isdn,56K,CreateDate,Active,Timezone,ModDa
te,ModNote
403 -770 -4904 ,CALGARY,AB,CAN,T2,Y,Y,Apr 29 2002
12:00:00:000AM,I,GMT-0700,,

As for variables, I need the following:
Split Number into $AreaCode & $Number > 403 & 770-4904
$City
$State
$Country

Thanks for any help.

Jason D. Williard





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.phpGet more from the Web.  FREE MSN 
Explorer download : http://explorer.msn.com

--- End Message ---
--- Begin Message ---

On Saturday, June 15, 2002 at 9:05:40 PM, Nathan Taylor wrote:
>  $open =  fopen("file.txt","r+");

> while($contents = fgets($open)) {
> $line_array[$x] = $contents;
> $x++;
> }

?>>

This wheel exists: http://www.php.net/file



-- 
Stuart


--- End Message ---
--- Begin Message ---

> 403 -770 -4904 ,CALGARY,AB,CAN,T2,Y,Y,Apr 29 2002
> 12:00:00:000AM,I,GMT-0700,,

Untested, off the top of my head, code...

$pointer = fopen('./file.csv', 'r');

while ( $Data = fgetcsv($pointer, 500) ) {
   # Do what you need, for example...
   echo 'Their city is: ' . $Data[1];
}

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

--- End Message ---
--- Begin Message ---

Just how much can the php name be used in applications?

The license says
  3. The name "PHP" must not be used to endorse or promote products
 derived from this software without prior permission from the
 PHP Group.  This does not apply to add-on libraries or tools
 that work in conjunction with PHP.  In such a case the PHP
 name may be used to indicate that the product supports PHP.

So, we have applications such as phpnuke etc that use the php name
quite freely. Is this ok, or is it a breach of the license?

Can I call my application 

[PHP] Extracting Time??

2002-06-16 Thread César Aracena

Hi all and sorry for bothering again.

I need to fetch one time and date from a MySQL DB where is stored as
TIMESTAMP (MMDDHHMMSS) to print it in a page but in common format
(DD MM  at HH:MM:SS). Actually, I don’t care ‘bout the st, nd and th
extensions after the day.

Thanks for any help on this,

Cesar Aracena  
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621





Re[2]: [PHP] Can't set a cookie? [SOLVED]

2002-06-16 Thread Julie Meloni

C> I've recently been learning about cookies myself, and had the same problem
C> with "" vs. 0  (PHP Fast&Easy Web Development showed the "" in their book).

The book was written in 2000 and the change is in some recent version
of PHP.  The instructions have been altered in the 2nd edition of the
book.

C> I know that setting the expire parameter to 0 is supposed to kill the cookie
C> when browser is closed, but I can't seem to make that happen.

Using "0" in the time slot does work for this, as long as the entire
browser process ends.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




[PHP] RE: [PHP-DB] Extracting Time??

2002-06-16 Thread César Aracena

Well... actually, I care about displaying it in Spanish instead of
English ( Enero instead of January). Does anybody has accomplished this
for Spanish or any other language? Is it possible?

Thanks again,

Cesar Aracena 
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621

> -Mensaje original-
> De: César Aracena [mailto:[EMAIL PROTECTED]]
> Enviado el: Domingo, 16 de Junio de 2002 05:12 a.m.
> Para: PHP General List; PHP DB List
> Asunto: [PHP-DB] Extracting Time??
> 
> Hi all and sorry for bothering again.
> 
> I need to fetch one time and date from a MySQL DB where is stored as
> TIMESTAMP (MMDDHHMMSS) to print it in a page but in common format
> (DD MM  at HH:MM:SS). Actually, I don’t care ‘bout the st, nd and
th
> extensions after the day.
> 
> Thanks for any help on this,
> 
> Cesar Aracena 
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 



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




Re: [PHP] RE: [PHP-DB] Extracting Time??

2002-06-16 Thread Justin French

I don't think there's a fucntion out-of-the-box for this, but it's only 12
months, so it'd be quite a simple function that you'd only ever have to
write once :)

Justin French


on 16/06/02 6:20 PM, César Aracena ([EMAIL PROTECTED]) wrote:

> Well... actually, I care about displaying it in Spanish instead of
> English ( Enero instead of January). Does anybody has accomplished this
> for Spanish or any other language? Is it possible?


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




Re: [PHP] Determine week

2002-06-16 Thread Rosen

Thanks,
but I think you didn't understand me.
I have the number of week in a year ( some number of week, not current
week ) and I must determite start & end date of given week.

Can you help me with some ides ?

Thanks,
Rosen



John Holmes <[EMAIL PROTECTED]> wrote in message
006101c214d9$dc9423f0$b402a8c0@mango">news:006101c214d9$dc9423f0$b402a8c0@mango...
> You'll need a combination of date() and mktime().
>
> I'm too lazy to write the exact code right now, but date('w') will
> return the day of the week, 0 = Sunday, 6 = Saturday. Then use mktime()
> to subtract the number returned from date('w') from the days component,
> and you'll have the start of the week. 6 minus the result of date('w'),
> added to the day component of mktime(), will give you the end...
>
> HTH,
> ---John Holmes...
>
>
> > -Original Message-
> > From: Rosen [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, June 15, 2002 7:55 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Determine week
> >
> > Hi,
> > how can I determine dates (start & end ) in one week.
> > I.e. 30th  week is between 22.07.2002 and 28.07.2002 .
> >
> >
> >
> >
> >
> > --
> > 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] Re: Determine week

2002-06-16 Thread Jason Morehouse

"Date_Calc - a class for manipulating and comparing calendar dates, as well as 
formulating arrays of
dates for traditional calendar display."

http://www.phpinsider.com/php/code/Date_Calc/

Works sweet.

You'd be loking at:



Cheers,
-J

On Sun, 16 Jun 2002 11:55:04 +1200, Rosen wrote:

> Hi,
> how can I determine dates (start & end ) in one week. I.e. 30th  week is
> between 22.07.2002 and 28.07.2002 .
 

-- 
 Jason Morehouse ([EMAIL PROTECTED])
 Netconcepts LTD, Auckland, New Zealand
 * Linux: because rebooting is for adding hardware.

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




[PHP] Update PHP

2002-06-16 Thread Christian Ista

Hello,

I have a dedied server (with linux RedHat 7.2) and PHP 4.1.2.

I'd like to update to the version 4.2.1

Is it enought :

tar -zxvf phpfile4-2-1.gz

It's the first time I install PHP on linux in general I work on Windows.

Bye



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




Re: [PHP] Update PHP

2002-06-16 Thread Julie Meloni

CI> I have a dedied server (with linux RedHat 7.2) and PHP 4.1.2.
CI> I'd like to update to the version 4.2.1

Wise.  Be sure to read the changelog!

CI> Is it enought :
CI> tar -zxvf phpfile4-2-1.gz


No.  All that does is unpack the distribution. You must now build the PHP
module.

If you were the person who installed PHP before, then you probably
remember the process.  It's a configure/make/make install process.

You may want to do a phpinfo() on your existing installation, to
determine the configuration directives that were used.  Likely, you
will want to use the same ones (or nearly the same) with this new
build.

Once the configure is successful, do a make && make install.  This
will place the PHP module in the correct place.   You need to then
restart Apache.

Note that this is a very simple description.  The PHP Manual has a
wonderful and thorough chapter on installation and configuration.

Or, if you need extra hand-holding, I have a hand-holding tutorial
called "Setup and Install Apache with PHP 4.2.1 as a Dynamic Module"
at http://www.thickbook.com/extra/php_apachephp4_ix.phtml

Although you wouldn't need the Apache part, just the PHP building
part.

Good luck!

- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




RE: [PHP] Update PHP

2002-06-16 Thread Christian Ista

> If you were the person who installed PHP before, then you probably
> remember the process.  It's a configure/make/make install process.


Sure :)

But I rent a dedicated server with all preinstalled, PHP, MySQL ...


Bye



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




Re[2]: [PHP] Update PHP

2002-06-16 Thread Julie Meloni

>> If you were the person who installed PHP before, then you probably
>> remember the process.  It's a configure/make/make install process.


CI> Sure :)

CI> But I rent a dedicated server with all preinstalled, PHP, MySQL ...


Ok, if you're saying you do not have root access, then  you have to
have someone with root access do it for you.

If you are saying that you didn't do it the first time and you don't
know how, then read the instruction manual or tutorial _very_ closely,
since it will be your first time.



- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




[PHP] RE4: Update PHP

2002-06-16 Thread Christian Ista

> Ok, if you're saying you do not have root access, then  you have to
> have someone with root access do it for you.

I have root access :)

> If you are saying that you didn't do it the first time and you don't
> know how, then read the instruction manual or tutorial _very_ closely,
> since it will be your first time.

Well classical answer, don't need newsgroup or mailing list to say that.

Bye




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




RE: [PHP] Update PHP

2002-06-16 Thread Christian Ista

> You may want to do a phpinfo() on your existing installation, to
> determine the configuration directives that were used.  Likely, you
> will want to use the same ones (or nearly the same) with this new
> build.

I have that :

System Linux localhost.localdomain 2.4.7-10BOOT #1 Thu Sep 6 16:15:00
EDT 2001 i686 unknown 

Build Date May 30 2002 

Configure Command  
'./configure' '--with-apache=../apache_1.3.24' '--with-dbase'
'--with-filepro' '--with-xml' '--enable-ftp' '--with-db'
'--enable-bcmath' '--enable-calendar' '--with-jpeg-dir' '--with-png-dir'
'--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir'
'--with-gettext' '--with-pgsql=/usr' '--with-mysql=/usr'
'--with-zlib-dir' '--enable-trans-sid' '--with-imap' '--with-kerberos'
'--with-imap-ssl' '--with-openssl' '--enable-sysvsem' '--enable-sysvshm'


Server API 
Apache 

Virtual Directory Support 
disabled 

Configuration File (php.ini) Path
/usr/local/lib/php.ini 

ZEND_DEBUG disabled 
Thread Safety disabled


Could you explain me a little bit more, how to do ?

Bye


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




[PHP] md5 php vs. md5 perl

2002-06-16 Thread Danny Kruitbosch

Hi,

I'm trying to rewrite a perl finction to php. The function uses Digest::MD5.

PHP md5() returns a 32 char hex number. The perl Digest::MD5 function 
returns a 16 char (ascii??) string. Can I also get this from PHP? If so 
how do I do that?

My ultimate goal is to have compatible PHP/Perl functions.


Thanks!

Danny


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




[PHP] translate perl unpack to php equivalent

2002-06-16 Thread Danny Kruitbosch

Hi,

How would I translate this perl unpack statement to the php equiv.

my ($salt, $xor) = unpack('a2 a*', $something)


Thanks!

Danny


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




Re: [PHP] RE4: Update PHP

2002-06-16 Thread Julie Meloni

>> If you are saying that you didn't do it the first time and you don't
>> know how, then read the instruction manual or tutorial _very_ closely,
>> since it will be your first time.

CI> Well classical answer, don't need newsgroup or mailing list to say that.

And people wonder why others get frustrated when answering cries
for help?

You then said:

CI> Configure Command
CI> './configure' '--with-apache=../apache_1.3.24' '--with-dbase'
CI> '--with-filepro' '--with-xml' '--enable-ftp' '--with-db'
CI> '--enable-bcmath' '--enable-calendar' '--with-jpeg-dir' '--with-png-dir'
CI> '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir'
CI> '--with-gettext' '--with-pgsql=/usr' '--with-mysql=/usr'
CI> '--with-zlib-dir' '--enable-trans-sid' '--with-imap' '--with-kerberos'
CI> '--with-imap-ssl' '--with-openssl' '--enable-sysvsem' '--enable-sysvshm'

And then:

CI> Could you explain me a little bit more, how to do ?

To which I will respond, albeit "classically", that you could:
a) read the installation manual or
b) read a tutorial or
c) read previous email message, which says to run the configure
command, then make, then make install, which will put the module in
the proper place.

If you do not understand option c, then you must read the installation
manual or a tutorial to gain some insight into the power that is root,
in this case.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] md5 php vs. md5 perl

2002-06-16 Thread John S. Huggins

On Sun, 16 Jun 2002, Danny Kruitbosch wrote:

>-Hi,
>-
>-I'm trying to rewrite a perl finction to php. The function uses Digest::MD5.
>-
>-PHP md5() returns a 32 char hex number. The perl Digest::MD5 function 
>-returns a 16 char (ascii??) string. Can I also get this from PHP? If so 
>-how do I do that?

32 hex characters describes the 128 bit result from the MD5 routine no
matter where it is run: PHP, Shell, whatever.  This assumes one hex
character stands for 4 bits => 32 x 4 = 128.  This is the usual way of
handling MD5 hashes as this is simple 7 bit ascii characters use to
describe the hex numerals 0-9, A, B, C, D, E, and F.

If you use a full byte then you get 8 bits * 16 = 128.  This result is an
extended ascii string which may or may not be difficult to handle with
built-in PHP functions.

You could write a routine that combines every two hex characters into one
byte by converting the right hex to its numerical value (0 to 15), the
left bit to its numerical value * 16, add them together to get the
resulting byte value (0 to 255) and use it to build your 16 byte result.

This should get you compatibility between the two different ways of
describing MD5 hashes.


>-
>-My ultimate goal is to have compatible PHP/Perl functions.
>-
>-
>-Thanks!
>-
>-Danny
>-
>-
>--- 
>-PHP General Mailing List (http://www.php.net/)
>-To unsubscribe, visit: http://www.php.net/unsub.php
>-

**

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**


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




[PHP] Beta-Testers wanted: PHP-MP3-Collectionmanager for Win32

2002-06-16 Thread Tobias Schlitt

Hi you all!

I'm searching for some Beta-Testers on my new Programm.

It's a Manager for your MP3-Collection (with editing-Functions for Filename,
ID3-Tags, integration in Winamp over a PlugIn, Playlistgeneration, Add and
Enqueue Files to winamp from the application,.).

Who's is interested in trying and reporting some bugs an workaraounds to me,
should download the script including the PlugIn on source-forge:

http://sourceforge.net/projects/php-mp3/

Would ne nice to hear from some of you. Maybe you can use source-forge for
reporting bugs. Making easier tracking!

Thanks a lot!
Cheers,
Toby



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




[PHP] get a html page and save it to a file

2002-06-16 Thread Aborla.net - webmaster

Hello again,

I would like to know how can I download a html page from other server and
write it's contents in a file.

Thanking in advance,
Nuno Lopes




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




[PHP] php, xml and flash

2002-06-16 Thread Henry

i'd like to use the flash xml sendAndLoad method to send a number of variables to a 
php script.

php would process the variables and query a database and dynamically write an xml 
formatted
response. and then obviously load it back into flash.

however, i'm having problems with the initial step of php processing the xml formatted 
variables.
how can i structure my php script to get at these variables?

the xml would be formatted like :



i need the value of variables type and search. the values may also have spaces.

cheers
Henry



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




[PHP] String within a string

2002-06-16 Thread Anthony Ritter

I want to make sure about the syntax using mysql and PHP.

Here is the line of code:

$query="SELECT * FROM books WHERE ". $searchtype. " LIKE '%" .$searchterm.
"%' ";
.

Am I correct that the reason for the single quote within the expression
above is that:

"SELECT * FROM books WHERE"  // Beginning and end double quotes before the
variable $searchtype

.  // concatation operator

$searchtype // variable

. // concatation operator

"LIKE '%"  // Beginning of double quote and then beginning single quote
beacuse it is the beginning of a string which then ends before the variable
$searchterm.

. // concatation operator

$searchterm // variable

. // concatation operator

"%' "; // beginning of double quote for regex synmbol which then ends the
string and then an end double quote.

Thank you.
Tony Ritter













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




RE: [PHP] get a html page and save it to a file

2002-06-16 Thread John Holmes

Fopen("http://www.example.com/page.html","r";);

Or 

File(http://www.example.com.page.html);

My email program might mess up that code...either way, just use fopen()
or file() to open the page, read it into a variable, then write that
variable somewhere on your own system...

---John Holmes...

> -Original Message-
> From: Aborla.net - webmaster [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 16, 2002 10:44 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] get a html page and save it to a file
> 
> Hello again,
> 
> I would like to know how can I download a html page from other server
and
> write it's contents in a file.
> 
> Thanking in advance,
> Nuno Lopes
> 
> 
> 
> 
> --
> 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] Determine week

2002-06-16 Thread Tom Rogers

Hi
Here is a messy solution, but I think it does what you want using strtotime()
(well worth looking up in the manual :)

";
?>

Tom




At 02:55 AM 16/06/2002 +0300, Rosen wrote:
>Hi,
>how can I determine dates (start & end ) in one week.
>I.e. 30th  week is between 22.07.2002 and 28.07.2002 .
>
>
>
>
>
>--
>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] String within a string

2002-06-16 Thread Chris Shiflett

Each item within double quotes is a literal string. The example you 
inquire about dynamically builds an SQL statement.

For example, if $searchtype is "author_name" and $searchterm is 
"Rasmus", then you would build a statement like:

select * from books where author_name like '%Rasmus%';

The SQL statement should be terminated by a semicolon, I believe, and 
that appears to be missing from your example.

"Beginning of double quote and then beginning single quote beacuse it is 
the beginning of a string which then ends before the variable $searchterm."

This is incorrect. The $searchterm is a part of the string. In the SQL 
statement above, '%Ramus' is the result of concatenating "'%" with the 
value of $searchterm with "%'".

Basically, you just want to achieve your SQL statement, regardless of 
the logic you use to do that. An SQL statement is just a string, so 
there are numerous ways to contruct one.

Chris

Anthony Ritter wrote:

>I want to make sure about the syntax using mysql and PHP.
>
>Here is the line of code:
>
>$query="SELECT * FROM books WHERE ". $searchtype. " LIKE '%" .$searchterm.
>"%' ";
>.
>
>Am I correct that the reason for the single quote within the expression
>above is that:
>
>"SELECT * FROM books WHERE"  // Beginning and end double quotes before the
>variable $searchtype
>
>.  // concatation operator
>
>$searchtype // variable
>
>. // concatation operator
>
>"LIKE '%"  // Beginning of double quote and then beginning single quote
>beacuse it is the beginning of a string which then ends before the variable
>$searchterm.
>
>. // concatation operator
>
>$searchterm // variable
>
>. // concatation operator
>
>"%' "; // beginning of double quote for regex synmbol which then ends the
>string and then an end double quote.
>
>Thank you.
>Tony Ritter
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>



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




Re: [PHP] String within a string

2002-06-16 Thread Anthony Ritter

Chris,
Maybe I didn't make myself clear...


"LIKE '%"// Beginning of double quote and then beginning single quote
beacuse it is the beginning of a string which then ends before the variable
$searchterm.
..

Is the reason that the is a single quote *before* % and then a double quote
after the % is:

There is a single quote in the above example because all strings *within* a
mysql expression which already starts and ends with double quotes must have
a single quote to differentiate the two quotes - double and single.   Please
disregard esacping characters in this example. Double quotes and single
quotes.

And in this case, the code begins with double quotes and ends with double
quotes *before* the concatenation operator and variable.  The string which
comes before the first string ends needs a single quote as in:

'%" file://here comes the concenation operator and variable

and then:

// variable and concenation operator and

" %' ";

The end single quote then resumes *after* the variable and next concatention
operator.

Thank you.
TR








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




[PHP] persistent connections

2002-06-16 Thread Chris Knipe

Lo all,

Is there anyway to "manage" persistent connections to MySQL?

I've started using them on various of my sites (mysql_pconnect instead of
mysql_connect - as in the documentation), but after a few hours, I notice
that the connections just keeps on getting more and more and more.

Eventually, the entire server crawls to a standstill and I have to restart
mysql to speed up the system...

Any ideas?


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




[PHP] preg_replace

2002-06-16 Thread Gerard Samuel

When you think you got it, you don't get it..
Im trying to scan the link for =A-Z0-9_=, dump the '=' and evaluate the 
remainder as a defined constant.
Yes its funny looking, but if I could get this going Im golden.
$bar is always returned with '=_L_OL_HERE=' as the link and not 'here' 
as it supposed to be.
Any help would be appreciated.
Thanks


=_L_OL_HERE=';
$bar = preg_replace('/(=)([A-Z0-9_])(=)/e', ' . constant("$2") . ', $foo);

echo $bar;

?>

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




Re: [PHP] Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to : ".word1 " word2 " word3."

2002-06-16 Thread Analysis & Solutions

Lance:

On Sun, Jun 16, 2002 at 03:19:39PM +0800, Lance wrote:
> 
> its because the html text is from user input.

So, you're going to run eval() on user supplied input?  Now THAT's 
scarry.

I strongly urge you to rethink what you're doing.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] String within a string

2002-06-16 Thread Chris Shiflett

I might be misinterpreting the question, because it sounds like the same 
question as before. Let me try to be more thorough.

SQL statements traditionally use single quotes around literal values. 
There is no reason of "escaping" that makes this characteristic exist.

Now, in PHP, most people construct the SQL statement as the value of a 
variable and use that variable in their SQL execution statement. This 
isn't necessary, but it makes for cleaner code.

You have to consider an SQL statement to be a string. There is 
absolutely nothing special about it in this regard. For example, this 
might be the string you wish to assign to a variable:

select * from books where book_title='HTTP';

Alternatively, you might want to search for all books where the title 
contains the term HTTP:

select * from books where book_title like '%HTTP%';

The "%" character just acts as a wildcard, so it matches zero or more of 
anything.

Taking the second SQL statement, we can store it in a variable like this:

$sql_statement="select * from books where book_title like '%HTTP%';";

Notice that there is no specific reason for using single quotes within 
the assign statement; they're just part of the string we wish to construct.

Now, getting back to the question at hand, the "HTTP" part of the SQL 
statement might be something from a form. For this example, we will 
assume it to be stored in a variable called $book_title.

If we want to use concatenation to build our SQL statement, we can do 
something like this:

$sql_statement="select * from books where book_title like '%" . 
$book_title . "%';";

Broken down, there are three things concatenated to build this string:

1) select * from books where book_title like '%
2) $book_title
3) %';

Notice these are just slices of the original SQL statement from the very 
top. The double quotes surround pieces 1 and 3 because these are 
strings. Don't let the fact that the string have single quotes within 
them confuse you. There is no reason for the single quotes for our 
concatenation. These become important when we try to execute the SQL 
statement only.

As another example, to get away from the single quotes, consider the 
following string:

I wish the HTML specification had a tag called  that I could use.

Assume the string "cool_tag" is in a variable called $tag_name, and we 
can do something very similar to the above method:

$example_string="I wish the HTML specification had a tag called <" . 
$tag_name . "> that I could use."

Since we are using angled brackets instead of single quotes, maybe it is 
easier to understand.

Hope that helps.

Chris

Anthony Ritter wrote:

>Chris,
>Maybe I didn't make myself clear...
>
>
>"LIKE '%"// Beginning of double quote and then beginning single quote
>beacuse it is the beginning of a string which then ends before the variable
>$searchterm.
>..
>
>Is the reason that the is a single quote *before* % and then a double quote
>after the % is:
>
>There is a single quote in the above example because all strings *within* a
>mysql expression which already starts and ends with double quotes must have
>a single quote to differentiate the two quotes - double and single.   Please
>disregard esacping characters in this example. Double quotes and single
>quotes.
>
>And in this case, the code begins with double quotes and ends with double
>quotes *before* the concatenation operator and variable.  The string which
>comes before the first string ends needs a single quote as in:
>
>'%" file://here comes the concenation operator and variable
>
>and then:
>
>// variable and concenation operator and
>
>" %' ";
>
>The end single quote then resumes *after* the variable and next concatention
>operator.
>
>Thank you.
>TR
>
>
>
>
>
>
>
>
>  
>



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




[PHP] Re: preg_replace

2002-06-16 Thread CC Zona

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Gerard Samuel) 
wrote:

> When you think you got it, you don't get it..
> Im trying to scan the link for =A-Z0-9_=, dump the '=' and evaluate the 
> remainder as a defined constant.
> Yes its funny looking, but if I could get this going Im golden.
> $bar is always returned with '=_L_OL_HERE=' as the link and not 'here' 
> as it supposed to be.
> Any help would be appreciated.
> Thanks
> 
> 
>  define('_L_OL_HERE', 'here');
> $foo = '=_L_OL_HERE=';
> $bar = preg_replace('/(=)([A-Z0-9_])(=)/e', ' . constant("$2") . ', $foo);
> 
> echo $bar;
> 
> ?>

You're trying to match one or more characters in the class, so add a "+".  
And you're not concatenating the expression 'constant("$2")' with anything, 
so lose the extra periods.  Parentheses aren't needed around the equals 
signs, so you might as well drop those too.  Ex:

preg_replace('/=([A-Z0-9_]+)=/e', 'constant("$1")', $foo);

-- 
CC

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




Re: [PHP] String within a string

2002-06-16 Thread Anthony Ritter

Many thanks Chris.

Tony



---
[This E-mail scanned for viruses by IAS, an Archiventure Company]


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




[PHP] Re: translate perl unpack to php equivalent

2002-06-16 Thread CC Zona

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Danny Kruitbosch) wrote:

> How would I translate this perl unpack statement to the php equiv.
> 
> my ($salt, $xor) = unpack('a2 a*', $something)

http://php.net/unpack

-- 
CC

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




[PHP] Help on including cgi scripts into php documents.

2002-06-16 Thread Vegitas Pride

I was searching around your site, php.net and was
wondering how, or if its possible to include a cgi
script onto a php-index page. My site currently uses
just an include php line to include html code, and I
wanted to include, like poll.cgi to my side menu. 

Thanks,
Nick



__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: [PHP] Help on including cgi scripts into php documents.

2002-06-16 Thread John Holmes

Take a look at virtual()

www.php.net/virtual

---John Holmes...

> -Original Message-
> From: Vegitas Pride [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 16, 2002 2:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Help on including cgi scripts into php documents.
> 
> I was searching around your site, php.net and was
> wondering how, or if its possible to include a cgi
> script onto a php-index page. My site currently uses
> just an include php line to include html code, and I
> wanted to include, like poll.cgi to my side menu.
> 
> Thanks,
> Nick
> 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.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




[PHP] --with-dom-xslt how to make use of it?

2002-06-16 Thread Alexander Gionov

Does anybody know about some documentation of functions available to 
you, when you have compiled your PHP with the option '--with-dom-xslt'?


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




[PHP] domxml

2002-06-16 Thread Douglas

Hi,

I have a web page with a form. I want the user to be able to use the £ 
symbol in a text field on the form. I then pass the value of the text 
field(the £ symbol) to a DOMXML function which creates a XML string 
which is transformed into XHTML using the XSLT functions.

I have a meta tag defining the encoding of the web page as UTF-8. (So 
the £ symbol is being passed into the DOMXML function in this format? I 
echo it out just before doing this and it displays correctly.)

the DOMXML functions use UTF-8 for input and output. When I echo the XML 
output before passing it to the XSLT functions, I see that it has placed 
a  symbol immediately before the £ symbol.

Why? What is going on?
Any ideas very much appreciated.

Douglas.


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




php-general Digest 16 Jun 2002 19:57:21 -0000 Issue 1409

2002-06-16 Thread php-general-digest-help


php-general Digest 16 Jun 2002 19:57:21 - Issue 1409

Topics (messages 102383 through 102417):

Extracting Time??
102383 by: César Aracena

Re: Can't set a cookie? [SOLVED]
102384 by: Julie Meloni

Re: [PHP-DB] Extracting Time??
102385 by: César Aracena
102386 by: Justin French

Re: Determine week
102387 by: Rosen
102388 by: Jason Morehouse
102404 by: Tom Rogers

Update PHP
102389 by: Christian Ista
102390 by: Julie Meloni
102391 by: Christian Ista
102392 by: Julie Meloni
102393 by: Christian Ista
102394 by: Christian Ista
102397 by: Julie Meloni

md5 php vs. md5 perl
102395 by: Danny Kruitbosch
102398 by: John S. Huggins

translate perl unpack to php equivalent
102396 by: Danny Kruitbosch
102413 by: CC Zona

Beta-Testers wanted: PHP-MP3-Collectionmanager for Win32
102399 by: Tobias Schlitt

get a html page and save it to a file
102400 by: Aborla.net - webmaster
102403 by: John Holmes

php, xml and flash
102401 by: Henry

String within a string
102402 by: Anthony Ritter
102405 by: Chris Shiflett
102406 by: Anthony Ritter
102410 by: Chris Shiflett
102412 by: Anthony Ritter

persistent connections
102407 by: Chris Knipe

preg_replace
102408 by: Gerard Samuel
102411 by: CC Zona

Re: Regular expression newbie question, convert this: [::word1 \" word2 \" word3::] to 
: ".word1 " word2 " word3."
102409 by: Analysis & Solutions

Help on including cgi scripts into php documents.
102414 by: Vegitas Pride
102415 by: John Holmes

--with-dom-xslt how to make use of it?
102416 by: Alexander Gionov

domxml
102417 by: Douglas

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

Hi all and sorry for bothering again.

I need to fetch one time and date from a MySQL DB where is stored as
TIMESTAMP (MMDDHHMMSS) to print it in a page but in common format
(DD MM  at HH:MM:SS). Actually, I don’t care ‘bout the st, nd and th
extensions after the day.

Thanks for any help on this,

Cesar Aracena  
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621



--- End Message ---
--- Begin Message ---

C> I've recently been learning about cookies myself, and had the same problem
C> with "" vs. 0  (PHP Fast&Easy Web Development showed the "" in their book).

The book was written in 2000 and the change is in some recent version
of PHP.  The instructions have been altered in the 2nd edition of the
book.

C> I know that setting the expire parameter to 0 is supposed to kill the cookie
C> when browser is closed, but I can't seem to make that happen.

Using "0" in the time slot does work for this, as long as the entire
browser process ends.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


--- End Message ---
--- Begin Message ---

Well... actually, I care about displaying it in Spanish instead of
English ( Enero instead of January). Does anybody has accomplished this
for Spanish or any other language? Is it possible?

Thanks again,

Cesar Aracena 
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621

> -Mensaje original-
> De: César Aracena [mailto:[EMAIL PROTECTED]]
> Enviado el: Domingo, 16 de Junio de 2002 05:12 a.m.
> Para: PHP General List; PHP DB List
> Asunto: [PHP-DB] Extracting Time??
> 
> Hi all and sorry for bothering again.
> 
> I need to fetch one time and date from a MySQL DB where is stored as
> TIMESTAMP (MMDDHHMMSS) to print it in a page but in common format
> (DD MM  at HH:MM:SS). Actually, I don’t care ‘bout the st, nd and
th
> extensions after the day.
> 
> Thanks for any help on this,
> 
> Cesar Aracena 
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 



--- End Message ---
--- Begin Message ---

I don't think there's a fucntion out-of-the-box for this, but it's only 12
months, so it'd be quite a simple function that you'd only ever have to
write once :)

Justin French


on 16/06/02 6:20 PM, César Aracena ([EMAIL PROTECTED]) wrote:

> Well... actually, I care about displaying it in Spanish instead of
> English ( Enero instead of January). Does anybody has accomplished this
> for Spanish or any other language? Is it possible?


--- End Message ---
--- Begin Message ---

Thanks,
but I think you didn't understand me.
I have the number of week in a year ( some number of week, not current
week ) and I must determite start & e