php-general Digest 16 Jun 2002 19:57:21 -0000 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 (YYYYMMDDHHMMSS) to print it in a page but in common format
(DD MM YYYY 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 <mailto:[EMAIL PROTECTED]> 
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 <mailto:[EMAIL PROTECTED]>
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 (YYYYMMDDHHMMSS) to print it in a page but in common format
> (DD MM YYYY 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 <mailto:[EMAIL PROTECTED]>
> 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 & 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
>
>


--- End Message ---
--- Begin Message ---
"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:

<?
$start = 
Date_Calc::beginOfWeek($day="$day",$month="$month",$year="$year",$format="%Y%m%d");
$end = 
Date_Calc::endOfWeek($day="$day",$month="$month",$year="$year",$format="%Y%m%d");
?>

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.
--- End Message ---
--- Begin Message ---
Hi
Here is a messy solution, but I think it does what you want using strtotime()
(well worth looking up in the manual :)

<?
$weeks = 30;
$year = date("Y");
$monday1 = strtotime("1 monday",strtotime("1/1/".$year));       //get unix 
time of first monday of this year
$monday = intval(date("d",$monday1));                           //get the 
day of the month
if($monday != 1):
         $week1 = strtotime("-1 week",$monday1);                 //first 
week started last year
else:
         $week1 = $monday1;                                      //neat 
this year started on a monday
endif;
$start = strtotime($weeks." monday",$week1);                    //get unix 
time of start * the number of weeks
$end = strtotime("next sunday",$start);                         //get unix 
time of end
//print them out as dates
echo "Week $weeks start date = ".date("d/m/Y",$start)." end date = 
".date("d/m/Y",$end)."<br>";
?>

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

--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
> 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


--- End Message ---
--- Begin Message ---
>> 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

--- End Message ---
--- Begin Message ---
> 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



--- End Message ---
--- Begin Message ---
> 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

--- End Message ---
--- Begin Message ---
>> 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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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/

**************************************

--- End Message ---
--- Begin Message ---
Hi,

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

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


Thanks!

Danny

--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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


--- End Message ---
--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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 :

<test_type=\"jellyfish\" search=\"big fish\" />

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

cheers
Henry


--- End Message ---
--- Begin Message ---
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












--- End Message ---
--- Begin Message ---
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
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>


--- End Message ---
--- Begin Message ---
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







--- End Message ---
--- Begin Message ---
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 <cool_tag> 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
>
>
>
>
>
>
>
>
>  
>


--- End Message ---
--- Begin Message ---
Many thanks Chris.

Tony



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

--- End Message ---
--- Begin Message ---
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?

--- End Message ---
--- Begin Message ---
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


<?php
define('_L_OL_HERE', 'here');
$foo = '<a href="there.com">=_L_OL_HERE=</a>';
$bar = preg_replace('/(=)([A-Z0-9_])(=)/e', ' . constant("$2") . ', $foo);

echo $bar;

?>

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


--- End Message ---
--- Begin Message ---
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
> 
> 
> <?php
> define('_L_OL_HERE', 'here');
> $foo = '<a href="there.com">=_L_OL_HERE=</a>';
> $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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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

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

--- End Message ---
--- Begin Message ---
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.

--- End Message ---

Reply via email to