php-general Digest 15 Apr 2002 05:51:33 -0000 Issue 1287

Topics (messages 92923 through 92948):

Re: PHP MySQL Hosting services
        92923 by: phplists.woodenpickle.com
        92928 by: eat pasta type fasta
        92929 by: phplists.woodenpickle.com
        92931 by: Steve
        92934 by: Vins
        92936 by: Vins

Re: Multiple Threads?
        92924 by: Cal Evans
        92932 by: Richard Creech
        92946 by: Matthew Walker
        92948 by: Richard Archer

make a set of variables available to all visitors?
        92925 by: olinux
        92926 by: Cal Evans

PHP templeate and client JavaScript.
        92927 by: Peter Ruan

Re: Need row number from database select
        92930 by: SP
        92941 by: David Robley

Re: first time user
        92933 by: zookie
        92937 by: heinisch.creaction.de

Re: globals in functions
        92935 by: Philip Olson

Php Config " OCX missing " in IIS Win2k
        92938 by: Simonk
        92940 by: Simonk

Exchange data script ?
        92939 by: Teqila MAN

Understanding If conditional statements
        92942 by: lmlweb
        92943 by: David Robley
        92945 by: lmlweb

graphing packages
        92944 by: Christian Calloway

Internet Explorer - BACK Button - Passwords?
        92947 by: Jason Caldwell

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 ---
http://webpipe.net

They seem to be doing good with uptime.. In the last couple months I've been
having a monitoring service check them frequently and so far we're at 100%..

Standard Virtual Package ($24.95/mo - $14.95 setup):
Linux RedHat 7.1
300mb Disk Space
25 POP3 Accounts
10GB/mo transfer
Static IP Address
Apache 1.3.20
PHP 4.0.6
Dedicated MySQL Server
CRON
Telnet/SSH/FTP
Sendmail
SSL
Webmin Control Panel
Host up to 25 Apache VHosts

Premium Virtual Package ($34.95/mo - $14.95 setup)::
Linux RedHat 7.1
500mb Disk Space
50 POP3 Accounts
20GB/mo transfer
Static IP Address
Apache 1.3.20
PHP 4.0.6
Dedicated MySQL Server
CRON
Telnet/SSH/FTP
Sendmail
SSL
Webmin Control Panel
Priority Technical Support
Host up to 50 Apache VHosts

Plus you get a free month credit for referring others.. Hint, hint.. (it's
Bob Weaver, account: custompcweb.com)

Later,

Bob Weaver


"Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi everyone,
>
> I am wondering if anyone has a good hosting service? I am currently with
> Aletia which has an excellant package good tech support but sometimes not
> very functional servers.
>
> My site has gone down at least 3 times within the last 20 days. Too many
for
> me.
>
> It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course
> PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at
least
> 15 POP3 email accounts, cron support.
>
> Thanks
> Jennifer
> --
> The sleeper has awaken
>
>
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>
>


--- End Message ---
--- Begin Message ---
Check out linux web host comes with PHP and MySql
Their PHP compile is pretty nice, including GD support. Their DB is
run via phpMyAdmin.

http://www.linuxwebhost.com


