OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 3 May 2003 04:28:33 -0000 Issue 2034

php-general-digest-helplists.php.net
Date: Fri May 02 2003 - 23:28:33 CDT


php-general Digest 3 May 2003 04:28:33 -0000 Issue 2034

Topics (messages 146138 through 146228):

Re: Archive Link
        146138 by: Miles Thompson
        146218 by: Gavin Nouwens

Re: GD and the New PHP
        146139 by: Jason Wong
        146143 by: Mike At Spy

Re: Ever heard of IonCube?
        146140 by: Robert Cummings
        146144 by: dan rossi
        146145 by: dan rossi
        146148 by: Ryan A

Flash Detection in PHP
        146141 by: Clint Tredway
        146146 by: Awlad Hussain

php sendmail attachment to stay as a file attachment.
        146142 by: slesnett
        146228 by: Manuel Lemos

Re: Bizarre gethostbyname() problem
        146147 by: Markus Latzel

Re: $_SERVER['PHP_AUTH_USER'] does not return value
        146149 by: Philip Olson

Re: Mail function corrupting images
        146150 by: Jeff Schwartz

Re: Print price value (newbie)
        146151 by: Jake Malone

Re: next page records
        146152 by: Edward Peloke

question - support
        146153 by: Fabricio orerreuG
        146164 by: Jason Sheets

how to exit loop early?
        146154 by: DomIntCom
        146157 by: Chris Boget
        146162 by: Tom Rogers
        146194 by: DomIntCom

Re: to whom it may concern
        146155 by: Jennifer Goodie

IDE for php
        146156 by: Mario Soto
        146158 by: Dan Joseph
        146163 by: Geoff Hankerson
        146168 by: Pierrick LE GALL
        146170 by: Tyler Lane

HELLO
        146159 by: Zanzamarr

Can't locate libmysqlclient.so.10 RPM for php-mysql-4.2.2-8.0.7.i386.rpm
        146160 by: DB

Include statement fails about 1% of the time
        146161 by: Derrick Fogle
        146166 by: Jason Sheets

Globals question
        146165 by: Ryan A
        146167 by: Jason Sheets

New Apache/MySQL/PHP... Problems
        146169 by: Mike

Re: Maybe an unrelated question but ...
        146171 by: Jennifer Goodie

Wonky Dates
        146172 by: Steve Keller

if not $_POST,not $_GET not $_REQUEST...what is it?
        146173 by: Ryan A
        146175 by: Greg Wiley

Source Code Manager
        146174 by: Warren Vail
        146176 by: Mark

session_destroy and session_unset not working
        146177 by: Guru Geek

win xp exec() question
        146178 by: Mike D

what am I doing wrong?
        146179 by: Amanda McComb
        146180 by: Jennifer Goodie
        146181 by: Jennifer Goodie
        146182 by: Amanda McComb
        146183 by: Amanda McComb
        146184 by: Dan Joseph
        146185 by: Jennifer Goodie

PHP AND SEARCH ENGINES
        146186 by: Zanzamarr
        146188 by: Aaron Gould
        146192 by: Jason Sheets
        146201 by: Roedel, Mark
        146208 by: Pierrick LE GALL

Re: what am I doing wrong? - closer!
        146187 by: Amanda McComb
        146189 by: Amanda McComb
        146190 by: Dan Joseph

need help - have deadline
        146191 by: Jay Fitzgerald
        146197 by: Matt Matijevich

Simple question, just confirmation needed
        146193 by: Ryan A

Pulling data out of a string
        146195 by: Richard Kurth
        146199 by: James E Hicks III

what am I doing wrong - error message?
        146196 by: Amanda McComb
        146204 by: Ernest E Vogelsinger

exec() QUESTION
        146198 by: Mike D
        146205 by: Ernest E Vogelsinger
        146210 by: Mike D

another question about dynamic forms
        146200 by: Amanda McComb

STRING PROBLEMS
        146202 by: Zanzamarr

Session ID problem
        146203 by: Mike

Retrieving web pages
        146206 by: Mark Douglas
        146209 by: Robert Cummings

Include problems
        146207 by: Shawn McKenzie
        146212 by: DvDmanDT
        146216 by: Shawn McKenzie

Re: Getting variables before the submit button is hit
        146211 by: Mario Soto

next page records (done, but a little problem. -OT-)
        146213 by: Ryan A
        146214 by: John W. Holmes
        146217 by: Ryan A
        146219 by: John W. Holmes
        146222 by: Ryan A
        146224 by: Ryan A

Validating Users
        146215 by: James MacLeod

Waiting for a time (or counting down) to execute an event
        146220 by: Mark Douglas
        146221 by: John W. Holmes

Is this possible?
        146223 by: Ben Cheng
        146227 by: John W. Holmes

Using register_globals=on with $_SESSION['var']?
        146225 by: Andre Dubuc

How can I securely send a url with GET info from a crontab php script to another server?
        146226 by: Daevid Vincent

Administrivia:

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

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

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

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

attached mail follows:


Such an obviously good idea -- get's my vote.
Miles Thompson

At 08:09 AM 5/2/2003 -0700, Richard Baskett wrote:
>Seriously, I think it would be a good idea to include the archive address in
>the footer of this list. Every single message has a footer appended onto
>the end of it, it is really simple to do with most list servers. Some of us
>have been on this list forever and a day and of course we know where the
>archives are, but some people are new or just plain lazy and don't want to
>go search.. let's make it easy for them and us, so all we have to do is
>click on a link that would be included on each and every single message sent
>through this list.
>
>Ideas? thoughts?
>
>Rick
>
>"Work like you don't need the money. Dance like no one is watching. And love
>like you've never been hurt." - Mark Twain
>
> > From: "Ryan A" <ryanjumac.com>
> > Date: Fri, 2 May 2003 15:12:05 +0200
> > To: <php-generallists.php.net>
> > Subject: Re: [PHP] next page records
> >
> > Hey Jason,
> > I would if I knew where it was, can you give me the address to the archives
> > please?
> > Thanks,
> > -Ryan
> >
> >
> >
> > ----- Original Message -----
> > From: "Jason Wong" <php-generalgremlins.biz>
> > To: <php-generallists.php.net>
> > Sent: Friday, May 02, 2003 3:09 PM
> > Subject: Re: [PHP] next page records
> >
> >
> >> On Friday 02 May 2003 20:00, Ryan A wrote:
> >>
> >>> I have made a little front end for the "admin" to see all the records in
> >>> the database..till now everything is working fine but when the records
> > are
> >>> over 20 theres a problem most probably because of the "limit" in
> >>> MySql...does anybody know how that "next page" feature works?
> >>>
> >>> eg:
> >>> if there are more than 20 records in the database there should be a link
> >>> below that says "next page" (if there are less than 20 records no link
> >>> should be shown or the link should be "disabled") and when the client
> >>> clicks on it he gets the next 20 records plus there should be a
> > "previous
> >>> page" link etc etc
> >>>
> >>> I have seen this on many sites (including google) and I am pretty sure
> > its
> >>> done with "count" in mySql but am getting lost somewhere in the logic...
> >>>
> >>> Kindly reply with a small code example if possible or somewhere where I
> > can
> >>> read up on it.
> >>
> >> This kind of question gets asked every week or so. Search the php-db
> > archives.
> >>
> >> --
> >> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> >> Open Source Software Systems Integrators
> >> * Web Design & Hosting * Internet & Intranet Applications Development *
> >> ------------------------------------------
> >> Search the list archives before you post
> >> http://marc.theaimsgroup.com/?l=php-general
> >> ------------------------------------------
> >> /*
> >> As long as the answer is right, who cares if the question is wrong?
> >> */
> >>
> >>
> >> --
> >> 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
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Would certainly cut down on a lot of the repetitive, simple questions!

