OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 21 Jul 2004 18:39:26 -0000 Issue 2890

php-general-digest-helplists.php.net
Date: Wed Jul 21 2004 - 13:39:26 CDT


php-general Digest 21 Jul 2004 18:39:26 -0000 Issue 2890

Topics (messages 191272 through 191371):

what is difference between php and perl
        191272 by: Syed Ghouse
        191276 by: Justin Patrin
        191279 by: Jason Davidson
        191283 by: Syed Ghouse

Re: session and mysql connection identifier
        191273 by: Justin Patrin
        191280 by: Dennis Gearon

Re: textarea/display question...
        191274 by: Dennis Gearon
        191297 by: John W. Holmes

Re: Money format
        191275 by: Luká¹ Moravec - PTV Servis

Re: string filtering
        191277 by: Mr. Bogomil Shopov

Re: How to use reflection API?
        191278 by: Jason Barnett
        191317 by: Curt Zirzow

PHP-5 book
        191281 by: Nadim Attari
        191282 by: Philip Olson
        191284 by: Paul Kain
        191286 by: Jurgen Stroo
        191288 by: Nadim Attari
        191289 by: Jason Barnett
        191291 by: Denis Fingonnet
        191314 by: Matthew Sims
        191318 by: Stephen Sadowski
        191335 by: Chris Shiflett

Re: PHP5, XPath and count()
        191285 by: Christian Stocker
        191290 by: Jason Barnett

HTML numeric string
        191287 by: Koriun A. Margarian
        191293 by: Torsten Roehr
        191295 by: Marcus Strube

Re: template and file read
        191292 by: rush
        191334 by: EE

PHP5 Bug with DOMDocument->xinclude
        191294 by: Siddharth Hegde
        191300 by: Siddharth Hegde

hide elements on page based on cookie
        191296 by: msa
        191302 by: Torsten Roehr
        191303 by: msa
        191305 by: Torsten Roehr

Re: Problem of a beginner with Array
        191298 by: Henri Marc
        191304 by: Torsten Roehr
        191308 by: Henri Marc
        191309 by: Torsten Roehr
        191313 by: Matt M.

Preventing static method calls in PHP4
        191299 by: Marcus Bointon

Re: Problem of a beginner with Array[Scanned]
        191301 by: Michael Egan
        191310 by: Michael Egan

Test Results
        191306 by: Ray Hayes

htmlArea look-a-like
        191307 by: Robb Kerr
        191311 by: Matt M.
        191312 by: Tim Van Wassenhove

Re: Update mysql.so problems
        191315 by: Jough P

"echo" and "html_decode"
        191316 by: Karl-Heinz Schulz
        191328 by: John W. Holmes

Coding Advice
        191319 by: Aaron Axelsen
        191326 by: Matt M.

URL
        191320 by: Bruno Santos
        191321 by: Robert Sossomon
        191322 by: Torsten Roehr
        191323 by: Matt M.
        191324 by: Bruno Santos
        191327 by: John W. Holmes
        191330 by: zareef ahmed

Zend Enc and 0T Q
        191325 by: PHP Gen
        191329 by: raditha dissanayake
        191331 by: Jason Wong
        191333 by: PHP Gen
        191340 by: Marcus Bointon
        191341 by: Richard Davey

Re: 'echo' and 'html_decode'
        191332 by: Matthew Sims
        191348 by: Daniel Kullik
        191356 by: Matthew Sims

how to use session?
        191336 by: Sheawh
        191338 by: Torsten Roehr
        191343 by: Sheawh
        191344 by: Matt M.
        191350 by: Josh Close
        191351 by: Justin Patrin
        191353 by: Matthew Sims
        191361 by: Chris Shiflett

Sending the output of a web page to a printer
        191337 by: Vern
        191345 by: Ron Stiemer

trim() white space from record set
        191339 by: msa
        191342 by: John W. Holmes
        191349 by: Justin Patrin
        191364 by: msa
        191366 by: msa
        191367 by: Justin Patrin

Error when using HTTP Location header
        191346 by: Arnout Boks
        191352 by: Marek Kilimajer
        191354 by: Jason Wong
        191355 by: Matthew Sims
        191357 by: Justin Patrin
        191359 by: Arnout Boks
        191363 by: Chris Shiflett
        191368 by: Chris Shiflett

exec/system question..
        191347 by: bruce
        191358 by: Justin Patrin
        191360 by: Justin Patrin
        191362 by: Kevin Martin
        191369 by: Frank Munch
        191370 by: Michael Sims

Project-browser-function / required/included
        191365 by: Frank Munch

Function with Optional Arguments
        191371 by: Alex Hogan

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:


Hi all

will anybody tell me the difference between perl and php

Regards
Syed

attached mail follows:


On Wed, 21 Jul 2004 12:35:46 +0530, Syed Ghouse <syedjinis.com> wrote:
> Hi all
>
> will anybody tell me the difference between perl and php
>

I'm giving you way too much here....you should just search the web,
I'm sure you can find much more in depth explanations.

Perl is an old, old, incredibly old command-line scripting language
that takes the kitchen-sink perspective, implementing lots of syntaxes
for things and makes it very easy to obfuscate its code. In fact, for
something you can't really get around obfuscating your code. However,
it is very well tested and has been used extensively over the years.
Many developers have created modules that you can download ffor free
from CPAN. Later in its life, people added CGI handlers and connected
Perl to Apache to be a web scripting language.

PHP started out as a web scripting language and has evolved much since
its inception. It is now (with PHP5) very Object friendly (Perl is
absolutely not IMHO) and supported objects well in PHP4 as well. It
has also grown and many people have created modules and code that you
can freely download and use. One place to find high quality code is
PEAR. Another place to find code is phpclasses. PHP has also grown
into a command-line scripting language.

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

paperCrane --Justin Patrin--

attached mail follows:


they are 2 seperate languages, completely. I dont beleive the 2
languages have any relation to eachother, possibly you can relate the
2 as serverside scripting languages.. but.. its still a stretch :)

see www.perl.org or php.net for history of the two.

Jason

On Wed, 21 Jul 2004 12:35:46 +0530, Syed Ghouse <syedjinis.com> wrote:
> Hi all
>
> will anybody tell me the difference between perl and php
>
> Regards
> Syed
>

attached mail follows:


 Thanks for help
 
 Regards
 Syed
> ----- Original Message -----
> From: "Syed Ghouse" <syedjinis.com>
> To: "php mailinglists" <php-generallists.php.net>
> Sent: Wednesday, July 21, 2004 PM 12:35
> Subject: [PHP] what is difference between php and perl
>
>
> Hi all
>
> will anybody tell me the difference between perl and php
>
> Regards
> Syed
>
>
>

attached mail follows:


On Tue, 20 Jul 2004 22:47:43 -0700 (PDT), mukta telang
<mukta_telangyahoo.com> wrote:
> Hi,
> I want to use mysql persistent connection to connect
> to mysql and use the connection identifier or handle
> in subsequent pages/scripts. So in script1.php I have
> session_start();
> session_register('conn');
> HTTP_SESSION_VARS['conn']=mysql_pconnect(...);
>
> and in script2.php I have,
>
> echo $conn;
>
> and I always get "1" as output and not Resource#.. as
> expected..
>

As an earlier poster said, you can't store resources in sessions (or
get, post or cookies) because it's "closed" when the script ends.
However, when you use a persistent database connection, PHP tries to
keep the connection open on the server side. The next time you call
pconnect for the same DB, it will use the saved connection
automatically.

Please read the manual on the funcitons you're using before posting to
the list...

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

paperCrane --Justin Patrin--

attached mail follows:


What he is really looking for is connection pooling. Do a google and see if you can find 'mysql connection pooling php'. It is persistent connections across page accesses, which PHP does not do natively AFAIK.

Jason Wong <php-generalgremlins.biz> wrote:

