php-general Digest 15 Jul 2002 08:52:25 -0000 Issue 1465

Topics (messages 107636 through 107680):

mysql LIMIT
        107636 by: Alexander Ross
        107638 by: Robert Cummings
        107640 by: David Freeman

Re: REminder APllication
        107637 by: The Doctor

retrieving random data from mysql database
        107639 by: mm fernandez
        107641 by: David Freeman
        107642 by: Chris Knipe
        107667 by: Anas Mughal

Re: Can not delete files that were uploaded
        107643 by: Richard Lynch

Question 1
        107644 by: Chris Kay
        107669 by: David Robley
        107672 by: David Robley
        107673 by: David Robley

Training / Courses in Australia
        107645 by: Chris Kay

Re: PHP and geographic maps
        107646 by: Martin Towell

Re: Newbie Date question
        107647 by: Jason Morehouse

DOM XML : experimental ?
        107648 by: Mario de Mello Bittencourt Neto

Re: Does not work
        107649 by: Alberto Serra
        107651 by: Justin French
        107658 by: Saci
        107660 by: Peter
        107662 by: Justin French
        107664 by: Saci
        107665 by: Justin French

Re: (Exact) Difference between -> and ::
        107650 by: Alberto Serra

Re: compiling with mysql
        107652 by: David Robley

IF inside LOOP?
        107653 by: César Aracena
        107654 by: Martin Towell

Re: IF inside LOOP? <-- SOLVED
        107655 by: César Aracena

two way encryption
        107656 by: Justin French
        107657 by: Joe Conway
        107661 by: Justin French
        107663 by: Joe Conway
        107666 by: James Cox
        107668 by: Justin French
        107670 by: Jason Wong

ignore_user_abort question
        107659 by: Jose Arce

Re: Variables aren't being passed to php page
        107671 by: Jason Wong
        107677 by: Tim Luoma

BREAK into the DB
        107674 by: César Aracena
        107675 by: Martin Towell

Re: BREAK into the DB <-- SOLVED
        107676 by: César Aracena

mysql error or PHP
        107678 by: Wilbert Enserink
        107679 by: Justin French

select multiple within for-each
        107680 by: William S.

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 ---
can I use limit to show the 2nd record on without knowing how many more
records there might be?

also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but
there are only 3 results? 7 results?


--- End Message ---
--- Begin Message ---
Alexander Ross wrote:
> 
> can I use limit to show the 2nd record on without knowing how many more
> records there might be?
> 
> also, what happens if I set the limit in a mysql statement (LIMIT 5,10), but
> there are only 3 results? 7 results?

This looks like a question that could be answered with a 10 second test
query!