Maybe even put it up at the top of the e-mail so people *definitely* see
it :)

-gav.

| -----Original Message-----
| From: Miles Thompson [mailto:milesthompsonns.sympatico.ca]
| Sent: Saturday, 3 May 2003 1:23 AM
| To: Richard Baskett; PHP General
| Subject: Re: [PHP] Archive Link
|
|
| Such an obviously good idea -- get's my vote.
| Miles Thompson

<snip>

attached mail follows:


On Friday 02 May 2003 23:18, Mike At Spy wrote:
> Someone just told me that GD is automatically configured in the new PHP,
> you just have to install the libraries.
>
> Is this true?

No.

> If so, can I install the libraries after PHP has been compiled on the
> newest version?

manual > Image functions

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A real diplomat is one who can cut his neighbor's throat without having
his neighbour notice it.
                -- Trygve Lie
*/

attached mail follows:


Actually, the 'No' answers both questions. :)

Thanks,

-Mike

> -----Original Message-----
> From: Jason Wong [mailto:php-generalgremlins.biz]
> Sent: Friday, May 02, 2003 11:32 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] GD and the New PHP
>
>
> On Friday 02 May 2003 23:18, Mike At Spy wrote:
> > Someone just told me that GD is automatically configured in the new PHP,
> > you just have to install the libraries.
> >
> > Is this true?
>
> No.
>
> > If so, can I install the libraries after PHP has been compiled on the
> > newest version?
>
> manual > Image functions
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> A real diplomat is one who can cut his neighbor's throat without having
> his neighbour notice it.
> -- Trygve Lie
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Wasn't the original post about improving speed? I do believe IonCube is the
current home of PHPAccelerator. Which just happens to be about improving
speed without buying the Zend accelerator since it is free (or at least the
version I still use is free :).

Cheers,
Rob.

dan rossi wrote:
>
> this really gets to me , whats the point ? , the whole idea about open
> source , is that its open source !, sorry to hijak your thread but while i'm
> on the topic , i am going to make a documentary on open source and the
> future of open source, anyone interested in being involved ? what sparked my
> idea is about a book called rebel code anyone heard of it ?
>
> -----Original Message-----
> From: Vek, Marvin (RW-NL) [mailto:marvin.vekrockwool.nl]
> Sent: Friday, May 02, 2003 4:44 PM
> To: php-generallists.php.net
> Subject: [PHP] Ever heard of IonCube?
>
> Ever heard of IonCube? Someone have experience with it or knows about it?
> http://www.ioncube.com/loader_download.php
>
> Now having an apache/mysql/php4 installation, i'm looking for some
> improvements to make the server even faster. Zend optimizer, offcourse
> already installed (automaticly with php4), now i found this, but i'm not
> sure..
>
> M. Vek

--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'

attached mail follows:


hmm yes i got him into the right direction to PHPA or APC cache system, his
actual link went directly to the encoder which is why i made a fuss about it

-----Original Message-----
From: sudswocmud.org [mailto:sudswocmud.org]On Behalf Of Robert
Cummings
Sent: Saturday, May 03, 2003 1:38 AM
To: dan rossi
Cc: Vek, Marvin (RW-NL); php-generallists.php.net
Subject: Re: [PHP] Ever heard of IonCube?

Wasn't the original post about improving speed? I do believe IonCube is the
current home of PHPAccelerator. Which just happens to be about improving
speed without buying the Zend accelerator since it is free (or at least the
version I still use is free :).

Cheers,
Rob.

dan rossi wrote:
>
> this really gets to me , whats the point ? , the whole idea about open
> source , is that its open source !, sorry to hijak your thread but while
i'm
> on the topic , i am going to make a documentary on open source and the
> future of open source, anyone interested in being involved ? what sparked
my
> idea is about a book called rebel code anyone heard of it ?
>
> -----Original Message-----
> From: Vek, Marvin (RW-NL) [mailto:marvin.vekrockwool.nl]
> Sent: Friday, May 02, 2003 4:44 PM
> To: php-generallists.php.net
> Subject: [PHP] Ever heard of IonCube?
>
> Ever heard of IonCube? Someone have experience with it or knows about it?
> http://www.ioncube.com/loader_download.php
>
> Now having an apache/mysql/php4 installation, i'm looking for some
> improvements to make the server even faster. Zend optimizer, offcourse
> already installed (automaticly with php4), now i found this, but i'm not
> sure..
>
> M. Vek

--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'

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

attached mail follows:


ok i understand fully but surely some of the code snippets originally would
have come from the open source community would they have not ?

-----Original Message-----
From: Ryan A [mailto:ryanjumac.com]
Sent: Friday, May 02, 2003 8:35 PM
To: Vek, Marvin (RW-NL)
Cc: php-generallists.php.net
Subject: Re: [PHP] Ever heard of IonCube?

Try this tool, its free and its very good.
http://pobs.mywalhalla.net/
I have myself used it as I make some freebie programs which are open source
and some which are not.
Before your "open source defination guys" get on my back please remember...I
gotto eat and I have to protect something that I spent hours sweating over,
got frustrated over and worked late nights...sometimes till 4am or more.

BTW the freebie programs go out with source intact.

Hope that helped.

Cheers,
-Ryan

----- Original Message -----
From: "Vek, Marvin (RW-NL)" <marvin.vekrockwool.nl>
To: <php-generallists.php.net>
Sent: Friday, May 02, 2003 8:44 AM
Subject: [PHP] Ever heard of IonCube?

> Ever heard of IonCube? Someone have experience with it or knows about it?
> http://www.ioncube.com/loader_download.php
>
> Now having an apache/mysql/php4 installation, i'm looking for some
> improvements to make the server even faster. Zend optimizer, offcourse
> already installed (automaticly with php4), now i found this, but i'm not
> sure..
>
> M. Vek
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

attached mail follows:


Maybe.
Depends on the program.
Cheers,
-Ryan.

> ok i understand fully but surely some of the code snippets originally
would
> have come from the open source community would they have not ?
>
> -----Original Message-----
> From: Ryan A [mailto:ryanjumac.com]
> Sent: Friday, May 02, 2003 8:35 PM
> To: Vek, Marvin (RW-NL)
> Cc: php-generallists.php.net
> Subject: Re: [PHP] Ever heard of IonCube?
>
>
> Try this tool, its free and its very good.
> http://pobs.mywalhalla.net/
> I have myself used it as I make some freebie programs which are open
source
> and some which are not.
> Before your "open source defination guys" get on my back please
remember...I
> gotto eat and I have to protect something that I spent hours sweating
over,
> got frustrated over and worked late nights...sometimes till 4am or more.
>
> BTW the freebie programs go out with source intact.
>
> Hope that helped.
>
> Cheers,
> -Ryan
>
>
>
> ----- Original Message -----
> From: "Vek, Marvin (RW-NL)" <marvin.vekrockwool.nl>
> To: <php-generallists.php.net>
> Sent: Friday, May 02, 2003 8:44 AM
> Subject: [PHP] Ever heard of IonCube?
>
>
> > Ever heard of IonCube? Someone have experience with it or knows about
it?
> > http://www.ioncube.com/loader_download.php
> >
> > Now having an apache/mysql/php4 installation, i'm looking for some
> > improvements to make the server even faster. Zend optimizer, offcourse
> > already installed (automaticly with php4), now i found this, but i'm not
> > sure..
> >
> > M. Vek
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I have a quick question. Is javascript the easiest way to detect the Flash
plugin?