<quote-------------------------------------------------------->
On Wednesday 21 July 2004 13:47, mukta telang wrote:

>> I want to use mysql persistent connection to connect
>> to mysql and use the connection identifier or handle
>> in subsequent pages/scripts. So in script1.php I have
>> session_start();
>> session_register('conn');
>> HTTP_SESSION_VARS['conn']=mysql_pconnect(...);
>>
>> and in script2.php I have,
>>
>> echo $conn;
>>
>> and I always get "1" as output and not Resource#.. as
>> expected..

You can't pass/use "resource IDs" across different pages/scripts. Please read
the manual > Persistent Database Connections to clear up some misconceptions
about persistent connections. Also follow ups to this should be sent to the
php-db list.

</quote--------------------------------------------------------->

attached mail follows:


Make sure to remove tags via:

        $var_that_will_be_displayed = strip_tags( $var_from_user_input_via_POST_or_GET_or_COOKIE );

if you are going to display or mail it as part of a link(email or URL), you might do this instead:

        $var_that_will_be_part_of_a_link = strip_tags( rawurldecode( $var_from_user_input_via_POST_or_GET_or_COOKIE ) );

See this page:

        http://www.cgisecurity.com/articles/xss-faq.shtml

attached mail follows:


Dennis Gearon wrote:
> Make sure to remove tags via:
>
> $var_that_will_be_displayed = strip_tags(
> $var_from_user_input_via_POST_or_GET_or_COOKIE );
>
> if you are going to display or mail it as part of a link(email or URL),
> you might do this instead:
>
> $var_that_will_be_part_of_a_link = strip_tags( rawurldecode(
> $var_from_user_input_via_POST_or_GET_or_COOKIE ) );
>
> See this page:
>
> http://www.cgisecurity.com/articles/xss-faq.shtml

Yeah, use strip_tags so you can get rid of evil, malicious content such
as <grin>... gasp! Just use htmlentities() like others have already
suggested, so you don't change the users input. There's nothing more
annoying than programs that strip out content from what users write
because they think it's bad. Using allowed_tags with strip_tags() just
introduces the possibility for vulnerabilities since attributes aren't
checked. Javascript in a <b> tag, you say? Yep...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


I got it.thankx to all.
Lukas

attached mail follows:


Hello
http://bg2.php.net/manual/en/function.preg-match.php

Regards

Bogomil
http://spisanie.com/indexen.php - WebDevMagazine

C.F. Scheidecker Antunes wrote:
> Hello all,
>
> I need to filter some strings. They can only contain characters like
> a...z or A..Z and 0..9. Some strings have blank spaces, -,./?>,<
> characters that must be discarded. I wrote a function to check each and
> every character but I guess there must be something else more efficient.
>
> Any suggestions?
>
> Thanks in advance.

attached mail follows:


Andreas Goetz wrote:

> I'm trying to use theh reflection API but can't seem to start:
>
> $func= new Reflection_Function('counter');

This was changed, manuals haven't caught up yet. This should be
$func = new ReflectionFunction('counter');

You can also just use the static method export, if you intend to echo the
information onto the screen.

>
> Fatal error: Class 'Reflection_Function' not found in
> C:\htdocs\reflection.php on line 34
>
> According to
> http://sitten-polizei.de/php/reflection_api/docs/language.reflection.class.reflection_function.html
> this should already work.

Yeah, this is about the only documentation available so far. It's mostly
correct, once you change the class names (i.e. no underscore).

attached mail follows:


* Thus wrote Andreas Goetz:
> I'm trying to use theh reflection API but can't seem to start:
>
> $func= new Reflection_Function('counter');
>
> Fatal error: Class 'Reflection_Function' not found in
> C:\htdocs\reflection.php on line 34
>
> According to
> http://sitten-polizei.de/php/reflection_api/docs/language.reflection.class.reflection_function.html
> this should already work.

See:
  http://www.php.net/manual/en/language.oop5.reflection.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:


Hello friends,

Can someone advise me of a very good PHP-5 book.

Most probably i'll buy it from eyrolles.com

Thanks,

~ nadim attari

attached mail follows:


> Can someone advise me of a very good PHP-5 book.

Hands down the best:

 Advanced PHP Programming
 by George Schlossnagle

Regards,
Philip

attached mail follows:


Wiley Publishing. PHP5 for dummies - Janet Valade.

not very advanced, but its in plain english with hints and tips and
technical stuff thats easy to understand.

For the serious beginner though.

On Wed, 21 Jul 2004 12:30:13 +0400, Nadim Attari <nadimalienworkers.com> wrote:
> Hello friends,
>
> Can someone advise me of a very good PHP-5 book.
>
> Most probably i'll buy it from eyrolles.com
>
> Thanks,
>
> ~ nadim attari
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


And then there is Learning PHP5 (from O'Reilly), which I should go for.

This one time, at band camp, Paul Kain said:

> Wiley Publishing. PHP5 for dummies - Janet Valade.
>
> not very advanced, but its in plain english with hints and tips and
> technical stuff thats easy to understand.
>
> For the serious beginner though.
>
>
>
>
>
> On Wed, 21 Jul 2004 12:30:13 +0400, Nadim Attari <nadimalienworkers.com> wrote:
> > Hello friends,
> >
> > Can someone advise me of a very good PHP-5 book.
> >
> > Most probably i'll buy it from eyrolles.com
> >
> > Thanks,
> >
> > ~ nadim attari
> >
> > --
> > 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:


1.
http://www.eyrolles.com/Informatique/Livre/9780672325618/livre-advanced-php-programming.php
2.
http://www.eyrolles.com/Informatique/Livre/9782212113235/livre-php-5-avance.php

two interesting books i found. Which one would you suggest ?

thanks

~ nadim attari

attached mail follows:


Philip Olson wrote:
>>Can someone advise me of a very good PHP-5 book.
>
>
> Hands down the best:
>
> Advanced PHP Programming
> by George Schlossnagle
>
> Regards,
> Philip

I've also read this book (*almost* cover to cover) and it is quite excellent.
However, it definitely assumes that you understand the basics already and don't
need hand holding. So if you've been doing some programming in PHP4 and are
looking for a book to make the move to PHP5, then this is an excellent book.

attached mail follows:


I have bought the second one : PHP5 avancé (in french).
And it is a very good book.

Denis Fingonnet

Nadim Attari a écrit :

>1.
>http://www.eyrolles.com/Informatique/Livre/9780672325618/livre-advanced-php-programming.php
>2.
>http://www.eyrolles.com/Informatique/Livre/9782212113235/livre-php-5-avance.php
>
>two interesting books i found. Which one would you suggest ?
>
>thanks
>
>~ nadim attari
>
>
>

attached mail follows:


>> Can someone advise me of a very good PHP-5 book.
>
> Hands down the best:
>
> Advanced PHP Programming
> by George Schlossnagle
>
> Regards,
> Philip

I also recommend this book. It covers the new OO model of PHP5 very well.

--Matthew Sims
--<http://killermookie.org>

attached mail follows:


> >> Can someone advise me of a very good PHP-5 book.
[snip]

I've been using Zeev & Leon Atkinson's _Core_PHP_Programming_ since
5beta1 was out. It was extremely helpful, and I still refer to it on a
regular basis. Just ignore the section on namespace support, if they
haven't had a revised printing yet.

http://www.eyrolles.com/Informatique/Livre/9780130463463/livre-core-php-programming.php

eyrolles has it listed at 65,00 EUR, and I'd swear by it.

-SS

attached mail follows:


--- Nadim Attari <nadimalienworkers.com> wrote:
> Can someone advise me of a very good PHP-5 book.

http://www.oreilly.com/catalog/upgradephp5/

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

attached mail follows:


On Tue, 20 Jul 2004 22:57:20 +0200, Victor Boivie
<vicbo261student.liu.se> wrote:
> Assume an XML file that looks like:
>
> <catalog>
> <cd>
> ..
> </cd>
> <cd>
> ..
> </cd>
> ..
> </catalog>
>
> ... and that I would like to know the number of CDs. An xpath expression
> would look like count(/catalog/cd), but how do I run this expression?
>
> $dom = new DOMDocument();
> $dom->load("catalog.xml");
> $xpath = new DOMXpath($dom);
> var_dump($xpath->query("count(/catalog/cd")->item(0));

this doesn't work yet in DOM. The returned value has to be a nodeset.
Will be fixed some day ;)

