OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Just this once, click the link below so I can receive your emails.
You won't have to do this again.

http://www.tgpwizards.com/spamcease2/verify.php?id=1800309


 
php-general Digest 26 Jul 2004 20:51:32 -0000 Issue 2900

php-general-digest-helplists.php.net
Date: Mon Jul 26 2004 - 15:51:32 CDT


php-general Digest 26 Jul 2004 20:51:32 -0000 Issue 2900

Topics (messages 191871 through 191913):

Re: If...Or...Else
        191871 by: Ford, Mike [LSS]
        191874 by: rush

Re: Embedding JavaScript into a PHP generated web page
        191872 by: Ford, Mike [LSS]

Re: Sticky session after session_destroy...
        191873 by: Jason Barnett

Re: Regex (Phone Number)
        191875 by: Burhan Khalid
        191911 by: Curt Zirzow

Usng Session Vaiable in WHERE Statement
        191876 by: Harlequin
        191878 by: Torsten Roehr
        191879 by: Chris Hayes
        191881 by: Daniel Kullik
        191882 by: Daniel Guerrier
        191883 by: Jason Davidson
        191884 by: Afan Pasalic
        191889 by: Jonathan Haddad

Re: Creation of MySQL Database Using PHP
        191877 by: Harlequin

[Newbie Guide] For the benefit of new members
        191880 by: Ma Siva Kumar

Re: domDocument source encoding?
        191885 by: Andreas Goetz
        191886 by: Christian Stocker
        191888 by: Andreas Goetz
        191890 by: Christian Stocker

Returned mail: Data format error
        191887 by: majordomo.auburn.edu

Re: Refer a class
        191891 by: Justin Patrin
        191894 by: Jason Davidson

-> operator and :: (formal names?)
        191892 by: Katie Marquez
        191904 by: Michael Sims
        191910 by: Curt Zirzow

Returned mail: see transcript for details
        191893 by: ipaq-request.handhelds.org

Problem with PEAR DB & MySQLi
        191895 by: Rodolfo Gonzalez Gonzalez
        191905 by: Torsten Roehr

Re: IMPORTANT: Please Verify Your Message
        191896 by: Justin Patrin

Re: IMPORTANT: Please Verify Your Message]
        191897 by: Justin Patrin

What is the PHP5 eqvivalent to domxml_open_mem in PHP4?
        191898 by: Erik Franzn
        191907 by: Christian Stocker

Re: PHP editor that doesn't require installation
        191899 by: barophobia

Retrieve The Last Record in a Table
        191900 by: Harlequin
        191901 by: Jay Blanchard
        191902 by: bbonkosk.tampabay.rr.com
        191903 by: Jason Davidson

Re: URGENT: Space char in rewriterule
        191906 by: Curt Zirzow

Is there a brian I can pick?
        191908 by: Tom Ray [Lists]
        191909 by: Matt M.
        191912 by: Philip Olson

JavaScript conversion to PHP code...
        191913 by: Scott Fletcher

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On 25 July 2004 21:16, Skippy wrote:

 
> Any idea why the need to have two logical operators with the
> same meaning BUT
> different precedences? I dig the need to put in OR as an
> alias, but why
> confuse people with the precedence issue? One would tend to
> think || and OR
> are perfectly interchangeable.

It's a horses for courses situation -- each tends to lead to better readability when used in its appropriate context. For instance (to improve on the above example):

   $result = mysql_query(.....) or die(mysql_error());

would need extra parentheses if rewritten using the || operator:

   ($result = mysql_query(.....)) || die(mysql_error());

On the other hand, a construct like:

   $is_valid = $x>0 || $y>0;

would need additional parentheses with or:

   $is_valid = ($x>0 or $y>0);

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


"Skippy" <skippyzuavra.net> wrote in message
news:20040725231541.7472ccf7xxx...
> I just wanted to make things clear, because the way you said it above may
> lead to misinterpretations, such as believing that || makes all the
elements
> in a condition evaluate even if not necessary, which is not true.
>
> So OR simply has lower precedence than ||, but no other hidden properties.
>
> Any idea why the need to have two logical operators with the same meaning
BUT
> different precedences? I dig the need to put in OR as an alias, but why
> confuse people with the precedence issue? One would tend to think || and
OR
> are perfectly interchangeable.

with OR you can write (and even get desirable result ;) :

$resultSet = mysql_query( abla dabla ) OR die("something");

since it OR has lower precedence than assignment operator =

rush
--
http://www.templatetamer.com/

attached mail follows:


On 26 July 2004 01:13, Robert Frame wrote:

> OK, now I am bewildered again.
>
> Sample Code
>
> <?php
>
> echo '<script language="text/javascript">';

   <script language="JavaScript">

> echo '<!-- ';
> echo 'function myWindow() { alert("javascript from php")}';
> echo '//--> </script>';

There's no need to echo your script from php -- just as with large chunks of
regular html, you can drop out of php mode and just write it as you want it:

?>
<script language="JavaScript">
<!--
function myWindow() { alert("javascript from php")}
//-->
</script>

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Since you're using cookies, are you remembering to destroy the cookie as well?
Check your web browser to see if the cookie is still there - then do your logout
script - and then immediately check to see if the cookie is still there.
Firefox makes this easy... just another reason why I love that browser.

BTW: your english is fine, and the information you provided for your problem was
excellent :)

attached mail follows:


Albert Padley wrote:
> I have been struggling with a javascript regex validation for U.S. phone

This is a PHP list.

attached mail follows:


* Thus wrote Albert Padley:
> I have been struggling with a javascript regex validation for U.S.
> phone numbers all afternoon. This is part of Manuel Lemos' Formsgen
> class. This is limited to the 7 digit number sans 3 digit area code. To
> be complete, the regex should disallow a phone number that begins with
> 0 or 1, 555 or any digit followed by 11. Here is the regex I'm using:
>
> ^(?!\d[1]{2}|[5]{3})([2-9]\d{2})([-])\d{4}$

start yourself in a controlled environment, instead of trying to
comeup with the endless ways a number can be formated and remove
all non digits, then simply test the condistion of the string

  if substr(0,1) == 0 || substr(0,1) == 1
    fail
  if substr(0,3) == 555
    fail
  if substr(1,2) == 11
    fail
  if strlen != 7
    fail

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


Could someone please help me with my syntax here...?

$MembersDataQry = "SELECT * FROM MembersData
WHERE UserID='$_SESSION['logname']'";

I get an error on line 2 but can't seem to figure out what I've missed.

The variable echoes fine so I know there's a string in there.

--
-----------------------------
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-----------------------------

attached mail follows:


"Harlequin" <michael.masonarraspeople.co.uk> wrote in message
news:20040726115856.1240.qmailpb1.pair.com...
> Could someone please help me with my syntax here...?
>
> $MembersDataQry = "SELECT * FROM MembersData
> WHERE UserID='$_SESSION['logname']'";
>
> I get an error on line 2 but can't seem to figure out what I've missed.
>
> The variable echoes fine so I know there's a string in there.
>

To use array values within double quotes you have to put curly braces around
them:
$MembersDataQry = "SELECT * FROM MembersData WHERE
UserID='{$_SESSION['logname']}'";

Or concatenate the string:
$MembersDataQry = "SELECT * FROM MembersData WHERE UserID='" .
$_SESSION['logname'] . "'";

Remember to apply mysql_real_escape_string() on any values used within a
query.

Regards,

Torsten Roehr

attached mail follows:


At 13:58 26-7-04, you wrote:
>Could someone please help me with my syntax here...?
>
>$MembersDataQry = "SELECT * FROM MembersData
>WHERE UserID='$_SESSION['logname']'";
>
>I get an error on line 2 but can't seem to figure out what I've missed.

