php-general Digest 3 Mar 2002 09:24:55 -0000 Issue 1204

Topics (messages 86918 through 86964):

Re: Where can I learn?
        86918 by: Boaz Yahav

Re: BBEdit
        86919 by: Boaz Yahav

Re: regex
        86920 by: Boaz Yahav

Returning error code from a function
        86921 by: Anas Mughal
        86927 by: DL Neil
        86955 by: Greg Donald

PHP4.1.2
        86922 by: Thomas Holton
        86925 by: Rasmus Lerdorf
        86929 by: Thomas Holton

Looking For Some Help
        86923 by: Josiah Wallingford
        86928 by: Josiah Wallingford

Re: PHP Help
        86924 by: Keith

Cannot compile PHP with APXS
        86926 by: Andrey Hristov

Re: php 4.1.1 vs 4.0.6
        86930 by: Scott Brown
        86931 by: Rasmus Lerdorf
        86933 by: Scott Brown
        86940 by: Rasmus Lerdorf

Re: fopen
        86932 by: DL Neil
        86934 by: Demitrious S. Kelly

PHP - Tutorial
        86935 by: Josiah Wallingford
        86938 by: Jeff Oien
        86939 by: Craig Westerman

cursor focus
        86936 by: Ralph Jarvis
        86948 by: Gaylen Fraley

Checking how many users are logged in?
        86937 by: Leif K-Brooks
        86954 by: Greg Donald

Web Cam Support
        86941 by: karthikeyan
        86942 by: Rasmus Lerdorf

Re: Sending a file with fpassthru() or readfile(), causes IE to hang.
        86943 by: Rasmus Lerdorf

A Small Bug Giving Me A Big Headache
        86944 by: Dr. Shim
        86945 by: Rasmus Lerdorf
        86947 by: Dr. Shim

How-to start a file download?
        86946 by: Ed Fair Jr.

headers showing up in browser using PHP as CGI handler
        86949 by: Matthew Scott

CheckBoxes....
        86950 by: Ben Turner
        86951 by: Jeff Sheltren
        86952 by: GENESiS DESiGNS
        86953 by: Ben Turner

Re: compile php with GD2
        86956 by: David Robley

Each() behaving different with PHP 4.1.2
        86957 by: Greg Breland
        86964 by: Yasuo Ohgaki

Re: Bizarre mail() problem
        86958 by: andy thomas

4.1.2 transitional blues
        86959 by: cyberskydive
        86960 by: Rasmus Lerdorf

Help with the PHP patch.
        86961 by: GENESiS DESiGNS

Apache & PHPMyAdmin
        86962 by: jtjohnston

Re: How to generate an broun & white JPG with GD
        86963 by: Tom Rogers

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://www.weberdev.com

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-----Original Message-----
From: Sean Kennedy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 1:26 PM
To: [EMAIL PROTECTED]
Subject: Re: Re: [PHP] Where can I learn?


Thank you Simon.

-Sean
-http://www.gdesigns.vcn.com

----- Original Message -----
From: "Simon Willison" <[EMAIL PROTECTED]>
To: "Sean Kennedy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 28, 2002 4:20 AM
Subject: Re: [PHP] Where can I learn?


> Sean Kennedy wrote:
>
> >I know the basic basics of PHP that I learned from the PHP 4 Bible
book,
but I
> >would like to learn ALOT more. I'm going to continue in my book, but
does
> >anyone have a suggestion on where to learn more?
> >
> Read EVERY article in the archive of www.phpbuilder.com - it'll take a
> while but you'll learn a huge amount about PHP. www.zend.com and
> www.devshed.com also have some great articles for learning more about
PHP.
>
>
> --
> 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

--- End Message ---
--- Begin Message ---
And I also suggest you BACKUP!!! :)

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-----Original Message-----
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 7:35 AM
To: Josiah Wallingford; PHP General
Subject: Re: [PHP] BBEdit


Yep sure is!  Just use a grep multi-file replace in BBEdit, and you'll
have
it! :)  Just do some tests first with the grep to make sure you have it
right before you edit all those pages :)

Rick

Once my heart was captured, reason was shown the door, deliberately and
with
a sort of frantic joy. I accepted everything, I believed everything,
without
struggle, without suffering, without regret, without false shame. How
can
one blush for what one adores? - George Sand

> From: Josiah Wallingford <[EMAIL PROTECTED]>
> Date: Wed, 27 Feb 2002 22:30:36 -0700
> To: [EMAIL PROTECTED]
> Subject: [PHP] BBEdit
> 
> I have a website with about 300 different pages. Each of those pages
has
> a different <title>description</title>. I need to replace all of those
> with one <title>description</title>. Is there a way to replace all
> things within two different tags?
> 
> 
> -- 
> 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

--- End Message ---
--- Begin Message ---
Maybe this can help :


pick up an array of variables from a query string such as:
http://www.archipro.com/test.php?state=AB&state=BC 

http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=3265

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.