see victors answer for the work around

chregu
>
> ... returns NULL.
>
> Any ideas?
>
> Thanks in advance,
> Victor
>
> --
> 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:


>
>
> this doesn't work yet in DOM. The returned value has to be a nodeset.
> Will be fixed some day ;)
>
> see victors answer for the work around
>
> chregu

I was wondering about that. So is there someplace online where we can find out
what does / does not yet work for XPath? I've been looking but google only
gives about 9 hits for DomXPath. If I wasn't such a lousy C coder I'd try to go
trudging through the source myself :)

attached mail follows:


Hello

how to convert HTML numeric string like
     &#1394;&#1377;&#1378;&#1377;&#13
to original text ?

--
Best regards,
 Koriun mailto:koriunipia.sci.am

attached mail follows:


"Koriun A. Margarian" <koriunipia.sci.am> wrote in message
news:19696767524.20040721143631ipia.sci.am...
> Hello
>
> how to convert HTML numeric string like
> &#1394;&#1377;&#1378;&#1377;&#13
> to original text ?
>
> --
> Best regards,
> Koriun

Try this:
http://de.php.net/manual/de/function.html-entity-decode.php

Regards, Torsten Roehr

PS: Don't hijack other's threads. Always create a new post when opening a
starting a new topci.

attached mail follows:


Am Mittwoch, 21. Juli 2004 11:36 schrieb Koriun A. Margarian:
> Hello
>
> how to convert HTML numeric string like
> &#1394;&#1377;&#1378;&#1377;&#13
> to original text ?
>
> --
> Best regards,
> Koriun mailto:koriunipia.sci.am

$dirty_data

$search4[0] = "/,/";
$search4[1] = "/A/";

$replacewith[0] = " ";
$replacewith[1] = " ";

$cleaned_data = preg_replace($search4,$replacewith,$dirty_data);

attached mail follows:


"Ee" <eebjaili.com> wrote in message
news:1090353198.2633.19.camellocalhost.localdomain...
> Would this slow down the site?

yes, but in most cases this is not important since bandwith to the client,
and database queries have usually orders of magnitude larger bottlenecks.

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

attached mail follows:


On Tue, 2004-07-20 at 23:08, Jason Barnett wrote:
> Ee wrote:
>
> > Dears,
> >
> > In one of the tutorials I read about templates, the writer is diving the
> > code into multiple files. He put the menu, main, left, right, footer
> > each in a separate file. He is using foreach to go through an array and
> > reads all these files.
> >
> > Is this a good practice?
>
> I use a lot of includes in most of my scripts mostly for logical seperation of
> libraries. So IMHO yes, that is a good practice. However I wouldn't bother
> using a foreach to include each file if I know ahead of time what files I'm
> going to need to call.
>
> > Would this slow down the site?
>
> Absolutely! Include(s) and Require(s) are some of the most expensive calls to
> make, however that can be mitigated by using a compiler cache. Google or check
> the list archives for some "PHP cache" suggestions.

Is the compiler cache a function of the my web host or my code?

attached mail follows:


Hi,

Can anyone tell me if they faced a similar problem.
When I manually save the following line into an file, it works
<xi:include href="xml_file.xml" parse="xml"/>

But if I remove this line, and add it dynamically using the following
code, and only after that call $xml_file->xinclude(); it does not work
$new_node = $xml_file->createElement('xi:include');
$new_node->setAttribute ('href', "xml_file.xml");
$new_node->setAttribute ('parse', 'xml');
$parent->appendChild($new_node);

($parent was set, so the error is not there)
After all the xinclude command, I write the o/p using saveXML() and I
see the <xi:include href="xml_file.xml" parse="xml"/> in the file
unprocessed.

Any ideas?
Any work arounds for now?

- Sid

attached mail follows:


Cool that worked :-) Thanks. BTW your presentation on your site was very useful.

- Sid

On Wed, 21 Jul 2004 13:25:11 +0200, Christian Stocker <chregugmail.com> wrote:
>
>
> On Wed, 21 Jul 2004 16:02:54 +0530, Siddharth Hegde <cipherxgmail.com> wrote:
> > Hi,
> >
> > Can anyone tell me if they faced a similar problem.
> > When I manually save the following line into an file, it works
> > <xi:include href="xml_file.xml" parse="xml"/>
> >
> > But if I remove this line, and add it dynamically using the following
> > code, and only after that call $xml_file->xinclude(); it does not work
> > $new_node = $xml_file->createElement('xi:include');
> > $new_node->setAttribute ('href', "xml_file.xml");
> > $new_node->setAttribute ('parse', 'xml');
> > $parent->appendChild($new_node);
> >
> > ($parent was set, so the error is not there)
> > After all the xinclude command, I write the o/p using saveXML() and I
> > see the <xi:include href="xml_file.xml" parse="xml"/> in the file
> > unprocessed.
> >
> > Any ideas?
> > Any work arounds for now?
>
> No workaround, just use the correct methods for inserting elements
> with a namespace ;)
>
> $new_node = $xml_file->createElementNS(XINCLUDE_NAMESPACE, 'include');
>
> XINCLUDE_NAMESPACE is of course to be replaced with tha actual
> xinclude namespace... (too lazy to look it..)
>
> chregu
> >
> > - Sid
> >
> > --
> > 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:


I have three <td> tags that I need to either hide or show, based on access
level defined in a cookie.

the three buttons are:
secure (to show when accessLevel = 1)
sales (to show when accessLevel = 2)
login (to show when there is no cookie)

I have had some success with to following code:

_________________________________
<tr> <?php if(strlen($_COOKIE['levelCookie']) == 1) { ?>

      <td height="22" class="menutable"><input name="Submit5292222"
type="button" class="menutext"
onClick="MM_goToURL('parent','http://atricure.com/test/secure/secure.php');r
eturn document.MM_returnValue"
onMouseOver="pviiClassNew(this,'menutextoverdown')"
onMouseOut="pviiClassNew(this,'menutext')" value="secure"></td>
    <?php } ?>
</tr>
    <tr><?php if(strlen($_COOKIE['levelCookie']) == 2) { ?>

      <td height="22" class="menutable"><input name="Submit5292222"
type="button" class="menutext"
onClick="MM_goToURL('parent','http://atricure.com/test/secure/sales.php');re
turn document.MM_returnValue"
onMouseOver="pviiClassNew(this,'menutextoverdown')"
onMouseOut="pviiClassNew(this,'menutext')" value="sales"></td>
    <?php } ?></tr>
    <tr><?php if(strlen($_COOKIE['levelCookie']) < 1) { ?>
      <td class="menutable" height="22">
      <form action="<?php echo "$PHP_SELF"; ?>" METHOD="POST"
name="UserLoginForm" id="UserLoginForm">
          <table width="145">
            <tr>
              <td class="menutextsmallleft" colspan="2"><p
class="alertText"><br><?php echo "$errorMessage"; ?><br>
               </p>
                <p>Login: <br>
                    <input name="UserName" type="text" id="UserName"
size="20" value="<?php echo $_COOKIE['acCookie']; ?>">
                </p></td>
            </tr>
            <tr>
              <td class="menutextsmallleft"colspan="2"><p>Password: <br>
                <input name="Password" type="Password" id="Password"
value="" size="20">
              </p></td>
            </tr>
            <tr>
              <td width="100">&nbsp;
            </td>
              <td width="40"><input name="Login" type="submit"
class="submitButton" id="Login" value="Login"></td>
            </tr>
          </table>
       <input name="action" type="hidden" id="action" value="login">
      </form></td><?php } ?>
    </tr>

