php-general Digest 30 Nov 2002 12:31:53 -0000 Issue 1735

Topics (messages 126506 through 126526):

Method for displaying downline
        126506 by: Daren Cotter
        126510 by: Daren Cotter
        126512 by: Daren Cotter

Re: How Do I install php on Apache 2.0
        126507 by: -<[ Rene Brehmer ]>-

Re: First PHP
        126508 by: -<[ Rene Brehmer ]>-

imap_open authentication failure
        126509 by: Dumdeedum

Re: &amp; in Query String
        126511 by: Malcolm Brownell

test for ascii or binary string
        126513 by: Jonathan Sharp
        126514 by: Jonathan Sharp
        126515 by: Morgan Hughes
        126523 by: Paul Chvostek

string
        126516 by: Remon Redika
        126517 by: Kyle Gibson

PHP & Javascript compatibilty
        126518 by: Wee Keat [Amorphosium]
        126519 by: Kyle Gibson

About Speech
        126520 by: Ing. Raúl González Rodríguez

Re: Test links?
        126521 by: Jason Wong

Re: Upload wont work, OS X
        126522 by: Jason Wong

Re: Hello ! How to write a programme in PHP which executes a routine at a given time ?
        126524 by: Paul Chvostek

Re: Multidimensional array
        126525 by: Paul Chvostek

Re: OpenSSL Encryption to a browser.
        126526 by: Tony Earnshaw

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
I need to display an entire downline (info about all
members referred by another member). The query to
actually get the info I need is fairly simple, but
displaying it in a table is what's tripping me up.

There are two tables: Affiliates and Referrals.
Affiliates keeps track of all affiliate info.
Referrals keeps track of who referred who (AffID and
ReferredBy fields).

The output I need is something like:

                         7
               10                 11
           14      16         18      20
         26  28  31  34     36  38  41  44

Where 7 referred 10 and 11, 10 referred 14 and 16, 14
referred 26 and 28, etc. Each member can only refer
two others.

I know some sort of looping (possibly recursion?)
structure is needed, but I can't figure out how to
display the output in tables as shown above.

Any help would be greatly appreciated!

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
I need to display an entire downline (info about all
members referred by another member). The query to
actually get the info I need is fairly simple, but
displaying it in a table is what's tripping me up.

There are two tables: Affiliates and Referrals.
Affiliates keeps track of all affiliate info.
Referrals keeps track of who referred who (AffID and
ReferredBy fields).

The output I need is something like:

                         7
               10                 11
           14      16         18      20
         26  28  31  34     36  38  41  44

Where 7 referred 10 and 11, 10 referred 14 and 16, 14
referred 26 and 28, etc. Each member can only refer
two others.

I know some sort of looping (possibly recursion?)
structure is needed, but I can't figure out how to
display the output in tables as shown above.

Any help would be greatly appreciated!


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
I need to display an entire downline (info about all
members referred by another member). The query to
actually get the info I need is fairly simple, but
displaying it in a table is what's tripping me up.

There are two tables: Affiliates and Referrals.
Affiliates keeps track of all affiliate info.
Referrals keeps track of who referred who (AffID and
ReferredBy fields).

The output I need is something like:

                         7
               10                 11
           14      16         18      20
         26  28  31  34     36  38  41  44

Where 7 referred 10 and 11, 10 referred 14 and 16, 14
referred 26 and 28, etc. Each member can only refer
two others.

I know some sort of looping (possibly recursion?)
structure is needed, but I can't figure out how to
display the output in tables as shown above.

Any help would be greatly appreciated!


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
Hi Adam Voigt,

On 27 Nov 2002 11:44:49 -0500, you wrote about "Re: [PHP] How Do I install
php on Apache 2.0" something that looked like this:

>A. What does having Adobe installed matter?

Where'd you get that??

>B. Why are you trying to run 2.0? Apache 2.0 isn't even recommended for
>use with PHP on linux systems yet, let alone windows. You'd have much
>better luck with the 1.3.27 version.

Why not??? I'm running a custom built Apache 2.0.40 with the latest PHP
and it works trouble free on WinXP ... 