Thanks!
Clint

attached mail follows:


shouldn't you be posting your javascript question in Javascript's mailing
list?

----- Original Message -----
From: "Clint Tredway" <ctredwayLEEFIN.COM>
To: <php-generallists.php.net>
Sent: Friday, May 02, 2003 4:46 PM
Subject: [PHP] Flash Detection in PHP

> I have a quick question. Is javascript the easiest way to detect the Flash
> plugin?
>
> Thanks!
> Clint
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi, I've got a problem in PHP sending a file PDF to a browser and have it
> stay as a file. So when you click on the file, the system issues a call to Acrobat to create the
> screen image.
>
> I'm using the $filecontent=chunk_split(base64_encode($filecontent));
>
> The attachment arrives but print with the email body looking like encrypted
> text instead of file attachment.

Stu

attached mail follows:


Hello,

On 05/02/2003 03:56 PM, Slesnett wrote:
> Hi, I've got a problem in PHP sending a file PDF to a browser and have it
>
>>stay as a file. So when you click on the file, the system issues a call to Acrobat to create the
>>screen image.
>>
>>I'm using the $filecontent=chunk_split(base64_encode($filecontent));
>>
>>The attachment arrives but print with the email body looking like encrypted
>>text instead of file attachment.

Try this class to compose and send messages with attached files:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

attached mail follows:


Brad, anyone,

did you find out what the problem is? I am experiencing the same.
Running PHP 4.2.2-117 with Apache on Linux SuSE 8.1

Cheers,
Markus

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

If I run the following code from the command line ("php -q socktest.php") it
works fine. If I try to run it through a browser gethostbyname fails (prints
unchanged host name).

<?php print gethostbyname( 'www.msn.com' ); ?>

What gives?

Brad

attached mail follows:


On Fri, 2 May 2003, P Lok wrote:

> The $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] do not get/return
> value when I try the HTTP authentication example from php manual.Anyone can
> tell me what pre-requisite(setting) is require in PHP.ini?I am using
> PHP4.3.1 and apache 2.0.45 on Win2000.HTTP Authentication example on Chapter
[snip]

Two questions:

  a) Is safe_mode turned on? Check phpinfo().
  b) Are you also using an external authentication, like
     with .htaccess?

Under these conditions the PHP_AUTH_* variables will not be
available but REMOTE_USER will still be available.

Regards,
Philip

attached mail follows:


Thanks, Marek, and I already use that class when creating messages with attachments.

 

However, in this case I'm forwarding a message with the attachment already in the body plus I want to preserve the original message headers, which isn't supported by the class.

 

There must be some way to make mail() work without damaging the contents it sends. ???

 

Jeff

 

>Try to use http://www.phpclasses.org/browse.html/package/9.html, it

>makes adding attachments much easier.

 

>>I'm relaying some email messages via mail(). Whenever the body contains a

>>.gif attachment the attachment is unreadable at the other end. I know

>>that mail() inserts exclamation points into text after 1024 characters

>>without a hard break and I've added "\n" to text to solve that. But, that won't

>>work in an image. Has anyone solved this or found a workaround?

>>Thanks,Jeff

---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

attached mail follows:


number_format()

"John M." <bali1afreemail.hu> wrote in message
news:20030502144039.85504.qmailpb1.pair.com...
> Hello,
>
> I want to display price values. I have this value as integer.
> What I want is an easy readable form, I mean price=1234567 and display
> 1,234,567.
> Is there any function to do this?
> If not how can I read only one caracter from an integer?
>
> Thanks!
>
>

attached mail follows:


not sure if this is what you want but there are some examples online...

http://codewalkers.com/seecode/264.html

Eddie
-----Original Message-----
From: Ryan A [mailto:ryanjumac.com]
Sent: Friday, May 02, 2003 9:12 AM
To: php-generallists.php.net
Subject: Re: [PHP] next page records

Hey Jason,
I would if I knew where it was, can you give me the address to the archives
please?
Thanks,
-Ryan

----- Original Message -----
From: "Jason Wong" <php-generalgremlins.biz>
To: <php-generallists.php.net>
Sent: Friday, May 02, 2003 3:09 PM
Subject: Re: [PHP] next page records

> On Friday 02 May 2003 20:00, Ryan A wrote:
>
> > I have made a little front end for the "admin" to see all the records in
> > the database..till now everything is working fine but when the records
are
> > over 20 theres a problem most probably because of the "limit" in
> > MySql...does anybody know how that "next page" feature works?
> >
> > eg:
> > if there are more than 20 records in the database there should be a link
> > below that says "next page" (if there are less than 20 records no link
> > should be shown or the link should be "disabled") and when the client
> > clicks on it he gets the next 20 records plus there should be a
"previous
> > page" link etc etc
> >
> > I have seen this on many sites (including google) and I am pretty sure
its
> > done with "count" in mySql but am getting lost somewhere in the logic...
> >
> > Kindly reply with a small code example if possible or somewhere where I
can
> > read up on it.
>
> This kind of question gets asked every week or so. Search the php-db
archives.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> As long as the answer is right, who cares if the question is wrong?
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

attached mail follows:


i was going to ask the question in the notes part of the site but i saw your comments of it so here it is.

this my error
Warning: Supplied argument is not a valid MySQL-Link resource in .....

it seems to be that my site is generating more visits which my server can handle. and everytime i pass a couple of thousand of visits a day i get this error.
and the only way of fixing it is restarting the mysql daemon. my question is there anyway i can restart this daemon via php so i wont have to keep on doing this manually? please help.

attached mail follows:


Hello,

You could be running out of connections to the MySQL database server, if
you have access to restart MySQL you might consider changing the
configuration so that it allows more concurrent connections.

Your description is interesting, are you using persistent connections?
If you are just using mysql_connect the server should free the
connection at the end of the result, so if you are using mysql_connect
and the connections are being reset at the end your peak load is
probably higher than the number of connections MySQL is accepting. If
you are using persistent connections you may consider turning them off
(you will take somewhat of a performance hit but it will result in more
mysql connections being available).

You can code around the issue somewhat by making sure you don't connect
to the database unless you are going to need the database connection and
using mysql_close when you are done with the connection, since PHP
closes the connection for you at the end of script execution that is
really only of benefit when you need to pull information from the
database and the processing takes some time and you want to free the
connection.

Bottom line take a look at your MySQL server configuration, you
shouldn't be needing to restart it every couple thousand visits.

Jason

Fabricio orerreuG wrote:

>i was going to ask the question in the notes part of the site but i saw your comments of it so here it is.
>
>this my error
>Warning: Supplied argument is not a valid MySQL-Link resource in .....
>
>it seems to be that my site is generating more visits which my server can handle. and everytime i pass a couple of thousand of visits a day i get this error.
>and the only way of fixing it is restarting the mysql daemon. my question is there anyway i can restart this daemon via php so i wont have to keep on doing this manually? please help.
>
>
>