___________________________________

the problem that I am having is that when I change one of the strlen
comparisons, it affects the others......so i get one or two of the
parameters to work and the other doesn't.....i change the third and it
works, but now the other two don't. With the above code, it works for:
login and secure....but not for sales. If i change the sales comparison,
then the other two don't work anymore............yee gads, very frustrating.

Thanks for any help....I am desperate!!

attached mail follows:


"Msa" <melissamaddesignusa.com> wrote in message
news:20040721112035.72081.qmailpb1.pair.com...
> I have three <td> tags that I need to either hide or show, based on access
> level defined in a cookie.
>
> the three buttons are:
> secure (to show when accessLevel = 1)
> sales (to show when accessLevel = 2)
> login (to show when there is no cookie)
>
> I have had some success with to following code:
>
> _________________________________
> <tr> <?php if(strlen($_COOKIE['levelCookie']) == 1) { ?>
>
> <td height="22" class="menutable"><input name="Submit5292222"
> type="button" class="menutext"
>
onClick="MM_goToURL('parent','http://atricure.com/test/secure/secure.php');r
> eturn document.MM_returnValue"
> onMouseOver="pviiClassNew(this,'menutextoverdown')"
> onMouseOut="pviiClassNew(this,'menutext')" value="secure"></td>
> <?php } ?>
> </tr>
> <tr><?php if(strlen($_COOKIE['levelCookie']) == 2) { ?>
>
> <td height="22" class="menutable"><input name="Submit5292222"
> type="button" class="menutext"
>
onClick="MM_goToURL('parent','http://atricure.com/test/secure/sales.php');re
> turn document.MM_returnValue"
> onMouseOver="pviiClassNew(this,'menutextoverdown')"
> onMouseOut="pviiClassNew(this,'menutext')" value="sales"></td>
> <?php } ?></tr>
> <tr><?php if(strlen($_COOKIE['levelCookie']) < 1) { ?>
> <td class="menutable" height="22">
> <form action="<?php echo "$PHP_SELF"; ?>" METHOD="POST"
> name="UserLoginForm" id="UserLoginForm">
> <table width="145">
> <tr>
> <td class="menutextsmallleft" colspan="2"><p
> class="alertText"><br><?php echo "$errorMessage"; ?><br>
> </p>
> <p>Login: <br>
> <input name="UserName" type="text" id="UserName"
> size="20" value="<?php echo $_COOKIE['acCookie']; ?>">
> </p></td>
> </tr>
> <tr>
> <td class="menutextsmallleft"colspan="2"><p>Password: <br>
> <input name="Password" type="Password" id="Password"
> value="" size="20">
> </p></td>
> </tr>
> <tr>
> <td width="100">&nbsp;
> </td>
> <td width="40"><input name="Login" type="submit"
> class="submitButton" id="Login" value="Login"></td>
> </tr>
> </table>
> <input name="action" type="hidden" id="action" value="login">
> </form></td><?php } ?>
> </tr>
>
> ___________________________________
>
> the problem that I am having is that when I change one of the strlen
> comparisons, it affects the others......so i get one or two of the
> parameters to work and the other doesn't.....i change the third and it
> works, but now the other two don't. With the above code, it works for:
> login and secure....but not for sales. If i change the sales comparison,
> then the other two don't work anymore............yee gads, very
frustrating.
>
> Thanks for any help....I am desperate!!

Are you sure you want to check the string length of the cookie instead of
its value?

Regards, Torsten Roehr

attached mail follows:


no, I am not sure of that.....I played with that code snippet from someone
else. how do I check for the value instead? would the reason why they
aren't working be because of checking for length and not value?

>
> Are you sure you want to check the string length of the cookie instead of
> its value?
>
> Regards, Torsten Roehr

attached mail follows:


"Msa" <melissamaddesignusa.com> wrote in message
news:20040721121742.97323.qmailpb1.pair.com...
> no, I am not sure of that.....I played with that code snippet from someone
> else. how do I check for the value instead? would the reason why they
> aren't working be because of checking for length and not value?
>
> >
> > Are you sure you want to check the string length of the cookie instead
of
> > its value?
> >
> > Regards, Torsten Roehr

You wrote you have three states, so the three condition should be:

// secure
if (isset($_COOKIE['levelCookie'] && $_COOKIE['levelCookie'] === 1)) {
}

// sales
if (isset($_COOKIE['levelCookie'] && $_COOKIE['levelCookie'] === 2)) {
}