Granted, this is for experimental testing only ... I'd never have a public
server running Windows in any shape or form any way...


--- End Message ---
--- Begin Message ---
Hi Khalid El-Kary,

On Fri, 29 Nov 2002 14:18:15 +0000, you wrote about "Re: [PHP] First PHP"
something that looked like this:

>hi,
>how about the manual?

Works for me to learn it ... it's the only thing I've read on PHP besides
the WebMonkey guide to get the Apache+PHP set up ...

--- End Message ---
--- Begin Message ---
Hi, I'm using the following code:

$x = imap_open("{mail.xxxx.com:110/pop3}INBOX", "[EMAIL PROTECTED]", "xxxx");
echo $x ? "YAY!" : "NO YAY!<BR>" . implode("<BR>", imap_errors());

It works fine on my local server, but as soon as I try it on the live 
machine it gives me:

Retrying CRAM-MD5 authentication after
Retrying CRAM-MD5 authentication after Invalid userid/password
Retrying CRAM-MD5 authentication after illegal command
Retrying CRAM-MD5 authentication after authentication exchange failed
Can not authenticate to POP3 server: authentication exchange failed

Which is just mean, the local server is Debian 2.2 running PHP 4.0.3pl1 and 
the live one is Slackware 8.1-rc1 running PHP 4.2.1.  The mail server seems 
to identify itself as IMail 6.02.  The live server can telnet into the mail 
server okay so it's not a connection problem and it can connect to 
different mail servers without problems.

After extensive googling I found something in Norwegian which I guessed was 
saying to try replacing the "@" in the login to "\$", which was tried... as 
before, worked locally but failed live.  So I gave up and decided to leave 
it to better minds than mine, ie. you.

Thanks in advance.
--- End Message ---
--- Begin Message ---
Looks fine in Opera 6.03
hth



http://www.vogelsinger.at/test.php?par1=value1&par2=value2&par3=value3
Opera 
Version 6.03 
 Build 1107
Platform Win32
System Windows 98
Java
Sun Java Runtime Environment 1.4

Testing the query string

This is the full query string ($_SERVER['QUERY_STRING']): par1=value1&par2=value2
&par3=value3
This is a printout of $_GET: Array ( [par1] => value1 [par2] => value2 [par3] => 
value3 )

I will use this string for the link below: /test.php?par1=value1&amp;par2=value2
&amp;par3=value3