attached mail follows:


I have a few scenario's where if a condition is met I want it to go to the
end of a while statement, but not exit the while statement (i.e. just force
it to go to the next item in the while statement / loop).

attached mail follows:


> I have a few scenario's where if a condition is met I want it to go to the
> end of a while statement, but not exit the while statement (i.e. just force
> it to go to the next item in the while statement / loop).

break;

Chris

attached mail follows:


Hi,

Saturday, May 3, 2003, 3:19:46 AM, you wrote:
D> I have a few scenario's where if a condition is met I want it to go to the
D> end of a while statement, but not exit the while statement (i.e. just force
D> it to go to the next item in the while statement / loop).

I think what you need is

continue;

That will end the current loop and continue to the next iteration

If you want to break out of the loop completly you would need

break;

--
regards,
Tom

attached mail follows:


thanks for the responses everybody... continue was what I was looking for,
and it works beautifully.

Jeff
"Domintcom" <infodomintcom.com> wrote in message
news:20030502172057.30083.qmailpb1.pair.com...
> I have a few scenario's where if a condition is met I want it to go to the
> end of a while statement, but not exit the while statement (i.e. just
force
> it to go to the next item in the while statement / loop).
>
>
>

attached mail follows:


You should reply to the list so that other people can benefit from the
answer.

Your problem is this line
<?php require_once(''); ?>

What are you trying to require? Do you know what require does? Require
includes a file into your script and '' is not really a filename. Read the
manual on this function.
http://www.php.net/manual/en/function.require-once.php

> -----Original Message-----
> From: Dina A. [mailto:dandash17hotmail.com]
> Sent: Friday, May 02, 2003 7:35 AM
> To: goodieapollointeractive.com
> Subject: RE: [PHP] to whom it may concern
>
>
>
> well i do want to learn it but at the mean time cuz i dont have
> much time i
> have to use Dreamweaver
> here is the code..
>
> <?php require_once(''); ?>
> <?php
> function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) :
> $theValue;
>
> switch ($theType) {
> case "text":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> break;
> case "long":
> case "int":
> $theValue = ($theValue != "") ? intval($theValue) : "NULL";
> break;
> case "double":
> $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
> "NULL";
> break;
> case "date":
> $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> break;
> case "defined":
> $theValue = ($theValue != "") ? $theDefinedValue :
> $theNotDefinedValue;
> break;
> }
> return $theValue;
> }
>
> $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
> if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
> $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
> }
>
> if ((isset($HTTP_POST_VARS["MM_insert"])) &&
> ($HTTP_POST_VARS["MM_insert"]
> == "StudentForm")) {
> $insertSQL = sprintf("INSERT INTO students (Gender, Country, City,
> SchoolName, Email) VALUES (%s, %s, %s, %s, %s)",
>
> GetSQLValueString($HTTP_POST_VARS['Gender'], "text"),
> GetSQLValueString($HTTP_POST_VARS['Country'],
> "text"),
> GetSQLValueString($HTTP_POST_VARS['city'], "text"),
> GetSQLValueString($HTTP_POST_VARS['SchoolName'],
> "text"),
>
> GetSQLValueString($HTTP_POST_VARS['Email'], "text"));
>
> mysql_select_db($database_phpregister, $phpregister);
> $Result1 = mysql_query($insertSQL, $phpregister) or die(mysql_error());
>
> $insertGoTo = "registration_details.php?email=$email";
> if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
> $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
> $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
> }
> header(sprintf("Location: %s", $insertGoTo));
> }
> ?>
>
>
> thx for your time

attached mail follows:


Hello every one.

I'm lookign for a good IDE for developing php scripts. I'm tired of the colors of front page and notepad. But there is a problem. I'm out of money, and I don't have much to buy an expensive php IDE, so I wonder if somebody know for a free or low cost IDE that don't stuck in the midddle of the way.

For any help, I'm thanked.

Mario Soto
mario_samigo.net.gt
-.-.-.-

attached mail follows:


Mario,

        You should look into Zend Studio. They have a personal edition which is
free. www.zend.com. I'm using the commercial version's trial, and so far I
like it a lot.

-Dan Joseph

> -----Original Message-----
> From: Mario Soto [mailto:mario_samigo.net.gt]
> Sent: Friday, May 02, 2003 12:18 PM
> To: php general
> Subject: [PHP] IDE for php
>
>
> Hello every one.
>
> I'm lookign for a good IDE for developing php scripts. I'm tired
> of the colors of front page and notepad. But there is a problem.
> I'm out of money, and I don't have much to buy an expensive php
> IDE, so I wonder if somebody know for a free or low cost IDE that
> don't stuck in the midddle of the way.
>
> For any help, I'm thanked.
>
>
> Mario Soto
> mario_samigo.net.gt
> -.-.-.-
>
>

attached mail follows:


Here are a few options:
HTML-kit:
http://www.chami.com/html-kit/

jEdit
www.jedit.org

Mario Soto wrote:

>Hello every one.
>
>I'm lookign for a good IDE for developing php scripts. I'm tired of the colors of front page and notepad. But there is a problem. I'm out of money, and I don't have much to buy an expensive php IDE, so I wonder if somebody know for a free or low cost IDE that don't stuck in the midddle of the way.
>
>For any help, I'm thanked.
>
>
>Mario Soto
>mario_samigo.net.gt
>-.-.-.-
>
>
>
>

attached mail follows:


"Mario Soto" <mario_samigo.net.gt> writes:

> Hello every one.

Hello "only" one ;-)

> I'm lookign for a good IDE for developing php scripts. I'm tired of
> the colors of front page and notepad. But there is a problem. I'm out
> of money, and I don't have much to buy an expensive php IDE, so I
> wonder if somebody know for a free or low cost IDE that don't stuck in
> the midddle of the way.

Under Microsoft Windows, you can try UltraEdit, which is a very good
text editor providing IDE functionnalities. It's not a free tool, but
it's low cost (about 30$ if I remember well).

Still under Microsoft Windows you can try emacs (not very easy to use in
the beginning) which is a free software.

Hope it helps :-)

--
Pierrick LE GALL | http://www.z0rglub.com
<pierrickz0rglub.com> | http://www.phpwebgallery.net

attached mail follows:


On Fri, 2003-05-02 at 10:43, Geoff Hankerson wrote:
> Here are a few options:
> HTML-kit:
> http://www.chami.com/html-kit/
>
> jEdit
> www.jedit.org
Amen to that. Jedit is THE BEST all around text editor right now.
I have been amazingly pleased with jEdit and i recommend that everyone
use it. It is that powerful and easy to use.

>
> Mario Soto wrote:
>
> >Hello every one.
> >
> >I'm lookign for a good IDE for developing php scripts. I'm tired of the colors of front page and notepad. But there is a problem. I'm out of money, and I don't have much to buy an expensive php IDE, so I wonder if somebody know for a free or low cost IDE that don't stuck in the midddle of the way.
> >
> >For any help, I'm thanked.
> >
> >
> >Mario Soto
> >mario_samigo.net.gt
> >-.-.-.-
> >
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Tyler Lane
tlanelyrical.net

attached mail follows:


HELLO

attached mail follows:


Hi,