// secure
if (!isset($_COOKIE['levelCookie')) {
}

Try if this is what you want.

Regards, Torsten

attached mail follows:


Hello,
 
Thank you very much for all the people who replied me
so fast.
Unfortunately I still have a problem with that part.

"Matt M." <h.dudenessgmail.com> wrote:

> Now, I want to know which numbers have been checked
by the player.
> I have a :
> "input name="Grid1" type="checkbox"
> for the first grid. Grid2 for the grid #2...
>if the user checks any Grid1[] boxes then
$_POST['Grid1'] will be an array and so on.

I want to avoid to have to name each check box like
this:
Grid[1][1] //1st checkbox of the first grid
Grid[1][2] //2nd checkbox of the first grid and so on

I would prefer to have if possible:
input name="Grid1[]" type"checkbox" //1st grid, 1st
checkbox
input name="Grid1[]" type"checkbox" //1st grid, 2nd
checkbox...

That's what Matt M proposed.
If I do: echo $_POST['Grid1'];
I have "on" as a result and not a value. I also tried
with echo $_POST['Grid1[]']; and other similars but I
have an error message "undefined index", or "array".

Thanks again.

Dave

        

        
                
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Yahoo! Messenger: dialoguez instantanément avec vos amis. Téléchargez GRATUITEMENT sur http://fr.messenger.yahoo.com

attached mail follows:


"Henri marc" <mesmlamoiyahoo.fr> wrote in message
news:20040721113329.95204.qmailweb50105.mail.yahoo.com...
> Hello,
>
> Thank you very much for all the people who replied me
> so fast.
> Unfortunately I still have a problem with that part.
>
> "Matt M." <h.dudenessgmail.com> wrote:
>
> > Now, I want to know which numbers have been checked
> by the player.
> > I have a :
> > "input name="Grid1" type="checkbox"
> > for the first grid. Grid2 for the grid #2...
> >if the user checks any Grid1[] boxes then
> $_POST['Grid1'] will be an array and so on.
>
> I want to avoid to have to name each check box like
> this:
> Grid[1][1] file://1st checkbox of the first grid
> Grid[1][2] file://2nd checkbox of the first grid and so on
>
> I would prefer to have if possible:
> input name="Grid1[]" type"checkbox" file://1st grid, 1st
> checkbox
> input name="Grid1[]" type"checkbox" file://1st grid, 2nd
> checkbox...
>
> That's what Matt M proposed.
> If I do: echo $_POST['Grid1'];
> I have "on" as a result and not a value. I also tried
> with echo $_POST['Grid1[]']; and other similars but I
> have an error message "undefined index", or "array".
>
> Thanks again.
>
> Dave

Hi Dave,

try this:

input name="Grid1[1]" type"checkbox" file://1st grid, 1st checkbox
input name="Grid1[2]" type"checkbox" file://1st grid, 2nd checkbox...

Pay attention to the indices in Grid1[1], Grid1[2].

After submit you will receive $_POST['Grid1'] as an ARRAY containing all
indices of the checked checkboxes. Then loop through it and do what ever you
want:

foreach ($_POST['Grid1'] as $value) {

    echo $value;
}

Regards, Torsten Roehr

attached mail follows:


Hello Torsten,

> try this:
>
> input name="Grid1[1]" type"checkbox" file://1st
> grid, 1st checkbox
> input name="Grid1[2]" type"checkbox" file://1st
> grid, 2nd checkbox...
Seems I can't do another way than this. Not possible
to do just Grid1[].

> After submit you will receive $_POST['Grid1'] as an
> ARRAY containing all
> indices of the checked checkboxes. Then loop through
> it and do what ever you
> want:
>
> foreach ($_POST['Grid1'] as $value) {
>
> echo $value;
> }
So, I did it like you said but the result of echo
$value is "on" not the checkedbox number.

Regards.

Dave

        

        
                
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Yahoo! Messenger: dialoguez instantanément avec vos amis. Téléchargez GRATUITEMENT sur http://fr.messenger.yahoo.com

attached mail follows:


"Henri marc" <mesmlamoiyahoo.fr> wrote in message
news:20040721125038.59916.qmailweb50104.mail.yahoo.com...
> Hello Torsten,
>
> > try this:
> >
> > input name="Grid1[1]" type"checkbox" file://1st
> > grid, 1st checkbox
> > input name="Grid1[2]" type"checkbox" file://1st
> > grid, 2nd checkbox...
> Seems I can't do another way than this. Not possible
> to do just Grid1[].

With Grid1[] how can you distinguish between the checkboxes?

>
> > After submit you will receive $_POST['Grid1'] as an
> > ARRAY containing all
> > indices of the checked checkboxes. Then loop through
> > it and do what ever you
> > want:
> >
> > foreach ($_POST['Grid1'] as $value) {
> >
> > echo $value;
> > }
> So, I did it like you said but the result of echo
> $value is "on" not the checkedbox number.

Try print_r($_POST['Grid1']); at the top of your second page (where the form
action points to).

Torsten

attached mail follows:


> I would prefer to have if possible:
> input name="Grid1[]" type"checkbox" //1st grid, 1st
> checkbox
> input name="Grid1[]" type"checkbox" //1st grid, 2nd
> checkbox...
>
> That's what Matt M proposed.
> If I do: echo $_POST['Grid1'];
> I have "on" as a result and not a value. I also tried
> with echo $_POST['Grid1[]']; and other similars but I
> have an error message "undefined index", or "array".

output your checkboxes like this:

<input name="Grid1[]" type="checkbox" value="1" />
<input name="Grid1[]" type="checkbox" value="2" />
<input name="Grid1[]" type="checkbox" value="3" />
.
.
.
and so on. Then do a print_r($_POST)

attached mail follows:


If I want to prevent a method from being called statically in PHP4, how can
I do it? So far I've tried these techniques:

<?php
class A {
var $Anotstatic;
  function A() {
    $this->Anotstatic = true;
  }
  function dynamic() {
    if (!isset($this) or !is_a($this, 'A') or !(isset($this->Anotstatic) and
$this->Anotstatic))
        echo "Method called statically\n";
    else
        echo "dynamic-only function\n";
  }
  function test ()
  {
     A::dynamic();
  }
}

class B {
function test() {
  A::dynamic();
}
}

$a = new A();
$a->dynamic();
A::dynamic();
$b = new B;
$b->test();
$a->test();
?>

This works for the first 3 tests (so I'm getting there), but not the fourth,
that is a dynamic method being called statically from an instance of the
same class. Is there something I've missed that will allow me to intercept
this style of call?

I know that this problem goes away in PHP5, and that the setting of $this in
static calls from other instances is not a bug (though it's the root of this
problem)!

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


Henri,

Try:

   if($HTTP_POST_VARS['submit'])
   {
      for($i = 1; $i < 51; $i ++)
      {
         if (${lottery_number.$i} == 'on')
            echo "Number selected is $i";
      }
   }
   else
   {
      echo "<form action='".$PHP_SELF."' method='post'>";
      for($i = 1; $i < 51; $i ++)
      {
         echo "Number $i: <input type='checkbox' name='lottery_number".$i."'><br />";
      }
      echo "<input type='submit' name='submit' value='Enter Numbers'>";
      echo "</form>";
   }

HTH,

Michael Egan

> -----Original Message-----
> From: Henri Marc [mailto:mesmlamoiyahoo.fr]
> Sent: 21 July 2004 12:33
> To: php-generallists.php.net
> Subject: Re: [PHP] Problem of a beginner with Array[Scanned]
>
>
> Hello,
>
> Thank you very much for all the people who replied me
> so fast.
> Unfortunately I still have a problem with that part.
>
> "Matt M." <h.dudenessgmail.com> wrote:
>
> > Now, I want to know which numbers have been checked
> by the player.
> > I have a :
> > "input name="Grid1" type="checkbox"
> > for the first grid. Grid2 for the grid #2...
> >if the user checks any Grid1[] boxes then
> $_POST['Grid1'] will be an array and so on.
>
> I want to avoid to have to name each check box like
> this:
> Grid[1][1] //1st checkbox of the first grid
> Grid[1][2] //2nd checkbox of the first grid and so on
>
> I would prefer to have if possible:
> input name="Grid1[]" type"checkbox" //1st grid, 1st
> checkbox
> input name="Grid1[]" type"checkbox" //1st grid, 2nd
> checkbox...
>
> That's what Matt M proposed.
> If I do: echo $_POST['Grid1'];
> I have "on" as a result and not a value. I also tried
> with echo $_POST['Grid1[]']; and other similars but I
> have an error message "undefined index", or "array".
>
> Thanks again.
>
> Dave
>
>
>
>
>
>
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
> Yahoo! Messenger: dialoguez instantanément avec vos amis.
> Téléchargez GRATUITEMENT sur http://fr.messenger.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
  
  
The information contained in this email (and in any attachments sent with it) is confidential. It is intended for the addressee only. Access to this email by anyone else is unintended and unauthorized.
If you are not the original addressee, 3tc asks you to please maintain confidentiality. If you have received this email in error please notify 3tc immediately by replying to it, then destroy any copies and delete it from your computer system.
  
Any use, dissemination, forwarding, printing or copying of this email by anyone except the addressee in the normal course of his/her business, is strictly prohibited. 3tc owns the copyright in this email and any document created by us and assert the right to be identified as the author of it. Copyright has not been transferred to the addressee.
We protect our systems with Sophos Anti-virus -
www.sophos.com
 

attached mail follows:


Henri,

I think you will need to give some sort of number to each of the checkboxes, e.g.

   for($i = 1; $i < 51; $i++)
   {
      echo "<input type='checkbox' name='lotterynumber".$i."'>";
   }

As you are finding, with checkboxes the value returned is either 'on' or null. So without giving specific names to the checkboxes you will be left with an array of only those checkboxes that have been checked.

By giving the checkboxes a unique name - based on the numbers - you should then be able to loop through the checkboxes irrespective of whether they have been checked, e.g.

   for($i = 1; $i < 51; $i ++)
   {
      if (${lottery_number.$i} == 'on')
        echo "The number chosen was $i";
   }

You can then determine whether a specific checkbox has been checked by seeing if it has the value of 'on' and translate this to the number you require.

I think a combination of the code I sent earlier together with that sent by Torsten will containg the answer.

HTH,

Michael Egan

> -----Original Message-----
> From: Henri Marc [mailto:mesmlamoiyahoo.fr]
> Sent: 21 July 2004 13:51
> To: php-generallists.php.net
> Subject: Re: [PHP] Problem of a beginner with Array[Scanned]
>
>
> Hello Torsten,
>
> > try this:
> >
> > input name="Grid1[1]" type"checkbox" file://1st
> > grid, 1st checkbox
> > input name="Grid1[2]" type"checkbox" file://1st
> > grid, 2nd checkbox...
> Seems I can't do another way than this. Not possible
> to do just Grid1[].
>
> > After submit you will receive $_POST['Grid1'] as an
> > ARRAY containing all
> > indices of the checked checkboxes. Then loop through
> > it and do what ever you
> > want:
> >
> > foreach ($_POST['Grid1'] as $value) {
> >
> > echo $value;
> > }
> So, I did it like you said but the result of echo
> $value is "on" not the checkedbox number.
>
> Regards.
>
> Dave
>
>
>
>
>
>
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
> Yahoo! Messenger: dialoguez instantanément avec vos amis.
> Téléchargez GRATUITEMENT sur http://fr.messenger.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
  
  
The information contained in this email (and in any attachments sent with it) is confidential. It is intended for the addressee only. Access to this email by anyone else is unintended and unauthorized.
If you are not the original addressee, 3tc asks you to please maintain confidentiality. If you have received this email in error please notify 3tc immediately by replying to it, then destroy any copies and delete it from your computer system.
  
Any use, dissemination, forwarding, printing or copying of this email by anyone except the addressee in the normal course of his/her business, is strictly prohibited. 3tc owns the copyright in this email and any document created by us and assert the right to be identified as the author of it. Copyright has not been transferred to the addressee.
We protect our systems with Sophos Anti-virus -
www.sophos.com
 

attached mail follows:


My test results from my build on a Cobalt RAQ550 seem to be in line with
other test results postings. Any ideas where these open items affect
processing?

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Catch Interfaces [tests/lang/039.phpt]
Bug #22836 (returning references to NULL) [Zend/tests/bug22836.phpt]
iconv_mime_encode() [ext/iconv/tests/iconv_mime_encode.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
Bug #20382 (strtotime ("Monday", $date) produces wrong result on DST
changeover) [ext/standard/tests/time/bug20382.phpt]
Bug #26614 (CDATA sections skipped on line count)
[ext/xml/tests/bug26614.phpt]
=====================================================================

Thanks

attached mail follows:


I am developing an app in which my visitors must be able to enter text and
do some minimal HTML formatting including making some of the text
hyperlinks. I like the looks of htmlArea, but can't get either available
version to work in any Mac browsers. I've also found EditLive! and am
intrigued by it. Does anyone know of anthing else like these availlable on
the market?

htmlArea = http://www.interactivetools.com/products/htmlarea/
EditLive! = http://www.ephox.com/product/editliveforjava/default.asp

Thanx,
Robb
--
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
----------------------------------------------------
http://www.digitaliguana.com
http://www.cancerreallysucks.org

attached mail follows:


> I am developing an app in which my visitors must be able to enter text and
> do some minimal HTML formatting including making some of the text
> hyperlinks. I like the looks of htmlArea, but can't get either available
> version to work in any Mac browsers. I've also found EditLive! and am
> intrigued by it. Does anyone know of anthing else like these availlable on
> the market?

You are in luck, some members of the list recommended on just yesterday.

http://dynarch.com/mishoo/htmlarea.epl

attached mail follows:


In article <1lkudxvuoxc1q.c5n1ew51g83h.dlg40tude.net>, Robb Kerr wrote:
> I am developing an app in which my visitors must be able to enter text and
> do some minimal HTML formatting including making some of the text
> hyperlinks. I like the looks of htmlArea, but can't get either available
> version to work in any Mac browsers. I've also found EditLive! and am
> intrigued by it. Does anyone know of anthing else like these availlable on
> the market?

You can try http://home.mysth.be/~timvw/test/ (user/pass webmaster/webmaster)

Source at http://home.mysth.be/~timvw/programming/php/easyform.zip

--
Tim Van Wassenhove <http://home.mysth.be/~timvw>

attached mail follows:


Posted this yesterday, still having problems.

I've used various combinations with --with-mysql. I removed all the
old mysql binaries and libs from /usr/lib, /usr/include and /usr/bin.
I removed the old mysql.so from /usr/lib/php4/

I even went as far as upgrading to PHP5. It is still using the mysql
3.23 client API. I've upgraded the dev server and my laptop to have
PHP5 and MySQL 4 successfully but can't manage to get PHP5 to use the
MySQL 4 client API.

On Jul 20, 2004, at 6:47 PM, Jough P wrote:

> Greetings all,
>
> I upgraded to MySQL 4 on a Redhat Enterprise box. I recompiled PHP
> 4.3.6 and a look at phpinfo() reveals that the old mysql client API is
> still being used. So, I moved the mysql.so to my home directory
> hoping that when did ./configure and make again it would create a new
> one. Doing an 'ls modules/' revealed that it hadn't.
>
> So I changed --with-mysql-dir=/usr to
> --with-mysql-dir-/usr/local/mysql and ./configure stops and says it
> can't find the mysql header files.
>
> Can anyone help please? My goal is to get a new mysql.so created.
>
> Thanks tons!!
> --Jough
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I'm trying to use html_decode with the echo function but failed so far.

<? echo mysql_result($product, 0,1) ?>

What would be the correct syntax?

TIA

Tracking #: 2F5B92054B5DBF4C990F63F9BA3F99A0558671EB

attached mail follows:


Karl-Heinz Schulz wrote:
> I'm trying to use html_decode with the echo function but failed so far.
>
> <? echo mysql_result($product, 0,1) ?>
>
> What would be the correct syntax?

Huh? I don't see "html_decode" anywhere and the function is
html_entity_decode(), anyhow.

If you want to run the above through the function, then:

<?php echo html_entity_decode(mysql_result($product,0,1)); ?>

Otherwise we'll need some more information. My crystal ball is currently
loaned out.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


Hello,

I am writing an app and right now im working on code that will display x
number of items on one page, and if there is overflow, provide a link to
the next. The url coming into the page looks something like:

projects.php?action=view&completed=no&start=0

My code so far, i just took the $_SERVER['REQUEST_URI'] and added
start=newstart to the end.

The problem is, i will eventually get a string thats very long, ebcause
start keeps appending onto the end. What is the easiest way to preserve
projects.php?action=view&completed=no and be able to add start=somenumber
to the end?

Thanks for your assistance.

--
Aaron Axelsen
aim: aaak2
email: listsfrozenpc.net

attached mail follows:


> I am writing an app and right now im working on code that will display x
> number of items on one page, and if there is overflow, provide a link to
> the next. The url coming into the page looks something like:
>
> projects.php?action=view&completed=no&start=0
>
> My code so far, i just took the $_SERVER['REQUEST_URI'] and added
> start=newstart to the end.
>
> The problem is, i will eventually get a string thats very long, ebcause
> start keeps appending onto the end. What is the easiest way to preserve
> projects.php?action=view&completed=no and be able to add start=somenumber
> to the end?

if you only need to pass 2 other variables, why not just build the
query string from scratch each time?

you could always do a string replacement on start=whatever instead of
just appending it to the end each time.

attached mail follows:


Hello All.

Im developing a couple of pages and i need to do some redirecting to
another page depending
on the choice of a user.
The problem is, to go to another page, i need to send some parameters in
the URL that are alredy present, but i need to make the redirecting
independent of the page.
if i use $_SERVER['PHP_SELF'], i have only http://some_domain/the_page
and what i want is
http://some_domain/the_page?some_parameters=value&another_parameter=value
the ?some_parameters=value are alredy present and i need to redirect
them again...

I know that are some fuctions to manage this, or not...
any solucion ??

thx in advance !

Bruno Santos

--
bvsantoshal.min-saude.pt
--
Divisao de Informatica
informaticahal.min-saude.pt
Tel: +351 272 000 155
Fax: +351 272 000 257

--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
geralhal.min-saude.pt
Tel: +351 272 000 272
Fax: +351 272 000 257

attached mail follows:


<SNIP>
-----Original Message-----
From: Bruno Santos [mailto:bvsantoshal.min-saude.pt]
Sent: Wednesday, July 21, 2004 11:05 AM
To: php-generallists.php.net
Subject: [PHP] URL

Hello All.

Im developing a couple of pages and i need to do some redirecting to
another page depending on the choice of a user.
</SNIP>

Since you are getting the information from the page anyways, just simply
do:

$_SERVER[PHP_SELF]?parameter1=$_GET[parameter1]&parameter2=$_GET[paramet
er2]&parameter3=$_GET[parameter3] etc...

HTH,
Robert

attached mail follows:


"Bruno Santos" <bvsantoshal.min-saude.pt> wrote in message
news:40FE8601.50403hal.min-saude.pt...
> Hello All.
>
> Im developing a couple of pages and i need to do some redirecting to
> another page depending
> on the choice of a user.
> The problem is, to go to another page, i need to send some parameters in
> the URL that are alredy present, but i need to make the redirecting
> independent of the page.
> if i use $_SERVER['PHP_SELF'], i have only http://some_domain/the_page
> and what i want is
> http://some_domain/the_page?some_parameters=value&another_parameter=value
> the ?some_parameters=value are alredy present and i need to redirect
> them again...
>
> I know that are some fuctions to manage this, or not...
> any solucion ??
>
> thx in advance !
>
> Bruno Santos

Hi Bruno,

do a print_r($_SERVER) on the page and look out for the value/array key that
fits your needs.

Regards, Torsten Roehr

attached mail follows:


> Since you are getting the information from the page anyways, just simply
> do:
>
> $_SERVER[PHP_SELF]?parameter1=$_GET[parameter1]&parameter2=$_GET[paramet
> er2]&parameter3=$_GET[parameter3] etc...

should also make sure to urlencode the data

here is another thrread about it
http://marc.theaimsgroup.com/?l=php-general&m=109000692120133&w=2

attached mail follows:


Thx Robert.
How could i miss that !! =:)

by the way, is any function in PHP that i can use to capture the current
URL ????

thx

-------- Original Message --------
Subject: RE: [PHP] URL
Date: Wed, 21 Jul 2004 11:12:33 -0400
From: Robert Sossomon <robertgcnorris.com>
To: <php-generallists.php.net>

<SNIP>
-----Original Message-----
From: Bruno Santos [mailto:bvsantoshal.min-saude.pt]
Sent: Wednesday, July 21, 2004 11:05 AM
To: php-generallists.php.net
Subject: [PHP] URL

Hello All.

Im developing a couple of pages and i need to do some redirecting to
another page depending on the choice of a user.
</SNIP>

Since you are getting the information from the page anyways, just simply
do:

$_SERVER[PHP_SELF]?parameter1=$_GET[parameter1]&parameter2=$_GET[paramet
er2]&parameter3=$_GET[parameter3] etc...

HTH,
Robert

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

--
bvsantoshal.min-saude.pt
--
Divisao de Informatica
informaticahal.min-saude.pt
Tel: +351 272 000 155
Fax: +351 272 000 257

--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
geralhal.min-saude.pt
Tel: +351 272 000 272
Fax: +351 272 000 257

attached mail follows:


Bruno Santos wrote:

> Im developing a couple of pages and i need to do some redirecting to
> another page depending
> on the choice of a user.
> The problem is, to go to another page, i need to send some parameters in
> the URL that are alredy present, but i need to make the redirecting
> independent of the page. if i use $_SERVER['PHP_SELF'], i have only
> http://some_domain/the_page
> and what i want is
> http://some_domain/the_page?some_parameters=value&another_parameter=value
> the ?some_parameters=value are alredy present and i need to redirect
> them again...
>
> I know that are some fuctions to manage this, or not...
> any solucion ??

How about $_SERVER['QUERY_STRING']?

That _should_ contain the current query string with the values still
encoded, but I'm not sure on that. If they aren't still encoded, then
just rebuild the query string by looping through $_GET.

$url = $_SERVER['PHP_SELF'] . '?';
foreach($_GET as $key => $value)
{ $url .= '&' . $key . '=' . urlencode($value); }

If you have arrays within $_GET, then you'll need a recursive function,
but hopefully one of the above will work for your needs.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


Hi

 You can user $_SERVER['REQUEST_URI'];

Thanks

Zareef Ahmed

--- "John W. Holmes" <holmes072000charter.net> wrote:
> Bruno Santos wrote:
>
> > Im developing a couple of pages and i need to do
> some redirecting to
> > another page depending
> > on the choice of a user.
> > The problem is, to go to another page, i need to
> send some parameters in
> > the URL that are alredy present, but i need to
> make the redirecting
> > independent of the page. if i use
> $_SERVER['PHP_SELF'], i have only
> > http://some_domain/the_page
> > and what i want is
> >
>
http://some_domain/the_page?some_parameters=value&another_parameter=value
> > the ?some_parameters=value are alredy present and
> i need to redirect
> > them again...
> >
> > I know that are some fuctions to manage this, or
> not...
> > any solucion ??
>
> How about $_SERVER['QUERY_STRING']?
>
> That _should_ contain the current query string with
> the values still
> encoded, but I'm not sure on that. If they aren't
> still encoded, then
> just rebuild the query string by looping through
> $_GET.
>
> $url = $_SERVER['PHP_SELF'] . '?';
> foreach($_GET as $key => $value)
> { $url .= '&' . $key . '=' . urlencode($value); }
>
> If you have arrays within $_GET, then you'll need a
> recursive function,
> but hopefully one of the above will work for your
> needs.
>
> --
> ---John Holmes...
>
> Amazon Wishlist:
> www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals –
> www.phparch.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!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

attached mail follows:


Hi all,

Our company has decided to encrypt the php programs
that we sell, I have to choose which encryption
package to buy.

After a lot of seaching (on this list(archives),
google, forums etc) I saw a quite a few products like
ioncube, zend, codesecure, blender, mmCache encryptor
etc etc
unfortunatly blender is not yet ready for stable
production use and althought I was leaning towards
mmcache as its free, not every host will be too happy
to install mmCache so I have decided to go with Zend
encryptor (not too bad a price for the "small
business" companies - companies that make less than
$250k a year - which is what we currently fall under)

I just wanted your comments on this, good idea? bad?
any of you guys tried it? any problems with hosts not
willing to install the "optimiser" to run encrypted
scripts? stable? etc
I have googled for these questions and it seems very
favourable, but I figure it would be wise to ask you
guys as you use php everyday/nearly everyday and can
give me better feedback as the "average joe" (a lot of
the sites recommending Zend Enc are linking to zend
with a little affiliate tag...so i'm guessing some of
them are biased).

Off topic Q, My ISP has blocked me sending mail from
my local machine (they have blocked port 25) any
program (for windows (2000 pro)) that can send mail on
another port? I used to use Merak mail server.

Thanks in advance.

-Mag

=====
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

        
                
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

attached mail follows:


PHP Gen wrote:

>Hi all,
>
>unfortunatly blender is not yet ready for stable
>production use and althought I was leaning towards
>mmcache as its free, not every host will be too happy
>to install mmCache
>
And the loss is entirely theirs. MMache really can take a load of your
webserver.

>I just wanted your comments on this, good idea? bad?
>any of you guys tried it? any problems with hosts not
>willing to install the "optimiser" to run encrypted
>scripts? stable? etc
>
>
Correct me if I am wrong, but according to my understanding when an
optimizer is installed it does not matter which encoder was used to
encode the scripts.

>Off topic Q, My ISP has blocked me sending mail from
>my local machine (they have blocked port 25) any
>program (for windows (2000 pro)) that can send mail on
>another port? I used to use Merak mail server.
>
>
how about using SSH tunneling instead.

>Thanks in advance.
>
>-Mag
>
>
>
>
Please start your signature with the '--' sequence and not '====' as you
have used.

>=====
>- The faulty interface lies between the chair and the keyboard.
>
>

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


On Wednesday 21 July 2004 23:37, raditha dissanayake wrote:

> Please start your signature with the '--' sequence and not '====' as you
> have used.

The signature separator should be '-- ' so that competent mail clients will
automatically strip the signature.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Win98 error 002: Insufficient diskspace. You need at least 300 GB free memory.
*/

attached mail follows:


Hi,
Thanks for replying.

> And the loss is entirely theirs. MMache really can
> take a load of your
> webserver.

True, but its easier to tell a webhosting company to
install a Zend product as they are the maker of PHP
blah blah than to tell them to install an "untrusted"
3rd party app like mmCache.
The above applies only to webhosts who are mostly half
wits, my present webhost (hub.org) are very nice guys
and know their business.
(ps. I dont get anything from hub for the plug above)

> Correct me if I am wrong, but according to my
> understanding when an
> optimizer is installed it does not matter which
> encoder was used to
> encode the scripts.

News to me, I thought each encryptor has its own
"style" of encrypting the php....will check up but I
think thats true.

>
> >Off topic Q, My ISP has blocked me sending mail
> from
> >my local machine (they have blocked port 25) any
> >program (for windows (2000 pro)) that can send mail
> on
> >another port? I used to use Merak mail server.
> >
> >
> how about using SSH tunneling instead.

Never tried it, any examples for a win2k pro machine?

> Please start your signature with the '--' sequence
> and not '====' as you
> have used.

Yahoo added the ====, will change it as you are the
second person who has complained...just have to find
the place where thats set.

Thanks,
Mag

=====
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

                
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

attached mail follows:


on 21/7/04 16:59, PHP Gen at genphpyahoo.com wrote:

> News to me, I thought each encryptor has its own
> "style" of encrypting the php....will check up but I
> think thats true.

Mmcache says explicitly that its output is compatible with Zend encoder.
Also note that encryption is not the same as encoding.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


Php Gen wrote:

> After a lot of seaching (on this list(archives),
> google, forums etc) I saw a quite a few products like
> ioncube, zend, codesecure, blender, mmCache encryptor
> etc etc

I think it depends on the scale of your product. If it is something that
a company is going to deploy on their own web servers then it would be
fair enough to ask them to make sure they have the required Zend files
installed to be able to decrypt your application.

On the other hand, if you are trying to sell a small application to
"smaller" web sites (i.e. hobby sites, or just sites that don't require
their own dedicated servers) then you will run into a problem with the
Zend solution, as I found out, that a lot of hosts won't even install
that. If you want to offer a trial version of your application
(encrypted, naturally) and it doesn't work when the user uploads it to
their host, you've 99% of the time lost that sale right away.

To encrypt or not decrypt is a business decision more than a technical one.

For what it is worth - I use SourceGuardian on a few smaller projects.
It doesn't require any libraries / extensions to be loaded as it can
include them at run-time (well, most of the time anyway). So it might be
worth looking at it? Cheaper than Zend too. The biggest problem I have
found with it is that you cannot install it onto a server that has the
Zend Debugger running (they conflict). But then no *production* server
should have this, but local development machines (especially those
running Zend Studio) will.

Cheers,

Rich
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde

attached mail follows:


> I'm trying to use html_decode with the echo function but failed so far.
>
> <? echo mysql_result($product, 0,1) ?>
>
> What would be the correct syntax?
>
> TIA

You should read up on how to use mysql_result properly. Read through the
user comments for tips.

http://us2.php.net/manual/en/function.mysql-result.php

For example:

$query = "SELECT * from tablename where index='var'";

$result = mysql_result($query);

while ($row = mysql_fetch_array($result)) {
  //do stuff with $row
}

--Matthew Sims
--<http://killermookie.org>

attached mail follows:


Matthew Sims wrote:
>>I'm trying to use html_decode with the echo function but failed so far.
>>
>><? echo mysql_result($product, 0,1) ?>
>>
>>What would be the correct syntax?
>>
>>TIA
>
>
> You should read up on how to use mysql_result properly. Read through the
> user comments for tips.
>
> http://us2.php.net/manual/en/function.mysql-result.php
>
> For example:
>
> $query = "SELECT * from tablename where index='var'";
>
> $result = mysql_result($query);
>
> while ($row = mysql_fetch_array($result)) {
> //do stuff with $row
> }
>
> --Matthew Sims
> --<http://killermookie.org>

Hello.

Matt, appearently you're confusing mysql_result() with mysql_query() (-:

Daniel

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

attached mail follows:


> Matthew Sims wrote:
>>>I'm trying to use html_decode with the echo function but failed so far.
>>>
>>><? echo mysql_result($product, 0,1) ?>
>>>
>>>What would be the correct syntax?
>>>
>>>TIA
>>
>>
>> You should read up on how to use mysql_result properly. Read through the
>> user comments for tips.
>>
>> http://us2.php.net/manual/en/function.mysql-result.php
>>
>> For example:
>>
>> $query = "SELECT * from tablename where index='var'";
>>
>> $result = mysql_result($query);
>>
>> while ($row = mysql_fetch_array($result)) {
>> //do stuff with $row
>> }
>>
>> --Matthew Sims
>> --<http://killermookie.org>
>
>
> Hello.
>
> Matt, appearently you're confusing mysql_result() with mysql_query() (-:
>
>
> Daniel
>

Holy moly! Okay, ignore me. :) Need my morning coffee, please.