-----Original Message-----
From: Paul A. Procacci [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 4:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex


Hey all,
   I'm been programming in php for a while, but I'm stumpt with this 
one.  You know the funny thing?  It's probably really simple.  Anyway 
here it is.  Assume I have this query string:

ticket_id=3&change_name=status&change_value=3&ticket_id=3&2=&1=&

And all I want is 2=&1=&.  Well, the closest I came was :

$string = preg_replace("/[^0-9]+\=/", "", $QUERY_STRING);  Assuming 
QUERY_STRING was the data.

Please help

Thanks Much,
Paul



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

--- End Message ---
--- Begin Message ---
I am wondering if someone could shed some light on
this aspect of PHP. It might be something obvious, but
I am not able to figure it out.

I have a function that returns a dynamically generated
HTML string. However, I need a way to let the caller
know if that function has failed. One way I thought
of, is to have an empty return:

  return; 

hoping that I could check for isset(). However, isset
reports "1". (In the C world, I could easily check for
NULL.)
Is there a way in PHP to return a failure flag back to
the caller? (Of course, I could use an argument as a
success flag. But, I am wondering if there is a way to
do it in the return variable.)

Thank you in advance.

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com
--- End Message ---
--- Begin Message ---
Anas,

> I am wondering if someone could shed some light on
> this aspect of PHP. It might be something obvious, but
> I am not able to figure it out.
>
> I have a function that returns a dynamically generated
> HTML string. However, I need a way to let the caller
> know if that function has failed. One way I thought
> of, is to have an empty return:
>
>   return;
>
> hoping that I could check for isset(). However, isset
> reports "1". (In the C world, I could easily check for
> NULL.)
> Is there a way in PHP to return a failure flag back to
> the caller? (Of course, I could use an argument as a
> success flag. But, I am wondering if there is a way to
> do it in the return variable.)


You could try:

return FALSE;

Remember that an IF condition can use == for 'same value' or === for
'same value and same type'.
NB I do not recommend/condone the use of a single variable/return value
to represent multiple data types, but if you're going to do it, this is
about the best mechanism.

Regards,
=dn

--- End Message ---
--- Begin Message ---
On Sat, 2 Mar 2002, Anas Mughal wrote:

>I am wondering if someone could shed some light on
>this aspect of PHP. It might be something obvious, but
>I am not able to figure it out.
>
>I have a function that returns a dynamically generated
>HTML string. However, I need a way to let the caller
>know if that function has failed. One way I thought
>of, is to have an empty return:
>
>  return;
>
>hoping that I could check for isset(). However, isset
>reports "1". (In the C world, I could easily check for
>NULL.)
>Is there a way in PHP to return a failure flag back to
>the caller? (Of course, I could use an argument as a
>success flag. But, I am wondering if there is a way to
>do it in the return variable.)

i would use something like

if(strlen($get_html())>0)
        //do something
else
        // do nothing


-- 
-----------------------------------------------------------------------
Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
-----------------------------------------------------------------------


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

Hello,
I upgraded my PHP to 4.1.2 from 4.0.6.

Now, twig, which uses imap, does not work.... just returns a popup that
says the document contained no data.
I have checked other applications using php and they all seem fine. Also,
pine, which uses the imap, is functioning normally as well.

There was 1 difference in my configuration this time around from January
when i built the 4.0.6:

config: ... --with-imap

this time: 4.1.2:

config ... --with-imap-ssl

The configuration forced me to use this option instead of just imap. I am
 running openssl-0.9.6b, but i was also running this last time and
apache's virtual host for the ssl is where twig is located and it worked
perfectly last time with just --with-imap.

Anyone have any ideas or similar problems?

thanks in advance!


--- End Message ---
--- Begin Message ---
> Anyone have any ideas or similar problems?

I just built a server yesterday for IMP.  My PHP configure line was:

'./configure' \
'--with-pdflib=/usr/local' \
'--with-gd=/home/rasmus/gd-2.0.1' \
'--with-jpeg-dir=/usr' \
'--with-freetype-dir=/usr' \
'--enable-gd-native-ttf' \
'--enable-gd-imgstrttf' \
'--with-jpeg-dir=/usr' \
'--with-png-dir=/usr' \
'--with-xpm-dir=/usr/X11R6' \
'--enable-exif' \
'--with-config-file-path=/etc' \
'--enable-debug' \
'--with-mysql=/usr' \
'--enable-inline-optimization' \
'--with-pgsql=/usr' \
'--with-zlib-dir=/usr' \
'--with-expat=/usr' \
'--enable-xslt' \
'--with-xslt-sablot=/usr' \
'--with-imap' \
'--with-gettext' \
'--with-kerberos' \
'--with-imap-ssl' \
'--with-mcrypt=/usr/local' \
'--with-ldap' \
'--with-pspell' \
'--with-apxs=/usr/sbin/apxs'

It worked fine.  So imap-ssl here as well.  So it definitely isn't a
general problem with it not working at all.  Must be something subtle.
You did a full rm config.cache && make clean?  Or started with a fress
tarball?  Do you have SSL linked into your Apache server?  If so, is it
the same version of SSL linked in there?  You might be able to tell with
'ldd'

-Rasmus

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

Thanks, I redid the configure with BOTH imap and imap-ssl
It now shows up in the phpinfo.
I now have another problem when the login is being deneid because of a bad
password, but this is a different problem. prob. not to do with php.
By the way, the system i am on is alpha OSF4.1.
thanks for your help


On Sat, 2 Mar 2002, Rasmus Lerdorf wrote:

> > Anyone have any ideas or similar problems?
>
> I just built a server yesterday for IMP.  My PHP configure line was:
>
> './configure' \
> '--with-pdflib=/usr/local' \
> '--with-gd=/home/rasmus/gd-2.0.1' \
> '--with-jpeg-dir=/usr' \
> '--with-freetype-dir=/usr' \
> '--enable-gd-native-ttf' \
> '--enable-gd-imgstrttf' \
> '--with-jpeg-dir=/usr' \
> '--with-png-dir=/usr' \
> '--with-xpm-dir=/usr/X11R6' \
> '--enable-exif' \
> '--with-config-file-path=/etc' \
> '--enable-debug' \
> '--with-mysql=/usr' \
> '--enable-inline-optimization' \
> '--with-pgsql=/usr' \
> '--with-zlib-dir=/usr' \
> '--with-expat=/usr' \
> '--enable-xslt' \
> '--with-xslt-sablot=/usr' \
> '--with-imap' \
> '--with-gettext' \
> '--with-kerberos' \
> '--with-imap-ssl' \
> '--with-mcrypt=/usr/local' \
> '--with-ldap' \
> '--with-pspell' \
> '--with-apxs=/usr/sbin/apxs'
>
> It worked fine.  So imap-ssl here as well.  So it definitely isn't a
> general problem with it not working at all.  Must be something subtle.
> You did a full rm config.cache && make clean?  Or started with a fress
> tarball?  Do you have SSL linked into your Apache server?  If so, is it
> the same version of SSL linked in there?  You might be able to tell with
> 'ldd'
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hell all,
I need a project done shortly and have already talked to some people 
about this project who can offer me the services but I am interested in 
all of your thoughts of scripts that already exist or you are willing to 
build.
Attached is an overview of what I need.
--- End Message ---
--- Begin Message ---
Hello,
Sorry about that last email apparently you cannot attach items to this 
list.
I need a project done shortly and have already talked to some people 
about this project who can offer me the services but I am interested in 
all of your thoughts of scripts that already exist or you are willing to 
build.
Take a look at what I need
www.josiahw.com/design.htm

--- End Message ---
--- Begin Message ---
You aren't going to be able to build a php application with frontpage or
any other WYSIWYG HTML editor. You are going to have to type it out, the
PHP that is. If this is something that you need done right away, I suggest
you hire an experienced PHP programmer. If you don't know much about MySQL
or PHP you aren't going to be able to build anything worthwhile, at least
not in the next 3 months.

 On Sat, 2 Mar 2002, Josiah Wallingford wrote:

> I do not know very much about MySql or PHP but need to build a pretty
> complex database and script. I need a program like (I hate to say this)
> Front Page or UltraDev that will allow me to do it visually. I am on a
> Mac but can run the software on a PC. I hate Front Page so I hope nobody
> says that. Anybody know of anything like that? I have the whole project
> in my head and can explain it in detail if I need to. If this program is
> written in php that would be awsome!
> Thanks.
>
>
>

-- 
K E I T H  V A N C E
Software Programmer
http://www.vanceconsulting.net
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Untared php 4.1.1 into /usr/local/src/php4.1.1
Untared apache 1.3.22 into /usr/local/src/apache-1.3.22
ran ./configure in apache
there is /var/www/bin/apxs
When configuring php : ./configure --with-mysql --with-apxs=/var/www/bin/apxs 
--with-xml
error occurs that says either perl is not installed(but it is) or Apache was not 
compiled with DSO support(I built one with DSO) or
apxs is not in the path but an output from "apxs" is shown.
What to do?

BTW I don't know how but succeeded to compile Apache with mod_php4.c(static module). 
Added AddType in /etc/httpd/conf/httpd.conf but
apache do not recognize .php files.

TIA

Andrey

--- End Message ---
--- Begin Message ---
So - to confirm...

If upgrading from a 4.0.x up to a 4.1.x version, putting register_globals =
on in the /etc/php.ini will ensure that old code continues to run.

But in the long term (ie, in some future php version), the $HTTP_* vars will
no longer be supported.


Is this correct?



> -----Original Message-----
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: February 23, 2002 12:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: php 4.1.1 vs 4.0.6
>
>
> In 4.1.x series there are new vars (global scope)
> $_GET,$_POST,$_COOKIE,$_FILES,$_SESSION
> not available in 4.0.x versions. For old scripts could be
> problem that register_globals is off in the 4.1.x tree(for new
> installations, not upgrades). But this is for good.
>
> Regards,
> Andrey Hristov
>

--- End Message ---
--- Begin Message ---
You will always be able to turn register_globals on.  Completely removing
that feature would make it impossible to ever run a lot of code written
for PHP.  Some will argue that this is a good thing, but ultimately it is
not for us to say.

When you turn register_globals on, $HTTP_* do not disappear.  What changes
is that the various Environment, Get, Post, Cookie, Server variables are
not automatically injected into the global symbol table.  You will have to
access them through either $HTTP_*_VARS['var_name'] or $_*['var_name'].
In the second case that would be $_ENV['var_name'], for example.

-Rasmus

On Sat, 2 Mar 2002, Scott Brown wrote:

> So - to confirm...
>
> If upgrading from a 4.0.x up to a 4.1.x version, putting register_globals =
> on in the /etc/php.ini will ensure that old code continues to run.
>
> But in the long term (ie, in some future php version), the $HTTP_* vars will
> no longer be supported.
>
>
> Is this correct?
>
>
>
> > -----Original Message-----
> > From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> > Sent: February 23, 2002 12:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Re: php 4.1.1 vs 4.0.6
> >
> >
> > In 4.1.x series there are new vars (global scope)
> > $_GET,$_POST,$_COOKIE,$_FILES,$_SESSION
> > not available in 4.0.x versions. For old scripts could be
> > problem that register_globals is off in the 4.1.x tree(for new
> > installations, not upgrades). But this is for good.
> >
> > Regards,
> > Andrey Hristov
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Thanks Rasmus,

But I'm not really sure I'm understanding.  Maybe if I make the question
simpler:

currently, I'm running 4.0.4pl1... and have:

variables_order         =       "EGPCS" ; This directive describes the order
in which PHP registers
register_globals        =       On              ; Whether or not to register
the EGPCS variables as global
                                                                ; not
require register_globals to be on;  Using form variables
register_argc_argv      =       On              ; This directive tells PHP
whether to declare the argv&argc

in the /etc/php.ini

I have a site that uses a $HTTP_POST_VARS['var_name'],
$HTTP_GET_VARS['var_name'] and $HTTP_SERVER_VARS['var_name'] all over the
place (there is more PHP in there than flat HTML :) and more than a handful
of references to $HTTP_USER_AGENT, $PHP_AUTH_*, $PHP_SELF, etc....

Is there anything I _have_ to do before installing the newly build server
with php 4.1.2 in order to retain a functional site???

Or is the site going to continue to work, but I should think hard about
moving to the new $_* variables before upgrading any more?



> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: March 2, 2002 6:51 PM
> To: Scott Brown
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Re: php 4.1.1 vs 4.0.6
>
>
> You will always be able to turn register_globals on.
> Completely removing
> that feature would make it impossible to ever run a lot of
> code written
> for PHP.  Some will argue that this is a good thing, but
> ultimately it is
> not for us to say.
>
> When you turn register_globals on, $HTTP_* do not disappear.
> What changes
> is that the various Environment, Get, Post, Cookie, Server
> variables are
> not automatically injected into the global symbol table.  You
> will have to
> access them through either $HTTP_*_VARS['var_name'] or
> $_*['var_name'].
> In the second case that would be $_ENV['var_name'], for example.
>
> -Rasmus
>
> On Sat, 2 Mar 2002, Scott Brown wrote:
>
> > So - to confirm...
> >
> > If upgrading from a 4.0.x up to a 4.1.x version, putting
> register_globals =
> > on in the /etc/php.ini will ensure that old code continues to run.
> >
> > But in the long term (ie, in some future php version), the
> $HTTP_* vars will
> > no longer be supported.
> >
> >
> > Is this correct?
> >
> >
> >
> > > -----Original Message-----
> > > From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> > > Sent: February 23, 2002 12:53 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: [PHP] Re: php 4.1.1 vs 4.0.6
> > >
> > >
> > > In 4.1.x series there are new vars (global scope)
> > > $_GET,$_POST,$_COOKIE,$_FILES,$_SESSION
> > > not available in 4.0.x versions. For old scripts could be
> > > problem that register_globals is off in the 4.1.x tree(for new
> > > installations, not upgrades). But this is for good.
> > >
> > > Regards,
> > > Andrey Hristov
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

--- End Message ---
--- Begin Message ---
> I have a site that uses a $HTTP_POST_VARS['var_name'],
> $HTTP_GET_VARS['var_name'] and $HTTP_SERVER_VARS['var_name'] all over the
> place (there is more PHP in there than flat HTML :) and more than a handful
> of references to $HTTP_USER_AGENT, $PHP_AUTH_*, $PHP_SELF, etc....
> Is there anything I _have_ to do before installing the newly build server
> with php 4.1.2 in order to retain a functional site???

Nope, these variables will be populated regardless of your
register_globals setting.

-Rasmus

--- End Message ---
--- Begin Message ---
Craig,

AFAIK you can't: fopen opens the file and leaves it up to you to read it
a character or some other chunk at a time, keeping what you want, and
leaving the rest. There is no concept of opening a file at a particular
character position, other than to write-over or write-append. (see
http://www.php.net/manual/en/function.fopen.php)

Regards,
=dn


> How can I use fopen to retrieve just one html table out of a whole web
page.
>
> I need to extract just this table (shown below) from this web page:
> http://quotes.nasdaq.com/quote.dll?page=multi&mode=stock&symbol=drooy
>
> Thanks Craig
> ***********************************************
>
> <table border="0" cellspacing="0" cellpadding="0" width="578">
>     <tr>
>  <td nowrap >
>      <table border="0" cellspacing="0" cellpadding="0" >
>   <tr>
>       <td align="left" width="100" rowspan="2" class="logoFont">
>    <img
>
src="http://a676.g.akamaitech.net/f/676/838/1h/nasdaq.com/logos/DROO.GIF
"
> border="0" align="absmiddle" height="40">&nbsp;
>       </td>
>       <td nowrap><font face="Arial, Helvetica, Verdana"
size="2"><b>Durban
> Roodeport Deep, Ltd.</b>&nbsp;DROOY</font></td>
>   </tr>
>   <tr>
>       <td width="247" align="right"><font face="Arial, Helvetica,
Verdana"
> size="2">Mar. 1, 2002&nbsp;Market Closed</font></td>
>   </tr>
>             </table>
>         </td>
>     </tr>
>     <tr>
>  <td nowrap>
>      <table border="0" cellpadding="0" cellspacing="0">
>   <tr>
>       <td nowrap width="85">Last Sale:</td>
>       <td align="right"
width="85"><nobr><b>$&nbsp;2.76</b></nobr></td>
>       <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
>       <td align="left" nowrap width="100">Net Change:</td>
>       <td align="right"><nobr><b>&nbsp;<font
color=".FF0000">0.02</font><img
>
src="http://a676.g.akamaitech.net/7/676/838/b801fe1d2351e8/nasdaq.com/im
ages
> /nc_down.gif" border="0" width="11"
> height="10"></b></nobr>&nbsp;<nobr><b>&nbsp;<font
> color="FF0000">0.72%</font></b> </nobr></td>
>       <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
>       <td rowspan="5" valign="top" align="left" nowrap>
>    <font face="Arial, Helvetica, Verdana" size="1">
>           <a
>
href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec
ted=
> DROOY%60&content=http://www.drd.co.za";><img
>
src="http://a676.g.akamaitech.net/f/676/838/1d/nasdaq.com/images/new_web
link
> s.gif" border="0"></a>&nbsp;&nbsp;<a
>
href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec
ted=
> DROOY%60&content=http://www.drd.co.za"; class="clsA">Web Site</a><br>
>    </font>
>       </td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Today's High:</td>
>       <td align="right"><nobr><b>$&nbsp;2.80</b></nobr></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Today's Low:</td>
>       <td align="right" nowrap ><nobr><b>$&nbsp;2.64</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Best Bid:</td>
>       <td align="right"
width="85"><nobr><b>$&nbsp;2.75</b></nobr></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Best Ask:</td>
>       <td align="right" nowrap><nobr><b>$&nbsp;2.76</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Volume:</td>
>       <td align="right" width="85"><b>1,551,300</b></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Previous Close:</td>
>       <td align="right" nowrap><nobr><b>$&nbsp;2.78</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap valign="top" width="85">Market:</td>
>       <td nowrap align="right" valign="top" width="85">Nasdaq-SCM</td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="200" align="left" valign="top"
> colspan="2"><b>American Depositary Shares</b></td>
>   </tr>
>      </table>
>
>
>

--- End Message ---
--- Begin Message ---
Heres a script I wrote to pull the top viruses from antivirus.com

Hope this helps...

<?php
$antivirus=file ('http://www.antivirus.com/');
unset($start);
unset($stop);
$count=0;
foreach($antivirus as $line) {
   if ( ! isset($stop) ) {
      if ( eregi('Top viruses', $line) ) {
       $start=$count;
      }
   }
   
   if ( isset($start) && ! isset($stop) ) {
      if ( $count > $start ) {
         if ( eregi('</table>', $line) ) {
            $stop=$count;
         }
      }
   }

   if ( ! isset($stop) ) { 
    $count++;
   }
}
$count=$start;
while ($count <= $stop ) {
   $data=str_replace('<', chr(10).'<', $antivirus[$count]);
   $data=str_replace('>', '>'.chr(10), $data);
   $data=explode(chr(10), $data);
   foreach($data as $line) {
      if ( !eregi('<.*>', $line) && trim($line) != '' && !eregi('<!--',
$line) && !eregi('\(.*\)', $line) ) {
         ?>
          <tr>
           <td bgcolor="#333333" align="center">
         <?php
         if ( $count != $start ) {
            echo '<a
href="http://216.33.22.211/vinfo/virusencyclo/default5.asp?VName=';
            echo eregi_replace("[0-9].......", '', trim($line));
            echo '" target="_blank">'.chr(10);
         } else { 
            echo '<font color="#FF0000">'.chr(10);
         }
         echo $line.chr(10);
         if ( $count != $start ) {
            echo '</a>'.chr(10);
         } else {
            echo '</font>'.chr(10);
         }
         echo '<br>'.chr(10);
         ?>
         </td></tr>
         <?php
      }
   }
   $count++;
}
?>
-----Original Message-----
From: DL Neil [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 02, 2002 3:54 PM
To: Craig Westerman; php-general-list
Subject: Re: [PHP] fopen

Craig,

AFAIK you can't: fopen opens the file and leaves it up to you to read it
a character or some other chunk at a time, keeping what you want, and
leaving the rest. There is no concept of opening a file at a particular
character position, other than to write-over or write-append. (see
http://www.php.net/manual/en/function.fopen.php)

Regards,
=dn


> How can I use fopen to retrieve just one html table out of a whole web
page.
>
> I need to extract just this table (shown below) from this web page:
> http://quotes.nasdaq.com/quote.dll?page=multi&mode=stock&symbol=drooy
>
> Thanks Craig
> ***********************************************
>
> <table border="0" cellspacing="0" cellpadding="0" width="578">
>     <tr>
>  <td nowrap >
>      <table border="0" cellspacing="0" cellpadding="0" >
>   <tr>
>       <td align="left" width="100" rowspan="2" class="logoFont">
>    <img
>
src="http://a676.g.akamaitech.net/f/676/838/1h/nasdaq.com/logos/DROO.GIF
"
> border="0" align="absmiddle" height="40">&nbsp;
>       </td>
>       <td nowrap><font face="Arial, Helvetica, Verdana"
size="2"><b>Durban
> Roodeport Deep, Ltd.</b>&nbsp;DROOY</font></td>
>   </tr>
>   <tr>
>       <td width="247" align="right"><font face="Arial, Helvetica,
Verdana"
> size="2">Mar. 1, 2002&nbsp;Market Closed</font></td>
>   </tr>
>             </table>
>         </td>
>     </tr>
>     <tr>
>  <td nowrap>
>      <table border="0" cellpadding="0" cellspacing="0">
>   <tr>
>       <td nowrap width="85">Last Sale:</td>
>       <td align="right"
width="85"><nobr><b>$&nbsp;2.76</b></nobr></td>
>       <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
>       <td align="left" nowrap width="100">Net Change:</td>
>       <td align="right"><nobr><b>&nbsp;<font
color=".FF0000">0.02</font><img
>
src="http://a676.g.akamaitech.net/7/676/838/b801fe1d2351e8/nasdaq.com/im
ages
> /nc_down.gif" border="0" width="11"
> height="10"></b></nobr>&nbsp;<nobr><b>&nbsp;<font
> color="FF0000">0.72%</font></b> </nobr></td>
>       <td width="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
>       <td rowspan="5" valign="top" align="left" nowrap>
>    <font face="Arial, Helvetica, Verdana" size="1">
>           <a
>
href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec
ted=
> DROOY%60&content=http://www.drd.co.za";><img
>
src="http://a676.g.akamaitech.net/f/676/838/1d/nasdaq.com/images/new_web
link
> s.gif" border="0"></a>&nbsp;&nbsp;<a
>
href="http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selec
ted=
> DROOY%60&content=http://www.drd.co.za"; class="clsA">Web Site</a><br>
>    </font>
>       </td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Today's High:</td>
>       <td align="right"><nobr><b>$&nbsp;2.80</b></nobr></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Today's Low:</td>
>       <td align="right" nowrap ><nobr><b>$&nbsp;2.64</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Best Bid:</td>
>       <td align="right"
width="85"><nobr><b>$&nbsp;2.75</b></nobr></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Best Ask:</td>
>       <td align="right" nowrap><nobr><b>$&nbsp;2.76</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap width="85">Volume:</td>
>       <td align="right" width="85"><b>1,551,300</b></td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="100">Previous Close:</td>
>       <td align="right" nowrap><nobr><b>$&nbsp;2.78</b></nobr></td>
>   </tr>
>   <tr>
>       <td nowrap valign="top" width="85">Market:</td>
>       <td nowrap align="right" valign="top" width="85">Nasdaq-SCM</td>
>       <td width="20">&nbsp;</td>
>       <td nowrap width="200" align="left" valign="top"
> colspan="2"><b>American Depositary Shares</b></td>
>   </tr>
>      </table>
>
>
>


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



--- End Message ---
--- Begin Message ---
Hello all,
I am a beginner of php/mysql and am looking for good books for beginners 
and mostly good online php tutorials. Anybody have any suggestions?

--- End Message ---
--- Begin Message ---
I have a site here that may be helpful:
http://www.webdesigns1.com/php/
Jeff Oien

> Hello all,
> I am a beginner of php/mysql and am looking for good books for beginners 
> and mostly good online php tutorials. Anybody have any suggestions?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Here is three excellent tutorials. Follow through each, step by step and you
will be in the game.

Building a Database-Driven Web Site Using PHP and MySQL
http://www.mysql.com/articles/ddws/index.html

Introduction to MySQL: A MySQL Tutorial
http://www.mysql.com/documentation/mysql/bychapter/manual_Tutorial.html#Tuto
rial

PHP 101 (Part 1 - 5)
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_1/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_2/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_3/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_4/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_5/print

Best regards,

Craig ><>
[EMAIL PROTECTED]

-----Original Message-----
From: Josiah Wallingford [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 02, 2002 7:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - Tutorial


Hello all,
I am a beginner of php/mysql and am looking for good books for beginners
and mostly good online php tutorials. Anybody have any suggestions?




--- End Message ---
--- Begin Message ---
This is really a newbie question, but here goes.....

I am running PHP4 with Apache on Redhat 6.2.

I am sure I read this somewheres, but can't find it again. When I open a
webpage in a small password application that I wrote, the cursor is not on
the first text box I need to fill in, I need to click on the text box to
begin typing. How do I get the cursor to "focus" on this text box?

Many thanks in advance

Ralph



--- End Message ---
--- Begin Message ---
This is not a php question. It is a JavaScript issue.  You need to add this
code to the bottom of your page:

<script>
    document.forms[0].text_box_name.focus();
</script>

--
Gaylen
PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/

"Ralph Jarvis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
> This is really a newbie question, but here goes.....
>
> I am running PHP4 with Apache on Redhat 6.2.
>
> I am sure I read this somewheres, but can't find it again. When I open a
> webpage in a small password application that I wrote, the cursor is not on
> the first text box I need to fill in, I need to click on the text box to
> begin typing. How do I get the cursor to "focus" on this text box?
>
> Many thanks in advance
>
> Ralph
>
>
>


--- End Message ---
--- Begin Message ---
I have a site with logins, etc.  I was wondering if there's any way to see
how many users are logged in.  I know I could change a database and add one
to a number when a user logs in, and subtract one when they log off, but
what if they just go to another site or close their browser? 

--- End Message ---
--- Begin Message ---
On Sat, 2 Mar 2002, Leif K-Brooks wrote:

>I have a site with logins, etc.  I was wondering if there's any way to see
>how many users are logged in.  I know I could change a database and add one
>to a number when a user logs in, and subtract one when they log off, but
>what if they just go to another site or close their browser?

I use database managed sessions and count the number of "active"
sessions, like how many sessions have had activity in the last 5 minutes
or so.

You can get this code out of phplinks if you want, from
http://phplinks.org/.;

-- 
-----------------------------------------------------------------------
Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
-----------------------------------------------------------------------


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

  I am trying to develop a web site for daycare and would like to support
web cam where users(parents) can login and see what their child is doing.

  I have PHP, Apache, Linux Setup.  What are the things required to get me
going with this.

  Looking forward for all your response.

  Regards,

karthikeyan.


--- End Message ---
--- Begin Message ---
I will be setting one up next week so should have more for you then.  But
there really isn't much for PHP to do here.  Basically you need something
like camstream to regularly create an image somewhere and then a little
meta-refresh page that reloads that image.  You are unlikely to be able to
stream out the video feed in any sort of realtime fashion unless you have
a whole lot of bandwidth going into this daycare.  The best you can do is
most likely to update the image every couple of seconds.

You can find camstream here:

http://www.smcc.demon.nl/camstream/index.html

I am assuming you have the right kernel driver for your webcam?  Assuming
a USB cam, see: http://www.smcc.demon.nl/webcam/

-Rasmus

On Sun, 3 Mar 2002, karthikeyan wrote:

> Hi All,
>
>   I am trying to develop a web site for daycare and would like to support
> web cam where users(parents) can login and see what their child is doing.
>
>   I have PHP, Apache, Linux Setup.  What are the things required to get me
> going with this.
>
>   Looking forward for all your response.
>
>   Regards,
>
> karthikeyan.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I don't see how this can be a PHP problem.  If you say that a similar
script written in Perl doesn't cause this, then simply compare the output
of the Perl one to the PHP one and make sure they are sending the same
thing.  If your IE browser gets confused with the PHP version then it must
be sending something different from the Perl version.  There is no way for
IE to tell that the image came from PHP and not something else.

-Rasmus

On Sat, 2 Mar 2002, John Chronakis wrote:

> Hello,
>
> I have posted the following message to php-windows but i got no answer.
>
> I am using IIs 5 on windows 2k sp2 with php 4.1.1.
> There is a problem with the sctipt that follows and MSIE versions 5 to 6.
>
> A script sends a jpeg image to the client. It goes like this:
>
> ------------------------------------------------------
> $imgsrc = 'full path of the image file';
> ....
> header ("Content-type: some/image");
> header ("Content-disposition: attachment; filename=myimage.jpg");
> header ("Content-length: ".filesize($imgsrc) );
>
> $fp = fopen( $imgsrc, "rb" );
> if (!$fp) {
>     ..... Log the error .....
>     exit;
> }
>
> fpassthru ($fp);
>
> exit;
> ------------------------------------------------------
>
> It works fine if the user desides to save or open the image.
> But if the user cancels the download, Internet Explorer stops
> receiving anything from the site. Any click on a link hangs
> (IE displays in the status bar "Web site found. Waiting for reply")
> Links to static html files on my web server work
> and you can also browse any other sites, but nothing on my site that is
> parsed by php works.
>
> After some attemts (clicks and reloads), IIs reports the following message:
> "HTTP 403.9 - Access Forbidden: Too many users are connected
> Internet Information Services"
> Increasing the user limit on IIS, just requires a few more atemts to show
> this message.
> After I close all IE instances or restart IIS, everything works fine again.
>
> I have tried ignore_user_abort(1), sending expire headers, readfile()
> instead of
> fpassthru() etc but the problem persists.
> Nothing changes with older versions of php or IE.
>
> This problem does not happen when using Netscape (any version)
> or download managers.
> Similar script written in perl does not have the same problem.
>
> Please help. It is a very-very late to switch to another scripting language
> for this project (even using perl or asp for the download part requires a
> great
> deal of work).
>
> John Chronakis
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I've tried, and tried. Reread, and reread. I can't at all find out what's
wrong with these two lines of code.

 $SQLString = "INSERT INTO Movies (Title, Actors, Review, Reviewer, Short)
     VALUES ('$Title','$Actors','$Review','$Reviewer','$Short')";
 $cursor = odbc_exec($db, $SQLString);

I have an if...then conditional statement causing echo to print out an error
message if the $cursor returns false.

The $cursor keeps returning false. I don't know why! My $db variable (which
plugs into the odbc database) is fine. Those two lines have got to be the
problem.


Can you people help me out with this?

If I have to give you my whole script (not very long) I will.

Thanks for any help you can give me.


--- End Message ---
--- Begin Message ---
Well, add this and tell us what it says:

if(!$cursor) echo odbc_error($db).": ".odbc_errormsg($db);

right after that odbc_exec() call.

*always check for errors - and when you get one, show it!*

-Rasmus

On Sat, 2 Mar 2002, Dr. Shim wrote:

> I've tried, and tried. Reread, and reread. I can't at all find out what's
> wrong with these two lines of code.
>
>  $SQLString = "INSERT INTO Movies (Title, Actors, Review, Reviewer, Short)
>      VALUES ('$Title','$Actors','$Review','$Reviewer','$Short')";
>  $cursor = odbc_exec($db, $SQLString);
>
> I have an if...then conditional statement causing echo to print out an error
> message if the $cursor returns false.
>
> The $cursor keeps returning false. I don't know why! My $db variable (which
> plugs into the odbc database) is fine. Those two lines have got to be the
> problem.
>
>
> Can you people help me out with this?
>
> If I have to give you my whole script (not very long) I will.
>
> Thanks for any help you can give me.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I did, and a rather informative error message came. I didn't know how to
debug like that. Sorry, I'm rather new to this.

It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT
INTO statement.





"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED].;
Well, add this and tell us what it says:

if(!$cursor) echo odbc_error($db).": ".odbc_errormsg($db);

right after that odbc_exec() call.

*always check for errors - and when you get one, show it!*

-Rasmus

On Sat, 2 Mar 2002, Dr. Shim wrote:

> I've tried, and tried. Reread, and reread. I can't at all find out what's
> wrong with these two lines of code.
>
>  $SQLString = "INSERT INTO Movies (Title, Actors, Review, Reviewer, Short)
>      VALUES ('$Title','$Actors','$Review','$Reviewer','$Short')";
>  $cursor = odbc_exec($db, $SQLString);
>
> I have an if...then conditional statement causing echo to print out an
error
> message if the $cursor returns false.
>
> The $cursor keeps returning false. I don't know why! My $db variable
(which
> plugs into the odbc database) is fine. Those two lines have got to be the
> problem.
>
>
> Can you people help me out with this?
>
> If I have to give you my whole script (not very long) I will.
>
> Thanks for any help you can give me.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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

This may be an HTML question, I'm not sure.  I need to start a file download
from within php.  The file I wish to download is named INSTALLER.EXE, and is
an InstallShield setup program.

I know I can use an anchor with an HREF to start a transfer: (A
HREF=INSTALLER.EXE)Click here(/A),  but I don't want the user to have to
click on anything to start the download -- when they go to myPage.php I
would like the download to start immediately.  Is this possible?

More information:

I have some (non-http) client/server software that includes authentication
upon connection.  If someone uses my client to connect to my server, they
must have an account established on the server and they must authenticate
upon connection, else the server turns them away.

I'm trying to make the whole process of setting up new users ("registering"
and installing the client) easy.  My desire is to write a form-based
"wizard" that guides the new user thru a register-download-verify process.

Step 1 Asks for the desired login id and checks that it is not already in
the user database(this works)
Step 2 Asks for the password, with verification, and inserts the login id
into the user database (this works too)
Step 3 Starts the agent download process.
Step 4 Verifies that the agent has downloaded and installed properly.

The trouble comes in transitioning from step 2 to step 3.  When the user
presses "NEXT" on step 2, I would like the wizard to start the download, and
say "When the download and installation is complete press NEXT".

The problem seems to be that the action= for step 2 must do two things:
start a file download AND display the next step of the wizard.

Any advice or examples would be appreciated!

ed


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

I would really like to upgrade to a new PHP but I am having a problem
when using 4.1.2 as a CGI script.

Here is my applicable httpd.conf for the sites that have PHP running as
a CGI:

ScriptAlias /cgi-php/ /var/www/accountname/cgi-php/
AddTYpe php-cgi .php .php3 .phtml
Action php-cgi /cgi-php/php

The php interpreter is placed in /var/www/accountname/cgi-php/php and
the php.ini file is placed alongside it.

This works fine with version 4.0.3pl1 as included with Debian 2.2 some
time back.  However when 4.1.2 is dropped in, it outputs the HTTP
headers inside the content of the page.

This isn't good because 1) it looks bad and 2) it disallows use of
Header() commands and scripts that generate graphics.

If I try to use the the newest 4.0.3 from Debian 2.2, I get a completely
different error when I copied /usr/bin/php4 to
/var/www/accountname/cgi-php/php:

Parse error: parse error in /var/www/accountname/cgi-php/php on line 286

Absolutely no configuration file changes were made to Apache's
httpd.conf.

Also I'm not looking for "put #!/usr/bin/php -q in your script and live
without Header()" because everything was working great until recently
and is still working great with the CGI version that's in use right now.

Anyone have any ideas?

Thanks for your help,


Matthew Scott





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

Re http://marc.theaimsgroup.com/?l=php-general&m=101069420521799&w=2

[prev in list] [next in list] [prev in thread] [next in thread] 

List:     php-general
Subject:  RE: [PHP] headers showing up in browser
From:     Mark <[EMAIL PROTECTED]>
Date:     2002-01-10 20:21:07
[Download message RAW]

lets say I have a page that contains just this code:
<?
header("Location: /myfile.html");
?>

the output I get is:
Location: /myfile.html Content-type: text/html 

- Mark

On Thu, 10 Jan 2002 14:03:26 -0600, Rick Emery wrote:
>what does your code look like?
>
>-----Original Message-----
>From: Mark [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, January 10, 2002 1:17 PM
>To: PHP
>Subject: [PHP] headers showing up in browser
>
>
>I've got this problem that won't go away.
>
>The headers are showing up at the top of the page when I run php=
 in
>cgi mode. any ideas?
>
>thanks,
>- Mark
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

[prev in list] [next in list] [prev in thread] [next in thread] 

   Log in / Log out
   Configure Your Environment
   About MARC
   We're Hiring!
   Want to add a list? Tell us about it.
   10East
 


--- End Message ---
--- Begin Message ---
Don't checkboxes, if you name them all the same name, produce a comma delimited string 
in php of the values selected???

such as for 15 checkboxes with numeric values would produce a string such as....

,,,,,,,13,,,,14,,,18

when the form was submited??  This is the way it was handled in ASP... is there 
something different for PHP?

thanks!
Ben
--- End Message ---
--- Begin Message ---
As far as I know, you can't name different checkboxes with the same name 
(seems odd to me to do this anyway...).  When you submit a form to a php 
page, the php page will have a variable for each input item in your 
form.  So if you have checkbox items named, "a", "b", "c", and "d", and 
submit a form with "a" and "c" checked, then the values of $a and $c will 
be "on", and $b and $d will have no values.  It's sometimes good to use the 
isset() function on checkbox items.  In this case, isset($a) would return 1 
and isset($b) would return 0.  Hope that helps.

Jeff

At 10:07 PM 3/2/2002 -0700, Ben Turner wrote:
>Don't checkboxes, if you name them all the same name, produce a comma 
>delimited string in php of the values selected???
>
>such as for 15 checkboxes with numeric values would produce a string such 
>as....
>
>,,,,,,,13,,,,14,,,18
>
>when the form was submited??  This is the way it was handled in ASP... is 
>there something different for PHP?
>
>thanks!
>Ben


--- End Message ---
--- Begin Message ---
Ben,

Hmm... I don't really understand you question, but when I had check boxes in a 
form, you have to name them all the same but the value all different. For 
example:

<input type="checkbox" name="name[1]" value="value1">
<input type="checkbox" name="name[2]" value="value2">
<input type="checkbox" name="name[3]" value="value3">
<input type="checkbox" name="name[4]" value="value4">

Now as far as the PHP script I think you need to use the implode(); function.


-GENESiS DESiGNS
-Sean Kennedy
-http://www.gdesigns.vcn.com

--- End Message ---
--- Begin Message ---
The form i am filling with the checkboxes has several checkbox options that
someone can select subscription types.  The sub types are all generated from
a result set so that the form can grow or shrink by what is in the database
and not by what is on the html code.... Trying to accomplish this with hand
off maintenace.  When a new option becomes available, add the option to the
db and all the work is done.  the php and the html code doesnt need to be
modified at all....

Oh I hope this can be accomplished....




----- Original Message -----
From: "Jeff Sheltren" <[EMAIL PROTECTED]>
To: "Ben Turner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, March 02, 2002 10:25 PM
Subject: Re: [PHP] CheckBoxes....


> As far as I know, you can't name different checkboxes with the same name
> (seems odd to me to do this anyway...).  When you submit a form to a php
> page, the php page will have a variable for each input item in your
> form.  So if you have checkbox items named, "a", "b", "c", and "d", and
> submit a form with "a" and "c" checked, then the values of $a and $c will
> be "on", and $b and $d will have no values.  It's sometimes good to use
the
> isset() function on checkbox items.  In this case, isset($a) would return
1
> and isset($b) would return 0.  Hope that helps.
>
> Jeff
>
> At 10:07 PM 3/2/2002 -0700, Ben Turner wrote:
> >Don't checkboxes, if you name them all the same name, produce a comma
> >delimited string in php of the values selected???
> >
> >such as for 15 checkboxes with numeric values would produce a string such
> >as....
> >
> >,,,,,,,13,,,,14,,,18
> >
> >when the form was submited??  This is the way it was handled in ASP... is
> >there something different for PHP?
> >
> >thanks!
> >Ben
>
>
>
--- End Message ---
--- Begin Message ---
In article <001001c1c15f$22473370$0100a8c0@red5>, php-general@ring-
wraith.com says...
> hi again,
> 
> well sorry about that, it worked when i changed it to:
> 
> ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-curl 
>--with-swf=/usr/local/flash
 --enable-ftp --with-gd=/usr --with-jpeg-dir=/usr/local --with-xpm-
dir=/usr/X11R6 --with-png-dir=/usr --with-imap --with-ming=/usr/src/ming-
0.2a --enable-magic-quotes --with-mysql --enable-safe-mode --enable-
track-vars --with-ttf --enable-versioning --with-zlib
> 
> ...however, now i ran into another problem: Ming!
> The source is located /usr/src/ming-0.2a
> and the installed files are located:
> /usr/lib
> /usr/include
> 
> but neither of these 3 is accepted in the configure line.
> Or can i just leave it in the configure line and then just add the php_ming.so file, 
>copy it into the extension dir and add it to php.ini file?
> 
> Regards,
> 
> Duncan
> 
Um, lateral thinking here? The same solution that worked for GD should 
work for Ming. In other words, 

--with-ming=/usr

and configure will look under /usr for the lib and include.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
I recently upgraded my site from PHP 4.0.6 to PHP 4.1.2.  The following
bit of code quit working:

        static $navigationLinks = array (
          "index.php3" =>  "News",
          "download.php3" => "Download",
          "links.php3" => "Links",
          "archived_news.php3" => "News Archives" );
       echo "              <div style=\"border-style:solid;\">\n";
       echo "                <ul>\n";
         while( list( $link, $label) = each( $navigationLinks ) ) {
           echo "<li";
           if( $PHP_SELF == $link ) echo " class=\"currentPage\"";
           echo "><a href=\"".$link."\">".$label."</a></li>\n";
         }
       echo "                </ul>\n";
       echo "              </div>\n";


If $navigationLinks is NOT declared as "static", then the code will work
with PHP 4.1.2.  It works both ways with 4.0.6.  Just an FYI and
wondering if anyone knows why?

Greg Breland

--- End Message ---
--- Begin Message ---
Greg Breland wrote:
> I recently upgraded my site from PHP 4.0.6 to PHP 4.1.2.  The following
> bit of code quit working:
> 
>         static $navigationLinks = array (
>           "index.php3" =>  "News",
>           "download.php3" => "Download",
>           "links.php3" => "Links",
>           "archived_news.php3" => "News Archives" );
>        echo "              <div style=\"border-style:solid;\">\n";
>        echo "                <ul>\n";
>          while( list( $link, $label) = each( $navigationLinks ) ) {
>            echo "<li";
>            if( $PHP_SELF == $link ) echo " class=\"currentPage\"";
>            echo "><a href=\"".$link."\">".$label."</a></li>\n";
>          }
>        echo "                </ul>\n";
>        echo "              </div>\n";
> 
> 
> If $navigationLinks is NOT declared as "static", then the code will work
> with PHP 4.1.2.  It works both ways with 4.0.6.  Just an FYI and
> wondering if anyone knows why?
> 
> Greg Breland
> 
> 

Create shortest & complete script and submit this bug with the script.
I don't notice this bug nor bug report, but make sure you search
bug db for the same bug.

-- 
Yasuo Ohgaki

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


On Sat, 2 Mar 2002, Andrey Hristov wrote:

> check you php.ini if you need to change sendmail -t -i to something other.

We are still having problems with this. Doing another mailshot, the script
crawled at 1 message every 75 seconds. After starting 10 more scripts,
each script was putting out one message every 75 seconds. Suddenly, after
about 40 minutes of this, all 11 scripts suddenly accelerated up to full
speed, load av hit 8+ and the mailshot completed in less than 1 hour!

I'm now doing another mail blast using just 5 parallel scripts - it's
crawling at the moment but it will be interesting to see what happens in
about half an hour's time.

Andy

> ----- Original Message -----
> From: "andy thomas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 02, 2002 11:04 AM
> Subject: [PHP] Bizarre mail() problem
>
>
> > I have written a script to do some massmailing - it extracts an email
> > address from a MySQL database and uses it to send a text file as a mail
> > message. It works but there is a 75 second delay between each message
> > being sent out!
> >
> > This is baffling - there are no delays built into the script and nothing
> > obvious in our sendmail configuration. As I've got over 38000 addresses to
> > mail out to, this is a problem - I've got round it for now by running 10
> > scripts simultaneously, each handling 1000 addresses and this has got mail
> > moving.
> >
> > The mail() function seems to call sendmail -t -i. This just sits there for
> > 75 seconds, then sends a message and then waits for another 75 seconds.
> > Surely this should not happen?
> >
> > Here's the relevant parts of the script - the email address is in column
> > 15 of the MySQL table, so it just extracts field 14 for the email address
> > data:
> >
> > $msg_txt="message.txt";
> >
> > mysql_connect("localhost",$mysql_user,$mysql_pwd);
> > $query="select * from $table";
> > $result=mysql($dbname, $query);
> > $rows=mysql_numrows($result);
> >
> > $r=0;
> > $f=14;
> > while ($r < $rows ) {
> >         $address=mysql_result($result,$r,$f);
> >         mail("$address","$subject","$message","From:$MailFromAddress");
> >         $r++;
> >         }
> >
> >
> > Any suggestions or pointers to where I'm going wrong will be warmly
> > received.
> >
> > Andy
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--- End Message ---
--- Begin Message ---
yayy i had my virtual server upgraded to php 4.1.2!

oh wait...... nothings F#*&ing working now!

a simple dropdown menu- leading to a page containing:

<?
header("location:$location");
exit;

?>
doesnt work anymore.

contact forms using php_self
survey using foreach()
mailing list declaring multiple functions called by
?action=whattodo

switch stements for links like:

somepage.php?get=thisstuff

SO is this a configuration problem or is there just going to be a new way of
doing things from now on?

PLEEEEZE!??-lol



--- End Message ---
--- Begin Message ---
Check that register_globals = On in your php.ini file.

On Sun, 3 Mar 2002, cyberskydive wrote:

> yayy i had my virtual server upgraded to php 4.1.2!
>
> oh wait...... nothings F#*&ing working now!
>
> a simple dropdown menu- leading to a page containing:
>
> <?
> header("location:$location");
> exit;
>
> ?>
> doesnt work anymore.
>
> contact forms using php_self
> survey using foreach()
> mailing list declaring multiple functions called by
> ?action=whattodo
>
> switch stements for links like:
>
> somepage.php?get=thisstuff
>
> SO is this a configuration problem or is there just going to be a new way of
> doing things from now on?
>
> PLEEEEZE!??-lol
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

I have PHP 4.1.1 installed on my apache web server, but how do apply the
patch for it? Thanks,

-GENESiS DESiGNS
-Sean Kennedy
-http://www.gdesigns.vcn.com

--- End Message ---
--- Begin Message ---
Hi,
No one seems to be home at my favourite apache newsgroup :) so I'll ask
here.
I'm trying to reconfigure my PHPMyAdmin.

What do I add to my conf file so as in http://phpmyadmin.somehere.com/
points
to a specific directory on my (windows) drive?

For example, how would I point http://www.somehere.com// to a
different directory than http://somehere.com/ , or
http://123.somehere.com// to a different directory than
http://456.somehere.com/ ?

John Taylor-Johnston

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

  ' ' '   Université de Sherbrooke:
 ô¿ô   http://compcanlit.ca/
   ~

--- End Message ---
--- Begin Message ---
Hi
Here is a small php script to create sepia images from a jpeg, put it in 
the same place as your images and call it sepia.php.
Uselike this:
img src="/images/sepia.php/filename.jpg"

<?
         $filename = ereg_replace("/","",$PATH_INFO);
         if($filename != ""):
                 $im =imagecreatefromjpeg($filename);
                 //convert to a pallette
                 imagetruecolortopalette($im,1,256);
                 $start_red = 2.1;                       //red scale at black
                 $start_blue = 2.3;                      //blue scale at black
                 $red_scale = ($start_red - 0.9)/256;    //blue modifier as 
greyscale goes to white
                 $blue_scale = ($start_blue - 0.9)/256;  //ditto for red
                 //loop through pallette
                 for($x = 0;$x < 256;$x++){
                         $a = array();
                         $a = imagecolorsforindex ($im, $x);
                         //calc a grayscale value
                         $gs = intval(($a["red"]*0.3) + ($a["green"]*.59) + 
($a["blue"]*.11));
                         $rm = $gs * $red_scale; //calc red modifier
                         $bm = $gs * $blue_scale; //calc blue modifier
                         $red_m = $start_red - $rm;
                         $blue_m = $start_blue - $bm;
                         $r = intval($gs * $red_m);              //scale red up
                         $g = $gs;                               //green no 
change
                         $b = intval($gs/$blue_m);               //scale 
blue down
                         imagecolorset ($im, $x, $r, $g, $b);
                 }
                 Header("Content-type: image/jpeg");
                 ImageJpeg($im,'',30);
         endif;
?>



Probably will only work with php-4+ and gd 2+

Tom


At 02:42 AM 3/3/02, Andy wrote:
>Hi there,
>
>I was recently browsing throught phpbuilder and did see the user pictures
>there.
>
>They are not black/white, but kind of brown white which look pretty cool and
>might save some disk space compared to true color.
>Here is the link:
>http://phpbuilder.com/columns/ying20000602.php3?page=1
>
>Does anybody know how to do this with GD?
>
>Thanx for any help
>
>Andy
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---

Reply via email to