1. You have errors with the ' quote: you use it to wrap the entire array as
well as for the index. That does not work.

2. Try not to put array names within double quotes. PHP has troubles
recognizing where the array start and ends.
Either wrap the array name and indexes in {} (for details check the manual)
or rather jump out of the quotes.

preferred:
$MembersDataQry = 'SELECT *
                         FROM MembersData
                         WHERE UserID="'.$_SESSION['logname'].'";';

attached mail follows:


Hello again, Michael!

You ought to read this:
http://de.php.net/manual/en/language.types.string.php#language.types.string.parsing

Daniel

Harlequin wrote:
> Could someone please help me with my syntax here...?
>
> $MembersDataQry = "SELECT * FROM MembersData
> WHERE UserID='$_SESSION['logname']'";
>
> I get an error on line 2 but can't seem to figure out what I've missed.
>
> The variable echoes fine so I know there's a string in there.
>

--
WWE e-commerce IT GmbH
Eiffestrasse 462, D-20537 Hamburg
Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50

attached mail follows:


Don't argue with machines, just give it what it wants.
Just put the session variable in it's own variable and
pass that to the sql statement.

$logon = $_SESSION['logname'];

$MembersDataQry = "SELECT * FROM MembersData
 WHERE UserID='$logon'";

--- Daniel Kullik <kullikwwe.biz> wrote:
> Hello again, Michael!
>
> You ought to read this:
>
http://de.php.net/manual/en/language.types.string.php#language.types.string.parsing
>
>
> Daniel
>
> Harlequin wrote:
> > Could someone please help me with my syntax
> here...?
> >
> > $MembersDataQry = "SELECT * FROM MembersData
> > WHERE UserID='$_SESSION['logname']'";
> >
> > I get an error on line 2 but can't seem to figure
> out what I've missed.
> >
> > The variable echoes fine so I know there's a
> string in there.
> >
>
> --
> WWE e-commerce IT GmbH
> Eiffestrasse 462, D-20537 Hamburg
> Tel.: +49-40-2530659-0, Fax: +49-40-2530659-50
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

                
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.
http://messenger.yahoo.com

attached mail follows:


hey, just take the single quotes around the word logname out and you
should be ok.

Jason

On Mon, 26 Jul 2004 12:58:28 +0100, Harlequin
<michael.masonarraspeople.co.uk> wrote:
> Could someone please help me with my syntax here...?
>
> $MembersDataQry = "SELECT * FROM MembersData
> WHERE UserID='$_SESSION['logname']'";
>
> I get an error on line 2 but can't seem to figure out what I've missed.
>
> The variable echoes fine so I know there's a string in there.
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I think he has to keep the single quotes and add double quotes with dots:
$MembersDataQry = "SELECT * FROM MembersData WHERE UserID='
".$_SESSION['logname']'." ' ";

afan

At 09:24 AM 7/26/2004, Jason Davidson wrote:
>hey, just take the single quotes around the word logname out and you
>should be ok.
>
>Jason
>
>On Mon, 26 Jul 2004 12:58:28 +0100, Harlequin
><michael.masonarraspeople.co.uk> wrote:
> > Could someone please help me with my syntax here...?
> >
> > $MembersDataQry = "SELECT * FROM MembersData
> > WHERE UserID='$_SESSION['logname']'";
> >
> > I get an error on line 2 but can't seem to figure out what I've missed.
> >
> > The variable echoes fine so I know there's a string in there.
> >
> > --
> > -----------------------------
> > Michael Mason
> > Arras People
> > www.arraspeople.co.uk
> > -----------------------------
> >
> > --
> > 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

attached mail follows:


Remember you can always use curly braces..

"SELECT * from MembersData WHERE UserID = '{$_SESSION['logname']}'"
works just fine

Jonathan Haddad

Afan Pasalic wrote:

> I think he has to keep the single quotes and add double quotes with dots:
> $MembersDataQry = "SELECT * FROM MembersData WHERE UserID='
> ".$_SESSION['logname']'." ' ";
>
> afan
>
> At 09:24 AM 7/26/2004, Jason Davidson wrote:
>
>> hey, just take the single quotes around the word logname out and you
>> should be ok.
>>
>> Jason
>>
>> On Mon, 26 Jul 2004 12:58:28 +0100, Harlequin
>> <michael.masonarraspeople.co.uk> wrote:
>> > Could someone please help me with my syntax here...?
>> >
>> > $MembersDataQry = "SELECT * FROM MembersData
>> > WHERE UserID='$_SESSION['logname']'";
>> >
>> > I get an error on line 2 but can't seem to figure out what I've
>> missed.
>> >
>> > The variable echoes fine so I know there's a string in there.
>> >
>> > --
>> > -----------------------------
>> > Michael Mason
>> > Arras People
>> > www.arraspeople.co.uk
>> > -----------------------------
>> >
>> > --
>> > 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
>
>

attached mail follows:


Marek

thanks very much.

--
-----------------------------
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-----------------------------
"Marek Kilimajer" <listskilimajer.net> wrote in message
news:4102DE50.1080607kilimajer.net...
> Harlequin wrote:
> > Hello.
> >
> > I have a friend who knows less than me about PHP and MySQL (which I know
is
> > hard to believe) but she needs a login facility for her site.
> >
> > I've passed over some script I use but she doesn't know how to create
the
> > database. I can write some commands that create the tables OK - but can
I do
> > the same for the database or does that have to be done through the
UI...?
> >
>
> Do you know phpMyAdmin?
>
> http://www.phpmyadmin.net/

attached mail follows:


=======================================
Please feel free to add more points and send
to the list.
=======================================

1. If you have any queries/problems about PHP
try http://www.php.net/manual/en first. You
can download a copy and use it offline also.

Please also try
http://www.php.net/manual/faq.php
for answers to frequently answered questions
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching
for "php YOUR QUERY" may fetch you relevant
information within the first 10 results.

3. There is a searchable archive of the
mailing list discussion at
http://phparch.com/mailinglists. Many of the
common topics are discussed repeatedly, and
you may get answer to your query from the
earlier discussions.

For example: One of the repeatedly discussed
question in the list is "Best PHP editor".
Everyone has his/her favourite editor.
You can get all the opinions by going through
the list archives. If you want a chosen list
try this link :
http://www.thelinuxconsultancy.co.uk/phpeditors/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want
find out what extensions are available to
you?

Just put the following code into a file with
a .php extension and access it through your
webserver:

<?php
phpinfo();
?>

If PHP is installed you will see a page with
a lot of information on it. If PHP is not
installed (or not working correctly) your
browser will try to download the file.

(contributed by Teren and reworded by Chris W
Parker)

5. If you are stuck with a script and do not
understand what is wrong, instead of posting
the whole script, try doing some research
yourself. One useful trick is to print
the variable/sql query using print or echo
command and check whether you get what you
expected.

After diagnosing the problem, send the
details of your efforts (following steps 1,
2 & 3) and ask for help.

6. PHP is a server side scripting language.
Whatever processing PHP does takes place
BEFORE the output reaches the client.
Therefore, it is not possible to access
users' computer related information (OS,
screen size etc) using PHP. Nor can you
modify any the user side settings. You need
to go for JavaScript and ask the question in
a JavaScript list.

On the other hand, you can access the
information that is SENT by the user's
browser when a client requests a page from
your server. You can find details about
browser, OS etc as reported by
this request. - contributed by Wouter van
Vliet and reworded by Chris W Parker.

7. Provide a clear descriptive subject line.
Avoid general subjects like "Help!!", "A
Question" etc. Especially avoid blank
subjects.