I'm attempting to install a forum which requires both MySQL and php. I am
getting a failed dependency for a MySQL RPM when attempting to install the
php-mysql-4.2.2-8.0.7.i386.rpm and I can't find the needed rpm, not even on
Red hat Network. The library I need is libmysqlclient.so.10.

  I have both MySQL and PHP running on my server, both appear to be working
OK (independently) my php test script comes up fine and indicates that it
does support MySQL, although not which version.

I ran rpm -iv to install php-MySQL and this is what came up -
[rootwww html]# rpm -iv php-mysql-4.2.2-8.0.7.i386.rpm
error: Failed dependencies:
        libmysqlclient.so.10 is needed by php-mysql-4.2.2-8.0.7

This is what I presently have on system...

[rootwww html]# rpm -qa | grep MySQL
MySQL-client-4.0.12-0
MySQL-server-4.0.12-0
[rootwww html]# rpm -qa | grep php
php-imap-4.2.2-8.0.7
php-4.2.2-8.0.7
php-ldap-4.2.2-8.0.7
[rootwww html]

Does anyone know where I can get this rpm? 'm running RH Linux 8 under
kernel-2.4.18-27.8.0

Thanks for any info

attached mail follows:


I've already been told that using include() statements is very
inefficient and should be avoided. But... I've written a web app that
uses them, and a little more than 1% of the time, the execution of the
file that calls an include just halts right before or after the
include. No errors, no nothing. Are include() statements really *that*
bad? Or might there be something else in my system (Linux RedHat 7
right now) that could be causing this?

I've only ever confirmed it happening when Win/MSIE connects via SSL,
and have never been able to reproduce the problem from the user's
perspective in-house; I've beefed up the SSL definition in my
httpd.conf file to minimize problems with MSIE, but I've put a debug
tracking mechanism in my code and have caught it not finishing code
execution on about 1% of the page accesses.

-Derrick

attached mail follows:


Include statements do have a cost but I wouldn't say they are very
inefficient and I wouldn't go to great lengths to avoid them. In most
cases the benefits of using includes properly far outweigh the cost
involved in using them (imagine writing the Linux Kernel or the Windows
OS using only one source file). Includes allow you to logically
organize your application and use a more modular system, just don't put
each individual function in it's own file.

The access method of the script should not influence whether or not the
include works, I would check and see if your system is exceeding the
maximum number of open files or if it is hitting an open file limit set
somewhere, when this happens the system can't open any more files. An
open file limit problem can be tricky to find because it only happens
when x files are open which on a web server would be under load.

The fact that the include works 99% of the time leads me to believe it
is probably a problem somewhere other than the include functionality itself.

Also what version of PHP are you running with what web server, what OS
is it running on?

I would recommend logging the number of open files and load of the
server when this problem occurs.

Jason

Derrick Fogle wrote:

> I've already been told that using include() statements is very
> inefficient and should be avoided. But... I've written a web app that
> uses them, and a little more than 1% of the time, the execution of the
> file that calls an include just halts right before or after the
> include. No errors, no nothing. Are include() statements really *that*
> bad? Or might there be something else in my system (Linux RedHat 7
> right now) that could be causing this?
>
> I've only ever confirmed it happening when Win/MSIE connects via SSL,
> and have never been able to reproduce the problem from the user's
> perspective in-house; I've beefed up the SSL definition in my
> httpd.conf file to minimize problems with MSIE, but I've put a debug
> tracking mechanism in my code and have caught it not finishing code
> execution on about 1% of the page accesses.
>
> -Derrick
>
>

attached mail follows:


Hi, (Warning, kind of newbie alert)

I have created a script which will take a lot of values from a form
I am getting various values entered into the script from variables like
$customer_name, $product_id etc etc I just take and use those variables as
is
eg:
I _DONT_ do:
$customer_name== $_GET['page'];

BUT my friend tells me that I should do that as "register globals" are off
on a lot of servers....which is getting me quite confused.

Should I convert all my scripts so it will work with register globals off?
Then for "GET" I use $_GET and for "POST" I am guessing I will have to use
$_POST, or should I use $_REQUEST?

or (my favourite alternative) is just keep the code as is and if they dont
have register globals on...tough luck! :-)
What do you think?

Because just thinking of going through all those damn variables one by one
and converting them sure sounds like a pain in the....exactly what you
thought :-)