On Wed, 27 Nov 2002 00:09:35 +0100, [EMAIL PROTECTED] (Ernest E Vogelsinger) 
wrote:
> At 00:00 27.11.2002, Jonathan Rosenberg \(Tabby's Place\) said:
> --------------------[snip]--------------------
> >Ok ... I take back what I said about &amp; not working in a query string.
> >It works just fine.
> --------------------[snip]-------------------- 
> 
> Ahhh - and I just created a test page for all to check out... nevertheless,
> here it is:
> http://www.vogelsinger.at/test.php
> 
> Simply provides a link using query parameters encoded with &amp;, to check
> with different browsers. Maybe someone will check this outwith his browser
> anyway.
> 
> 
> -- 
>    >O     Ernest E. Vogelsinger
>    (\)    ICQ #13394035
>     ^     http://www.vogelsinger.at/
> 
> 



--- End Message ---
--- Begin Message ---
Is there a way to determine if a string has ascii or binary data in it?

-js

--- End Message ---
--- Begin Message ---
Doh, so simple. I guess the correct form of the question would be how do
I determine if a string has just a-zA-Z0-9 in it plus punctuation...

thanks,
-js


Paul Chvostek wrote:
> On Fri, Nov 29, 2002 at 10:27:05PM -0600, Jonathan Sharp wrote:
> 
>>Is there a way to determine if a string has ascii or binary data in it?
> 
> 
> You could always see if it matches a regular expression that represents
> the ascii range you're considering.  I.e., ereg('[^a-zA-Z0-9]',$string)
> will return true if non-alphanumerics are in the string.
> 
> Remember that a string is just a string.  Whether the data contained in
> it is represented as ASCII or something else is completely a matter of
> implementation.  ALL 7-bit data can be represented as ASCII.  All 8-bit
> data can be represented as "IBM Extended ASCII" or whatever you want to
> call it.  But the string is just a string of bits.
> 



--- End Message ---
--- Begin Message ---
On Fri, 29 Nov 2002, Jonathan Sharp wrote:

> Is there a way to determine if a string has ascii or binary data in it?

  I've used this kind of approach in the past to determine which encoding
  to use on a string which may contain text or an image.  Basically it
  uses addcslashes to escape non-ASCII chars, then strips all
  non-backslash chars, and takes the size of the string...  $size should
  contain the number of bytes (out of 1024) that were escaped, and should
  be very low for clean text, and pretty high for binary.  This was made
  for analyzing blobs, but maybe the approach is useful...


  $text = addcslashes(substr($string, 0, 1024), "\\\"'\0..\37\177..\377");
  $size = strlen(preg_replace('/[^\\\\]/', '', $text));
  if ($size < 200)
    print "mostly text, use addslashes";
  else
    print "mostly binary, use base64_encode";


-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356


--- End Message ---
--- Begin Message ---
On Fri, Nov 29, 2002 at 10:27:05PM -0600, Jonathan Sharp wrote:
> 
> Is there a way to determine if a string has ascii or binary data in it?

You could always see if it matches a regular expression that represents
the ascii range you're considering.  I.e., ereg('[^a-zA-Z0-9]',$string)
will return true if non-alphanumerics are in the string.

Remember that a string is just a string.  Whether the data contained in
it is represented as ASCII or something else is completely a matter of
implementation.  ALL 7-bit data can be represented as ASCII.  All 8-bit
data can be represented as "IBM Extended ASCII" or whatever you want to
call it.  But the string is just a string of bits.

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/

--- End Message ---
--- Begin Message --- hi everyone..
how to get the part of string and make it into a variable..
sample :
"determine"
now, i want to take just "mine" or 4 word from right, or "deter" (for left function).
and after i got it, i want to make the "mine" into $x variable
my mind..
$x = "mean"
help please...
--- End Message ---
--- Begin Message ---
hi everyone..
how to get the part of string and make it into a variable..
sample :
"determine"
now, i want to take just "mine" or 4 word from right, or "deter" (for left function).
and after i got it, i want to make the "mine" into $x variable
my mind..
$x = "mean"
help please...
$x = substr("determine",-4);

For more information on SUBSTR,

http://www.php.net/manual/en/function.substr.php

;)

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/

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

I'm developing a WYSIWYG editor using PHP and Javascript (for COM). However, I start 
having problems when I try to display the page using the .php extension. The 
Javascript is not working. 

However, when I save it to HTML, it worked fine. 

Can anyone please help me? Why is this so? What can I do to get Javascript working 
with PHP with ease? Any articles on this?

Thanks a lot... again. :)



Yours,

Wee Keat Chin

----------------------------------------------
"If you cannot win, make the one ahead of you break the record." 
--- End Message ---
--- Begin Message ---
I'm developing a WYSIWYG editor using PHP and Javascript (for COM). However, I start having problems when I try to display the page using the .php extension. The Javascript is not working.
However, when I save it to HTML, it worked fine.
Can anyone please help me? Why is this so? What can I do to get Javascript working with PHP with ease? Any articles on this?

Thanks a lot... again. :)
If you show me some code I can look at, I might be able to assist you.

You should have no trouble executing JS on a file with a .php extension, so long as it is incorporated into HTML.

--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/

--- End Message ---
--- Begin Message ---
Hi.

I need to know if it's possible generate a wav, mid or mp3 file from php. I
really need create a sound file and send it to the user using http. Exist
some tool to do this work? Someone can give me an idea?

Thanks.


--- End Message ---
--- Begin Message ---
On Saturday 30 November 2002 06:53, Rob Packer wrote:
> First, I'd like to say that I'm not asking for anyone to write a script...
> how would I go about checking a MySQL database of links to see if any are
> down?
>
> I've had some varying results with all the methods I've tried, so would
> like to see if anyone has a proven method for doing this.