8. When you want to start a new topic, open a
new mail composer and enter the mailing list
address php-generallists.php.net instead of
replying to an existing thread and replacing
the subject and body with your message.

9. It's always a good idea to post back to
the list once you've solved your problem.
People usually add [SOLVED] to the subject
line of their email when posting solutions.
By posting your solution you're helping the
next person with the same question.
[contribued by Chris W Parker]

10. Ask smart questions
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with
attachments. If you don't have a place to
upload your code, try the many pastebin
websites (such as www.pastebin.com).
[contributed by Burhan Khalid]

Hope you have a good time programming with
PHP.

--
Integrated Management Tools for leather
industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

attached mail follows:


I'm confused and google couldn't answer :(

I'm parsing XML files using domDocument and XPath in php5. Works like a
charm. But- how do I know if I need to apply and utf8decode to the data
returned from the domDocument? Unlike xml_parser_create the domDocument does
not seem to offer an parameter for source encoding.

Any ideas?

Thanks a lot,
Andi

attached mail follows:


Hi

On Mon, 26 Jul 2004 16:31:38 +0200, Andreas Goetz <cpuidlegmx.de> wrote:
> I'm confused and google couldn't answer :(
>
> I'm parsing XML files using domDocument and XPath in php5. Works like a
> charm. But- how do I know if I need to apply and utf8decode to the data
> returned from the domDocument? Unlike xml_parser_create the domDocument does
> not seem to offer an parameter for source encoding.

if you're using ->save or saveXML() it should use the initial encoding
(and state that in the <?xml header). Otherwise (eg.
$element->nodeValue) it's always utf-8. You can also read and write
the attribute $doc->encoding to change the output encoding (or to read
the input encoding).

But as a general rule. Except for the load (where it uses the value in
the <?xml header) and save methods , it's always UTF-8.

chregu

> Any ideas?
>
> Thanks a lot,
> Andi
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB

attached mail follows:


Excellent, thank you. So I should read the document, the do a $doc->encoding
= 'ISO-8859-1' before reading any nodedata values to obtain ISO characters?!

As documentation hasn't caught up with $doc->encoding, how could I've found
out myself?

Thanks again for the quick help,
Andreas

"Christian Stocker" <chregugmail.com> wrote in message
news:49373ab7040726080141034d5cmail.gmail.com...
> Hi
>
> On Mon, 26 Jul 2004 16:31:38 +0200, Andreas Goetz <cpuidlegmx.de> wrote:
> > I'm confused and google couldn't answer :(
> >
> > I'm parsing XML files using domDocument and XPath in php5. Works like a
> > charm. But- how do I know if I need to apply and utf8decode to the data
> > returned from the domDocument? Unlike xml_parser_create the domDocument
does
> > not seem to offer an parameter for source encoding.
>
> if you're using ->save or saveXML() it should use the initial encoding
> (and state that in the <?xml header). Otherwise (eg.
> $element->nodeValue) it's always utf-8. You can also read and write
> the attribute $doc->encoding to change the output encoding (or to read
> the input encoding).
>
> But as a general rule. Except for the load (where it uses the value in
> the <?xml header) and save methods , it's always UTF-8.
>
> chregu
>
> > Any ideas?
> >
> > Thanks a lot,
> > Andi
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
> phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
> http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB

attached mail follows:


On Mon, 26 Jul 2004 17:18:48 +0200, Andreas Goetz <cpuidlegmx.de> wrote:
> Excellent, thank you. So I should read the document, the do a $doc->encoding
> = 'ISO-8859-1' before reading any nodedata values to obtain ISO characters?!

No, if you access the nodeData with for example ->nodeValue, it's
UTF-8, always. $doc->encoding is only honoured during save() or
saveXML().

>
> As documentation hasn't caught up with $doc->encoding, how could I've found
> out myself?

reading the source or the W3C Specs ;)

chregu
>
> Thanks again for the quick help,
> Andreas
>
> "Christian Stocker" <chregugmail.com> wrote in message
> news:49373ab7040726080141034d5cmail.gmail.com...
>
>
> > Hi
> >
> > On Mon, 26 Jul 2004 16:31:38 +0200, Andreas Goetz <cpuidlegmx.de> wrote:
> > > I'm confused and google couldn't answer :(
> > >
> > > I'm parsing XML files using domDocument and XPath in php5. Works like a
> > > charm. But- how do I know if I need to apply and utf8decode to the data
> > > returned from the domDocument? Unlike xml_parser_create the domDocument
> does
> > > not seem to offer an parameter for source encoding.
> >
> > if you're using ->save or saveXML() it should use the initial encoding
> > (and state that in the <?xml header). Otherwise (eg.
> > $element->nodeValue) it's always utf-8. You can also read and write
> > the attribute $doc->encoding to change the output encoding (or to read
> > the input encoding).
> >
> > But as a general rule. Except for the load (where it uses the value in
> > the <?xml header) and save methods , it's always UTF-8.
> >
> > chregu
> >
> > > Any ideas?
> > >
> > > Thanks a lot,
> > > Andi
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > --
> > christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
> > phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
> > http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB

attached mail follows:


The original message was received at Mon, 26 Jul 2004 08:58:34 -0600 from auburn.edu [82.197.96.166]

----- The following addresses had permanent fatal errors -----
<php-generallists.php.net>

----- Transcript of session follows -----
... while talking to lists.php.net.:
>>> MAIL FROM:majordomoauburn.edu
<<< 509 Refused

attached mail follows:


On Sun, 25 Jul 2004 20:00:18 +0200, Michael Ochs <michael.ochsgmx.net> wrote:
> I can call $myclass->module['mymodule']->variable; so I think the class is
> instantiate correctly. But the reference doesn't seem to work, cause the
> variable I get ist always the same:
>
> $myclass->nickname = "xyz";
> $class2 = $myclass->loadModule("mysecondclass");
> $myclass->nickname = "abc";
>
> Now, when I call $this->main->nickname in $class2, wich actually should call
> $myclass, it returns "xyz" instead of "abc"!
>
> Any idea?
>

It's being copied somewhere. Maybe try this in the loadModule function:
$this->module[$name] =& new $name($this);

You don't need the & for $this as you've defined the function to send
it by reference.

> Thanks, Michael
>
> "Jason Davidson" <jason.davidsongmail.com> schrieb im Newsbeitrag
> news:6c925ae204072510516d870312mail.gmail.com...
>
>
> > If there is no error, check the values of all the vars and array
> > ellements in your logic for the first method. Make sure its actually
> > getting to the point where it instantiates the new object.
> >
> > Jason
> >
> > On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <michael.ochsgmx.net>
> wrote:
> > > Hi,
> > > I try to load some 'modules' into my class. These modules are other
> classes.
> > > I want to refer the main class to this new module but that doesn't work.
> At
> > > the moment it looks like this:
> > >
> > > Mainclass:
> > >
> > > function loadModule($name) {
> > > if(class_exists($name)) { //Class found
> > > if(!$this->module[$name]) {
> > > $this->module[$name] = new $name(&$this);
> > > }
> > > return true;
> > > } else {
> > > return false;
> > > }
> > > }
> > >
> > > The mainfunktion of the module:
> > >
> > > function module_artikelvote(&$parent) {
> > > $this->main = &$parent;
> > > return true;
> > > }
> > >
> > > I can use $this->main->VARIABLE but the values are old. If I call a
> function
> > > with $this->main->func_name(); it doesn't work, but there also isn't an
> > > error message!
> > >
> > > What's wrong with these functions?
> > >
> > > Thanks for help, Michael
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


What version of PHP is this, in php 5, all classes are passed by
reference by default i beleive.

Jason

On Sun, 25 Jul 2004 20:00:18 +0200, Michael Ochs <michael.ochsgmx.net> wrote:
> I can call $myclass->module['mymodule']->variable; so I think the class is
> instantiate correctly. But the reference doesn't seem to work, cause the
> variable I get ist always the same:
>
> $myclass->nickname = "xyz";
> $class2 = $myclass->loadModule("mysecondclass");
> $myclass->nickname = "abc";
>
> Now, when I call $this->main->nickname in $class2, wich actually should call
> $myclass, it returns "xyz" instead of "abc"!
>
> Any idea?
>
> Thanks, Michael
>
> "Jason Davidson" <jason.davidsongmail.com> schrieb im Newsbeitrag
> news:6c925ae204072510516d870312mail.gmail.com...
>
>
> > If there is no error, check the values of all the vars and array
> > ellements in your logic for the first method. Make sure its actually
> > getting to the point where it instantiates the new object.
> >
> > Jason
> >
> > On Sun, 25 Jul 2004 19:36:44 +0200, Michael Ochs <michael.ochsgmx.net>
> wrote:
> > > Hi,
> > > I try to load some 'modules' into my class. These modules are other
> classes.
> > > I want to refer the main class to this new module but that doesn't work.
> At
> > > the moment it looks like this:
> > >
> > > Mainclass:
> > >
> > > function loadModule($name) {
> > > if(class_exists($name)) { //Class found
> > > if(!$this->module[$name]) {
> > > $this->module[$name] = new $name(&$this);
> > > }
> > > return true;
> > > } else {
> > > return false;
> > > }
> > > }
> > >
> > > The mainfunktion of the module:
> > >
> > > function module_artikelvote(&$parent) {
> > > $this->main = &$parent;
> > > return true;
> > > }
> > >
> > > I can use $this->main->VARIABLE but the values are old. If I call a
> function
> > > with $this->main->func_name(); it doesn't work, but there also isn't an
> > > error message!
> > >
> > > What's wrong with these functions?
> > >
> > > Thanks for help, Michael
> > >
> > > --
> > > 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
>
>

attached mail follows:


Hi!

I did a search of the PHP manual for these:

-> and ::

I know what they are used for, but what I don't know
is what they are formally called. Can someone tell me
what they are called (short of using the symbol in the
name)?

The PHP manual's search engine returns me (among
others)the "Chapter 10: Operators" page , but I didn't
see the symbols listed there. I also checked the
section for chapters 13 and 14 "classes and object"
and did find the :: listed, but it does not give the
name of the symbol. A search of Google with keywords
"->" or "::" comes back empty.

Thanks,
K.

                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

attached mail follows:


Katie Marquez wrote:
> Hi!
>
> I did a search of the PHP manual for these:
>
> -> and ::
>
> I know what they are used for, but what I don't know
> is what they are formally called. Can someone tell me
> what they are called (short of using the symbol in the
> name)?

I don't know what PHP's official name for these operators are but in Perl the "->"
is called the "infix arrow operator" since it lies between its operands (the
instance variable and the attribute or method name). I've seen the "::" referred to
as the "double-colon operator", but I don't know how offical that is either. :)

HTH

attached mail follows:


* Thus wrote Katie Marquez:
> Hi!
>
> I did a search of the PHP manual for these:
>
> -> and ::
>

as far as the :: is, its name (in php): The Paamayim Nekudotayim.

Paamayim Nekudotayim would, at first, seem a strange choice for a
double-colon. However, at the time of writing of Zend Engine 0.5
(which powered PHP3), that is what Andi and Zeev decided to call
it. It actually does mean double-colon - in Hebrew! As PHP has
progressed with its development it has just never changed.

php4:
  http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

php5 (comming soon):
  http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


05P$~/R4{ߟBPYe-Ӳi#VWʠB^pFkhXINrhNE&-b纟QOmN_n
.1A_^0rLhRywDKR5ܩmǍyMW:44>ϒ ~61XsQۆ6y
GI)~
[UN&aSIg
b

P~EV86>L|
ԒP%TWV&w&
󼶚u29kAHB(Gxd^2왒?ꬭE]V!lЫWuJVIg
Ĵ72&>lŶY1SuqJ$>[3z9mcU \͟Z|%Ƹ;3 /qպ.?Eʼ2E>H57rypK}.*vNohFm$O)L
eC:*k}lۧ>;]]D/N1
Slu*!:b"ds3l\(
5Vw^pY3؞ǿ4\zZt
v'3uXPD'|~V W(5~vJx%?GLبŘlXg_D|VeZז}9U2rMTDp.±Be"A-К/5ҌI2!,'ϳTނ-1!dsF!i