After going on google and searching for the answer I see that even the
creator or PHP thinks that register globals should be on as putting it off
does not add to a higher sense of
security.(http://www.webmasterbase.com/article/767/)

Any advise/suggestions/comments welcome.
Cheers,
-Ryan

attached mail follows:


The default for register globals is off, so you should write all new
code to work without register globals.

Since the super globals $_GET, $_POST and $_REQUEST have been available
since PHP 4.1 I would recommend using them or using the $HTTP_POST and
$HTTP_GET variables (which are not super globals but are available in
PHP prior to version 4.1).

You will find that if you insist on register globals on your application
will be broken by default on most new installs.

Jason

Ryan A wrote:

>Hi, (Warning, kind of newbie alert)
>
>I have created a script which will take a lot of values from a form
>I am getting various values entered into the script from variables like
>$customer_name, $product_id etc etc I just take and use those variables as
>is
>eg:
>I _DONT_ do:
>$customer_name== $_GET['page'];
>
>
>BUT my friend tells me that I should do that as "register globals" are off
>on a lot of servers....which is getting me quite confused.
>
>Should I convert all my scripts so it will work with register globals off?
>Then for "GET" I use $_GET and for "POST" I am guessing I will have to use
>$_POST, or should I use $_REQUEST?
>
>or (my favourite alternative) is just keep the code as is and if they dont
>have register globals on...tough luck! :-)
>What do you think?
>
>Because just thinking of going through all those damn variables one by one
>and converting them sure sounds like a pain in the....exactly what you
>thought :-)
>
>After going on google and searching for the answer I see that even the
>creator or PHP thinks that register globals should be on as putting it off
>does not add to a higher sense of
>security.(http://www.webmasterbase.com/article/767/)
>
>Any advise/suggestions/comments welcome.
>Cheers,
>-Ryan
>
>
>
>

attached mail follows:


Hi,

So I just installed Apache/MySQL/PHP4.3 and all is great... just got a
problem in one of my scripts... it works fine on php 4.2... but now i
get the errors:

Warning: page(/var/www/html/prattcms/modules/mod_homepage.mod.php)
[function.page]: failed to create stream: No such file or directory in
/var/www/html/prattcms/classes/Page.class.php on line 59

Fatal error: page() [function.page]: Failed opening required
'/var/www/html/prattcms/modules/mod_homepage.mod.php'
(include_path='.:/usr/local/share/pear') in
/var/www/html/prattcms/classes/Page.class.php on line 59

from the code:

if (!$_GET['id'] && !$_SESSION['logged_in']) {
        require(getcwd() . "/modules/mod_homepage.mod.php");
        exit;
}

Any ideas?

-Michael

attached mail follows:


Maybe he is not paying because he is unsatsified with the job you did? You
just admitted creating security holes on his server. Personally, I wouldn't
pay for something shoddily written and in my book anything that requires
files being 777 is not well written or professionally done.

> -----Original Message-----
> From: Webmaster [mailto:webmastertwsc.co.za]
> Sent: Friday, May 02, 2003 1:35 AM
> To: php-generallists.php.net
> Subject: [PHP] Maybe an unrelated question but ...
>
>
> Hi there everybody -
>
> Have this problem : wrote a huge PHP script for a website (create
> webpages,
> admin areas, advertising program etc etc) and now the guy is not
> paying me.
> He changed the FTP login password so I can't block my work or
> deny him from
> using it.
>
> Some of the files do have 777 permissions - like hit counter log
> files, and
> I have tried to write something that will upload via an online form on his
> site and go and sit on the log file. Calling the log file directly should
> then execute the script which I would like then to give me some sort of
> access to change directory names (which will corrupt the scripts)
>
> I'm now writing scripts that would first look for a file on my site that
> would authenticate the script license before the script will
> execute on the
> other site - so I can block bad payers with this system - but I
> need to sort
> this guy out.
>
> Any help and ideas would be appreciated.
>
> August

attached mail follows:


Our pages seem to occassionally burp out weird Date responses. For example,
this is a line from our student certificate for today:

        <p style="font-size: 14pt;">Awarded this <?
                echo date("jS");
                ?> day of <?
                echo date("F");
                ?>, Two Thousand Three</p>

What that's returning is:

        Awarded this 31nd day of May, Two Thousand Three

I haven't been able to pin-point a rhyme or reason for what's causing this,
especially since the above code produced a correct date ten minutes later.
I have a niggling suspicion it might be because of something with the
server, but I'll admit to being beyond my depth at this point.

Any ideas what could be causing this? Anyone? Ferris?
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: skellerhealthtvchannel.org
Web: www.healthtvchannel.org

attached mail follows:


Hi,
I am getting some values from 2checkout...I wanted to know in what form so I
made this simple little test script...

<?
if($_POST[$product_id] >=3 && $_POST[$product_id] <=8)

{print("post is true");}

elseif($_GET[$product_id] >=3 && $_GET[$product_id] <=8)

{print("GET is true");}

elseif($_REQUEST[$product_id] >=3 && $_REQUEST[$product_id] <=8)

{print("request is true");}
else
{echo 'None worked';}
?>

The $product_id that I am passing is 6 but I always get the message "None
worked"....What should I do? what else is there?

Kindly reply,
-Ryan

attached mail follows:


Ryan A wrote:
> Hi,
> I am getting some values from 2checkout...I wanted to know in
> what form so I made this simple little test script...
>
> <?
> if($_POST[$product_id] >=3 && $_POST[$product_id] <=8)
>
> {print("post is true");}
>
> elseif($_GET[$product_id] >=3 && $_GET[$product_id] <=8)
>
> {print("GET is true");}
>
> elseif($_REQUEST[$product_id] >=3 && $_REQUEST[$product_id] <=8)
>
> {print("request is true");}
> else
> {echo 'None worked';}
>>
>
> The $product_id that I am passing is 6 but I always get the
> message "None worked"....What should I do? what else is there?
>
Remove the '$' character from the $_POST, $_GET and $_REQUEST array indices,
e.g.

$_GET[$product_id] should be $_GET['product_id'].

Cheers, Greg.

attached mail follows:


Hope this is the right list for this.

I have some open source code that a client of mine wants to use on his site.
The contributor of this code is very good about updating and providing new
releases of his code a couple of times a year.

I am also generating some fixes (not many) and new modules for this client.

I would like to be able to keep my code separate from the contributors code,
and when I get a new release from the contributor, install my changes to the
new release (of course, I will need to shake down the conflicts). Is there
a open source product that works well on this kind of thing? Where can I
find out more about it?

thanks in advance,

Warren Vail
warrenvailtech.net

attached mail follows:


--- Warren Vail <warrenvailtech.net> wrote:
> Hope this is the right list for this.
>
> I have some open source code that a client of mine wants to use on
> his site.
> The contributor of this code is very good about updating and
> providing new
> releases of his code a couple of times a year.
>
> I am also generating some fixes (not many) and new modules for this
> client.
>
> I would like to be able to keep my code separate from the
> contributors code,
> and when I get a new release from the contributor, install my
> changes to the
> new release (of course, I will need to shake down the conflicts).
> Is there
> a open source product that works well on this kind of thing? Where
> can I
> find out more about it?

Sounds like an ideal opportunity to use CVS.

try www.cvshome.org or check your favorite open source site.

>
> thanks in advance,
>
> Warren Vail
> warrenvailtech.net
>

=====
Mark Weinstock
mark_weinstockyahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing.
***************************************

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

attached mail follows:


Hello,

I'm using session_destroy() and session_unset() in a script. When I try
to reload the script in my browser for another test run, the script is
still running with the last session_id and the previous sessions's
variable values. I have to exit and re-open my browser to test run the
script again.

I thought with session_destroy() and session_unset() you didn't have to
do that?

Thanks,
Roger

attached mail follows:


This works perfectly from a command window but doesn't work from a php
page, why?
(Note: There is a path variable set for mogrify)

$cmd = "mogrify -resize 200x134 \"C:\\Apache\\myDocs\\myImage.jpg\"";
exec($cmd , $results);

Mike Dunlop
Webmaster - AWN, Inc.
[E] webmasterawn.com
[P] 323.606.4237
[F] 323.466.6619

attached mail follows:


Ok, so I have been trying to create a dynamic database driven form. In
the form, there is a list of checkboxes that come from a table in the
database. I can create the list just fine, but when I want to use the
data in the checkboxes, I keep screwing up. There are a few things that
need to be done with the data, but right now, so I can figure out what the
heck I'm doing wrong, all I want to do is submit the form and display the
values. I keep getting this error:

Warning: Invalid argument supplied for foreach() in
/usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
on line 563

Why am I so confused about this?

Anyway, here is a snippet of code that is giving me errors. (the form
itself is soooo long, I don't
want to post everything).

Join these list servs:
        <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
OR
        retired_flag = 0 ORDER BY list_serv_name";
        $search_results = mysql_query($query) or die("Select Failed!"); ?>

        <?while ($search_result = mysql_fetch_array($search_results)) {?>
<INPUT
                     TYPE="checkbox"
                     NAME="list_serv[<? echo
$search_result['list_serv_cd']; ?>]"
                     SIZE="20"
                     MAXLENGTH="50"
                     VALUE="1"><? echo
                     $search_result['list_serv_name'] ?> <BR>
<?
}

foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
    $quantity *= 1; // make it numeric
    if($quantity) { // if one exists
       echo $list_serv_cd;
    }
}

?>

attached mail follows:


$_POST['list_serv'] is not an array. Should it be? Are there form elements
in the form that is posting to this script called 'list_serv[]' ?

> -----Original Message-----
> From: Amanda McComb [mailto:amccombindiana.edu]
> Sent: Friday, May 02, 2003 12:17 PM
> To: php-generallists.php.net
> Subject: [PHP] what am I doing wrong?
>
>
> Ok, so I have been trying to create a dynamic database driven form. In
> the form, there is a list of checkboxes that come from a table in the
> database. I can create the list just fine, but when I want to use the
> data in the checkboxes, I keep screwing up. There are a few things that
> need to be done with the data, but right now, so I can figure out what the
> heck I'm doing wrong, all I want to do is submit the form and display the
> values. I keep getting this error:
>
> Warning: Invalid argument supplied for foreach() in
> /usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
> on line 563
>
> Why am I so confused about this?
>
> Anyway, here is a snippet of code that is giving me errors. (the form
> itself is soooo long, I don't
> want to post everything).
>
> Join these list servs:
> <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
> OR
> retired_flag = 0 ORDER BY list_serv_name";
> $search_results = mysql_query($query) or die("Select Failed!"); ?>
>
> <?while ($search_result = mysql_fetch_array($search_results)) {?>
> <INPUT
> TYPE="checkbox"
> NAME="list_serv[<? echo
> $search_result['list_serv_cd']; ?>]"
> SIZE="20"
> MAXLENGTH="50"
> VALUE="1"><? echo
> $search_result['list_serv_name'] ?> <BR>
> <?
> }
>
> foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> $quantity *= 1; // make it numeric
> if($quantity) { // if one exists
> echo $list_serv_cd;
> }
> }
>
> ?>