>http://webpipe.net
>
>They seem to be doing good with uptime.. In the last couple months I've been
>having a monitoring service check them frequently and so far we're at 100%..
>
>Standard Virtual Package ($24.95/mo - $14.95 setup):
>Linux RedHat 7.1
>300mb Disk Space
>25 POP3 Accounts
>10GB/mo transfer
>Static IP Address
>Apache 1.3.20
>PHP 4.0.6
>Dedicated MySQL Server
>CRON
>Telnet/SSH/FTP
>Sendmail
>SSL
>Webmin Control Panel
>Host up to 25 Apache VHosts
>
>Premium Virtual Package ($34.95/mo - $14.95 setup)::
>Linux RedHat 7.1
>500mb Disk Space
>50 POP3 Accounts
>20GB/mo transfer
>Static IP Address
>Apache 1.3.20
>PHP 4.0.6
>Dedicated MySQL Server
>CRON
>Telnet/SSH/FTP
>Sendmail
>SSL
>Webmin Control Panel
>Priority Technical Support
>Host up to 50 Apache VHosts
>
>Plus you get a free month credit for referring others.. Hint, hint.. (it's
>Bob Weaver, account: custompcweb.com)
>
>Later,
>
>Bob Weaver
>
>
>"Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hi everyone,
>>
>> I am wondering if anyone has a good hosting service? I am currently with
>> Aletia which has an excellant package good tech support but sometimes not
>> very functional servers.
>>
>> My site has gone down at least 3 times within the last 20 days. Too many
>for
>> me.
>>
>> It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course
>> PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at
>least
>> 15 POP3 email accounts, cron support.
>>
>> Thanks
>> Jennifer
>> --
>> The sleeper has awaken
>>
>>
>>
>>
>>
>>
>> ---
>> Outgoing mail is certified Virus Free.
>> Checked by AVG anti-virus system (http://www.grisoft.com).
>> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>>
>>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Yeah, I actually used to have a couple accounts with linuxwebhost.com...
They are nice and fast.. I just like the ability to be able to compile and
install my own software on the server..

Later,

Bob
"Eat Pasta Type Fasta" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Check out linux web host comes with PHP and MySql
> Their PHP compile is pretty nice, including GD support. Their DB is
> run via phpMyAdmin.
>
> http://www.linuxwebhost.com
>
>
> >http://webpipe.net
> >
> >They seem to be doing good with uptime.. In the last couple months I've
been
> >having a monitoring service check them frequently and so far we're at
100%..
> >
> >Standard Virtual Package ($24.95/mo - $14.95 setup):
> >Linux RedHat 7.1
> >300mb Disk Space
> >25 POP3 Accounts
> >10GB/mo transfer
> >Static IP Address
> >Apache 1.3.20
> >PHP 4.0.6
> >Dedicated MySQL Server
> >CRON
> >Telnet/SSH/FTP
> >Sendmail
> >SSL
> >Webmin Control Panel
> >Host up to 25 Apache VHosts
> >
> >Premium Virtual Package ($34.95/mo - $14.95 setup)::
> >Linux RedHat 7.1
> >500mb Disk Space
> >50 POP3 Accounts
> >20GB/mo transfer
> >Static IP Address
> >Apache 1.3.20
> >PHP 4.0.6
> >Dedicated MySQL Server
> >CRON
> >Telnet/SSH/FTP
> >Sendmail
> >SSL
> >Webmin Control Panel
> >Priority Technical Support
> >Host up to 50 Apache VHosts
> >
> >Plus you get a free month credit for referring others.. Hint, hint..
(it's
> >Bob Weaver, account: custompcweb.com)
> >
> >Later,
> >
> >Bob Weaver
> >
> >
> >"Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Hi everyone,
> >>
> >> I am wondering if anyone has a good hosting service? I am currently
with
> >> Aletia which has an excellant package good tech support but sometimes
not
> >> very functional servers.
> >>
> >> My site has gone down at least 3 times within the last 20 days. Too
many
> >for
> >> me.
> >>
> >> It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of
course
> >> PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at
> >least
> >> 15 POP3 email accounts, cron support.
> >>
> >> Thanks
> >> Jennifer
> >> --
> >> The sleeper has awaken
> >>
> >>
> >>
> >>
> >>
> >>
> >> ---
> >> Outgoing mail is certified Virus Free.
> >> Checked by AVG anti-virus system (http://www.grisoft.com).
> >> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
> >>
> >>
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >


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

Check out Hub.Org Networking services 

http://www.hub.org

They have Virtual Machine that can be configured to your NEEDS without 
affecting other clients and vice versa. and MANY other features
including ssh, ftp, cgi/perl and I believe they have also added MySQL
3.23 to the list.

Not sure if it would be what you want but they are good :)


Jennifer Downey wrote:
> 
> Hi everyone,
> 
> I am wondering if anyone has a good hosting service? I am currently with
> Aletia which has an excellant package good tech support but sometimes not
> very functional servers.
> 
> My site has gone down at least 3 times within the last 20 days. Too many for
> me.
> 
> It has to be at least 50 mb disk space, 10 to 15gig /m transfer, of course
> PHP and MySQL, ftp, ssh or telnet, cgi/perl, free domain transfer, at least
> 15 POP3 email accounts, cron support.
> 
> Thanks
> Jennifer
> --
> The sleeper has awaken
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
--- End Message ---
--- Begin Message ---
Hey.
I have the best hosting you can get.
for only $46 p/m

ALL THIS...

a.. 400 MB web space
a.. Execution of Custom CGI scripts
a.. Support for PERL
a.. Support for C and C++
a.. Support for SSI
a.. Support for GCC
a.. Support for GD
a.. Support for 5 independent MySQL Databases

      Own URL in the format www.your-name.co.za


      Choice of local / int. server


      30-Day Moneyback Guarantee


      Extensive Support Forum


      99,9% Uptime


      24/7/365 Network Monitoring


      Power Back-up & Generator


      Daily Back-ups


      Web Site Control Panel


      FTP User Login


      POP3 Accessible Mailbox(es)
     25

      Unlimited E-mail Aliases


      Online Mail Administration Tool


      Online Web Mailbox


      Advanced E-mail Forwarding


      E-mail Auto Responder


      Form to e-mail CGI script (cgiemail and formmail.pl)


      Access to CGI Counter and Counter Configurations Tool


      Daily Log Files


      Graphic Statistics Report


      Disk Usage Monitor


      Full range of MIME types


      Execution of PHP scripts (PHP4)


      Telnet Access (activated on request)


      SSH Access (activated on request)


      Microsoft Frontpage 2000 Extensions
      (activated on request)


      Databases with MySQL
     5

      CGI Shopping Cart


      Custom CGI


      Support for SSI


      Perl


      C, C++


      GCC





begin 666 clip_image001.gif
M1TE&.#EA"@`*`*(``+^_OQ\?'S,S,V9F9@```/___P```````"'Y! ``````
M+ `````*``H`0 ,A6+JL,"$,L *Y.#B!B:#%T%W#\D33(HYE88U:`7#8U]P)
"`#L`
`
end

--- End Message ---
--- Begin Message ---
Hey.
I have the best hosting you can get.
for only $46 p/m

ALL THIS...

400 MB web space
Execution of Custom CGI scripts
Support for PERL
Support for C and C++
Support for SSI
Support for GCC
Support for GD
Support for 5 independent MySQL Databases

Own URL in the format
Extensive Support Forum
99,9% Uptime
24/7/365 Network Monitoring
Power Back-up & Generator
Daily Back-ups
Web Site Control Panel
FTP User Login
25 POP3 Accessible Mailbox(es)
Unlimited E-mail Aliases
Online Mail Administration Tool
Online Web Mailbox
Advanced E-mail Forwarding
E-mail Auto Responder
Form to e-mail CGI script (cgiemail and formmail.pl)
Access to CGI Counter and Counter Configurations Tool
Daily Log Files
Graphic Statistics Report
Disk Usage Monitor
Full range of MIME types
Execution of PHP scripts (PHP4)
Telnet Access (activated on request)
SSH Access (activated on request)
Microsoft Frontpage 2000 Extensions (activated on request)
5 Databases with MySQL
CGI Shopping Cart
Custom CGI
Support for SSI
Perl
C, C++
 GCC


--- End Message ---
--- Begin Message ---
PHP can fork but the docs say not to do it in a web server environment.
basically, it's only usable on *nix machines and in a shell scripting
environment.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: Matthew Walker [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 13, 2002 10:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple Threads?


I don’t remember the name of the module offhand, but once upon a time, I
used a perl module that would fork multiple threads so that you could
execute several web queries at the same time. This saved a lot of time,
if, for instance, you had to get information from UPS, FedEx, and the
USPS about shipping rates to display on a page. If you had to query them
one at a time, the delay would be unacceptable. However, with that perl
module, you could query them all at the same time, making it much
faster.

Does anyone know if such a thing exists for PHP?

Matthew Walker
Senior Software Engineer
ePliant Marketing


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002


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


--- End Message ---
--- Begin Message ---
Hello All,
IF you are using mySQL database then the php manual indicates you can run multiple 
connections. Presumably you could execute several web queries at the same time, each 
with its own connection. I haven't tried such, but the manual suggests it is possible:

http://www.php.net/manual/en/function.mysql-connect.php

"If a second call is made to mysql_connect() with the same arguments, no new link will 
be established, but instead, the link identifier of the already opened link will be 
returned. The new_link parameter modifies this behavior and makes mysql_connect() 
always open a new link, even if mysql_connect() was called before with the same 
parameters. 
Note: The new_link parameter became available in PHP 4.2.0 
 "


Kind Regards,

Richard Creech
[EMAIL PROTECTED]
250.744.3350 Pacific Time Canada
Dreamriver Software Powers the Net
http://www.dreamriver.com

"Matthew Walker" <[EMAIL PROTECTED]> wrote:

I don’t remember the name of the module offhand, but once upon a time, I
used a perl module that would fork multiple threads so that you could
execute several web queries at the same time. This saved a lot of time,
if, for instance, you had to get information from UPS, FedEx, and the
USPS about shipping rates to display on a page. If you had to query them
one at a time, the delay would be unacceptable. However, with that perl
module, you could query them all at the same time, making it much
faster.
 
Does anyone know if such a thing exists for PHP?
 
Matthew Walker
Senior Software Engineer
ePliant Marketing
 

--- End Message ---
--- Begin Message ---
Won't work for web connections, because it waits for each connection to
complete before running the next one.

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-----Original Message-----
From: Richard Creech [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, April 14, 2002 1:46 PM
To: [EMAIL PROTECTED]
Cc: Matthew Walker
Subject: Re: Multiple Threads?

Hello All,
IF you are using mySQL database then the php manual indicates you can
run multiple connections. Presumably you could execute several web
queries at the same time, each with its own connection. I haven't tried
such, but the manual suggests it is possible:

http://www.php.net/manual/en/function.mysql-connect.php

"If a second call is made to mysql_connect() with the same arguments, no
new link will be established, but instead, the link identifier of the
already opened link will be returned. The new_link parameter modifies
this behavior and makes mysql_connect() always open a new link, even if
mysql_connect() was called before with the same parameters. 
Note: The new_link parameter became available in PHP 4.2.0 
 "


Kind Regards,

Richard Creech
[EMAIL PROTECTED]
250.744.3350 Pacific Time Canada
Dreamriver Software Powers the Net
http://www.dreamriver.com

"Matthew Walker" <[EMAIL PROTECTED]> wrote:

I don’t remember the name of the module offhand, but once upon a time, I
used a perl module that would fork multiple threads so that you could
execute several web queries at the same time. This saved a lot of time,
if, for instance, you had to get information from UPS, FedEx, and the
USPS about shipping rates to display on a page. If you had to query them
one at a time, the delay would be unacceptable. However, with that perl
module, you could query them all at the same time, making it much
faster.
 
Does anyone know if such a thing exists for PHP?
 
Matthew Walker
Senior Software Engineer
ePliant Marketing
 



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002
 
--- End Message ---
--- Begin Message ---
At 9:25 PM -0600 13/4/02, Matthew Walker wrote:

>I don't remember the name of the module offhand, but once upon a time, I
>used a perl module that would fork multiple threads so that you could
>execute several web queries at the same time. This saved a lot of time,
>if, for instance, you had to get information from UPS, FedEx, and the
>USPS about shipping rates to display on a page. If you had to query them
>one at a time, the delay would be unacceptable. However, with that perl
>module, you could query them all at the same time, making it much
>faster.

You could system() or shell_exec() an external program/script which
forked off 3 children to perform the queries. You would then need to
parse the script output for the data you need. system() would require
you to capture the script output via output buffering.

If you want to use a CGI version of PHP as the external program the
functions described at http://www.php.net/manual/en/ref.pcntl.php are
what you need.

This is a very neat idea. I hope I remember this when I need it :)

 ...R.
--- End Message ---
--- Begin Message ---
What would be the best way to make a set of variables
available to all visitors?

example: 
if I stick all variables in a separate file and
include - include(settings.php); - that works fine.
seems that this is a lot of overhead to include these
on every page. These variables would never change
(they basically turn an alpha string into numeric to
speed up queries.) I don't think hard coding would be
a great solution either... 

simplified example:
one set of variables to be included on all pages refer
to the article type - i would like to use urls that
make sense to the visitor rather than number strings
so - 
$article_type = array("news" => 1,"opinion" =>
2,"finance" => 3);

Maybe it would be best to simply query for WHERE
article_type = 'news' etc.

Thanks much,
olinux


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
--- End Message ---
--- Begin Message ---
Actually, if they are static variables that rarely or never change, I would
stick with the include file.  It's faster than making a database connection
and selecting them.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-----Original Message-----
From: olinux [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 14, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] make a set of variables available to all visitors?


What would be the best way to make a set of variables
available to all visitors?

example:
if I stick all variables in a separate file and
include - include(settings.php); - that works fine.
seems that this is a lot of overhead to include these
on every page. These variables would never change
(they basically turn an alpha string into numeric to
speed up queries.) I don't think hard coding would be
a great solution either...

simplified example:
one set of variables to be included on all pages refer
to the article type - i would like to use urls that
make sense to the visitor rather than number strings
so -
$article_type = array("news" => 1,"opinion" =>
2,"finance" => 3);

Maybe it would be best to simply query for WHERE
article_type = 'news' etc.

Thanks much,
olinux


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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


--- End Message ---
--- Begin Message ---
Hi,
  I'm not sure if this belongs to JavaScript or PHP section.  I'm
running into problems when I'm trying to use php templates with embeded
JavaScript.
  In my template file, I have something like...

<script language="JavaScript">
....

function Show()
{
  if(layer) {
   if(timer) {
     clearTimeout(timer);
   }
   for(menu=0; menu<Layer.length; menu++) {
      if(Layer[menu]) {
        eval(layer).visibility = "hidden";
      }
   }
    for(i=0; i<arguments.length; i++) {
     menu=arguments[i];
    eval(layer).visibility = "visible";
    }
  }
}
....
</script>

  When I instantiate the template in my PHP file and do a view source, I
get this instead:

<script language="JavaScript">
....

function Show()

   for(menu=0; menu<Layer.length; menu++)
   }
    for(i=0; i<arguments.length; i++)
  }
}
....
</script>


As you can see, the all the 'if' statements are missing?  Why is that?

Thanks,
-Peter



--- End Message ---
--- Begin Message ---
I am displaying a folder tree and want to alternate the colors for each
folder so my database table shows that for example the Apples folder is
located under the Fruits folder.  Therefore I want to know which row is odd
or even so I can assign it different colors.  Incidently, does anyone know
of a more efficient way of displaying a folder tree without doing it
recursively?

id parent_id name
== ========= =======
1      1     Home
2      1     Products
3      2     Fruits
4      2     Vegetables
5      3     Apples


function build_folder_tree(&$output, $parent=1, $indent="")
{
  $qid = mysql_query("SELECT id, name FROM folders WHERE parent_id =
$parent");

  while ($cat =  mysql_fetch_object($qid))
  {
    $output .= $cat->name + $indent; // here is where I want to assign diff.
colors
    if ($cat->id != $parent)
      build_folder_tree($output, $cat->id, $indent."&nbsp;&nbsp;");
  }
}

-----Original Message-----
From: John Simpson [mailto:[EMAIL PROTECTED]]
Sent: April 14, 2002 7:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Need row number from database select


If you know you're looking for Bob or Mike or John, you could select the
rows each time in your loop as an associative array.

mysql_fetch_array(result, MYSQL_ASSOC)

will do the trick.

"Sp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> If this is my database result from a select then I need to know that Bob
is
> the 1st result, Mike is the 2nd result and John is the 3rd result ...
>
> Name     Address
> ======== ===============
> Bob      121 King St.
> Mike     99 Main St.
> John     8433 Albert St.
>
> Does mysql keep track of this?  I know I could just do a $i++ as I loop
> through the results but I'm doing something recursively so the counter
> doesn't work here.
>
>



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


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I am displaying a folder tree and want to alternate the colors for each
> folder so my database table shows that for example the Apples folder is
> located under the Fruits folder.  Therefore I want to know which row is odd
> or even so I can assign it different colors.  Incidently, does anyone know
> of a more efficient way of displaying a folder tree without doing it
> recursively?
> 
> id parent_id name
> == ========= =======
> 1      1     Home
> 2      1     Products
> 3      2     Fruits
> 4      2     Vegetables
> 5      3     Apples
> 
> 
> function build_folder_tree(&$output, $parent=1, $indent="")
> {
>   $qid = mysql_query("SELECT id, name FROM folders WHERE parent_id =
> $parent");
> 
>   while ($cat =  mysql_fetch_object($qid))
>   {
>     $output .= $cat->name + $indent; // here is where I want to assign diff.
> colors
>     if ($cat->id != $parent)
>       build_folder_tree($output, $cat->id, $indent."&nbsp;&nbsp;");
>   }
> }

Well, you don't need to know what row number is. Something like:

function build_folder_tree(&$output, $parent=1, $indent="")
{
$color = "red"; // Set var to first option

  $qid = mysql_query("SELECT id, name FROM folders WHERE parent_id =
 $parent");

  while ($cat =  mysql_fetch_object($qid))
  {
    $output .= $cat->name + $indent; // here is where I want to assign 
diff. colors
  $color == "red" ? $color = "blue": $color = "red"; // Cycle color for 
each iteration
 
    if ($cat->id != $parent)
      build_folder_tree($output, $cat->id, $indent."&nbsp;&nbsp;");
  }
}



-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Thank's Oliver,
now i have come up to this: <?
print ("<a href=german$PHP_SELF>link german</a>");
?>
and this seems to work as long as i add these php tags inside html, but how
do i insert this inside my array which is in the .js format (javascript) ?
any ideas that could help me? or would you need to look at the array?

thank you.
regards
coo

Btw. excuse the question but what means HTH in the end of our reply?
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
At 13.04.2002  12:04, you wrote:
>hi folks,
>i am somewhat like a new newbie, just read my first php tutorial, installed
>an apache server on my windows and php on top for testing , first question
>is : is this the right place for me here to ask questions or is this
>newsgroup rather for advanced users?

You´re welcome here, if your questions related to php. If there are specific
php-windows questions, you should ask them on the windowsPHP list.


>second question is my task i want to complete in PHP :
>
>i have an array for a dhtml navigation menu for my site. all the links are
>"hard coded" inside the array and are , of course , the same for the whole
>site EXCEPT for the language selection.
>
>now, for example, i am on a page called about.php, i am clicking on the
link
>for the german version and a page called german/about.php should be
>retrieved. same for spanish.
>
>now, what do i do?
>i have found a php snippet that reads the current url <?php
>
>$filelocation=$HTTP_HOST.$PHP_SELF;
>echo($filelocation);?>
>
>but can i use this somehow and how do i do that?

You can shorten this :
echo "<a href="'$HTTP_HOST."/german/".$PHP_self.'">German</a>';
echo "<a href="'$HTTP_HOST."/spanish/".$PHP_self.'">Espanol</a>';
but it should be enough if you use
echo "<a href="'german/".$PHP_self.'">German</a>';
assuming that this dir/page is locatet in the root of your vserver.
HTH Oliver



--- End Message ---
--- Begin Message ---
At 14.04.2002  14:55, you wrote:
>Thank's Oliver,
>now i have come up to this: <?
>print ("<a href=german$PHP_SELF>link german</a>");
>?>

echo '<a href="german/'.$PHP_SELF.'/link german</a>");
It should like this, but I don´t know your encironment, so I put some "/" in
hope you get it fixed
or if you want to cat these vars to a new word
$link = "german".$PHP_SELF."link german";
echo '<a href="'.$link.'">FOO</a>");

>and this seems to work as long as i add these php tags inside html, but how
>do i insert this inside my array which is in the .js format (javascript) ?
>any ideas that could help me? or would you need to look at the array?

Maybe you´re mixin´up two things, where php is enough.
But as I cannot know whats in your JavaScript, I can give you only a hint.
Your JavaScript should be echoed also, To avoid conficts with java´s "'"
you should escape them and/or the " .
so it would look like
echo " some javacode \' (foo)\' ";
And as another hint "JavaScript" is client-side while PHP is serverside.
You´re just delivering a page to the clients browser.
HTH Oliver



>Btw. excuse the question but what means HTH in the end of our reply?

Hope this helps

><[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>At 13.04.2002  12:04, you wrote:
> >hi folks,
> >i am somewhat like a new newbie, just read my first php tutorial, installed
> >an apache server on my windows and php on top for testing , first question
> >is : is this the right place for me here to ask questions or is this
> >newsgroup rather for advanced users?
>
>You´re welcome here, if your questions related to php. If there are specific
>php-windows questions, you should ask them on the windowsPHP list.
>
>
> >second question is my task i want to complete in PHP :
> >
> >i have an array for a dhtml navigation menu for my site. all the links are
> >"hard coded" inside the array and are , of course , the same for the whole
> >site EXCEPT for the language selection.
> >
> >now, for example, i am on a page called about.php, i am clicking on the
>link
> >for the german version and a page called german/about.php should be
> >retrieved. same for spanish.
> >
> >now, what do i do?
> >i have found a php snippet that reads the current url <?php
> >
> >$filelocation=$HTTP_HOST.$PHP_SELF;
> >echo($filelocation);?>
> >
> >but can i use this somehow and how do i do that?
>
>You can shorten this :
>echo "<a href="'$HTTP_HOST."/german/".$PHP_self.'">German</a>';
>echo "<a href="'$HTTP_HOST."/spanish/".$PHP_self.'">Espanol</a>';
>but it should be enough if you use
>echo "<a href="'german/".$PHP_self.'">German</a>';
>assuming that this dir/page is locatet in the root of your vserver.
>HTH Oliver

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

> Is there an easier way than having to manually place "global" 
> in each function...??

It's not that hard :)

> Other than passing by parameter?
> 
> Like is it possible to actually declare var's in PHP 
> as global?

No.  Consider arrays, constants, extract(), etc.


Regards,
Philip

--- End Message ---
--- Begin Message ---
When I install php after installing the IIS under win2k
The setup said " Due to missing OCX control , the automatic configuration
can not be done. " ...........-_-
how can I fix this problem?
I dont have this problem before, but after formatting my hard drive and
reinstall win2k
this appear.....
plz help!
(Dont tell me to config myself, I tried so many time and spend too many
hrs...but failed!)

__________________________________________________________________ ¦èªù³½
SeeMon Simonk ICQ#: 25943733 Current ICQ status: + More ways to contact me i
See more about me:
__________________________________________________________________


--- End Message ---
--- Begin Message ---
When I install php after installing the IIS under win2k
The setup said " Due to missing OCX control , the automatic configuration
can not be done. " ...........-_-
how can I fix this problem?
I dont have this problem before, but after formatting my hard drive and
reinstall win2k
this appear.....
plz help!
(Dont tell me to config myself, I tried so many time and spend too many
hrs...but failed!)
__________________________________________________________________


--- End Message ---
--- Begin Message ---
Hello,

 I;m looking for such a script.

 1.Users signup.
 2.One are sellers and other buyers.
 3.Buyer ask via form a question
 4.Question is send to all buyers.
 5.They respond (buyers)
 6.User who asked a quesition choose the best answer and has option to view
user data.

Or a script that i can transform to such a job.


Thx for your help.
Teqilman

--- End Message ---
--- Begin Message ---
I'm trying to get my code to print out a "sorry - no results" message if
there is no match. I've read the If statement in the PHP manual
(http://www.php.net/manual/ro/control-structures.php#control-structures.if)

and

I think my code structure may be wrong.. am I wrong to nest it this way in
the following code? If so, where should I be putting the " if $sql returns 0
records, then print.." code?

while ($row = mysql_fetch_array($sql_result)) {
 if ($sql_result = 0) {
  $option_block .= "Sorry, your search has resulted in 0 records. Please try
again. \n";
  }
 else {
  $advocateID = $row["advocateID"];
  $esc_fname = $row["FNAME"];
  $esc_lname = $row["LNAME"];
  $esc_firm = $row["FIRM"];
  $esc_city = $row["CITY"];
  $esc_province = $row["PROVINCE"];
  $esc_area = $row["AREA"];

  // strips out special characters before output.
  $fname = stripslashes($esc_fname);
  $lname = stripslashes($esc_lname);
  $firm = stripslashes($esc_firm);
  $city = stripslashes($esc_city);
  $province = stripslashes($esc_province);
  $area = stripslashes($esc_area);

  $option_block .= "<li><b>Name:</b> <a
href=\"advocate_details.html?sel_advocateID=$advocateID\">$fname
$lname</a><br><b>Firm/Organization:</b> $firm<br><b>Location:</b> $city,
$province<br><b>Specialty:</b> $area<br>&nbsp;</li>\n";
  }
 }


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> I'm trying to get my code to print out a "sorry - no results" message if
> there is no match. I've read the If statement in the PHP manual
> (http://www.php.net/manual/ro/control-structures.php#control-structures.if)
> 
> and
> 
> I think my code structure may be wrong.. am I wrong to nest it this way in
> the following code? If so, where should I be putting the " if $sql returns 0
> records, then print.." code?
> 
> while ($row = mysql_fetch_array($sql_result)) {
>  if ($sql_result = 0) {
>   $option_block .= "Sorry, your search has resulted in 0 records. Please try
> again. \n";
>   }
>  else {

Firstly, $sql_result insn't the value to check and secondly you should do 
it before you start the while loop.

Do your query to the DB, then check mysql_num_rows. If it is zero, print 
the error message; otherwise go into the while loop to display your 
results.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hi,

I've rewritten the code to:

// Sends the Query
$sql_result = mysql_query($sql);
if (!$sql_result) {
   echo "Can't execute $sql " . mysql_error();
   exit;
 }
if (mysql_num_rows($sql_result) == 0) {
 $option_block .= "Sorry, your search has resulted in 0 records. Please try
again. \n";
 }

// organizes data in an orderly manner (ie bulleted area)

while ($row = mysql_fetch_array($sql_result)) {
 $advocateID = $row["advocateID"];
 $esc_fname = $row["FNAME"];
 $esc_lname = $row["LNAME"];
 $esc_firm = $row["FIRM"];
 $esc_city = $row["CITY"];
 $esc_province = $row["PROVINCE"];
 $esc_area = $row["AREA"];
 ....

and it works beautifully! Thanks for pointing me to the clue!

"David Robley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> says...
> > I'm trying to get my code to print out a "sorry - no results" message if
> > there is no match. I've read the If statement in the PHP manual
> >
(http://www.php.net/manual/ro/control-structures.php#control-structures.if)
> >
> > and
> >
> > I think my code structure may be wrong.. am I wrong to nest it this way
in
> > the following code? If so, where should I be putting the " if $sql
returns 0
> > records, then print.." code?
> >
> > while ($row = mysql_fetch_array($sql_result)) {
> >  if ($sql_result = 0) {
> >   $option_block .= "Sorry, your search has resulted in 0 records. Please
try
> > again. \n";
> >   }
> >  else {
>
> Firstly, $sql_result insn't the value to check and secondly you should do
> it before you start the while loop.
>
> Do your query to the DB, then check mysql_num_rows. If it is zero, print
> the error message; otherwise go into the while loop to display your
> results.
>
> --
> David Robley
> Temporary Kiwi!
>
> Quod subigo farinam


--- End Message ---
--- Begin Message ---
hey ppl,

I need to create some fairly complex graphs dynamically, and I need to be
able to specify line, bar, or pie charts. Are there any PHP packages that
someone could point me to that would fill my needs. Thanks


--- End Message ---
--- Begin Message ---
Don't know if anyone can help me with this one:

It's not directly a PHP question -- but maybe someone knows the fix?

I have a form, when the user presses the submit button, I pass the form vars
to my PHP checkform.php script -- which checks all the fields to make sure
the user entered the correct values -- if the user missed something, then
they are passed to my error page, which lists out the fields they need
fix -- ideally, i would like them to press their browsers BACK button to
return to the form, instead of reloading all their session data back into
the form with a submit button on the error page -- too much data.

So, in Netscape, when a user presses their BACK button all the fields are
filled in just as they were filled in ... including the password field.
However, in Internet Explorer, when the user presses their BACK button, all
fields are good EXCEPT the password fields, which are bank ... so the user
is forced to reenter their password info -- kinda annoying.

Is there a HEADER or something or an IE fix anyone knows of that will force
IE not to delete the password info in this manner?

Thanks.
Jason


--- End Message ---

Reply via email to