Why don't you briefly summarise what methods you have tried? That way people 
won't reply with methods that you already know of.

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

/*
Between grand theft and a legal fee, there only stands a law degree.
*/

--- End Message ---
--- Begin Message ---
On Saturday 30 November 2002 06:42, magnus nilsson wrote:
> It works, partially. I can upload the file, but it's named "array".

  print_r($_FILES)

to see what it contains and how you can use it.

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

/*
The Beatles:
        Paul McCartney's old back-up band.
*/

--- End Message ---
--- Begin Message ---
PHP itself does not have any facility for running things according to a
schedule in the way you describe.  It looks like you need to run some
additional software using cron (or your operating system's equivalent).
Unix systems have a command called "at" which can be used to execute
things at specific times, but what it actually executes is still a
problem.  If you want to be able to launch programs on external
machines, there are security issues which must be addressed as well.

And what does "centian" mean?


On Fri, Nov 29, 2002 at 01:18:16AM +0800, Jonathan wrote:
> 
> Dear all ,
>  Hello ! I am a student and going to write a suit of programme . The
> producers as follow
> 
>  producer 1.
>  User A add an new appointment A ( "open Winamp at 2:30 on computer B")
> through IE in his local computer A .
> 
>  producer 2.
>  Computer A send the message to server A through http . The Servlet /
> ASP.net which locates on server A receives the message and send message to
> computer B (IP or domain name of computer B is given , named
> "www.computerB.com") .
> 
>  producer 3.
>  Computer B receives the message from server A through http at 1:01 . It is
> expected to implement the new added appointment A ( "open Winamp at 2:30 on
> computer B" ) at given time .
> 
>  I know what to implement the producer 1 and 2. However , I don't know how
> to implement producer 3. Do you mind to tell me how to make a PHP programme
> to execute a centian routine at a given time ? Thank you !

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/

--- End Message ---
--- Begin Message ---
A multidimensional array is just an array whose values are themselves
arrays.  So ...

$thing="2002-11"; // or whatever
$issue=array();
$issue[$thing]=array();
$issue[$thing]['number']="this";
$issue[$thing]['headline']="that";

And if you ksort($issue), the key/value associations will be maintained;
you're just changing the order of the elements.  If you want to sort by
other "fields", array_multisort() may be for you.

p

On Thu, Nov 28, 2002 at 09:11:03AM -0800, Mako Shark wrote:
> 
> Here is a problem I'm having similar to somethnig
> someone just posted, but not quite the same. I'm not
> toooooo experienced with the intricacies and
> complications of arrays, but I have a bunch of fields
> like this for a magazine organizer (best way to put
> it, I guess):
> 
> $issuenumber[]
> $issueheadline[]
> $issuewriters[]
> $issuemonth[]
> $issueyear[]
> $issuedescription[]
> among other fields.
> 
> I would like to store this all in one multidimensional
> array, like
> $issue->number[]
> $issue->headline[]
> etc.
> 
> What is the syntax? I'm bumbling around right now.
> Also, if I sort() the array by number, would the rest
> of the fields be properly sorted? I assume so, but
> don't want to find out the hard way that it doesn't.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/

--- End Message ---
--- Begin Message ---
fre, 2002-11-29 kl. 12:50 skrev Comunica2 s. coop.:

> I would like to use OpenSSL to send encrypted information to a browser. The
> information would be encrypted to a public key that has its private
> counterpart installed in the browser. The idea is that the information would
> be decrypted automatically, but only when the destination browser has the
> right private key installed.

PKI encryption just does not work like that. Read up on the Openssl docs
and especially Ralf Engelschall's mod_ssl docs. The rsasecurity web site
PKI FAQ is also a good one to read, mark, learn and inwardly digest it
all. Given the existence of Carnivore and wireless networks, it's a
'must' for tomorrow's computing.

Best,

Tony


-- 

Tony Earnshaw

When all's said and done ...
there's nothing left to say or do.

e-post:         [EMAIL PROTECTED]
www:            http://www.billy.demon.nl



--- End Message ---

Reply via email to