>

attached mail follows:


I think I posted too soon. Is the top chunk of code the form and the bottom
chunk the action?

> -----Original Message-----
> From: Jennifer Goodie [mailto:goodieapollointeractive.com]
> Sent: Friday, May 02, 2003 12:21 PM
> To: Amanda McComb; php-generallists.php.net
> Subject: RE: [PHP] what am I doing wrong?
>
>
> $_POST['list_serv'] is not an array. Should it be? Are there
> form elements
> in the form that is posting to this script called 'list_serv[]' ?
>
> > -----Original Message-----
> > From: Amanda McComb [mailto:amccombindiana.edu]
> > Sent: Friday, May 02, 2003 12:17 PM
> > To: php-generallists.php.net
> > Subject: [PHP] what am I doing wrong?
> >
> >
> > Ok, so I have been trying to create a dynamic database driven form. In
> > the form, there is a list of checkboxes that come from a table in the
> > database. I can create the list just fine, but when I want to use the
> > data in the checkboxes, I keep screwing up. There are a few things that
> > need to be done with the data, but right now, so I can figure
> out what the
> > heck I'm doing wrong, all I want to do is submit the form and
> display the
> > values. I keep getting this error:
> >
> > Warning: Invalid argument supplied for foreach() in
> >
> /usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
> > on line 563
> >
> > Why am I so confused about this?
> >
> > Anyway, here is a snippet of code that is giving me errors. (the form
> > itself is soooo long, I don't
> > want to post everything).
> >
> > Join these list servs:
> > <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
> > OR
> > retired_flag = 0 ORDER BY list_serv_name";
> > $search_results = mysql_query($query) or die("Select
> Failed!"); ?>
> >
> > <?while ($search_result =
> mysql_fetch_array($search_results)) {?>
> > <INPUT
> > TYPE="checkbox"
> > NAME="list_serv[<? echo
> > $search_result['list_serv_cd']; ?>]"
> > SIZE="20"
> > MAXLENGTH="50"
> > VALUE="1"><? echo
> > $search_result['list_serv_name'] ?> <BR>
> > <?
> > }
> >
> > foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> > $quantity *= 1; // make it numeric
> > if($quantity) { // if one exists
> > echo $list_serv_cd;
> > }
> > }
> >
> > ?>
>
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hmm...so using list_serv[] as the name doesn't make it an array? How do I
do that?

No, there there is no function or script called list_serv[]. I was just
attempting to build an array.

On Fri, 2 May 2003, Jennifer Goodie wrote:

> $_POST['list_serv'] is not an array. Should it be? Are there form elements
> in the form that is posting to this script called 'list_serv[]' ?
>
> > -----Original Message-----
> > From: Amanda McComb [mailto:amccombindiana.edu]
> > Sent: Friday, May 02, 2003 12:17 PM
> > To: php-generallists.php.net
> > Subject: [PHP] what am I doing wrong?
> >
> >
> > Ok, so I have been trying to create a dynamic database driven form. In
> > the form, there is a list of checkboxes that come from a table in the
> > database. I can create the list just fine, but when I want to use the
> > data in the checkboxes, I keep screwing up. There are a few things that
> > need to be done with the data, but right now, so I can figure out what the
> > heck I'm doing wrong, all I want to do is submit the form and display the
> > values. I keep getting this error:
> >
> > Warning: Invalid argument supplied for foreach() in
> > /usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
> > on line 563
> >
> > Why am I so confused about this?
> >
> > Anyway, here is a snippet of code that is giving me errors. (the form
> > itself is soooo long, I don't
> > want to post everything).
> >
> > Join these list servs:
> > <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
> > OR
> > retired_flag = 0 ORDER BY list_serv_name";
> > $search_results = mysql_query($query) or die("Select Failed!"); ?>
> >
> > <?while ($search_result = mysql_fetch_array($search_results)) {?>
> > <INPUT
> > TYPE="checkbox"
> > NAME="list_serv[<? echo
> > $search_result['list_serv_cd']; ?>]"
> > SIZE="20"
> > MAXLENGTH="50"
> > VALUE="1"><? echo
> > $search_result['list_serv_name'] ?> <BR>
> > <?
> > }
> >
> > foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> > $quantity *= 1; // make it numeric
> > if($quantity) { // if one exists
> > echo $list_serv_cd;
> > }
> > }
> >
> > ?>
>
> >
>
>
>

attached mail follows:


Yes! Sorry I didn't clarify that. I just ripped out the relevant
snippets. The last 'foreach' is what happens after a submit.

On Fri, 2 May 2003, Jennifer Goodie wrote:

> I think I posted too soon. Is the top chunk of code the form and the bottom
> chunk the action?
>
> > -----Original Message-----
> > From: Jennifer Goodie [mailto:goodieapollointeractive.com]
> > Sent: Friday, May 02, 2003 12:21 PM
> > To: Amanda McComb; php-generallists.php.net
> > Subject: RE: [PHP] what am I doing wrong?
> >
> >
> > $_POST['list_serv'] is not an array. Should it be? Are there
> > form elements
> > in the form that is posting to this script called 'list_serv[]' ?
> >
> > > -----Original Message-----
> > > From: Amanda McComb [mailto:amccombindiana.edu]
> > > Sent: Friday, May 02, 2003 12:17 PM
> > > To: php-generallists.php.net
> > > Subject: [PHP] what am I doing wrong?
> > >
> > >
> > > Ok, so I have been trying to create a dynamic database driven form. In
> > > the form, there is a list of checkboxes that come from a table in the
> > > database. I can create the list just fine, but when I want to use the
> > > data in the checkboxes, I keep screwing up. There are a few things that
> > > need to be done with the data, but right now, so I can figure
> > out what the
> > > heck I'm doing wrong, all I want to do is submit the form and
> > display the
> > > values. I keep getting this error:
> > >
> > > Warning: Invalid argument supplied for foreach() in
> > >
> > /usr/local/packages/apache-1.3.27/htdocs/amccomb/prodev/customer_form.php
> > > on line 563
> > >
> > > Why am I so confused about this?
> > >
> > > Anyway, here is a snippet of code that is giving me errors. (the form
> > > itself is soooo long, I don't
> > > want to post everything).
> > >
> > > Join these list servs:
> > > <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
> > > OR
> > > retired_flag = 0 ORDER BY list_serv_name";
> > > $search_results = mysql_query($query) or die("Select
> > Failed!"); ?>
> > >
> > > <?while ($search_result =
> > mysql_fetch_array($search_results)) {?>
> > > <INPUT
> > > TYPE="checkbox"
> > > NAME="list_serv[<? echo
> > > $search_result['list_serv_cd']; ?>]"
> > > SIZE="20"
> > > MAXLENGTH="50"
> > > VALUE="1"><? echo
> > > $search_result['list_serv_name'] ?> <BR>
> > > <?
> > > }
> > >
> > > foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> > > $quantity *= 1; // make it numeric
> > > if($quantity) { // if one exists
> > > echo $list_serv_cd;
> > > }
> > > }
> > >
> > > ?>
> >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Hi,