_$?`ˮ,8
77utCE~0wi$h-X}f˴n׾LZ_L2 $0,BH:/򋥹Qje8`qo}Wڎ>Fj6-uXfbxeMw-93av9'_3;V
kG6a߰q2Kم'R3wpϩ$Z9uKuifdcds*Q-GE~6}ekuB%蕘iVVf6!-$UIH~I2p&0Z?*A7qpesnQXj JEstIYpN't&#f\Eh6,2,u݁sC$|\sq<UP:Y9fV{Ő^NH4bzҊef2
Ðj͎fÚ$MyqycӲ}ͼ8;XpQ\2g9ks%XzSv4*KGdeҋda(?EYQ[_Tlf#8[,־b
cu^ܷ,;EkƁ!As
CKBq{('07\LY|;)G:'0 #ӓ0BX۵Ļ(T
]Fٯ
.,嶛RjN0OJn
M7E*]9pY!!bҲO$Ȇldqu9,TOmn`Y"
9Q%es >
LԢ.טkOcƣ˱mHȘCXz~yQ]$aTo<I$$X1v(B~ӆXCWd55yhbAoJZEYIi{Quʤmkں$xZyo0WZ8Sf*ŚLKh-2HMkM`ޡՋI}$t YRl4DdPu{ma߶Q%;1Gdj'6IWшȾ
pu%1^{[P5Xp1Xɤ"lTVGDk'rT^ɾ(-}H}&~v^OnE]%ɏ`|y1 ؖ'aF"?g|<6\O68O
E#VoLşV B0OKKȼFx|RDz)
"kZҲŜ~'[Eg퉑UC?d5c:Hd]h"Q#
xx{b|4tYRj(M}SW':0?B-,ҏ)fD{3]{
k9?Lu^k8͚cpM}tkHsK%࣊3ruT%FTjp,3_>A"˟),[eǟyN^HD7'a_v`n<dON,q*E9Ih
ij
TWMBhJ$MdtF¤[C<ya2FO/2lm(~VcKPGh d2BQ|-UgMs,_#3WPO~A";,5[q>lRV\x]t߭Ʈ
ts%bL(ٲR~N\lG50G(5҃M$
_}F6j#ZК(%:$0_{`/L<1<
y]4E1\bQ2M5.8Sg*X_Lu)%]-PBڍPu9#ͲkRnL-_5](ە>%{Q4M݃$^Pfw-ːCRۻd.y}lhȜq{64WsU|S)aӎ{Iv*Wl$8Z
s]w|~`h\P9* I/RkMBx./ۓK}yu_ܞv%<0g

attached mail follows:


Hi,

I'm trying to use PEAR's DB class with the new PHP 5 MySQLi support on
MySQL 4.1.3, using this example from the PEAR's docs (with my parameters
of course). I'm getting "DB unknown error" messages after the query. The
same query from the mysql client works fine, there are no connection
problems... anyone has tried PEAR with mysqli?.

<?php
// Create a valid DB object named $db
// at the beginning of your program...
require_once 'DB.php';

$db =& DB::connect('mysqli://prueba:clave127.0.0.1:3306/mibase');
if (DB::isError($db)) {
    die($db->getMessage());
}

// Proceed with a query...
$res =& $db->query('SELECT * FROM users');

// Always check that result is not an error
if (DB::isError($res)) {
    die($res->getMessage());
}
?>

result:

DB Error: unknown error

Regards,
Rodolfo.

attached mail follows:


"Rodolfo Gonzalez Gonzalez" <rodolfoequinoxe.g-networks.net> wrote in
message news:Pine.LNX.4.58L0.0407261211280.30058equinoxe.g-networks.net...
> Hi,
>
> I'm trying to use PEAR's DB class with the new PHP 5 MySQLi support on
> MySQL 4.1.3, using this example from the PEAR's docs (with my parameters
> of course). I'm getting "DB unknown error" messages after the query. The
> same query from the mysql client works fine, there are no connection
> problems... anyone has tried PEAR with mysqli?.

Hi,

you should ask this on the PEAR general mailing list.

Regards, Torsten Roehr

>
> <?php
> // Create a valid DB object named $db
> // at the beginning of your program...
> require_once 'DB.php';
>
> $db =& DB::connect('mysqli://prueba:clave127.0.0.1:3306/mibase');
> if (DB::isError($db)) {
> die($db->getMessage());
> }
>
> // Proceed with a query...
> $res =& $db->query('SELECT * FROM users');
>
> // Always check that result is not an error
> if (DB::isError($res)) {
> die($res->getMessage());
> }
> ?>
>
> result:
>
> DB Error: unknown error
>
>
> Regards,
> Rodolfo.

attached mail follows:


On Sun, 25 Jul 2004 19:05:38 -0700 (PDT), Mark <mark_weinstockyahoo.com> wrote:
> --- Jason Wong <php-generalgremlins.biz> wrote:
> > On Sunday 25 July 2004 09:42, Mark wrote:
> > > Am I the only one who gets annoyed at these?
> >
> > No you're not. Look in the past week's archives.
> >
> > > Ed.Lazord20News.com, php-generallists.php.net is currently
> >
> > You've got the culprit here. Either lambast him publically (since
> > he doesn't
> > want to receive your private mail). Or do what this says:
> >
> > > http://www.tgpwizards.com/spamcease2/verify.php?id=1334886
> >
> > Or set a filter to trash these messages.
>
> If he doesn't want my emails, so be it. Filter is set... Seems pretty
> incompetent to not be able to whitelist a dstribution list.
>

This isn't nearly fair. Some of the PHP lists still have spam coming
in on them, so whitelisting it will let the spam in.

> BTW, I just got one that *implies* php-general is using their filter.
> There was no other address, and it appears to be forged from
> php-generallists.php.net
>

Well then, it *does* sound like something isn't right here.

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


On Mon, 26 Jul 2004 11:27:32 +0300, EE <eebjaili.com> wrote:
> What is this? I got this message few times from php.net...
>

Well, that's weird....I've never seen that one.

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


The docs for PHP5 and dom xml is not written yet, so I tried to find
information about load and save methods on the w3c site, but I didn't
find anything.

What's is the PHP5 eqvivalent to domxml_open_mem in PHP4?

/Erik

attached mail follows:


On Mon, 26 Jul 2004 19:19:56 +0200, Erik Franzn <eriknordicaudi.com> wrote:
> The docs for PHP5 and dom xml is not written yet,

yes they are: http://www.php.net/dom

> so I tried to find
> information about load and save methods on the w3c site, but I didn't
> find anything.

You didn't look good enough ;)

http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/

> What's is the PHP5 eqvivalent to domxml_open_mem in PHP4?

DomDOcument::loadXML();

Further readings:

http://php5.bitflux.org/phpconf2004/slide_68.php
and
http://zend.com/php5/articles/php5-xmlphp.php

chregu

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

--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregugmail.com | gnupg-keyid 0x5CE1DECB

attached mail follows:


On Sat, 24 Jul 2004 16:37:03 +0200, rush <piparush.avalon.hr> wrote:

> scite, from the scintilla fame. TemplateTamer would also work fine if you
> just copy the whole directory

wow. that's a pretty awesome editor. too bad it can't connect to FTP
sites. all my files are remote!

anyone have a work around for this?

thanks.

attached mail follows:


I would like to retrieve the last entry in a login table and present that to
a user so they can verify the date we have when they last logged in.

Is this possible...?

--
-----------------------------
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-----------------------------

attached mail follows:


[snip]
I would like to retrieve the last entry in a login table and present
that to
a user so they can verify the date we have when they last logged in.

Is this possible...?
[/snip]

yes,
http://catb.org/~esr/faqs/smart-questions.html

attached mail follows:


I'm sure there are many ways to do this.

Perhaps use something like this as a query?
select * from login_table order by DATE_LAST_LOGGED_IN ASC limit 1

----- Original Message -----
From: Harlequin <michael.masonarraspeople.co.uk>
Date: Monday, July 26, 2004 1:27 pm
Subject: [PHP] Retrieve The Last Record in a Table

> I would like to retrieve the last entry in a login table and
> present that to
> a user so they can verify the date we have when they last logged in.
>
> Is this possible...?
>
>
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


as mentioned already, use a column in the table to order the query and
then use LIMIT to only to return one record. Best columns to use would
be an auto_increment or a datetime field type.

Jason

On Mon, 26 Jul 2004 18:27:25 +0100, Harlequin
<michael.masonarraspeople.co.uk> wrote:
>
>
> I would like to retrieve the last entry in a login table and present that to
> a user so they can verify the date we have when they last logged in.
>
> Is this possible...?
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


* Thus wrote Robert Winter:
> I have the following rewriterule:
>
> RewriteRule ^(([0-9]|[A-Z]|[a-z]|_)+)$ redirect.php?$1 [L]

And why is this so more urgent than any other email? and what does
any of this have to any thing to do with PHP? perhaps you meant
'OT:'

>
> that transforms http://mysite.com/XXX to http://mysite.com/redirect.php?XXX
>
> and I need to also include to space char, for example
>
> that transforms http://mysite.com/AB XX to http://mysite.com/redirect.php?AB
> XX

read the rfc on http protocol, and URI definitions.

>
>
> I didn't find a way to write the " " characters. I tested with RewriteRule
> ^(([0-9]|[A-Z]|[a-z]|_| )+)$ redirect.php?$1 [L] but didn't work.

rtfm: http://apache.org/

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


Hey all-

I've run into a small bump in some code I'm writing for a membership
database. The first thing that needs to be done is an index of all
states in the US with members. The fun part is that the state
information is stored as the abbreviation in the database (ie MI, WI)
and the HTML page needs to display the full name of the State. I want to
display the information in a four column table that kicks out as many
rows as needed. Now in order to get the full name of the state, I'm
running the state result through a switch statement. Actaully, it's
working rather well expect for this little issue:

Row 8: South Dakota Tennessee Texas Virgina
Row 9: West Virgina Wisconsin Texas Virgina

I need to kill that extra Texas and Virgina.....here's how I'm doing this:

<table border=1>
<?
$query=mysql_query("SELECT DISTINCT state FROM members WHERE
country='US' ORDER BY state ASC");
while($q=mysql_fetch_array($query)) {
$q1=mysql_fetch_array($query);
$q2=mysql_fetch_array($query);
$q3=mysql_fetch_array($query);
$q4=mysql_fetch_array($query);

(4 Switch statements here one for q1, q2, q3, q4)
?>

<tr><td><?= $state1 ?></td><td><?= $state2 ?></td><td><?= $state3
?></td><td><?= $state4 ?></td></tr>

<?
}
?>

Any thoughts, let me know if more information is needed.

TIA.

attached mail follows:


> I need to kill that extra Texas and Virgina.....here's how I'm doing this:
>
> <table border=1>
> <?
> $query=mysql_query("SELECT DISTINCT state FROM members WHERE
> country='US' ORDER BY state ASC");
> while($q=mysql_fetch_array($query)) {
> $q1=mysql_fetch_array($query);
> $q2=mysql_fetch_array($query);
> $q3=mysql_fetch_array($query);
> $q4=mysql_fetch_array($query);
>
> (4 Switch statements here one for q1, q2, q3, q4)
> ?>
>
> <tr><td><?= $state1 ?></td><td><?= $state2 ?></td><td><?= $state3
> ?></td><td><?= $state4 ?></td></tr>
>
> <?
> }
> ?>

I would change the loop so you are only calling mysql_fetch_array
once. Are you sure that this loop is working correctly?

at the bottom of your while loop try this:

unset($state1,$state2,$state3,$state4,$q1, $q2, $q3, $q4);

attached mail follows:


> I've run into a small bump in some code I'm writing for a membership
> database. The first thing that needs to be done is an index of all
> states in the US with members. The fun part is that the state
> information is stored as the abbreviation in the database (ie MI, WI)
> and the HTML page needs to display the full name of the State. I want to
> display the information in a four column table that kicks out as many
> rows as needed. Now in order to get the full name of the state, I'm
> running the state result through a switch statement. Actaully, it's
> working rather well expect for this little issue:
>
> Row 8: South Dakota Tennessee Texas Virgina
> Row 9: West Virgina Wisconsin Texas Virgina
>
> I need to kill that extra Texas and Virgina.....here's how I'm doing this:
>
> <table border=1>
> <?
> $query=mysql_query("SELECT DISTINCT state FROM members WHERE
> country='US' ORDER BY state ASC");

Try something more like this:

<table>
 <tr>
<?php
// Assuming this ($statenames) is a full list
// and that uppercase appreviations come from the DB
// and that you implement error handling
$statenames = array('WA' => 'Washington', 'OR' => 'Oregon');
$i = 1;
$count = mysql_num_rows($query);
while ($row = mysql_fetch_assoc($query)) {
    echo "\t<td>". $statenames[$row['state']] ."</td>\n";
    if (($i % 4) === 0 && $count !== $i++) {
        echo "</tr>\n<tr>\n";
    }
}
?>
 </tr>
</table>

Regards,
Philip

attached mail follows:


Hi, what is in your opinion is the best way to convert from JavaScript to
PHP.... What I'm not entirely sure of is the
"char_set.indexOf(input.charAt())"..... It look pretty tricky....

--snip--
     var algorithm = 8;

     for (loop=0; loop<input.length; loop++)
     {
        //search char_set string for character and set char_code variable...
        char_code = char_set.indexOf(input.charAt(loop));

        //opposite of encrypt algorithm goes here
        if (char_code - algorithm < 0) {
           space = algorithm - char_code;
           char_code = char_set.length - space;
        } else {
           char_code -= algorithm;
        }

        //set output variable in accordance to char_set
        output += char_set.charAt(char_code);
     }
--snip--

Thanks,
 FletchSOD


 
php-general Digest 27 Jul 2004 09:00:24 -0000 Issue 2901

php-general-digest-helplists.php.net
Date: Tue Jul 27 2004 - 04:00:24 CDT


php-general Digest 27 Jul 2004 09:00:24 -0000 Issue 2901

Topics (messages 191914 through 191949):

Re: -> operator and :: (formal names?) (RESOLVED)
        191914 by: Mike Dichirico

Re: JavaScript conversion to PHP code...
        191915 by: Scott Fletcher
        191916 by: Matt M.
        191922 by: Curt Zirzow

Re: PHP editor that doesn't require installation
        191917 by: Justin Patrin
        191924 by: Tom Rogers

Re: Refer a class
        191918 by: Michael Ochs

Re: Problem with PEAR DB & MySQLi
        191919 by: Justin Patrin

Re: Is there a brian I can pick?
        191920 by: Robert Sossomon
        191921 by: Jason Davidson
        191923 by: Brian Dunning
        191934 by: Oliver John V. Tibi

Extra byte added to PDF streaming file
        191925 by: Scott Taylor
        191927 by: Larry E. Ullman
        191928 by: Curt Zirzow

PHP vs. Java
        191926 by: Ed Lazor
        191929 by: raditha dissanayake

php 5 DOM tutorials / examples?
        191930 by: Ed Lazor
        191938 by: Christian Stocker

Re: IMPORTANT: Please Verify Your Message]
        191931 by: Chris Martin
        191932 by: Curt Zirzow
        191933 by: Curt Zirzow

Re: URGENT: Space char in rewriterule
        191935 by: Robert Winter

issue a value on header, not working..
        191936 by: Louie Miranda
        191937 by: zareef ahmed
        191939 by: Justin Patrin
        191941 by: Louie Miranda

phpize missing files
        191940 by: Thijs Lensselink

Re: select * on all current?
        191942 by: Louie Miranda
        191943 by: Louie Miranda
        191944 by: Lester Caine

Mail System Error - Returned Mail
        191945 by: nick.loman.net

totally new to PHP
        191946 by: Paul Kain
        191947 by: Jason Barnett
        191948 by: Bruno Santos

Re: Retrieve The Last Record in a Table
        191949 by: Harlequin

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Michael and Curt,

Thank you very much with your time and promptness. You both have been very
helpful.

Kind regards,
Katie
----- Original Message -----
From: "Curt Zirzow" <php-generalzirzow.dyndns.org>
To: "php" <php-generallists.php.net>
Sent: Monday, July 26, 2004 1:12 PM
Subject: Re: [PHP] -> operator and :: (formal names?)

> * Thus wrote Katie Marquez:
> > Hi!
> >
> > I did a search of the PHP manual for these:
> >
> > -> and ::
> >
>
> as far as the :: is, its name (in php): The Paamayim Nekudotayim.
>
> Paamayim Nekudotayim would, at first, seem a strange choice for a
> double-colon. However, at the time of writing of Zend Engine 0.5
> (which powered PHP3), that is what Andi and Zeev decided to call
> it. It actually does mean double-colon - in Hebrew! As PHP has
> progressed with its development it has just never changed.
>
> php4:
> http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php
>
> php5 (comming soon):
> http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
>
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid
schemes
> you've been hearing about. No, sir. Our model is the trapezoid!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I think maybe this will do the trick..

--snip--
$char_code = strpos($char_set,(substr($input,$loop,1)));
--snip--

FletchSOD

"Scott Fletcher" <scottabcoa.com> wrote in message
news:20040726205131.14452.qmailpb1.pair.com...
> Hi, what is in your opinion is the best way to convert from JavaScript to
> PHP.... What I'm not entirely sure of is the
> "char_set.indexOf(input.charAt())"..... It look pretty tricky....
>
> --snip--
> var algorithm = 8;
>
> for (loop=0; loop<input.length; loop++)
> {
> //search char_set string for character and set char_code
variable...
> char_code = char_set.indexOf(input.charAt(loop));
>
> //opposite of encrypt algorithm goes here
> if (char_code - algorithm < 0) {
> space = algorithm - char_code;
> char_code = char_set.length - space;
> } else {
> char_code -= algorithm;
> }
>
> //set output variable in accordance to char_set
> output += char_set.charAt(char_code);
> }
> --snip--
>
> Thanks,
> FletchSOD

attached mail follows:


> --snip--
> $char_code = strpos($char_set,(substr($input,$loop,1)));
> --snip--

even a little shorter

$char_code = strpos($char_set,$input{$loop});

attached mail follows:


* Thus wrote Scott Fletcher:
> Hi, what is in your opinion is the best way to convert from JavaScript to
> PHP.... What I'm not entirely sure of is the
> "char_set.indexOf(input.charAt())"..... It look pretty tricky....
>

Sometimes a whole complete approach can be done:

> --snip--
> var algorithm = 8;
>

// shift the contents over and add the shifted to the end.
$trans = substr($char_set, $algorithm-1) .
             substr($chars_set, 0, $algorithm);

$output = strtr($input, $trans_set, $trans);

If your $input string is of a significant length this will be more
efficient with the cost of some memory (strlen($trans_set)x2).

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


On Mon, 26 Jul 2004 10:20:56 -0700, barophobia <barophobiagmail.com> wrote:
> On Sat, 24 Jul 2004 16:37:03 +0200, rush <piparush.avalon.hr> wrote:
>
> > scite, from the scintilla fame. TemplateTamer would also work fine if you
> > just copy the whole directory
>
> wow. that's a pretty awesome editor. too bad it can't connect to FTP
> sites. all my files are remote!
>
> anyone have a work around for this?
>

Edit locally and FTP manually.

Or get some kind of mounted FTP filesystem....doesn't Windows XP have
something like this built in....?

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


Hi,

Tuesday, July 27, 2004, 7:40:25 AM, you wrote:

JP> Edit locally and FTP manually.

JP> Or get some kind of mounted FTP filesystem....doesn't Windows XP have
JP> something like this built in....?

JP> --
JP> DB_DataObject_FormBuilder - The database at your fingertips
JP> http://pear.php.net/package/DB_DataObject_FormBuilder

JP> paperCrane --Justin Patrin--

I use a program called webdrive
(http://www.webdrive.com/index.php?pg=./products/webdrive/index)
that sets up the remote site as a
local drive which works really well.

--
regards,
Tom

attached mail follows:


> It's being copied somewhere. Maybe try this in the loadModule function:
> $this->module[$name] =& new $name($this);
>
> You don't need the & for $this as you've defined the function to send
> it by reference.

It doesn't work, either. But I think maybe the problem is somewhere else, it
seems that this bug just appears when a user sees the first page after the
login, so I think this part works correct. Going to look on other lines! :)
Thanks for help, all of you! :)

attached mail follows:


On Mon, 26 Jul 2004 12:18:37 -0500 (CDT), Rodolfo Gonzalez Gonzalez
<rodolfoequinoxe.g-networks.net> wrote:
> Hi,
>
> I'm trying to use PEAR's DB class with the new PHP 5 MySQLi support on
> MySQL 4.1.3, using this example from the PEAR's docs (with my parameters
> of course). I'm getting "DB unknown error" messages after the query. The
> same query from the mysql client works fine, there are no connection
> problems... anyone has tried PEAR with mysqli?.
>
> <?php
> // Create a valid DB object named $db
> // at the beginning of your program...
> require_once 'DB.php';
>
> $db =& DB::connect('mysqli://prueba:clave127.0.0.1:3306/mibase');
> if (DB::isError($db)) {
> die($db->getMessage());
> }
>
> // Proceed with a query...
> $res =& $db->query('SELECT * FROM users');
>
> // Always check that result is not an error
> if (DB::isError($res)) {
> die($res->getMessage());
> }
> ?>
>
> result:
>
> DB Error: unknown error
>

Echo $res->getUserInfo() as well. It has the real error.

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


It looks like you need to reset the $state variables each loop through
so that they are all empty, hence when you get to west virginia and
wisconsin they are but empties behind them

Heck, personally I'd just add another cell to the table and make it have
the full name in, then just use that column of data to populate the
system, since you are calling everything anyways, why work more when
another column can be used and have multiple uses??

My $.02

Robert

attached mail follows:


Hey, an alternative to your switch statement, is to have an
associative array with the full State names in it like this ...
$states = array('MI'=>'Michigan'); and so forth.
then just uses it in your html.. $states['$state'];

Jason

On Mon, 26 Jul 2004 15:28:11 -0400, Tom Ray [Lists]
<listsblazestudios.com> wrote:
> Hey all-
>
> I've run into a small bump in some code I'm writing for a membership
> database. The first thing that needs to be done is an index of all
> states in the US with members. The fun part is that the state
> information is stored as the abbreviation in the database (ie MI, WI)
> and the HTML page needs to display the full name of the State. I want to
> display the information in a four column table that kicks out as many
> rows as needed. Now in order to get the full name of the state, I'm
> running the state result through a switch statement. Actaully, it's
> working rather well expect for this little issue:
>
> Row 8: South Dakota Tennessee Texas Virgina
> Row 9: West Virgina Wisconsin Texas Virgina
>
> I need to kill that extra Texas and Virgina.....here's how I'm doing this:
>
> <table border=1>
> <?
> $query=mysql_query("SELECT DISTINCT state FROM members WHERE
> country='US' ORDER BY state ASC");
> while($q=mysql_fetch_array($query)) {
> $q1=mysql_fetch_array($query);
> $q2=mysql_fetch_array($query);
> $q3=mysql_fetch_array($query);
> $q4=mysql_fetch_array($query);
>
> (4 Switch statements here one for q1, q2, q3, q4)
> ?>
>
> <tr><td><?= $state1 ?></td><td><?= $state2 ?></td><td><?= $state3
> ?></td><td><?= $state4 ?></td></tr>
>
> <?
> }
> ?>
>
> Any thoughts, let me know if more information is needed.
>
> TIA.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I'm a Brian, but you can't pick me unless you're a really hot chick.

- Brian

attached mail follows:


Brian, pardon the typo, but maybe he's looking for a brain. *chuckles*. :)

--

Running 'ojtibi' on '127.0.0.1' (BATCH_OPTIMISTIC mode).
"Live free() or die()."

"Brian Dunning" <brianbriandunning.com> wrote in message
news:629E8940-DF53-11D8-9E6D-000A95BD6AE4briandunning.com...
> I'm a Brian, but you can't pick me unless you're a really hot chick.
>
> - Brian

attached mail follows:


I'm using this code to stream a PDF file:

$file = $_SERVER['DOCUMENT_ROOT'] . "/file.pdf";
   
simple_streamfile($file);

function simple_streamfile($file)
{

    $fp = fopen($file, 'rb');
    // send the right headers
    header("Content-Type: application/pdf");
    header("Content-Length: " . filesize($file));
    // dump the file and stop the script
    fpassthru($fp);
    fclose($fp);
    exit;

}

It appears as though some readers (such as adobe acrobat) can read this
file fine yet others (such as the program gv in *NIX) cannot read it.

The reason for this is that somehow a hex 0A is added before the inital
%PDF-1.2 which marks the start of the PDF file causing some readers to
not recognize it as a PDF file. Is there anything in this code which
could possibly (always) cause an extra byte (0A) to be added before the
real start of the file? And no, the file is not corrupted (I've
already tried that) - this only happens when it goes through this
script, and not loaded directly as example.com/file.pdf.

Scott

attached mail follows:


> It appears as though some readers (such as adobe acrobat) can read
> this file fine yet others (such as the program gv in *NIX) cannot read
> it.
>
> The reason for this is that somehow a hex 0A is added before the
> inital %PDF-1.2 which marks the start of the PDF file causing some
> readers to not recognize it as a PDF file. Is there anything in this
> code which could possibly (always) cause an extra byte (0A) to be
> added before the real start of the file? And no, the file is not
> corrupted (I've already tried that) - this only happens when it goes
> through this script, and not loaded directly as example.com/file.pdf.

I've seen cases where extra buffer content gets added to the downloaded
file. The problem was fixed by deleting any existing buffer before
sending the file to the client. Not sure that will solve the problem
but it's worth a shot.

Larry

attached mail follows:


* Thus wrote Scott Taylor:
>
> $fp = fopen($file, 'rb');
> // send the right headers
> header("Content-Type: application/pdf");
> header("Content-Length: " . filesize($file));
> // dump the file and stop the script
> fpassthru($fp);
>
> ...
>
> The reason for this is that somehow a hex 0A is added before the inital
> %PDF-1.2 which marks the start of the PDF file causing some readers to
> not recognize it as a PDF file. Is there anything in this code which
> could possibly (always) cause an extra byte (0A) to be added before the
> real start of the file? And no, the file is not corrupted (I've
> already tried that) - this only happens when it goes through this
> script, and not loaded directly as example.com/file.pdf.

The reason this can happen is if you are including a file that
looks like this:
<?php
// content of includ file
?>

EOF

To find out where this is, turn error_reporting(E_ALL); and
ini_set('display_errors', true); you'll get a message telling you
that output was sent before the headers, and on what line the
output started on.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


Any comments or opinions on pros and cons, especially in terms of stability,
security, and future upgradability?

 

I know this is probably one of those religious war topics, but I'd still
like your feedback.

 

-Ed

 

attached mail follows:


Ed Lazor wrote:

>Any comments or opinions on pros and cons, especially in terms of stability,
>security, and future upgradability?
>
>
This is a a religious war topic. Horses for course but in this list of
PHP fanatics you should expect only one answer - PHP is better for web
applications - no contest when it comes to mobiles or desktop applications.

>
>
>I know this is probably one of those religious war topics, but I'd still
>like your feedback.
>
>
>
>-Ed
>
>
>
>
>
>

--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

attached mail follows:


Any recommendations on books, links, tutorials, etc. for PHP 5's new DOM /
XML stuff?

 

Thanks,

 

Ed

 

attached mail follows:


On Mon, 26 Jul 2004 18:02:51 -0700, Ed Lazor <ed.lazord20news.com> wrote:
> Any recommendations on books, links, tutorials, etc. for PHP 5's new DOM /
> XML stuff?

Answered some hours ago here on this list

See http://news.php.net/php.general/191907

(there's certainly more ;) )

chregu

--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregubitflux.ch | gnupg-keyid 0x5CE1DECB

attached mail follows:


Justin Patrin wrote:
> On Mon, 26 Jul 2004 11:27:32 +0300, EE <eebjaili.com> wrote:
>
>>What is this? I got this message few times from php.net...
>>
>
>
> Well, that's weird....I've never seen that one.
>

Apparently they're from an annoying spam service that someone on this
list has subscribed to and not actually from the list itself.

They seem to have caused quite a disturbance on a few lists recently.
Safe to ignore, setup a filter, and delete.

- Chris

attached mail follows:


* Thus wrote Chris Martin:
> Justin Patrin wrote:
> >On Mon, 26 Jul 2004 11:27:32 +0300, EE <eebjaili.com> wrote:
> >
> >>What is this? I got this message few times from php.net...
> >>
> >
> >
> >Well, that's weird....I've never seen that one.
> >
>
> Apparently they're from an annoying spam service that someone on this
> list has subscribed to and not actually from the list itself.

At closer look at the message, it isn't from someone subscribed to
the list using that service, it is someone injecting the messages
to the person posting to the list.

Note the email of whom is claiming to be using the service, it is
php-gerneralphp, php does not use that service!

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


* Thus wrote EE:
> What is this? I got this message few times from php.net...

This isn't a message from php.net, it appears to be someone
attempting to harvest valid emails.

I would suggest to report this message including all the headers
but it doesn't appear they provide anyway to do such a thing. Not
to mention they appear to be some sort of marketing scheme as well.

Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!

attached mail follows:


It didn't work. Still the same problem.

Thanks

"Marek Kilimajer" <listskilimajer.net> escribi en el mensaje
news:410467A7.7050408kilimajer.net...
> Robert Winter wrote:
> > I have the following rewriterule:
> >
> > RewriteRule ^(([0-9]|[A-Z]|[a-z]|_)+)$ redirect.php?$1 [L]
> >
> > that transforms http://mysite.com/XXX to
http://mysite.com/redirect.php?XXX
> >
> > and I need to also include to space char, for example
> >
> > that transforms http://mysite.com/AB XX to
http://mysite.com/redirect.php?AB
> > XX
> >
> >
> > I didn't find a way to write the " " characters. I tested with
RewriteRule
> > ^(([0-9]|[A-Z]|[a-z]|_| )+)$ redirect.php?$1 [L] but didn't work.
> >
> > Thanks!
> > Rob
> >
>
> Did you try
>
> RewriteRule ^([0-9A-Za-z_%]+)$ redirect.php?$1
>
> ?

attached mail follows:


This outputs a filename on $catchresult, and im working on redirecting
it to that file via header. But when ever i run this the value of
$catchresult is not being pass to the header() on php.

$catchresult = $db_view->getOne($getfile);
header('Location: clients/FILES/$catchresult');

Hmm, it seems simple but, its really not working..

--
Louie Miranda
http://www.axishift.com

attached mail follows:


--- Louie Miranda <lmirandagmail.com> wrote:

> This outputs a filename on $catchresult, and im
> working on redirecting
> it to that file via header. But when ever i run this
> the value of
> $catchresult is not being pass to the header() on
> php.
>
> $catchresult = $db_view->getOne($getfile);
> header('Location: clients/FILES/$catchresult');
>
> Hmm, it seems simple but, its really not working..

Yes it is simple just change your single quotes to
double quotes. i.e.

 header("Location: clients/FILES/$catchresult");

zareef ahmed

>
> --
> Louie Miranda
> http://www.axishift.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

=====
Zareef Ahmed :: A PHP Developer in Delhi(India).
Homepage :: http://www.zasaifi.com

        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail

attached mail follows:


On Tue, 27 Jul 2004 11:59:14 +0800, Louie Miranda <lmirandagmail.com> wrote:
> This outputs a filename on $catchresult, and im working on redirecting
> it to that file via header. But when ever i run this the value of
> $catchresult is not being pass to the header() on php.
>
> $catchresult = $db_view->getOne($getfile);
> header('Location: clients/FILES/$catchresult');
>
> Hmm, it seems simple but, its really not working..
>

When using single quotes, variables aren't replaced by their content.
Using double quotes would fix it, but consider this alternative:

header('Location: clients/FILES/'.$catchresult);

Cleaner, more obvious that you're using a variable, will be
highlighted correctly by syntax highlighters, and, most important,
it's faster. :-)

--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

attached mail follows:


ah ic, thanks. it now works fine.

thanks also for the tip! :)

On Mon, 26 Jul 2004 23:29:06 -0700, Justin Patrin <papercranegmail.com> wrote:
> On Tue, 27 Jul 2004 11:59:14 +0800, Louie Miranda <lmirandagmail.com> wrote:
> > This outputs a filename on $catchresult, and im working on redirecting
> > it to that file via header. But when ever i run this the value of
> > $catchresult is not being pass to the header() on php.
> >
> > $catchresult = $db_view->getOne($getfile);
> > header('Location: clients/FILES/$catchresult');
> >
> > Hmm, it seems simple but, its really not working..
> >
>
> When using single quotes, variables aren't replaced by their content.
> Using double quotes would fix it, but consider this alternative:
>
> header('Location: clients/FILES/'.$catchresult);
>
> Cleaner, more obv