--Matthew Sims
--<http://killermookie.org>

attached mail follows:


I have started a session using session_start();
but it returns :

Warning: Cannot send session cookie - headers already sent by (output
started at c:\inetpub\wwwroot\diary\index.php:7) in
c:\inetpub\wwwroot\diary\reg_session.php on line 11

Warning: Cannot send session cache limiter - headers already sent (output
started at c:\inetpub\wwwroot\diary\index.php:7) in
c:\inetpub\wwwroot\diary\reg_session.php on line 11

If I don't want to use session cookie , how to set it?
thanks.

attached mail follows:


"Sheawh" <ilovethisgame1984hotmail.com> wrote in message
news:20040721161131.50608.qmailpb1.pair.com...
> I have started a session using session_start();
> but it returns :
>
> Warning: Cannot send session cookie - headers already sent by (output
> started at c:\inetpub\wwwroot\diary\index.php:7) in
> c:\inetpub\wwwroot\diary\reg_session.php on line 11
>
> Warning: Cannot send session cache limiter - headers already sent (output
> started at c:\inetpub\wwwroot\diary\index.php:7) in
> c:\inetpub\wwwroot\diary\reg_session.php on line 11
>
>
> If I don't want to use session cookie , how to set it?
> thanks.

No output is allowed before starting the session. Look at the user comments
in the manual and search the mailing list archives.

Regards, Torsten Roehr

attached mail follows:


even Example: page1.php
I got the same result,
and what if i set session auto start ??
is that means it starts a new session when accessing a HTML?

<HTML>
     ....
<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal'] = 'cat';
$_SESSION['time'] = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

echo "SID : " . session_id();
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
.... </HTML>

"Torsten Roehr" <roehrzilleon.com> ¦b¶l¥ó
news:20040721162707.16695.qmailpb1.pair.com ¤¤¼¶¼g...
> "Sheawh" <ilovethisgame1984hotmail.com> wrote in message
> news:20040721161131.50608.qmailpb1.pair.com...
> > I have started a session using session_start();
> > but it returns :
> >
> > Warning: Cannot send session cookie - headers already sent by (output
> > started at c:\inetpub\wwwroot\diary\index.php:7) in
> > c:\inetpub\wwwroot\diary\reg_session.php on line 11
> >
> > Warning: Cannot send session cache limiter - headers already sent
(output
> > started at c:\inetpub\wwwroot\diary\index.php:7) in
> > c:\inetpub\wwwroot\diary\reg_session.php on line 11
> >
> >
> > If I don't want to use session cookie , how to set it?
> > thanks.
>
> No output is allowed before starting the session. Look at the user