> > > <?while ($search_result =
> > mysql_fetch_array($search_results)) {?>
> > > <INPUT
> > > TYPE="checkbox"
> > > NAME="list_serv[<? echo
> > > $search_result['list_serv_cd']; ?>]"
> > > SIZE="20"
> > > MAXLENGTH="50"
> > > VALUE="1"><? echo
> > > $search_result['list_serv_name'] ?> <BR>
> > > <?

        It kind of appears that you're making an array type name value in the html.
list_serv[something] instad of just list_serv.

        I would set NAME="list_serv" and VALUE="<?echo
$search_result['list_serv_cd']; ?>"

        I think that will do ths trick. Right now it doesn't think
$_POST['list_serv'] is an array, which it probably isn't from seeing that.

-Dan Joseph

attached mail follows:


I always mess up calling a foreach on a _POST element that contains an
array. Instead of messing with the [] placement (I can never remember if it
would be $_POST[list_serv[]] or $_POST[list_serv][] or if I need {} in there
somewhere) I just do this

$list_serv = $_POST['list_serv'];
foreach($list_serv as $list_serv_cd => $quantity) {

It is kind of a cop out, but I am usually under a tight dealine and it gets
the job done.

> -----Original Message-----
> From: Amanda McComb [mailto:amccombindiana.edu]
> Sent: Friday, May 02, 2003 12:29 PM
> To: Jennifer Goodie
> Cc: php-generallists.php.net
> Subject: RE: [PHP] what am I doing wrong?
>
>
> Yes! Sorry I didn't clarify that. I just ripped out the relevant
> snippets. The last 'foreach' is what happens after a submit.
>
> On Fri, 2 May 2003, Jennifer Goodie wrote:
>
> > I think I posted too soon. Is the top chunk of code the form
> and the bottom
> > chunk the action?
> > > > <?while ($search_result =
> > > mysql_fetch_array($search_results)) {?>
> > > > <INPUT
> > > > TYPE="checkbox"
> > > > NAME="list_serv[<? echo
> > > > $search_result['list_serv_cd']; ?>]"
> > > > SIZE="20"
> > > > MAXLENGTH="50"
> > > > VALUE="1"><? echo
> > > > $search_result['list_serv_name'] ?> <BR>
> > > > <?
> > > > }
> > > >
> > > > foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
> > > > $quantity *= 1; // make it numeric
> > > > if($quantity) { // if one exists
> > > > echo $list_serv_cd;
> > > > }
> > > > }

attached mail follows:


Does anyone know if there are some problems with Php pages and search engines?

attached mail follows:


In the view of search-engine spiders, any PHP pages should look the same as
static HTML pages. After all, the resulting output from PHP pages is static
HTML. Thus, there should be no issues.
--
Aaron Gould
Web Developer
Parts Canada

----- Original Message -----
From: "Zanzamarr" <zanzamarryahoo.com.au>
To: <php-generallists.php.net>
Sent: Friday, May 02, 2003 3:40 PM
Subject: [PHP] PHP AND SEARCH ENGINES

Does anyone know if there are some problems with Php pages and search
engines?

attached mail follows:


PHP pages themselves shouldn't cause any problems with search engines
but some of the techniques PHP authors can cause problems.

Some engines have problems with strings such as
index.php?variable=value, etc as far as knowing they are seperate pages.

Jason

Aaron Gould wrote:

>In the view of search-engine spiders, any PHP pages should look the same as
>static HTML pages. After all, the resulting output from PHP pages is static
>HTML. Thus, there should be no issues.
>--
>Aaron Gould
>Web Developer
>Parts Canada
>
>
>----- Original Message -----
>From: "Zanzamarr" <zanzamarryahoo.com.au>
>To: <php-generallists.php.net>
>Sent: Friday, May 02, 2003 3:40 PM
>Subject: [PHP] PHP AND SEARCH ENGINES
>
>
>Does anyone know if there are some problems with Php pages and search
>engines?
>
>
>
>

attached mail follows:


PHP by itself won't cause problems for search engines...we use it for
templating and the like across our entire site, and we're still indexed
and so on.

Having said that, it's certainly possible to use PHP on a site in ways
that make it more difficult for search engines to access and index your
site. (A simple example might be if the only way to access some of your
content is via a form submit...)

---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell

> -----Original Message-----
> From: Zanzamarr [mailto:zanzamarryahoo.com.au]
> Sent: Friday, May 02, 2003 2:40 PM
> To: php-generallists.php.net
> Subject: [PHP] PHP AND SEARCH ENGINES
>
>
> Does anyone know if there are some problems with Php pages
> and search engines?

attached mail follows:


Jason Sheets <jsheetsshadonet.com> writes:

> Some engines have problems with strings such as
> index.php?variable=value, etc as far as knowing they are seperate
> pages.

Yes, here is the point. The problem comes from the use of variables in
the URL. For example, Google stops parsing URLs after the second
variables.

If you want a good solution to this problem, you must use
url_rewriting. It is a process that can translate something like this :

          http://domain.com/index.php?group=books&article=154

to something like that :
 
          http://domain.com/books/154.htm

--
Pierrick LE GALL | http://www.z0rglub.com
<pierrickz0rglub.com> | http://www.phpwebgallery.net

attached mail follows:


Ok, here is what I have now, and it is very close:

          <?$query = "SELECT * FROM list_serv_t WHERE retired_flag is NULL
OR
        retired_flag = 0 ORDER BY list_serv_name";
        $search_results = mysql_query($query) or die("Select Failed!"); ?>

        <?while ($search_result = mysql_fetch_array($search_results)) {?>

                <INPUT TYPE="CHECKBOX" NAME="list_serv[]" VALUE="<?echo
$search_result['list_serv_cd']; ?>">
                <? echo $search_result['list_serv_name'] ?> - <? echo
$search_result['list_serv_cd'] ?><BR>

        <?}

        foreach( $_POST['list_serv'] as $list_serv_cd => $quantity) {
                    $quantity *= 1; // make it numeric
                    if($quantity) { // if one exists
                               echo $list_serv_cd;
                    }
        }?>

I have printed the list_serv_cd beside the name so I can compare them to
what the foreach prints out. Unfortuantely, they don't match. Here is
what is displayed in HTML:

 Bursar - 1
 Cards on Campus - 3
 SLRC - 2
 Treasury - 5
0123

So, it looks like I am printing out the loop count. How can I print out
the value?

Thanks!!!

On Fri, 2 May 2003, Dan Joseph wrote:

> Hi,
>
> > > > <?while ($search_result =
> > > mysql_fetch_array($search_results)) {?>
> > > > <INPUT
> > > > TYPE="checkbox"
> > > > NAME="list_serv[<? echo
> > > > $search_result['list_serv_cd']; ?>]"
> > > > SIZE="20"
> > > > MAXLENGTH="50"
> > > > VALUE="1"><? echo
> > > > $search_result['list_serv_name'] ?> <BR>
> > > > <?
>
> It kind of appears that you're making an array type name value in the html.
> list_serv[something] instad of just list_serv.
>
> I would set NA