Cheers,
Rob.
-- 
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer  |
:----------------------------------------------:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109                 |
:----------------------------------------------:
| Website : http://www.webmotion.com           |
| Fax     : (613) 260-9545                     |
`----------------------------------------------'
--- End Message ---
--- Begin Message ---

 > can I use limit to show the 2nd record on without knowing 
 > how many more records there might be?
 > 
 > also, what happens if I set the limit in a mysql statement 
 > (LIMIT 5,10), but there are only 3 results? 7 results?

My answer would tend to be that you should try it for yourself and
see...

But anyway, without having tried it myself recently, the first question
is that you could use LIMIT (2, 1) and you'd probably get what you're
trying for.  As for the second question, you'll only get what records
there are.  If your limit excludes all possible results then you'll get
no result (ie. If you use LIMIT(5, 10) and you've only got 3 records,
then you won't get anything back at all.  If you've got 7 records then
you'll get the last 3 of them).  But in all honesty, you could have
worked this out for yourself fairly quickly with some simple testing of
your own.

CYA, Dave



--- End Message ---
--- Begin Message ---
On Thu, Jul 11, 2002 at 10:05:05PM -0400, John Holmes wrote:
> > DOes anyone know how to build a reminder application on:
> > 
> > a) identified users
> > b)  Sorting users' reminders??
> 
> Yes.
> 
> ---John Holmes...
> 
> http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-n
> o-answers.html
>

Getting down to specifics then:

1)  I have a reminder process that

a) uses .htpasswd
b)  USes a static file

So I want to:

I)  Convert or use said file using a fill in the blank username/password
    process on a Web Page

Once in

II) The user have instant access to their reminder list  so they could

    A)  Modify by adding and/or deleting
    B)  Set up an e-mail reminder time
    C)  Set up which e-mail address to go to.


Can I do/convert this and SPECIFICAAL how?

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html 
 Not acceptible.
 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]       Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Beware of defining as intelligent only those who share your opinions
--- End Message ---
--- Begin Message ---
hi,
can you teach me how to retrieve random data from my database? like for example...i 
have a list of names on my database and i'd like to retrieve only one name at a 
time..randomly. how do i go about this?

hope someone can help...thanx.


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

 > can you teach me how to retrieve random data from my 
 > database? like for example...i have a list of names on my 
 > database and i'd like to retrieve only one name at a 
 > time..randomly. how do i go about this?

This is really a database question rather than a php question and you
haven't said which database you're using so it's hard to give a
definitive answer.  In MySQL you'd do something like this:

Select * from some_table where some_condition order by RAND() limit 1;

That would select one random row out of all rows that meet
"some_condition".

CYA, Dave



--- End Message ---
--- Begin Message ---
SELECT RANDOM name FROM table

or

SELECT name FROM table ORDER BY RANDOM LIMIT 1

not tested, used at your own free will.

--
me


----- Original Message -----
From: "mm fernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 14, 2002 11:37 PM
Subject: [PHP] retrieving random data from mysql database


hi,
can you teach me how to retrieve random data from my database? like for
example...i have a list of names on my database and i'd like to retrieve
only one name at a time..randomly. how do i go about this?

hope someone can help...thanx.




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

When you say, 
Order by RAND()
I would think the "Order by"  construct expects a column name.
In your case, it gets a decimal value.
How does "Order by" treat decimal values?
Oh, I just checked the manual:
In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER BY RAND() 
I still don't understand how does "Order by" work with a decimal value!!!
 
  David Freeman <[EMAIL PROTECTED]> wrote: 
> can you teach me how to retrieve random data from my 
> database? like for example...i have a list of names on my 
> database and i'd like to retrieve only one name at a 
> time..randomly. how do i go about this?

This is really a database question rather than a php question and you
haven't said which database you're using so it's hard to give a
definitive answer. In MySQL you'd do something like this:

Select * from some_table where some_condition order by RAND() limit 1;

That would select one random row out of all rows that meet
"some_condition".

CYA, Dave




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



---------------------------------
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
--- End Message ---
--- Begin Message ---
>> Be warned that if PHP can delete them, so can anybody else on the shared
>> server who wants to write a PHP script to delete them, unless you've
>> configured PHP specially to run as a specific user, which is unlikely for
>> most ISP setups.
>
>How can PHP be configured to run as a specific user? I'm referring to a
>DSO installation, where I assume that because PHP is 'part' of Apache, it
>would be the same user as Apache.

Apache 2.0 allows that...

Meanwhile, in *CURRENT* ISP-land :-)

Some ISPs give you *BOTH* Apache as Module (DSO) and as CGI via suExec,
using different extensions.

So for those really critical security pages that need to run as you, use the
.phpcgi (or whatever) extension and leave the rest as "normal" .php

Actually, I don't even know what the extension is that does .phpcgi on my
servers, I just use the ForceType directive to set the mime-type.

It's nice to be able to run a PHP script as "me" when I have to instead of
as "nobody"

Very nice.

-- 
Like Music?  http://l-i-e.com/artists.htm

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

I am looking at importing data from rdtool into a mysql backend
And not sure how to go about it...

I was wondering if anyone has tried this or know of some information
that may help.

Or even a theroy on how the best way would be to do this...

Thanks in advance..

------------------------------------------------------------------------
---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for
Business
------------------------------------------------------------------------
---


--- End Message ---
--- Begin Message ---
In article <E00ACB0129A4C748B02A744610798CE50652CE@headoffice-
fs.techex.net.au>, [EMAIL PROTECTED] says...
> 
> I am looking at importing data from rdtool into a mysql backend
> And not sure how to go about it...
> 
> I was wondering if anyone has tried this or know of some information
> that may help.
> 
> Or even a theroy on how the best way would be to do this...
> 
> Thanks in advance..

Does rdtool allow you to export in commma/tab/whatever delimited format? 
Then just use mysql's LOAD DATA INFILE

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
On 15 Jul 2002 at 14:27, Chris Kay wrote:

> 
> I wish it was that eazy :)
> 
> ------------------------------------------------------------------------
> --- Chris Kay Technical Support - Techex Communications Website:
> www.techex.com.au   Email: [EMAIL PROTECTED] Telephone: 1300 88 111
> 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW
> 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for
> Business
> ------------------------------------------------------------------------
> ---
> 
> 
> 
> 
> -----Original Message-----
> From: David Robley [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 15, 2002 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Question 1
> 
> 
> In article <E00ACB0129A4C748B02A744610798CE50652CE@headoffice-
> fs.techex.net.au>, [EMAIL PROTECTED] says...
> > 
> > I am looking at importing data from rdtool into a mysql backend And not
> > sure how to go about it...
> > 
> > I was wondering if anyone has tried this or know of some information
> > that may help.
> > 
> > Or even a theroy on how the best way would be to do this...
> > 
> > Thanks in advance..
> 
> Does rdtool allow you to export in commma/tab/whatever delimited format?
> 
> Then just use mysql's LOAD DATA INFILE
> 

OK - I can then assume that rdtool is the Ruby Documentation tool? At 
least that's what google chucks up. It appears that it produces 
documentation in a number of formats. Perhaps if you could be a bit more 
specific about exactly what you want to achieve? For example, how is 
your data currently formatted? is it just in text files? what sort of 
table structure do you want to put it in?

-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"This is mutiny!" said Tom bountifully.


--- End Message ---
--- Begin Message ---
On 15 Jul 2002 at 14:50, Chris Kay wrote:

> 
> The data is stored in a text file that is created by mrtg/rrdtool
> The file size always stays the same and never grows even though the data
> does.
> 
> I wish to pull the data into a mysql database, I don't have fields yet as
> I am not sure how to do it,...
> 
> 
> -----Original Message-----
> From: David Robley [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, July 15, 2002 2:49 PM
> To: Chris Kay; [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: Question 1
> 
> 
> On 15 Jul 2002 at 14:27, Chris Kay wrote:
> 
> > 
> > I wish it was that eazy :)
> > 
> ------------------------------------------------------------------------ >
> --- > > > > > -----Original Message----- > From: David Robley
> [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 2:27 PM >
> To: [EMAIL PROTECTED] > Subject: [PHP] Re: Question 1 > > > In
> article <E00ACB0129A4C748B02A744610798CE50652CE@headoffice- >
> fs.techex.net.au>, [EMAIL PROTECTED] says... > > > > I am looking at
> importing data from rdtool into a mysql backend And > > not sure how to go
> about it... > > > > I was wondering if anyone has tried this or know of
> some information
> 
> > > that may help.
> > > 
> > > Or even a theroy on how the best way would be to do this...
> > > 
> > > Thanks in advance..
> > 
> > Does rdtool allow you to export in commma/tab/whatever delimited 
> > format?
> > 
> > Then just use mysql's LOAD DATA INFILE
> > 
> 
> OK - I can then assume that rdtool is the Ruby Documentation tool? At
> least that's what google chucks up. It appears that it produces
> documentation in a number of formats. Perhaps if you could be a bit more
> specific about exactly what you want to achieve? For example, how is your
> data currently formatted? is it just in text files? what sort of table
> structure do you want to put it in?

First, may I suggest you keep the discussion on-list, as there may be others there 
better 
equipped to help you.

My first suggestion, now that you say you are using rrdtool not rdtool:-) would be to 
open 
the file in which your data is stored and try and work out the structure in which it 
is 
stored. Then, decide which of that data you need for your purpose, and work from there.

-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"My stereo's half-fixed," said Tom monotonously.


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

Would anyone know of any PHP training or courses in Australia...

Also for the devolopers...

Is there at present, or a future plan for a PHPCE
A certified engineer :)

Just a thought since everyone else has them....

------------------------------------------------------------------------
---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for
Business
------------------------------------------------------------------------
---


--- End Message ---
--- Begin Message ---
> Lowell:
>
> On Fri, Jul 12, 2002 at 09:25:56AM -0400, Lowell Allen wrote:
> > Are you using JavaScript to update the image without going back to the
map
> > server?
> 
> Dude, Dynamic HTML / JavaScript are a poor idea... unless you don't care
> about your potential customers.
> 
> http://www.analysisandsolutions.com/code/weberror.htm?j=y
> 
> --Dan

The requirements for this project was that the site is designed for IE5.5
and above with JS turned on. So in this case, using DHTML was fine.
--- End Message ---
--- Begin Message ---
include("Calc.php"); 

#http://www.phpinsider.com/php/code/Date_Calc/
#Date_Calc - a class for manipulating and comparing 
#Calendar dates, as well as formulating arrays of dates
# for traditional calendar display.

$yesterday =
Date_Calc::prevDay($day=date('d'),$month=date('m'),$year=date('Y'),$format="%m-%Y-%d");

Hope that helps.
-J

On Sun, 14 Jul 2002 23:01:07 +1200, Royw wrote:

> If:
> 
> $today = date("Y-m-d");
> 
> Then how to I get:
> 
> $yesterday = ?
> 
> Thanks!

-- 
 Jason Morehouse (jm [@] netconcepts [.] com)
 Netconcepts LTD - Auckland, New Zealand
 * Linux: Because rebooting is for adding hardware.

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

I am planning to use PHP to develop some scripts that will need to 
create and manipulate html pages.  One of the things that will be 
created is a DOM tree of the html.

After reading the manual I've found that php supports the event-driven 
and dom xml, but with the latter tagged as EXPERIMENTAL.  I've also 
noticed that as of 4.3.0-dev (which I am using) the api has changed.

So I'd like to know how "experimental" (also stable) this support is and 
suggestions regarding this issue and DOM itself.

One of the main issues is that I'll need to cope with html (not xml) and 
mostly not "well-formed".

Regards.

--- End Message ---
--- Begin Message ---
ðÒÉ×ÅÔ!

Saci wrote:
> // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> 
> Anybody know how to do that using JAva history with PHP together , or any
> other methode that works and can be trusted.

Thank god no method can be trusted :) History even less the the 
referrer. Just think of the frequency at which people in their offices 
clear it to avoid bosses seeing where they surfed while they were 
supposed to work...

You'll never get a secure method, and if you do I'll personally report 
you to the authority for protection of privacy :) Marketing dotcoms 
would just love to do it, but fortunately it cannot be done :) Relax, 
you can live without knowing where some of the guys came from. Most 
won't mind telling you. But I just cleared my history immediately after 
reading your msg :) Pavlovian reaction ;)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......

--- End Message ---
--- Begin Message ---
Pffft you can't trust Java, JavaScript or anything on the server side at
all.  Since it's set by the browser (client) itself, the best you can do is
test for it, and provide a fall back option.

For the bulk of users, this will be okay, because they're on IE.  What you
need to be carefull of is what effect your fall back has on the unknown
browsers.

Or design/program without the need to know what they're using :D


Justin French


on 15/07/02 5:34 AM, Saci ([EMAIL PROTECTED]) wrote:

> // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> 
> Anybody know how to do that using JAva history with PHP together , or any
> other methode that works and can be trusted.
> 
> 

--- End Message ---
--- Begin Message ---
To say the minumum yor reply does not help in nothing.

Who cares about privacy on my own company Intranet ?



"Alberto Serra" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ðÒÉ×ÅÔ!
>
> Saci wrote:
> > // HTTP_REFERER as a feature. In  short, it cannot really be trusted.
> >
> > Anybody know how to do that using JAva history with PHP together , or
any
> > other methode that works and can be trusted.
>
> Thank god no method can be trusted :) History even less the the
> referrer. Just think of the frequency at which people in their offices
> clear it to avoid bosses seeing where they surfed while they were
> supposed to work...
>
> You'll never get a secure method, and if you do I'll personally report
> you to the authority for protection of privacy :) Marketing dotcoms
> would just love to do it, but fortunately it cannot be done :) Relax,
> you can live without knowing where some of the guys came from. Most
> won't mind telling you. But I just cleared my history immediately after
> reading your msg :) Pavlovian reaction ;)
>
> ÐÏËÁ
> áÌØÂÅÒÔÏ
> ëÉÅ×
>
>
> @-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@
>
> LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
> lOrD i'M sHiNiNg...
> YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is
> tHe TeSt, YeS iT iS
> ThE tEsT, yEs It Is.......
>


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


> -----Original Message-----
> From: Saci [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 15 July 2002 12:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Does not work
> 
> 
> To say the minumum yor reply does not help in nothing.
> 
> Who cares about privacy on my own company Intranet ?
> 
> 
ummmm the bosses.. the employees tring to hide where they been from the bosses... the 
network admin... the list goes on and on and on and on and on and on and on ...
--- End Message ---
--- Begin Message ---
on 15/07/02 12:51 PM, Saci ([EMAIL PROTECTED]) wrote:

> To say the minumum yor reply does not help in nothing.
> 
> Who cares about privacy on my own company Intranet ?

1. I don't believe you specified this was a company intranet, but you may
have.

2. Generally it's a good idea to get things right the first time, rather
than assuming that something will always remain in it's current state.  I
tend to copy-and-paste a lot of code from one project to another, or
assemble libraries of code.  It might be okay for you to say "this code
works for a limited environment, and i'm happy with that", but will you
remember this when:

a) you copy it across to another project
b) the status of the project changes or is extended
c) the project is no longer in your control

If you insist on sticking with this limitation, do yourself and your
co-workers a favour, and ensure you:

a) comment your code well, pointing out the limitation
b) do some minimal (at least) error handling to deal with the fact that it
may not be there

3. The reply WAS helpful, raised some important issues, and IMHO you should
have thanked the poster for being kind enough to point out issues you may
not have thought of.  You could have easily replied with "thanks for those
pointers, but I'm less concerned with privacy, since this is a corporate
intranet".


I'm not sure I'd ever help you again, if I'd received a reply such as yours.


Justin French

--- End Message ---
--- Begin Message ---
I agree, I made a mistake on my last reply , and I apologize for that.

Thank you also for you for your coments, but my main question still open
without any related reply.




>
> > To say the minumum yor reply does not help in nothing.
> >
> > Who cares about privacy on my own company Intranet ?
>
> 1. I don't believe you specified this was a company intranet, but you may
> have.
>
> 2. Generally it's a good idea to get things right the first time, rather
> than assuming that something will always remain in it's current state.  I
> tend to copy-and-paste a lot of code from one project to another, or
> assemble libraries of code.  It might be okay for you to say "this code
> works for a limited environment, and i'm happy with that", but will you
> remember this when:
>
> a) you copy it across to another project
> b) the status of the project changes or is extended
> c) the project is no longer in your control
>
> If you insist on sticking with this limitation, do yourself and your
> co-workers a favour, and ensure you:
>
> a) comment your code well, pointing out the limitation
> b) do some minimal (at least) error handling to deal with the fact that it
> may not be there
>
> 3. The reply WAS helpful, raised some important issues, and IMHO you
should
> have thanked the poster for being kind enough to point out issues you may
> not have thought of.  You could have easily replied with "thanks for those
> pointers, but I'm less concerned with privacy, since this is a corporate
> intranet".
>
>
> I'm not sure I'd ever help you again, if I'd received a reply such as
yours.
>
>
> Justin French
>


--- End Message ---
--- Begin Message ---
This works for me, PHP 4.1.1

Upon first loading the page, I get nothing, but when I click on "go", I get
both referrer address' echoed.

refer.php:
---
<html>
<body>
<A HREF="refer.php">go</a><BR><BR>

Page refered by
<?php
echo $HTTP_REFERER.'<br>';
echo $_SERVER['HTTP_REFERER'].'<br>';
?>
</body>
</html>
---



It's already been said but:


1. are you sure php is working (with other files, and with simple echo
"hello world!"; type stuff)?


2. use this file (phpinfo.php) to test for the existence of HTTP_REFERER:

refer.php:
---
<html>
<body>
<A HREF="refer.php">go</a><BR><BR>

Page refered by
<?php
echo $HTTP_REFERER.'<br>';
echo $_SERVER['HTTP_REFERER'].'<br>';
?>
</body>
</html>
---

Upon first loading, it will not be set, but when you click go, you have a
referer, and it is set.  For me, it's listed under the Apache Environment
heading.


If you still can't get a referrer var after all that, then there's an issue
with your server (are you using apache????) or perhaps the client (browser).

because it *should* be simple.


Justin French

--- End Message ---
--- Begin Message ---
ðÒÉ×ÅÔ!

Micha wrote:
> Hi,
> 
> I would like to know the exact difference between -> and ::.
> I know that I can use as class directcly by using :: but I still don't
> know the exact meaning....
> So why do they use in Example 8 on
> http://www.php.net/source.php?url=/zend2_example.phps $this->id =
> self::$id++ and not self::id++ or $this->id++ ... ?
> 

Some OO languages (notably smalltalk does it) name a difference between 
Class methods (and variables) and instance variables. What is "class" 
can be used and executed even when lacking any actual instance of the 
class.

PHP has not fully implemented this model (we miss class variables, that 
is, a value that is common and general to all instances of a given 
class) but does have a bit of it.

So :: is mainly used to execute a method without needing to create an 
instance for it. If your class "Printer" has a method 
"changeCartridge()" you can use Printer::changeCartridge() without the 
need of any prior
$myPrinter = new Printer()

That is, you use a class as a common library. This has a limitation in 
that you cannot dinamically say $myclass::changeCartridge(), while you 
can say:

$a = "printer";
$p = new $a();
$p->changeCartridge();

The operator :: cannot address internal variables directly like -> does 
for the simple reason that no variable exists, in the absence of the 
instance. Which is why you declare $ signs. :: operator is also handy 
when you need to call an overriden method. By saying parent::myMethod() 
you call your parent's method, while $this->myMethod would execute the 
locally redeclared code.

-> operator can be read (maybe it must be read, I don't know) as 
"belongs to". So "this->a" means "the $a that belongs to $this" (the 
object in which you are executing class code). -> obviously only applies 
to single instances and not to classes.

Hope it was clear.


ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is.......

--- End Message ---
--- Begin Message ---
In article <Pine.LNX.4.21.0207120957190.1434-
[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> 
> Another PHP compilation question ...
> 
> I've just compiled PHP 4.2.1 --with-mysql. I added no path to mysql, and
> it worked fine as it always does. However, I'm keen to add mod_python as a
> DSO to Apache as well, and noticed in PHP's INSTALL notes that I'll
> probably need to recompile PHP with a path to mysql:
> 
>       --with-mysql=/somewhere/or/other/
> 
> 1. Is this always the case?
> 
> 2. Where would the path be likely to be on RedHat 7.2 with MySQL rpms?

I'm not a Redhat user, but.... I think you will have to have installed a 
source rpm for mysql. You can probably check if you have the include files 
installed by doing locate mysql.h to give you the mysql include directory, 
possibly something like /var/mysql/include or /usr/local/mysql/include. 
Stripping the /include should give you the 'parent' directory under which 
both the include files and lib files can be found.

Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hi all.
 
I’ve been fooling around with a LOOP which should show one or more text
string stored in separate rows in a DB. The trick would we to separate
them with commas (,) when there’s another string to show or end it with
a period (.) if no other row is found according to the SELECT criteria.
This is what I have so far:
 
for ($m=0; $m<$num_rows2; $m++)
{
$row2 = mysql_fetch_array($result2);
 
echo $row2[devlanguage];
 
if ($m < $num_rows2)
{
echo ", ";
}
else
{
echo ".";
}
}
 
The problem is that the LOOP stops as it’s told to do, keeping the ELSE
statement from doing it’s work, resulting in comma separated string as
it should, but also add an extra comma at the end of it instead of a
period. What approach should I use?
 
Thanks in advance,
 
 <mailto:[EMAIL PROTECTED]> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
 
--- End Message ---
--- Begin Message ---
try using this if statement instead

if ($m < $num_rows2 - 1)

or even use the ?: operator

echo ($m < $num_rows2 - 1 ? ", " : ".");


-----Original Message-----
From: César Aracena [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 12:04 PM
To: PHP General List
Subject: [PHP] IF inside LOOP?


Hi all.
 
I've been fooling around with a LOOP which should show one or more text
string stored in separate rows in a DB. The trick would we to separate
them with commas (,) when there's another string to show or end it with
a period (.) if no other row is found according to the SELECT criteria.
This is what I have so far:
 
for ($m=0; $m<$num_rows2; $m++)
{
$row2 = mysql_fetch_array($result2);
 
echo $row2[devlanguage];
 
if ($m < $num_rows2)
{
echo ", ";
}
else
{
echo ".";
}
}
 
The problem is that the LOOP stops as it's told to do, keeping the ELSE
statement from doing it's work, resulting in comma separated string as
it should, but also add an extra comma at the end of it instead of a
period. What approach should I use?
 
Thanks in advance,
 
 <mailto:[EMAIL PROTECTED]> Cesar Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621
 
--- End Message ---
--- Begin Message ---
Thanks for two things Martin: First for teaching me about the "-1"
operation (which seems logic now) and second, for getting me into the
"?:" operator. I've read something about it in the books, but didn't
tough it was really useful 'till now.

It worked perfectly. C.

> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 14, 2002 11:05 PM
> To: 'César Aracena'; PHP General List
> Subject: RE: [PHP] IF inside LOOP?
> 
> try using this if statement instead
> 
> if ($m < $num_rows2 - 1)
> 
> or even use the ?: operator
> 
> echo ($m < $num_rows2 - 1 ? ", " : ".");
> 
> 
> -----Original Message-----
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 12:04 PM
> To: PHP General List
> Subject: [PHP] IF inside LOOP?
> 
> 
> Hi all.
> 
> I've been fooling around with a LOOP which should show one or more
text
> string stored in separate rows in a DB. The trick would we to separate
> them with commas (,) when there's another string to show or end it
with
> a period (.) if no other row is found according to the SELECT
criteria.
> This is what I have so far:
> 
> for ($m=0; $m<$num_rows2; $m++)
> {
> $row2 = mysql_fetch_array($result2);
> 
> echo $row2[devlanguage];
> 
> if ($m < $num_rows2)
> {
> echo ", ";
> }
> else
> {
> echo ".";
> }
> }
> 
> The problem is that the LOOP stops as it's told to do, keeping the
ELSE
> statement from doing it's work, resulting in comma separated string as
> it should, but also add an extra comma at the end of it instead of a
> period. What approach should I use?
> 
> Thanks in advance,
> 
>  <mailto:[EMAIL PROTECTED]> 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


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

I'm looking at a way of encrypting AND decrypting a string (cc#) with a key.
I plan to store the key in a file outside the docroot, and have asked the
ISP for as much advice as possible to protect the key file.

Anyway, since it needs to be encrypted and decrypted with a key, I obviously
can't use the old faithfull md5(), and from my understanding of the manual,
crypt() is also one-way.

Then I found mcrypt_encrypt() and mcrypt_decrypt().

Paraphrasing the samples in the php manual, does the below code achieve what
I want, assuming that the key would usually be stored in a separate file
outside the docroot?

<?

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256,
MCRYPT_MODE_ECB), MCRYPT_RAND);
$key = "This is a very secret key";
$text = "11112222333344445555";
echo "plain string: {$text}<BR>";

$crypttext = mcrypt_encrypt (MCRYPT_RIJNDAEL_256, $key, $text,
MCRYPT_MODE_ECB, $iv);
echo "encoded string: {$crypttext}<BR>";

$dectext = mcrypt_decrypt (MCRYPT_RIJNDAEL_256, $key, $crypttext,
MCRYPT_MODE_ECB, $iv);
echo "decoded string: {$dectext}<BR>";

?>

I'm getting the following error using 4.1.1:
"Fatal error: Call to undefined function: mcrypt_create_iv() in
/usr/local/apache/htdocs/tests/enc.php on line 3"

Which is confusing, given that the manual says mcrypt_create_iv() is
available in PHP 4.


Any ideas / contributions / pointers?


Justin French

--- End Message ---
--- Begin Message ---
Justin French wrote:
> I'm getting the following error using 4.1.1:
> "Fatal error: Call to undefined function: mcrypt_create_iv() in
> /usr/local/apache/htdocs/tests/enc.php on line 3"
> 
> Which is confusing, given that the manual says mcrypt_create_iv() is
> available in PHP 4.

Looks like your ISP doesn't have mcrypt support. What does phpinfo() show?

General encryption advice -- generate your key using urandom and save it 
to your key file. It will be much more secure than anything you can 
think up for a good key.

HTH,

Joe


--- End Message ---
--- Begin Message ---
on 15/07/02 12:41 PM, Joe Conway ([EMAIL PROTECTED]) wrote:

> Looks like your ISP doesn't have mcrypt support. What does phpinfo() show?

Well, that was on my local test server, which I didn't compile with
mcrypt... so that solves that, but it appears my ISP didn't compile with it
either... so there's very little point in getting my local server working
with it.

What alternatives do I have?


> General encryption advice -- generate your key using urandom and save it
> to your key file. It will be much more secure than anything you can
> think up for a good key.

Good advice.


Justin French

--- End Message ---
--- Begin Message ---
Justin French wrote:
> Well, that was on my local test server, which I didn't compile with
> mcrypt... so that solves that, but it appears my ISP didn't compile with it
> either... so there's very little point in getting my local server working
> with it.
> 
> What alternatives do I have?

I don't *think* PHP includes any builtin-by-default, non-one-way 
encryption functions, but I haven't looked in a long time so I could be 
wrong. You might be able to get your ISP to install mcrypt itself which 
has a command line utility. Then you could use passthru() I suppose.

Joe

--- End Message ---
--- Begin Message ---
sorry to step in, but did you consider base64_[encode|decode] ?

 -- james

> 
> Justin French wrote:
> > Well, that was on my local test server, which I didn't compile with
> > mcrypt... so that solves that, but it appears my ISP didn't 
> compile with it
> > either... so there's very little point in getting my local 
> server working
> > with it.
> > 
> > What alternatives do I have?
> 
> I don't *think* PHP includes any builtin-by-default, non-one-way 
> encryption functions, but I haven't looked in a long time so I could be 
> wrong. You might be able to get your ISP to install mcrypt itself which 
> has a command line utility. Then you could use passthru() I suppose.
> 
> Joe
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
--- End Message ---
--- Begin Message ---
base64 doesn't have a key, so anyone could decode the string, which is
obviously not desirable :)

thanks anyway

Justin


on 15/07/02 2:00 PM, James Cox ([EMAIL PROTECTED]) wrote:

> sorry to step in, but did you consider base64_[encode|decode] ?
> 
> -- james
> 
>> 
>> Justin French wrote:
>>> Well, that was on my local test server, which I didn't compile with
>>> mcrypt... so that solves that, but it appears my ISP didn't
>> compile with it
>>> either... so there's very little point in getting my local
>> server working
>>> with it.
>>> 
>>> What alternatives do I have?
>> 
>> I don't *think* PHP includes any builtin-by-default, non-one-way
>> encryption functions, but I haven't looked in a long time so I could be
>> wrong. You might be able to get your ISP to install mcrypt itself which
>> has a command line utility. Then you could use passthru() I suppose.
>> 
>> Joe
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 

--- End Message ---
--- Begin Message ---
On Monday 15 July 2002 10:27, Justin French wrote:

> I'm getting the following error using 4.1.1:
> "Fatal error: Call to undefined function: mcrypt_create_iv() in
> /usr/local/apache/htdocs/tests/enc.php on line 3"

Did you actually install the mcrypt libs?

> Which is confusing, given that the manual says mcrypt_create_iv() is
> available in PHP 4.

The hooks to those functions are there, it still requires that you install the 
lib.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Ah say, son, you're about as sharp as a bowlin' ball.
*/

--- End Message ---
--- Begin Message ---
Hi, got a question.

What happend if ignore_user_abort is true, and the user closes the window?

Also, i tried, but i push the stop button, and the script stops, shouldn 
ignore that?.

Thx :D

_________________________________________________________________
MSN Fotos: la forma más fácil de compartir e imprimir fotos. 
http://photos.msn.es/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
On Monday 15 July 2002 03:55, Tim Luoma wrote:
> Jason Wong wrote:
> > This list gets at least one question a day on this subject ...
>
> And there will be a lot more as people scan the web for example scripts
> and find ones that assume 'register_globals' is set to on.

Questions coming from those sources are partly understandable. 

What I was referring to was the particular case of "I've got an application 
that was working perfectly using php X.XX, then I upgraded to php Y.YY and 
now it doesn't work anymore".

It is those people who should look before they leap and read before they 
upgrade.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If all the world's a stage, I want to operate the trap door.
                -- Paul Beatty
*/

--- End Message ---
--- Begin Message ---
Jason Wong wrote:
> On Monday 15 July 2002 03:55, Tim Luoma wrote:
> 
>>Jason Wong wrote:
>>
>>>This list gets at least one question a day on this subject ...
>>
>>And there will be a lot more as people scan the web for example scripts
>>and find ones that assume 'register_globals' is set to on.
> 
> Questions coming from those sources are partly understandable. 

It was confusing to me to wonder why from one day to the next the same 
scripts stopped working, until I checked the PHP version.


> What I was referring to was the particular case of "I've got an application 
> that was working perfectly using php X.XX, then I upgraded to php Y.YY and 
> now it doesn't work anymore".
> 
> It is those people who should look before they leap and read before they 
> upgrade.

Quite right.

TjL




--- End Message ---
--- Begin Message ---
Hi all. I have this DB where I’m storing this sometimes large amount of
text into a TEXT field, but I can’t seem to find the way to BREAK lines
so it won’t make my browser go 3000 pixels wide when that text is
printed. About this, I have two questions:

1) What should I use to break the text into lines at the DB so HTML can
read them fine? and
2) How should I make the TEXT INPUT BOX so the visitor doesn't have to
type <br> or something after 20 words or so? Is there a way that PHP can
count and break text strings by itself prior storing?

Thanks in advance,

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



--- End Message ---
--- Begin Message ---
there's a function "word_wrap()" (or is it "wordwrap()", something like that
anyway) that'll help you there.

-----Original Message-----
From: César Aracena [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 3:00 PM
To: 'PHP General List'
Subject: [PHP] BREAK into the DB


Hi all. I have this DB where I'm storing this sometimes large amount of
text into a TEXT field, but I can't seem to find the way to BREAK lines
so it won't make my browser go 3000 pixels wide when that text is
printed. About this, I have two questions:

1) What should I use to break the text into lines at the DB so HTML can
read them fine? and
2) How should I make the TEXT INPUT BOX so the visitor doesn't have to
type <br> or something after 20 words or so? Is there a way that PHP can
count and break text strings by itself prior storing?

Thanks in advance,

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
--- End Message ---
--- Begin Message ---
Thanks Martin. Greg just told me in private to look for nl2br and
through that I found wordwrap() (without "_") which helped me.

Thanks to both of you. C.

> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 2:06 AM
> To: 'César Aracena'; 'PHP General List'
> Subject: RE: [PHP] BREAK into the DB
> 
> there's a function "word_wrap()" (or is it "wordwrap()", something
like
> that
> anyway) that'll help you there.
> 
> -----Original Message-----
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 3:00 PM
> To: 'PHP General List'
> Subject: [PHP] BREAK into the DB
> 
> 
> Hi all. I have this DB where I'm storing this sometimes large amount
of
> text into a TEXT field, but I can't seem to find the way to BREAK
lines
> so it won't make my browser go 3000 pixels wide when that text is
> printed. About this, I have two questions:
> 
> 1) What should I use to break the text into lines at the DB so HTML
can
> read them fine? and
> 2) How should I make the TEXT INPUT BOX so the visitor doesn't have to
> type <br> or something after 20 words or so? Is there a way that PHP
can
> count and break text strings by itself prior storing?
> 
> Thanks in advance,
> 
> 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


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


has anybody ever seen this? And knows what it means?
thx.

You have an error in your SQL syntax near 's self-supporting ribbed form was probably 
not strong enough to render the desig' at line 1


regards Wilbert


-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
try add_slashes($string) before inserting into the database, or turn on
magic quotes in php.ini

justin french


on 15/07/02 5:57 PM, Wilbert Enserink ([EMAIL PROTECTED]) wrote:

> Hi all,
> 
> 
> has anybody ever seen this? And knows what it means?
> thx.
> 
> You have an error in your SQL syntax near 's self-supporting ribbed form was
> probably not strong enough to render the desig' at line 1
> 
> 
> regards Wilbert
> 
> 
> -------------------------
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -------------------------

--- End Message ---
--- Begin Message ---
This works OK with creating buttons but is not what I want.
POST/INPUT

        <xsl:for-each select=". . . ">
                <xsl:sort/>

                <form>
                        <xsl:attribute name="name">myform</xsl:attribute>
                        <xsl:attribute name="action">list.php</xsl:attribute>
                        <xsl:attribute name="method">post</xsl:attribute>
                <input>
                        <xsl:attribute name="type">submit</xsl:attribute>
                        <xsl:attribute name="name">insert</xsl:attribute>
                        <xsl:attribute name="value"><xsl:value-of 
select="."/></xsl:attribute>
                </input>
                </form>
                </xsl:for-each>

***This is what I would like to do but it does _not_ work and is wrong.***
POST/SELECT MULTIPLE

        <xsl:for-each select=". . . ">
                <xsl:sort/>

                <form>
                        <xsl:attribute name="name">myform</xsl:attribute>
                        <xsl:attribute name="action">list.php</xsl:attribute>
                        <xsl:attribute name="method">post</xsl:attribute>
                <select>
                        <xsl:attribute name="multiple"></xsl:attribute>
                        <xsl:attribute name="name">insert</xsl:attribute>
                        <option>
                                <xsl:attribute name="value"><xsl:value-of 
select="."/></xsl:attribute>
                                <xsl:value-of select="."/>
                        </option>
                </select>
                </form>
                </xsl:for-each>

So how do I get a select-multiple form to work this way?

-- 
Bill
Amsterdam, NL
--- End Message ---

Reply via email to