|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Wed Apr 11 2001 - 20:35:22 CDT
php-general Digest 12 Apr 2001 01:35:22 -0000 Issue 622
Topics (messages 48160 through 48225):
Re: radio groups in loop form
48160 by: Tim Ward
Re: *** HTML Programming question *** no php at all...
48161 by: Josh McDonald
timer in PHP
48162 by: george
48168 by: Chris Lee
Re: $8 PHP hosting from Jeffrey Greer
48163 by: Ashley M. Kirchner
Re: string comparsion "inf"
48164 by: Renze Munnik
Re: Are calling COM applications a trojan?
48165 by: Pierre-Yves Lemaire
48166 by: Hoover, Josh
reload only one layer?
48167 by: An Onyke
Re: No new topic using reply please.
48169 by: Chris Lee
site review
48170 by: Keyur Kalaria
48176 by: Steve Werby
Re: Apache configuration
48171 by: Alexis Antonakis
Re: header( )
48172 by: Chris Lee
Re: Can't redeclare already declared function
48173 by: Johnson, Kirk
48174 by: Altunergil, Oktay
48175 by: Jeffrey Paul
48178 by: Johnson, Kirk
Re: PHPemPT
48177 by: Manuel Lemos
Arrays of objects
48179 by: Daniel Fairs
ezpublish install
48180 by: Peter Van Dijck
48186 by: Seung-woo Nam
Creating Arrays
48181 by: Ashley M. Kirchner
48199 by: Rodney J. Woodruff
48204 by: Morgan Curley
48208 by: Ashley M. Kirchner
48213 by: Matt McClanahan
Job Opening in Brazil
48182 by: Leonardo Dias
Date/Time Arithmetic
48183 by: Erich Reimberg N.
48184 by: Boget, Chris
Pic Upload & Safe Mode
48185 by: Matthias Auchmann
Mac IE - Text Area - PHP
48187 by: Kevin Leavell
Single Quotes in Oracle Queries
48188 by: Richard Crawford
48189 by: Johnson, Kirk
48190 by: Richard Crawford
Including a URL for mailing..
48191 by: Chad Day
48200 by: Rodney J. Woodruff
48201 by: Chad Day
48212 by: Brett
PHP and IE5.5 download problem
48192 by: Vikram Vaswani
foreach vs. while(list() = each())
48193 by: Joe Stump
48225 by: Yasuo Ohgaki
passthru
48194 by: Michael Dickson
48195 by: Johnson, Kirk
Javascript issue
48196 by: Jack Sasportas
What is the syntax to get the HTTP_ENV_VARS?
48197 by: Phil Labonte
48224 by: Yasuo Ohgaki
Re: ldap ext not working.
48198 by: Joe Rice
windows 2000 install
48202 by: Deborah Dennison
48203 by: Jerry Lake
48207 by: Phil Driscoll
Calling a function that resides elsewhere
48205 by: Gerry
48209 by: Gerry
Database result set question
48206 by: Morgan Curley
Loop in a loop menu system output problem
48210 by: Fates
Re: Supplied argument is not a valid MySQL result resource
48211 by: Chris Worth
radio groups in looped form
48214 by: Peter Houchin
48216 by: SED
48217 by: Peter Houchin
48218 by: Lindsay Adams
48220 by: SED
48221 by: Lindsay Adams
48222 by: SED
checkdnsrr() in PHP 4.0.5rc1
48215 by: Jochen Kaechelin
HELP with (Fatal Error: Call to a member function on a non-object)
48219 by: g0thic
48223 by: Brian Clark
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
grouped radio buttons should have the same name, i.e. avail not avail[].
This way you get a single variable which is always submitted but with a
value depending on the user's selection. The way you did it pases an array
with a single element, the value of this element (and maybe the key) will
vary. I'm not sure quite what your problem is or whether this will fix it
but it should help the form work as intended.
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Peter Houchin [mailto:peterh
vfsa.com.au]
> Sent: 11 April 2001 06:30
> To: Php-General
Lists. Php. Net
> Subject: radio groups in loop form
>
>
> hiya,
>
> I have a radio button in a loop with the rest of the form,
> how ever when i go to do the mutliple update it clears all
> but the updated radio buttons(rest of form data is fine just
> the update on radio buttons) could some one pls give me an
> idea why, when every thing else works propperly with the script
>
> heres the code (only concerning the radio buttons)
>
> <?
> if ($submit) {
> //echo "Values submitted via POST method:<br>";
> reset ($HTTP_POST_VARS);
> while (list ($key, $val) = each ($HTTP_POST_VARS)) {
> //echo "$key => $val<br>";
> }
> reset($id);
> while (list ($key, $val) = each ($id)) {
> //echo "Key: $key => Value: $val;<br>";
>
> rs="update...
> rs .= "quote='".$quote[$key]."',";
> ...
> rs .= WHERE id='$id[$key];
> $result = mysql_query($rs,$db);
> print mysql_error($db);
>
> }
> }
> ?>
>
> rest of form
> <input type="radio" name="avail[]" value="y" <? if ($avail ==
> 'y') { echo 'CHECKED'; }?>> // repeated line with 'n' &
> 'pending' instead of 'y'
>
> Peter Houchin
> peterh
sunrentals.com.au
> =========================================================
> _____ __ /\
> /_/_/_\ / |_/ \
> /_/_/_ __ __ __ __ / \
> \_/_/_\ /_/ /_/ /_/ /_/ \ _ /
> ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
> \_//_/_/ /_/_/_/ /_/ \/_/ v
> ________ ________________________________________
> /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> /_/_ _/_/ ______ __ __ /_/ ____ __ ______
> /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
> /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
> /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM! **************
>
>
attached mail follows:
In ie5.x and earlier the select element will also be above all layers. I
think ie6 doesn't have that problem, as I remember MS promising to fix it,
tho i haven't got my hands on whistler yet so I don't know fer sure
G is for the gang of money I make.
F is for the gang of fools I break.
U is for the undisputed champ.
N is 'cause you never gonna get the mic back.
K is for the niggaz that I knock on they back.
----- Original Message -----
From: "Chris Albanese" <calbanese
clikcommunications.com>
To: "David Diaz i Torrico" <ddiaz
drac.com>; <php-general
lists.php.net>
Sent: Wednesday, April 11, 2001 6:26 AM
Subject: RE: [PHP] *** HTML Programming question *** no php at all...
>
> In Netscape 4.x, form elemtents are always rendered as the top layer,
> regardless of z-indexing. You need to move the form element. Netscape 6 (I
> beleive) and IE5 are fine.
>
> -----Original Message-----
> From: David Diaz i Torrico [mailto:ddiaz
drac.com]
> Sent: Wednesday, April 11, 2001 4:54 AM
> To: php-general
lists.php.net
> Subject: [PHP] *** HTML Programming question *** no php at all...
>
>
>
> Sorry if someone takes that as an offtopic but, I can't find good
> HTML/Javascript programming lists, if someone can point it out any I'd
> apreciate it a lot.And haven't been able to find any reference to my
> problem even searching for hours in google.
>
>
> And the question here it goes, I've got a page with a header,
> the header is a layer floating around the page, with Explorer I've no
> problem but with Netscape, voilà, when the layer passes over a textbox,
> select or some other typical form widget, the widget remains over the
> layer. I've tried all the possible combinations with z-index with no
> result.
>
> There's any workaround to this?, I'm stuck.
>
>
> Thank you very much in advance, and sorry if this is an offtopic.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I need to have a time running and after a certain time it will not allow
you to submit anything else, on top of that if someone makes an entry with
less than 2 minutes to go the time must be extended by 5 minutes.
I really am at a loss how to do this.
Can it be done.
TIA
George
attached mail follows:
there is no sure way, but using cookies/sessions you can make something that will *work* . assign the user a session_id, every time the user makes an entry add a value to the db,
session_id = $SessionID
next_time = time() + 120
every time you make an entry, check to make sure that next_time < time() if it is then proceed, else update next_time = time + 300;
If you need a code example email me, I'll whip something up :)
--Chris Lee lee
mediawaveonline.com
""george"" <geo.mclachlan
btinternet.com> wrote in message news:9b1p05$t6c$1
toye.p.sourceforge.net... I need to have a time running and after a certain time it will not allow you to submit anything else, on top of that if someone makes an entry with less than 2 minutes to go the time must be extended by 5 minutes. I really am at a loss how to do this. Can it be done.
TIA
George
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Jeffrey Greer wrote:
> Is 1/2 per > year too much down time?
<sarcasm> Half a year downtime? Yes, I would have a BIG problem with that. </sarcasm>
AMK4
-- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:ashleypcraft.com> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
attached mail follows:
marco.banaj
vishay.com wrote:
>
> Hi all,
>
> I got a problem comparing the string "inf" with another in PHP3. It is
> used as File-Extention for information-files on our system. When
> comparing the following all works fine and the expected result is given:
>
> "otto" = "karl" =>0
> "otto" = "otto" =>1
> "otto"! = "karl" =>1
> "otto"! = "otto" =>0
>
> The following problem occurs when comparing the string "inf":
>
> "inf" = "otto" =>0 correct result
> "inf" = "inf" =>0 incorrect result!!!! expected 1
> "inf" != "otto" =>1 correct result
> "inf" != "inf" => 1 incorrect result!!! expected: 0
>
> Does anybody have any idea what´s wrong with the string "inf"? It is not
> an reserved word.
>
> Tahnks in advance
>
> Marco
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
Well... where shall I start...
Comparison: == Assingment: = (and _not_ the other way 'round)
And then... Why would you even think about comparing to fixed strings? You wouldn't. So I guess you'd like to send some real code next time, so people can see what you're trying to do.
And then... "inf" = "inf" doesn't work _at all_! It produces an error. If you use "inf" == "inf" the result is exactly what you'd expect.
And then... In your real code, which is something like $var = "inf", you should use $var == "inf". If you do that, you won't have any problems.
--* R&zE:
*************************** ** Renze Munnik ** ** E: renze
datalink.nl ** M: +31 6 218 111 43 ***************************
attached mail follows:
Well, first off all, what I'm taking about has nothing to do with COM object. Word will format HTML very nicely, keep it simple with only <br>, <p>, <b> tags.
All you need to do is put this on top of your page, that is, before you send anyting to the client. header("Content-Type: application/vnd.ms-word");
Now the client knows that the data will be a word document. (built in HTML but we don't care) IE will open word if it is on the client pc, netscape will open a download box of a word document.
I beleive you could built a more sophiticated solution using COM, but this as always work fine for me and my user's, especially since I hate word so much :)
py
At 09:18 PM 4/11/01 +0800, you wrote:
>download dialog?
>
>what will be in that dialog box?
>
>And, I read a book saying that you can open a word document on the client
>side and insert words in it.
>
>
>----- Original Message -----
>From: Pierre-Yves Lemaire <py
e-medhosting.com>
>To: <php-general
lists.php.net>
>Sent: Wednesday, 11 April, 2001 3:54 PM
>Subject: Re: [PHP] Are calling COM applications a trojan?
>
>
> >
> > It can't.
> > If you put the appropriate header type (ms-word in this case), IE will
>open
> > word. Netscape
> > and other browser will open a download dialog box of the document.
> >
> > py
> >
> >
> > At 04:57 PM 4/11/01 +0800, you wrote:
> > >Then, how can it open a words document on the client side?
> > >
> > >----- Original Message -----
> > >From: Delbono <delbono
dsc.it>
> > >To: Zeus <techzeus
pacific.net.sg>
> > >Sent: Wednesday, 11 April, 2001 4:32 PM
> > >Subject: Re: [PHP] Are calling COM applications a trojan?
> > >
> > >
> > > > Com Apps, are not called on a client side.
> > > > Actually, if you print out the version of the com application, it
>displays
> > > > the version of the software installed on the server, not the one on
>the
> > > > client.
> > > >
> > > > If I have Word2000 on m local PC and on the server I have Word97,
> > > >
> > > > a script taht prints App.Version, will print MSWord97.
> > > >
> > > >
> > > > Sent: Wednesday, April 11, 2001 10:26 AM
> > > > Subject: [PHP] Are calling COM applications a trojan?
> > > >
> > > >
> > > > I'm sure many of you seasoned developers have used COM before (not
> > >necessary
> > > > with PHP) but if PHP is a server-side language, how can it call a
>program
> > >on
> > > > the client to open. Isn't it as deadly as a hacker opening your
>computer?
> > > >
> > > > Lets see some sides :)
> > > >
> > > > ------------------------------------------
> > > > David Chua aka. Zeus
> > > > Founder, Frozened.com
> > > > ------------------------------------------
> > > >
> > > >
> > > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > >For additional commands, e-mail: php-general-help
lists.php.net
> > >To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
> >
> > + ======================
> > + Pierre-Yves Lem
ire
> > + E-MedHosting.com
> > + (514) 729-8100
> > + pylem
sympatico.ca
> > + ======================
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
+ ======================
+ Pierre-Yves Lem
ire
+ E-MedHosting.com
+ (514) 729-8100
+ pylem
sympatico.ca
+ ======================
attached mail follows:
>And, I read a book saying that you can open a word document on the client >side and insert words in it.
Are you sure this was done on the client side and not on the server side? Here is a common example used to show a simple use of COM and PHP:
$word=new COM("word.application") or die("Cannot start word for you"); print "Loaded word version ($word->Version)\n"; $word-visible =1 ; $word->Documents->Add(); $word->Selection->Typetext("Dit is een test"); $word->Documents[1]->SaveAs("burb ofzo.doc"); $word->Quit();
This does not work on the client. PHP is on the server side. COM is used to access local objects, not remote ones. So, in the example, PHP is using word on the server and opening a document and saving it on the server. This has nothing to do with a client. The use of COM and PHP would mainly be for PHP to access COM objects that a business has currently in other applications. Many times it would be nice for PHP to utilize objects already written, and in the Windows world right now those objects are normally accessible via COM if they're accessible at all.
Josh Hoover
KnowledgeStorm, Inc.
jhoover
knowledgestorm.com
Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here
attached mail follows:
hi, I have a page with some layers (<DIV> tags) and one layer's content is built by a PHP script which gets its content from a database. What I want is: when the database content should change, I'd like to see that immediately on my page. I dont thinks theres a command to do this? I thought about an automatic reload after xxx seconds, but how would I do that? It shouldnt reload the whole page, but only one layer... can this be done with PHP or should I search for it with JavaScript?
TIA!!
attached mail follows:
Accually, Ive noticed in Outlook Express
Ctrl - N = new message Ctrl - R = relpy to user directly, does not get posted to newsgroup/mailling list Ctrl - G = relpy directly to newsgroup, in turn gets posted to the mailing list
On another note, good post, I see alot of people posting 'new' threads by hitting relpy, hehe.
--Chris Lee lee
mediawaveonline.com
""Yasuo Ohgaki"" <yohgaki
hotmail.com> wrote in message news:9b1k02$f6h$1
toye.p.sourceforge.net... Hello all,
I think most of users knows about news://news.php.net and list archives, if you use your mail client's reply button, it becomes part of a thread. (It does not start new thread)
Therefore, do not post new topic using reply button.
Regards, -- Yasuo Ohgaki
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hello everybody,
I recently developed this site : http://www.goodlookingindia.com . I am adding many more sections in it.
Pl. let me know how can i improve the performance of this site. Your reviews will be very helpful to me.
Thanks in advance.
Keyur $$$$$$$
attached mail follows:
"Keyur Kalaria" <keyur
hyper-net.net> wrote:
> I recently developed this site : http://www.goodlookingindia.com .
> I am adding many more sections in it.
>
> Pl. let me know how can i improve the performance of this site.
> Your reviews will be very helpful to me.
It's difficult to improve to suggest changes to improve the performance until you define "performance" and explain how the database is structured, how the pages are built, what hardware and software you are running, usage patterns (average/peak pages/minute, etc.) and what symptoms lead you to believe performance needs to be improved. If by "performance" you mean "generating more revenue or increasing page views" I have plenty of ideas, but the last thing the world needs anyway is another hotornot.com copycat.
-- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
attached mail follows:
Problem solved, it turned out I had two php.ini files, one for PHP3 on my c drive and one for PHP4 on my d drive.
Many thanks to all who replied
Alexis
-----Original Message-----
From:
php-general-return-48155-alexisantonakis=compuserve.com
lists.php.net
[mailto:php-general-return-48155-alexisantonakis=compuserve.com
lists.ph
p.net]On Behalf Of Jon Haworth
Sent: 11 April 2001 14:14
To: Php-General
Lists. Php. Net
Subject: RE: [PHP] Apache configuration
/tmp is the directory used on Unix systems to store session info. On a windows box you will need to change it to something like c:\temp or c:\apache\sessions. IIRC it's in your php.ini file, not httpd.conf.
HTH Jon
-----Original Message-----
From: Alexis Antonakis [mailto:alexisantonakis
compuserve.com]
Sent: 11 April 2001 12:56
To: Php-General
Lists. Php. Net
Subject: [PHP] Apache configuration
Hi,
I am having problems in trying to configure Apache on my PC correctly.
FYI I am using Win95 and PHP4.
I have configured Apache so that it will run PHP scripts, however when I try to start a session I get the following messages:
--- Warning: open(/tmp\sess_20e483a01d217181f5379858afee4cf4, O_RDWR) failed: m (2) in d:\apache\htdocs\session.php on line 2Warning: open(/tmp\sess_20e483a01d217181f5379858afee4cf4, O_RDWR) failed: m (2) in Unknown on line 0
Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 ----
I can see that the script cannot locate the '/tmp' directory. What my question is where does this '/tmp' directory need to be created and do I need to update the 'httpd.conf' file accordingly, and if so where within it?
Many thanks Alexis
********************************************************************** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I'll post you a simple HTTP auth script. but you should realize something about header()
client -> server server -> client
the client sends some HTTP request to the server, then the server sends some HTTP response to the client. php is strictly server side, you have full control over the HTTP headers sent to the user, but not from the user to the server. ie. method='post' that is sending client data to the server, you will have no control over this at all...
php_auth.php <? include_once('session.egn'); include_once('database.egn');
function bad_passwd() { echo "You have entered an invalid password.<br>\n"; exit(); }
if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r = fetch_db_value('people_manager', "WHERE username = '$PHP_AUTH_USER' AND password = '$PHP_AUTH_PW' ") ) $SessionID = $peop_r['peopleID']; else { Header("WWW-Authenticate: Basic realm='$SERVER_NAME' "); Header("HTTP/1.0 401 Unauthorized"); bad_passwd(); } ?>
--Chris Lee lee
mediawaveonline.com
"Patrick Dunford" <a47xxy
hotmail.com> wrote in message news:MPG.153f093a8428dce798968a
news.php.net... Can someone explain "header" to me?
Does it mean you can send HTTP headers with any script if you are loading another document?
There are two possibilities that interest me:
1. Sending username and password for authorisation in a protected area. This of course is done by browsers when they get a 401 and ask the user for their username and password in a dialog box. I would like to ask them for the data in a form then send it to the page in question.
2. Passing in variables to a script without specifying them as part of the URL. Like a form that uses POST to submit variables to a script without them being displayed in the URL when the page loads.
-- ======================================================================= Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/
If only for this life we have hope in Christ, we are to be pitied more than all men. -- 1 Corinthians 15:19 http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010411 ======================================================================= Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time.
Kirk
> -----Original Message-----
> From: kenny.hibs [mailto:kenny.hibs
ntlworld.com]
> Sent: Wednesday, April 11, 2001 3:10 AM
> To: php-general
lists.php.net
> Subject: [PHP] Can't redeclare already declared function
>
>
> Anyone help with this
>
> Fatal error: Can't redeclare already declared function in
> header.php3 on
> line 233
> The troubl is that there is no line 233 so it must be looking
> at another
> page?
>
attached mail follows:
If you're using php4 you can say include_once("include_file_name.php");
(there's also require_once() )
oktay
-----Original Message-----
From: Johnson, Kirk [mailto:kjohnson
zootweb.com]
Sent: Wednesday, April 11, 2001 11:18 AM
To: php-general
lists.php.net
Subject: RE: [PHP] Can't redeclare already declared function
The function in question is defined in an included file, right? This function definition file is most likely being included twice. The best bet is that it is being included from another included file (at least, that's how I usually manage to produce this error :) ). Check all your included files for a line that re-includes the function definition file a second time.
Kirk
> -----Original Message-----
> From: kenny.hibs [mailto:kenny.hibs
ntlworld.com]
> Sent: Wednesday, April 11, 2001 3:10 AM
> To: php-general
lists.php.net
> Subject: [PHP] Can't redeclare already declared function
>
>
> Anyone help with this
>
> Fatal error: Can't redeclare already declared function in
> header.php3 on
> line 233
> The troubl is that there is no line 233 so it must be looking
> at another
> page?
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
better yet, try include_once() instead of all instances of include(). It will only include a file once, rather than every time you call include() on that path.
Nifty feature.
-j
At 11:17 AM 4/11/2001, Johnson, Kirk wrote:
>The function in question is defined in an included file, right? This
>function definition file is most likely being included twice. The best bet
>is that it is being included from another included file (at least, that's
>how I usually manage to produce this error :) ). Check all your included
>files for a line that re-includes the function definition file a second
>time.
>
>Kirk
>
> > -----Original Message-----
> > From: kenny.hibs [mailto:kenny.hibs
ntlworld.com]
> > Sent: Wednesday, April 11, 2001 3:10 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Can't redeclare already declared function
> >
> >
> > Anyone help with this
> >
> > Fatal error: Can't redeclare already declared function in
> > header.php3 on
> > line 233
> > The troubl is that there is no line 233 so it must be looking
> > at another
> > page?
> >
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
----------------------------------------------
sneak
datavibe.net - 0x514DB5CB
he who lives these words shall not taste death
becoming nothing yeah yeah
forever liquid cool
attached mail follows:
Thanks to all who suggested using include_once. Maybe it is just me (long FORTRAN background), but the very idea of include_once makes me nervous, and I don't use it. It violates my sense of acceptable design. I would rather design my code such that a file is *really* only included once, if that is what is supposed to happen. I *want* PHP to tell me when something gets included more than once, then I can review the design. Maybe including the file more than once is OK, maybe not. Depends on what else is in the included file. Not an "Extreme Programming" outlook, I admit :) YMMV.
The Old Fogey,
Kirk
> -----Original Message-----
> From: Jeffrey Paul [mailto:sneak
datavibe.net]
> Sent: Wednesday, April 11, 2001 9:22 AM
> To: php-general
lists.php.net
> Subject: RE: [PHP] Can't redeclare already declared function
>
>
>
>
> better yet, try include_once() instead of all instances of
> include(). It
> will only include a file once, rather than every time you
> call include() on
> that path.
>
> Nifty feature.
>
> -j
>
> At 11:17 AM 4/11/2001, Johnson, Kirk wrote:
> >The function in question is defined in an included file, right? This
> >function definition file is most likely being included
> twice. The best bet
> >is that it is being included from another included file (at
> least, that's
> >how I usually manage to produce this error :) ). Check all
> your included
> >files for a line that re-includes the function definition
> file a second
> >time.
> >
> >Kirk
attached mail follows:
Viva,
Carlos Serrão wrote: > > Hi all, > just to announce that a new PHP local users list is born. > > It is called PHPemPT and it is dedicated to Portuguese users. > > This list is useful both for new users as well as for advanced > users too. > > You can find this list at: > > http://groups.yahoo.com/group/phpempt
Ha' precisamente 2 anos foi criada uma lista para utilizadores de PHP que falam Portugues. Depois de se ter fundido com uma outra lista de utilizadores de PHP brasileiros, tem actualmente mais de 1500 inscritos.
http://groups.yahoo.com/group/php-pt
Existe uma outra lista mais moderada que se destina discutir questoes menos triviais de PHP que tem actualmente mais de 500 inscritos.
http://groups.yahoo.com/group/php-especialistas
Seria bom que nao se andasse a criar mais listas para os mesmos fins para evitar que as pessoas nao enviem as mesmas mensagems para listas diferentes obrigando os que participam em varias a receber copias desnecessarias.
Manuel Lemos
attached mail follows:
Hi,
PHP provides a number of array-related functions which rely on a relation existing between each array element. This is easy to understand for primitive types (integers, strings and so on) but how does it work for objects?
For example, I have a class Person. I have a number of Person objects in an array. How do I define how a Person object is 'equal' to another, for the purposes of searching through the array? Or would it be better to write a Collection class, encapsulating an array (or some other storage structure), which used callbacks in the Person class to determine equality, much in the way the Java equals() method works?
Thanks, Dan
attached mail follows:
Hi, I think I finally found a cms that does most of what I want it to: ezpublish ( http://developer.ez.no/article/archive/4/ ) I'm trying to install it, I'm on a apache server, and having some problems.
Where can I find help to install this? I've checked the entire website, there's no answers to my questions on the forum there...
Thanks for any tips Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://liga1.com: building multiple language/culture websites
attached mail follows:
http://developer.ez.no/filemanager/list/1/ There are installation doc files near the bottom of the page.
Seung-woo Nam
Peter Van Dijck wrote: > > Hi, > I think I finally found a cms that does most of what I want it to: > ezpublish ( http://developer.ez.no/article/archive/4/ ) > I'm trying to install it, I'm on a apache server, and having some problems. > > Where can I find help to install this? I've checked the entire website, > there's no answers to my questions on the forum there... > > Thanks for any tips > Peter > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > http://liga1.com: building multiple language/culture websites
attached mail follows:
I need to convert an MySQL result into an Array...somehow. The query returns the following:
+----+-----------+ | ID | Project | +----+-----------+ | 1 | Home | | 2 | Work | | 3 | Family | | 4 | Misc. | | . | ... | | . | ... | +----+-----------+
...which I want to convert into:
Array(1 => "Home", 2 => "Work", 3 => "Family", 4 => Misc.", etc....);
What's the best way to do this.
AMK4
-- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:ashleypcraft.com> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
attached mail follows:
http://www.php.net/manual/en/function.msql-fetch-array.php
Hope this helps.
"Ashley M. Kirchner" wrote:
> I need to convert an MySQL result into an Array...somehow. The
> query returns the following:
>
> +----+-----------+
> | ID | Project |
> +----+-----------+
> | 1 | Home |
> | 2 | Work |
> | 3 | Family |
> | 4 | Misc. |
> | . | ... |
> | . | ... |
> +----+-----------+
>
> ...which I want to convert into:
>
> Array(1 => "Home", 2 => "Work", 3 => "Family", 4 => Misc.", etc....);
>
> What's the best way to do this.
>
> AMK4
>
> --
> W |
> | I haven't lost my mind; it's backed up on tape somewhere.
> |____________________________________________________________________
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
> SysAdmin / Websmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . eFax 248.671.0909
> http://www.pcraft.com . 3550 Arapahoe Ave #6
> .................. . . . . Boulder, CO 80303, USA
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
try <?php while( $my_data = msql_fetch_row ( $your_query_identifier ){ $the_array_I_want[ $my_data[ 0 ] ] = $my_data[ 1 ] ; }
echo "<PRE>"; print_r( $the_array_I_want ); echo "</PRE>"; ?>
Be aware that adding an element to $the_array_I_want will give it the next sequential number which would look like an ID but have nothing to do with the contents of your database.
Unless it is absolutely necessary I would recommend against doing this though. If you have record set with just a few records, no problem, 100's or 1000's of records and you should realize this array is using up your server memory. I am not sure of the mechanics of msql_fetch_row but I am pretty sure large result sets are not kept entirely in memory.
Morgan
At 12:10 PM 4/11/2001, you wrote:
> I need to convert an MySQL result into an Array...somehow. The
>query returns the following:
>
> +----+-----------+
> | ID | Project |
> +----+-----------+
> | 1 | Home |
> | 2 | Work |
> | 3 | Family |
> | 4 | Misc. |
> | . | ... |
> | . | ... |
> +----+-----------+
>
> ...which I want to convert into:
>
>Array(1 => "Home", 2 => "Work", 3 => "Family", 4 => Misc.", etc....);
>
> What's the best way to do this.
>
> AMK4
>
>--
>W |
> | I haven't lost my mind; it's backed up on tape somewhere.
> |____________________________________________________________________
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Ashley M. Kirchner <mailto:ashley
pcraft.com> . 303.442.6410 x130
> SysAdmin / Websmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . eFax 248.671.0909
> http://www.pcraft.com . 3550 Arapahoe Ave #6
> .................. . . . . Boulder, CO 80303, USA
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
"Rodney J. Woodruff" wrote:
> http://www.php.net/manual/en/function.msql-fetch-array.php
Okay, call me dense. I can't figure this out. This is what I'm trying to do:
$sql = "select p_id, project from proj where uid=$uid"; $result = mysql_db_query($database,$sql);
(the resulting table in mysql is as follows: +------+-----------+ | p_id | project | +------+-----------+ | 0 | Undefined | | 1 | Work | | 2 | Personal | +------+-----------+ 3 rows in set (0.00 sec)
...yes, that 'Undefined' IS a valid project, and the p_id's don't necessarily start at 0 either.)
I need that result into the following: $items = array(0 => "Undefined", 1 => "Work", 2 => "Personal");
Reason is, I pass that $items variable to the following function:
function MakeSelect($items, $selected) { $str = ""; while(list($value, $name) = each($items)) { $str .= "<option value=\"$value\"" . ($value != $selected ? \ ">" : " selected>") . "$name\n"; } return $str; }
...which then creates (assuming the person had 'Work' previously selected):
<select name=whatever_i_specify> <option value="0">Undefined <option value="1" selected>Work <option value="2">Personal </select>
How do I create that $items array?
AMK4
-- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:ashleypcraft.com> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
attached mail follows:
On Wed, Apr 11, 2001 at 03:55:38PM -0600, Ashley M. Kirchner wrote:
> "Rodney J. Woodruff" wrote: > > > http://www.php.net/manual/en/function.msql-fetch-array.php
(snip)
> I need that result into the following: > $items = array(0 => "Undefined", 1 => "Work", 2 => "Personal");
Here's a hint.
$arr[$key] = $value;
Define $key and $value from the row data that mysql_fetch_array gives you.
> Reason is, I pass that $items variable to the following function: > > function MakeSelect($items, $selected) { > $str = ""; > while(list($value, $name) = each($items)) { > $str .= "<option value=\"$value\"" . ($value != $selected ? \ > ">" : " selected>") . "$name\n"; > } > return $str; > }
For the record, you're thinking about list() backwards. In your function, the array keys will go into $value, and the values will go into $name.
HTH, Matt
attached mail follows:
Hi, there.
We're looking for advanced PHP programmers to Work in Brazil. Catho Online is the biggest job website in Brazil and possibly in Latin America. We're looking for someone who's already experienced and willing to learn even more with us.
The salary is 3000 reais (aproximately 1500 dollars). The cost of life in Brazil is low, whick makes that salary pretty high to the brazilian standards. There are also special bonus prizes for finished projects.
One does not have to be experienced in PHP. C and Perl programmers are also welcome, since these languages are similar. We work mainly with PHP and MySQL.
This job is to work in Brazil, São Paulo. For the brazilians out there, we are near Paulista Avenue, in Bela Vista.
Please send résumés directly to madleo
catho.com.br. I prefer the résumé
in the body of the message, but other formats will also be read.
Greetings,
-- Leonardo Dias Catho Online WebDeveloper http://www.catho.com.br/
attached mail follows:
Hello,
Is it possible to do some arithmetic with time/date values in PHP? for example, to calculate:
today + 1050 days. today - 7 days. etc.
I mean, does PHP have functions to perform these operations?
Thanks, Erich Reimberg.
PS. I'm new to PHP, and I didn't find anything like this in the FAQ
Please Cc to my email: ereimber
multinet.cl, for there are many
posts in this group that my server seems to loose.
attached mail follows:
> Is it possible to do some arithmetic with time/date values in PHP? > for example, to calculate: > today + 1050 days. > today - 7 days. > etc. > I mean, does PHP have functions to perform these operations?
$oneDay = 86400; // number of seconds in a day // 60 seconds * 60 minutes * 24 hours
$today = date( "U" ); // lookup the date() function
$oneWeekAgo = $today - ( $oneDay * 7 ); $1050Days = $today + ( $oneDay * 1050 );
echo "The date for one week ago is: "; echo date( "F d, Y", $oneWeekAgo );
echo "1,050 days in the future is: "; echo date( "F d, Y", $1050Days );
The unix timestamp is an awesome tool for date arithmetic. Time arithmetic uses the same logic but on a smaller scale.
$oneMinute = 60; // seconds $oneHour = 3600; // seconds; 60 seconds * 60 minutes
Chris
attached mail follows:
Hi !
Does anyone have a fileupload script that works with Safe Mode ? In all scripts I saw copy was used, so it didn't work. On the other hand, I don't want to run my server without safemode .... any hints ?
thnx
Matthias
attached mail follows:
1. I have a form that is used to upload articles to a site. The form works well with windows IE. The mac IE won't take all the text! It seems to have a cap on the amount of text a text area will allow. Any thoughts? We updated the browser which seemed to increase the limit but still have problems getting the entire article into the text area on the form.
2. I am getting strange results when the mac IE browser submits the text. Letters of words are randomly replaced with question marks. Also had some php code actually show up as if it were posted in the text area (which is of some concern).
The server is a windows based server w2k.
Thanks for any ideas. I am baffled.
Kevin
attached mail follows:
Before we go about writing new functions to handle single quotes for our Phorum reengineering project, I need to know if there is a way for PHP to easily handle the issue of passing strings to a PL/SQL script, which requires that single quotes be doubled up: that "I don't know" is properly translated into "I don''t know". In my dreams, this is handled by OCIParse or even OCIExecute, but I have a sinking feeling that this isn't the case, and that we'll need to do an extra parsing step for all of our strings that are inserted into the database, just for single quotes.
Help!
Richard
attached mail follows:
Where are the strings coming from? If from a <FORM>, then magic_quotes_sybase (in php.ini) is your friend. If from elsewhere, see magic_quotes_runtime for possible help (also in php.ini).
Kirk
> -----Original Message-----
> From: Richard Crawford [mailto:rcrawford
mossroot.com]
> Sent: Wednesday, April 11, 2001 12:05 PM
> To: php-general
lists.php.net
> Subject: [PHP] Single Quotes in Oracle Queries
>
>
> Before we go about writing new functions to handle single
> quotes for our
> Phorum reengineering project, I need to know if there is a
> way for PHP to
> easily handle the issue of passing strings to a PL/SQL script, which
> requires that single quotes be doubled up: that "I don't know" is
> properly translated into "I don''t know". In my dreams, this
> is handled
> by OCIParse or even OCIExecute, but I have a sinking feeling
> that this
> isn't the case, and that we'll need to do an extra parsing
> step for all
> of our strings that are inserted into the database, just for single
> quotes.
>
> Help!
>
> Richard
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
attached mail follows:
The quotes are indeed coming from a FORM. I'll look into magic_quote_sybase. Thanks!
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 4/11/01, 11:19:26 AM, "Johnson, Kirk" <kjohnson
zootweb.com> wrote
regarding RE: [PHP] Single Quotes in Oracle Queries:
> Where are the strings coming from? If from a <FORM>, then > magic_quotes_sybase (in php.ini) is your friend. If from elsewhere, see > magic_quotes_runtime for possible help (also in php.ini).
> Kirk
> > -----Original Message-----
> > From: Richard Crawford [mailto:rcrawford
mossroot.com]
> > Sent: Wednesday, April 11, 2001 12:05 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Single Quotes in Oracle Queries
> >
> >
> > Before we go about writing new functions to handle single
> > quotes for our
> > Phorum reengineering project, I need to know if there is a
> > way for PHP to
> > easily handle the issue of passing strings to a PL/SQL script, which
> > requires that single quotes be doubled up: that "I don't know" is
> > properly translated into "I don''t know". In my dreams, this
> > is handled
> > by OCIParse or even OCIExecute, but I have a sinking feeling
> > that this
> > isn't the case, and that we'll need to do an extra parsing
> > step for all
> > of our strings that are inserted into the database, just for single
> > quotes.
> >
> > Help!
> >
> > Richard
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
What I'm trying to do is specify a URL in a form, and then take that URL, put its contents into a variable, and mail it out in an e-mail message with the body of the message being that URL. I haven't gotten anywhere so far, just getting blank messages for the body.. can anyone point me in the right direction on saving the contents of a page to a variable? I've ran across a few examples, but nothing has worked for me yet. :(
Thanks, Chad
attached mail follows:
What have you tried so far?
-- Rodney
Chad Day wrote:
> What I'm trying to do is specify a URL in a form, and then take that URL,
> put its contents into a variable, and mail it out in an e-mail message with
> the body of the message being that URL. I haven't gotten anywhere so far,
> just getting blank messages for the body.. can anyone point me in the
> right direction on saving the contents of a page to a variable? I've ran
> across a few examples, but nothing has worked for me yet. :(
>
> Thanks,
> Chad
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Various things, but I finally hit upon something that worked. Thanks anyway.
Chad
-----Original Message-----
From: Rodney J. Woodruff [mailto:rwoodruf
umich.edu]
Sent: Wednesday, April 11, 2001 5:03 PM
To: Chad Day
Cc: php-general
lists.php.net
Subject: Re: [PHP] Including a URL for mailing..
What have you tried so far?
-- Rodney
Chad Day wrote:
> What I'm trying to do is specify a URL in a form, and then take that URL,
> put its contents into a variable, and mail it out in an e-mail message
with
> the body of the message being that URL. I haven't gotten anywhere so far,
> just getting blank messages for the body.. can anyone point me in the
> right direction on saving the contents of a page to a variable? I've ran
> across a few examples, but nothing has worked for me yet. :(
>
> Thanks,
> Chad
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
> What I'm trying to do is specify a URL in a form, and then take that URL, > put its contents into a variable, and mail it out in an e-mail message with > the body of the message being that URL. I haven't gotten anywhere so far, > just getting blank messages for the body.. can anyone point me in the > right direction on saving the contents of a page to a variable? I've ran > across a few examples, but nothing has worked for me yet. :( > > Thanks, > Chad >
try using output buffering. In a php script put the following:
ob_start(); //everything following will be stored for output.
include 'your_page.php';
$body=ob_get_contents(); //store everything in output in $body variable
Then mail as usual. Your page will be the $body variable. If you want to display the page as well use ob_end_flush(). If you just want to mail the page use ob_end_clean() to clear the output buffering and continue scripting for normal display.
check out http://www.php.net/manual/en/ref.outcontrol.php for more information on output buffering. If you are still stuck email me off list and I will send you a sample of a file that does the same thing for me.
Brett
attached mail follows:
Hi!
I have a script which sends the following headers in order to get the client to display a "file save" prompt.
> header ("Content-Type: application/octet-stream"); > header ("Content-Disposition: attachment; filename=$filename"); > readfile($filename);
This works well on Netscape/lynx. However, IE 5.5 has a problem with this - I get a message saying that the "file could not be found". Looked around online, some sites say that this is an IE-specific issue with MIME-type recognition.
However, I see sites like yahoo and deja allowing users to download email attachments using a similar technique, and that works fine on IE. Any ideas on what I'm doing wrong here?
TIA!
Vikram
attached mail follows:
What are the differences in these? I know with while() you have to reset() the array afterwards, but foreach() you don't. Also foreach() appears to be quite a bit faster.
My main question is there ANY difference in how these two loop through the array.
--Joe
/******************************************************************************\ * Joe Stump - PHP/SQL/HTML Developer * * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * * "Better to double your money on mediocrity than lose it all on a dream." * \******************************************************************************/
attached mail follows:
One apparent problem with foreach() is it can misbehave code as follows. (4.0.4pl1, 4.0.5RC6)
function foo($a) { foreach ($a[0] as $k => $v) { echo $k.$v; } }
$a = 'abc'; foo($a);
You'll get 'server not found' or browser waiting forever with this code. (If you don't, please let me know)
String can be accessed like array, but foreach does not handle invalid parameter well. While() does not misbehave with equivalent code.
Regards,
-- Yasuo Ohgaki"Joe Stump" <miester
php.net> wrote in message news:20010411134931.C3680
zorka.com... > What are the differences in these? I know with while() you have to reset() the > array afterwards, but foreach() you don't. Also foreach() appears to be quite > a bit faster. > > My main question is there ANY difference in how these two loop through the > array. > > --Joe > > > > /******************************************************************************\ > * Joe Stump - PHP/SQL/HTML Developer * > * http://www.care2.com - http://www.miester.org - http://gtk.php-coder.net * > * "Better to double your money on mediocrity than lose it all on a dream." * > \******************************************************************************/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
On the server itself (to which I have root access) I type:
someProgram arg1 arg2 arg3
and it runs properly, returning the proper output to standard output (the screen). I can do this from anywhere on the server (for example, from the same directory where my php scripts are located, /var/www/html/blah), and I can do it as the same user that apache runs as ('apache').
BUT, when I try:
<?php passthru("someProgram arg1 arg2 arg3"); ?>
it fails. I get no output at all. I can check that everything else is ok by doing something like
<?php passthru("someProgram arg1 arg2 arg3"); passthru("echo 'finished'"); ?>
which then returns just the word 'finished' to the browser.
I CAN do other things via passthru, for example,
<?php passthru("man tar"); ?>, and
<?php passthru("ls -al"); ?>
and so on. I am running php as an apache module. I am NOT running php in 'safe mode'.
Any ideas what is going wrong here?
Thanks,
Michael Dickson
attached mail follows:
Just guessing here. On our setup, PHP runs as nobody. Is there a permissions problem around "someProgram"?
Kirk
> -----Original Message-----
> From: Michael Dickson [mailto:midickso
indiana.edu]
> Sent: Wednesday, April 11, 2001 1:27 PM
> To: php-general
lists.php.net
> Subject: [PHP] passthru
>
>
> On the server itself (to which I have root access) I type:
>
> someProgram arg1 arg2 arg3
>
> and it runs properly, returning the proper output to standard
> output (the
> screen). I can do this from anywhere on the server (for
> example, from the
> same directory where my php scripts are located,
> /var/www/html/blah), and I
> can do it as the same user that apache runs as ('apache').
>
> BUT, when I try:
>
> <?php passthru("someProgram arg1 arg2 arg3"); ?>
>
> it fails. I get no output at all. I can check that
> everything else is ok
> by doing something like
>
> <?php passthru("someProgram arg1 arg2 arg3"); passthru("echo
> 'finished'");
> ?>
>
> which then returns just the word 'finished' to the browser.
>
> I CAN do other things via passthru, for example,
>
> <?php passthru("man tar"); ?>, and
>
> <?php passthru("ls -al"); ?>
>
> and so on. I am running php as an apache module. I am NOT
> running php in
> 'safe mode'.
>
> Any ideas what is going wrong here?
>
> Thanks,
>
> Michael Dickson
attached mail follows:
I am doing a basic mouseiver on a page where some php code also resides.
I basically dump the top of the web page through a function page_top() which is just passing all the html & java through a string, then pull some db stuff out, and finally call the page_bottom() which pulls in the rest of the html.
The problem is that the mouseover doesn't work within the php page which puts the whole thing together.
Any ideas on how to work around this ?
Thanks
-- ___________________________________________________________ Jack Sasportas Innovative Internet Solutions Phone 305.665.2500 Fax 305.665.2551 www.innovativeinternet.com www.web56.net
attached mail follows:
I want to get the hostname from the browsers that access my site.
What is the syntax to use with the HTTP_ENV_VARS?
mysql_query("INSERT INTO weblog(ip, hostname, port, time) " . " \ VALUES('$REMOTE_ADDR', '$HTTP_ENV_VARS....', '$REMOTE_PORT', \ '$time')");
Thanks!
attached mail follows:
Did you read PHP Manual? If you don't read online manual, I suggest to read it. Annotated manual is very useful.
http://www.php.net/manual/en/language.variables.external.php
Regards,
-- Yasuo Ohgaki"Phil Labonte" <plabonte
atreus-systems.com> wrote in message news:1B5C7FA9D60DD511ABEF00508BFDEFDC106A
EXCHANGE... > > I want to get the hostname from the browsers that access my site. > > What is the syntax to use with the HTTP_ENV_VARS? > > mysql_query("INSERT INTO weblog(ip, hostname, port, time) " . " \ > VALUES('$REMOTE_ADDR', '$HTTP_ENV_VARS....', '$REMOTE_PORT', \ > '$time')"); > > Thanks! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net > For additional commands, e-mail: php-general-help
lists.php.net > To contact the list administrators, e-mail: php-list-admin
lists.php.net >
attached mail follows:
Hi, I'm trying to configure in --with-ldap. i have the iPlanet ldapsdk installed in /usr/local/include /usr/local/lib
php configures and compiles with out any complaints. the problem happens when i try to start apache.
Syntax error on line 23 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1: /usr/local/apache/bin/httpd: fatal: relocation error: file /usr/local/apache/libexec/libphp4.so: symbol ldap_unbind_s: referenced symbol not found /usr/local/apache/bin/apachectl start: httpd could not be started
I don't know what this means.
line 23 of /usr/local/apache/conf/httpd.conf is;
LoadModule php4_module libexec/libphp4.so
any help or direction would be appreciated.
Thanks, joe rice
web admin www.bigidea.com
attached mail follows:
Desperate and frustrated new php peep here. Trying to install php4 on windows 2000 using IIS5. I have tried EVERYTHING. Last thing I tried was the easyinstaller from the phpeverywhere people. No luck. Everytime I try a test, I get a blank page???
Take pity on me please!!!!!!! If I cannot get this to work I have to use Lotus Domino (yuck) and I am signed up to take a class but have to have php installed first. I already bought the book. I want to use this. I like this. But cannot get past the installation. Am I a lost cause already???
Is there anyone out there who has been in my shoes and worked this all out? Can someone give me a list of what to check etc.. Everytime I try to install. I follow the directions and nothing seems to work. I have been to the php.net site and no luck with those instructions either. And no, I cannot use Apache so please don't even mention it.
The sad thing is I had installed Apache and php4 on Windows NT in about a 1/2 hour. Ran my phpinfo test and it worked. Then, my system config changed and now under 2000/IIs I cannot get it to work. Help me please.......
Thanks So much Deb
P.S. I have tried sending this to the windows php list and it keeps getting returned so I thought I would try here
attached mail follows:
What are you using as a test ?
try saving this below as info.php
<? phpinfo(); ?>
make sure you are saving this to your webroot and calling it through your browser http://localhost/info.php
Jerry Lake - jerryl
europa.com
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: Deborah Dennison [mailto:dennisond
netscout.com]
Sent: Wednesday, April 11, 2001 1:55 PM
To: php-general
lists.php.net
Subject: [PHP] windows 2000 install
Desperate and frustrated new php peep here. Trying to install php4 on windows 2000 using IIS5. I have tried EVERYTHING. Last thing I tried was the easyinstaller from the phpeverywhere people. No luck. Everytime I try a test, I get a blank page???
Take pity on me please!!!!!!! If I cannot get this to work I have to use Lotus Domino (yuck) and I am signed up to take a class but have to have php installed first. I already bought the book. I want to use this. I like this. But cannot get past the installation. Am I a lost cause already???
Is there anyone out there who has been in my shoes and worked this all out? Can someone give me a list of what to check etc.. Everytime I try to install. I follow the directions and nothing seems to work. I have been to the php.net site and no luck with those instructions either. And no, I cannot use Apache so please don't even mention it.
The sad thing is I had installed Apache and php4 on Windows NT in about a 1/2 hour. Ran my phpinfo test and it worked. Then, my system config changed and now under 2000/IIs I cannot get it to work. Help me please.......
Thanks So much Deb
P.S. I have tried sending this to the windows php list and it keeps getting returned so I thought I would try here
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
There are two stages here. Getting PHP installed and working and getting IIS configured.
To tackle the first should be easy. If php.exe and phpts.dll are in the same directory as each other (say C:\php) and php.ini is in the WINNT folder AND you haven't done anything silly in php.ini, then PHP should work.
Test by opening a command window, changing directory to C:\php and typing php.exe -i. A screenful of html tells you php is working. Alternatively, an error message might tell you what's wrong.
If that works, run the Internet service manager and check that for the web site you are playing with, the .php file extension is mapped onto the php.exe.
Run a .php file containing just <?php phpinfo();?> from your web browser on localhost.
If that works, great. If not, tell us exactly what happens.
Cheers
-- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
attached mail follows:
I hope you understand:
It is too long to include here so I'll give you an idea.
file.B ----------------------- <?php $all_cats = "1, 2, 3"; function html_options($output, $values = NULL, $selected = NOT_NULL, $first_option_output = false) } return($html_output); }
echo"<select name=\"cat\" size=\"1\">"; //-cats $cats = explode(',',$all_cats); //--values $cats_vals = explode(',',$all_cats); print html_options($cats, $cats_vals, $selected, "--Select one--"); echo"</SELECT>"; ?> ------------------------
file.A code: <?php $connect to db; $get result; $cat = $row["cat"]; $selected = "$cat"; ----------------------- include ("file.B"); ----------------------- done ?> From here on I get the menu with --select one-- option first then 1, 2, 3, but it ignores the fact the I told it $selected = "$cat". I figure it has to do with including the function file instead of having the function inside of "A". How can I call file.B from different files and have it accept the variable $selected from such files?
Thaks in advance:
Gerry Figueroa
attached mail follows:
I got it, I think:
and this at the beginning of file "B" $selected == "$selected";
and placed this statement in file "A"
if (isset($selected[$cat])) { include ("cat_select.php"); }
I don't know why it works but it does, is there anything wrong with this method?
Gerry wrote:
>
> I hope you understand:
>
> It is too long to include here so I'll give you an idea.
>
> file.B
> -----------------------
> <?php
> $all_cats = "1, 2, 3";
> function html_options($output,
> $values = NULL,
> $selected = NOT_NULL,
> $first_option_output = false)
> }
> return($html_output);
> }
>
> echo"<select name=\"cat\" size=\"1\">";
> //-cats
> $cats = explode(',',$all_cats);
> //--values
> $cats_vals = explode(',',$all_cats);
> print html_options($cats, $cats_vals, $selected, "--Select one--");
> echo"</SELECT>";
> ?>
> ------------------------
>
> file.A code:
> <?php
> $connect to db;
> $get result;
> $cat = $row["cat"];
> $selected = "$cat";
> -----------------------
> include ("file.B");
> -----------------------
> done
> ?>
> From here on I get the menu with --select one-- option first then 1, 2,
> 3, but it ignores the fact the I told it $selected = "$cat". I figure it
> has to do with including the function file instead of having the
> function inside of "A". How can I call file.B from different files and
> have it accept the variable $selected from such files?
>
> Thaks in advance:
>
> Gerry Figueroa
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Just out of curiosity, can anyone explain the mechanics behind accessing a database query result set. ie $result_id = pg_execute( 'select * from my_table' );
when I call loop through pg_fetch_row( $result_id, $rom_num ) or pg_fetch_object( $result_id, $rom_num ) has php read the entire result set into memory( say the result set has 10,000 records ), cached a fixed number of records in memory or does it simply have a record_set_pointer of some sort that tells the DB where to fetch the next asked for record from.
This is probably a DB engine setting but I am curious what the process is.
Thanks, Morgan
attached mail follows:
I am trying to make a simple HTML menu system. I am having problems displaying menu links under the correct submenu from a loop.
I have a database with two tables. One table holds menu and sub menu headings and the other table holds the contents of each submenu (the actual menu links and names). I need to display the menu title and then the sub menu title from table 1 and then display the submenu contents or links from table 2 and then display the next set of links under the correct submenu
Example output would look like this:
Say person clicks on Admin menu which is already displayed then the networking submenu heading will display along with the submenu links:
Example: Admin (main menu title from db table 1) Networking (submenu title , from db table 1 ping (Link to ping from db table 2) traceroute (Link to ping from db table 2) nsloopup etc........
I don't know how to go about outputing the links under the correct submenu. The main menu is no problem. I am thinking I would need a loop within a loop.
The query I use: $query = "SELECT * FROM menutable, elementstable WHERE menutable.menutable_id = elementstable.menuid AND menutable.mainmenu = 'Admin' ";
$result = mysql_db_query("menus", $query);
This loop simply assigns variables and prints out all output under the main menu called Admin. The problem is how do I display
while ($r = mysql_fetch_array($result)) {
// start menu table (table holds main menu/sub menu headings $menutable_id = $r["menutable_id"]; $menunumber = $r["menunumber"]; $mainmenu = $r["mainmenu"]; $submenu = $r["submenu"]; // start elements table (table that holds the links and names of each link) // element_id references menu table $element_id = $r["element_id"]; $element = $r["element"]; $url = $r["url"]; $menuid = $r["menuid"];
// next display data this is wrong cause it displays 1 submenu and 1 link looping ?> <TD><? echo "$submenu"; ?></TD> <TD><a href="<? echo "$url"; ?> "> <? echo "$element"; ?></a> </TD> <?
// this doesn't work if ($menutable_id == $menuid) { ?> <TD><? echo "equal $submenu"; ?></TD> <? // print "both equal"; // // $b = $a; }
?>
Notes: Loop de loop: // outer loop display submenus (when submenu changes display next set of elements or links from inner loop) if submenu changes then display next set of menu links for that submenu // inner loop display elements or links for that submenu until sub menu changes
MySQL and PHP4 latest using Linux OS
attached mail follows:
This happened to me when I used _affected_rows instead of _count
make sure you're using the right function.
that drove me nuts before I got it working, AND I followed the durn directions.
chris
On Tue, 10 Apr 2001 09:02:32 -0700, elias wrote:
>can you show me some code?
>basically when you provide an invalid link to any MySql function this error
>occur.
>
>-elias
>http://www.kameelah.org/eassoft
>
>""Nathan Roberts"" <Nathan
fpandts.com> wrote in message
>news:9atdps$kgv$1
toye.p.sourceforge.net...
>> I am trying to get to grips with managing data in mysql, am am currentky
>> working on deleting records
>>
>> I have worked through a turorial - no problems, but now I am trying to
>apply
>> it to my own database, I am getting the error
>> Warning: Supplied argument is not a valid MySQL result resource in .... on
>> line 14
>>
>> I cannot see what is causing it - if anyone can it would be much
>> appreciated.
>>
>> thanks
>>
>> Nathan
>>
>> For clarity/brevity I have cut the page back to what i beleive to be the
>> relivant part. Code for page is:-
>>
>> <html>
>>
>> <body>
>>
>> <?php
>>
>> $db = mysql_connect("localhost", "username", "pasword");
>>
>> mysql_select_db("catalogue",$db);
>>
>>
>> $result = mysql_query("SELECT * FROM SECTIONS",$db);
>>
>> while ($myrow = mysql_fetch_array($result)) {
>>
>> printf("<a href=\"%s?section_id=%s\">%s %s</a> \n", $PHP_SELF,
>> $myrow["section_id"], $myrow["section_name"], $myrow["section"]);
>>
>> printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a><br>", $PHP_SELF,
>> $myrow["section_id"]);
>>
>> }
>>
>>
>> ?>
>>
>>
>>
>> </body>
>>
>> </html>
>>
>>
>> SQL for the table is
>>
>> CREATE TABLE SECTIONS (
>> section_name varchar(25) NOT NULL,
>> section_id tinyint(3) unsigned DEFAULT '0' NOT NULL auto_increment,
>> section char(1) NOT NULL,
>> PRIMARY KEY (section_id),
>> UNIQUE section (section_name, section_id, section)
>>
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>> For additional commands, e-mail: php-general-help
lists.php.net
>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
hiya,
I have a script that repeats a form x number of times depending on how many records there are, what's happening is when i go to update my radio buttons it sees every radio button on the page as the ONE group when really it's x number of groups (again depending on how many records there are)
How can i differ between raido groups with out having to get the name changed for every record after the 1st one?
Peter Houchin
peterh
sunrentals.com.au
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
attached mail follows:
I don't think you can. The browser groups them by the name, so you will have to write some code (simple) to change the name...
SED
-----Original Message-----
From: Peter Houchin [mailto:peterh
vfsa.com.au]
Sent: 11. apríl 2001 23:33
To: Php-General
Lists. Php. Net
Subject: [PHP] radio groups in looped form
hiya,
I have a script that repeats a form x number of times depending on how many records there are, what's happening is when i go to update my radio buttons it sees every radio button on the page as the ONE group when really it's x number of groups (again depending on how many records there are)
How can i differ between raido groups with out having to get the name changed for every record after the 1st one?
Peter Houchin
peterh
sunrentals.com.au
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
attached mail follows:
even though i am putting them in an array?
like
<input type="radio" name="avail[]" value="y" <? if ($avail == 'y') { echo 'CHECKED'; }?>>
(i have another 2 radio buttons with this group)
Peter
-----Original Message-----
From: SED [mailto:sed
sed.is]
Sent: Thursday, April 12, 2001 10:05 AM
To: Peter Houchin
Cc: Php-General
Lists.Php.Net
Subject: RE: [PHP] radio groups in looped form
I don't think you can. The browser groups them by the name, so you will have
to write some code (simple) to change the name...
SED
-----Original Message-----
From: Peter Houchin [mailto:peterh
vfsa.com.au]
Sent: 11. apríl 2001 23:33
To: Php-General
Lists. Php. Net
Subject: [PHP] radio groups in looped form
hiya,
I have a script that repeats a form x number of times depending on how many
records there are, what's happening is when i go to update my radio buttons
it sees every radio button on the page as the ONE group when really it's x
number of groups (again depending on how many records there are)
How can i differ between raido groups with out having to get the name
changed for every record after the 1st one?
Peter Houchin
peterh
sunrentals.com.au
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
attached mail follows:
My question:
are the groups all within different forms? does each for have a different name? don't know, something to try.
On 4/11/01 5:05 PM, "Peter Houchin" <peterh
vfsa.com.au> wrote:
> even though i am putting them in an array?
>
> like
>
> <input type="radio" name="avail[]" value="y" <? if ($avail == 'y') { echo
> 'CHECKED'; }?>>
>
> (i have another 2 radio buttons with this group)
>
> Peter
>
> -----Original Message-----
> From: SED [mailto:sed
sed.is]
> Sent: Thursday, April 12, 2001 10:05 AM
> To: Peter Houchin
> Cc: Php-General
Lists.Php.Net
> Subject: RE: [PHP] radio groups in looped form
>
>
> I don't think you can. The browser groups them by the name, so you will have
> to write some code (simple) to change the name...
>
> SED
>
> -----Original Message-----
> From: Peter Houchin [mailto:peterh
vfsa.com.au]
> Sent: 11. apríl 2001 23:33
> To: Php-General
Lists. Php. Net
> Subject: [PHP] radio groups in looped form
>
>
> hiya,
>
> I have a script that repeats a form x number of times depending on how many
> records there are, what's happening is when i go to update my radio buttons
> it sees every radio button on the page as the ONE group when really it's x
> number of groups (again depending on how many records there are)
>
> How can i differ between raido groups with out having to get the name
> changed for every record after the 1st one?
>
> Peter Houchin
> peterh
sunrentals.com.au
> =========================================================
> _____ __ /\
> /_/_/_\ / |_/ \
> /_/_/_ __ __ __ __ / \
> \_/_/_\ /_/ /_/ /_/ /_/ \ _ /
> ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
> \_//_/_/ /_/_/_/ /_/ \/_/ v
> ________ ________________________________________
> /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> /_/_ _/_/ ______ __ __ /_/ ____ __ ______
> /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
> /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
> /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
> =========================================================
> Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
> ************* We rent the dot in .COM! **************
>
>
attached mail follows:
So far as I know, the HTML does not support arrays. However, you can make simple code that adds number to each group so you can refer to them later e.g.:
$i = 0; while (your arguments) {
echo "name=\avail$i\"; $i++;
}
And afterwards you can refer to it the same way (perhaps you may want to keep the total value of $i in a hidden form field for later use).
SED
-----Original Message-----
From: Peter Houchin [mailto:peterh
vfsa.com.au]
Sent: 12. apríl 2001 00:05
To: sed
sed.is
Cc: Php-General
lists.php.net
Subject: RE: [PHP] radio groups in looped form
even though i am putting them in an array?
like
<input type="radio" name="avail[]" value="y" <? if ($avail == 'y') { echo 'CHECKED'; }?>>
(i have another 2 radio buttons with this group)
Peter
-----Original Message-----
From: SED [mailto:sed
sed.is]
Sent: Thursday, April 12, 2001 10:05 AM
To: Peter Houchin
Cc: Php-General
Lists.Php.Net
Subject: RE: [PHP] radio groups in looped form
I don't think you can. The browser groups them by the name, so you will have to write some code (simple) to change the name...
SED
-----Original Message-----
From: Peter Houchin [mailto:peterh
vfsa.com.au]
Sent: 11. apríl 2001 23:33
To: Php-General
Lists. Php. Net
Subject: [PHP] radio groups in looped form
hiya,
I have a script that repeats a form x number of times depending on how many records there are, what's happening is when i go to update my radio buttons it sees every radio button on the page as the ONE group when really it's x number of groups (again depending on how many records there are)
How can i differ between raido groups with out having to get the name changed for every record after the 1st one?
Peter Houchin
peterh
sunrentals.com.au
=========================================================
_____ __ /\
/_/_/_\ / |_/ \
/_/_/_ __ __ __ __ / \
\_/_/_\ /_/ /_/ /_/ /_/ \ _ /
___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
\_//_/_/ /_/_/_/ /_/ \/_/ v
________ ________________________________________
/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/_/_ _/_/ ______ __ __ /_/ ____ __ ______
/_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
/_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
/_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
=========================================================
Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
************* We rent the dot in .COM! **************
attached mail follows:
by this I mean, html code of the form: <FORM NAME="form1" METHOD="post" ACTION=""> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> </FORM> <FORM NAME="form2" METHOD="post" ACTION=""> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> <INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"> INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton">
INPUT TYPE="radio" NAME="radiobutton" ALUE="radiobutton" </FORM>
radiobuttons with the same name, in the same FORM tag will always be considered a group. if they are in separate form tags, they should be separate groups, even if the form does not have a name (unless the browser is buggy)
the way around this is multidimensional arrays
printing your radio buttons as name="avail[1][]" will put make different subgroups or radio buttons every time you change the index in the first [].
but, if you truly have separate form tags, the only data that is going to get sent back, is the data within that for, doesn't matter WHAT the other buttons in the other forms say.
personally, I try to stay away from multiple forms per page.
in a situation like yours sounds to be, I like to put a hidden field on each line that is mykey[] and set the value to a unique id in the database.
I can then put a lot of data into multiple rows, enabling me to update a whole group of data at once.
I still have to send one update to my database per row, but what the hell.
On 4/11/01 5:07 PM, "Lindsay Adams" <lindsay
dingos.net> wrote:
> My question:
>
> are the groups all within different forms? does each for have a different
> name? don't know, something to try.
>
>
> On 4/11/01 5:05 PM, "Peter Houchin" <peterh
vfsa.com.au> wrote:
>
>> even though i am putting them in an array?
>>
>> like
>>
>> <input type="radio" name="avail[]" value="y" <? if ($avail == 'y') { echo
>> 'CHECKED'; }?>>
>>
>> (i have another 2 radio buttons with this group)
>>
>> Peter
>>
>> -----Original Message-----
>> From: SED [mailto:sed
sed.is]
>> Sent: Thursday, April 12, 2001 10:05 AM
>> To: Peter Houchin
>> Cc: Php-General
Lists.Php.Net
>> Subject: RE: [PHP] radio groups in looped form
>>
>>
>> I don't think you can. The browser groups them by the name, so you will have
>> to write some code (simple) to change the name...
>>
>> SED
>>
>> -----Original Message-----
>> From: Peter Houchin [mailto:peterh
vfsa.com.au]
>> Sent: 11. apríl 2001 23:33
>> To: Php-General
Lists. Php. Net
>> Subject: [PHP] radio groups in looped form
>>
>>
>> hiya,
>>
>> I have a script that repeats a form x number of times depending on how many
>> records there are, what's happening is when i go to update my radio buttons
>> it sees every radio button on the page as the ONE group when really it's x
>> number of groups (again depending on how many records there are)
>>
>> How can i differ between raido groups with out having to get the name
>> changed for every record after the 1st one?
>>
>> Peter Houchin
>> peterh
sunrentals.com.au
>> =========================================================
>> _____ __ /\
>> /_/_/_\ / |_/ \
>> /_/_/_ __ __ __ __ / \
>> \_/_/_\ /_/ /_/ /_/ /_/ \ _ /
>> ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/
>> \_//_/_/ /_/_/_/ /_/ \/_/ v
>> ________ ________________________________________
>> /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>> /_/_ _/_/ ______ __ __ /_/ ____ __ ______
>> /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/
>> /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\
>> /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/
>> =========================================================
>> Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755
>> ************* We rent the dot in .COM! **************
>>
>>
>
attached mail follows:
One thing I forgot to mention, you can of course name the group: avail[$i] (see below) so you will able to refer to it as an array in PHP file later on.
----------------------------------------------------------------------------
-- So far as I know, the HTML does not support arrays. However, you can make simple code that adds number to each group so you can refer to them later e.g.:$i = 0; while (your arguments) {
echo "name=\avail[$i]\"; $i++;
}
And afterwards you can refer to it the same way (perhaps you may want to keep the total value of $i in a hidden form field for later use).
SED
-----Original Message----- From: Peter Houchin [mailto:peterh
vfsa.com.au] Sent: 12. apríl 2001 00:05 To: sed
sed.is Cc: Php-General
lists.php.net Subject: RE: [PHP] radio groups in looped form
even though i am putting them in an array?
like
<input type="radio" name="avail[]" value="y" <? if ($avail == 'y') { echo 'CHECKED'; }?>>
(i have another 2 radio buttons with this group)
Peter
-----Original Message----- From: SED [mailto:sed
sed.is] Sent: Thursday, April 12, 2001 10:05 AM To: Peter Houchin Cc: Php-General
Lists.Php.Net Subject: RE: [PHP] radio groups in looped form
I don't think you can. The browser groups them by the name, so you will have to write some code (simple) to change the name...
SED
-----Original Message----- From: Peter Houchin [mailto:peterh
vfsa.com.au] Sent: 11. apríl 2001 23:33 To: Php-General
Lists. Php. Net Subject: [PHP] radio groups in looped form
hiya,
I have a script that repeats a form x number of times depending on how many records there are, what's happening is when i go to update my radio buttons it sees every radio button on the page as the ONE group when really it's x number of groups (again depending on how many records there are)
How can i differ between raido groups with out having to get the name changed for every record after the 1st one?
Peter Houchin peterh
sunrentals.com.au ========================================================= _____ __ /\ /_/_/_\ / |_/ \ /_/_/_ __ __ __ __ / \ \_/_/_\ /_/ /_/ /_/ /_/ \ _ / ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ \_//_/_/ /_/_/_/ /_/ \/_/ v ________ ________________________________________ /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /_/_ _/_/ ______ __ __ /_/ ____ __ ______ /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ ========================================================= Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 ************* We rent the dot in .COM! **************
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
What about this error:
checkdnsrr() is not supported in this PHP build
Any answers?
-- Jochen Kaechelin - Ihr WEBberater Stuttgarter Str.3, D-73033 Goeppingen Tel. 07161-92 95 94, Fax 07161-92 95 98 http://www.wa-p.de, mailto:jkwa-p.de
attached mail follows:
Hi guys,
Below is the error message that I am receiving, and 3 or 4 lines around the code that seems to be causing the issue. Lines are numbered so it gives you a good idea of line 183. What I need to know, is in my context, what is the error saying, and if there is a variable (or function or class) to define, how can I tell which one it is?
Fatal error: Call to a member function on a non-object in /home/httpd/www/g0thic/cawood_a4/edit_f.php on line 183
178- if($seditFileErr == "") 179- { 180- // Load primary key and form parameters 181- $fldf_id = get_param("f_id"); 182- $fldu_id = get_param("u_id"); 183- $tpl->set_var("Trn_u_id", get_param("u_id")); 184- $pf_id = get_param("f_id"); 185- $tpl->set_var("editFileError", ""); 186- }
Get_param is a function to get the variable "u_id" that would have been sent back with the page url (e.g.: page.php?u_id=3993)
Any ideas?
Cheers,
Sean
attached mail follows:
Hi g0thic,
8:17:24 PM on 4/11/2001, g0thic wrote:
... > Fatal error: Call to a member function on a non-object in > /home/httpd/www/g0thic/cawood_a4/edit_f.php on line 183
> 178- if($seditFileErr == "") > 179- { > 180- // Load primary key and form parameters > 181- $fldf_id = get_param("f_id"); > 182- $fldu_id = get_param("u_id"); > 183- $tpl->set_var("Trn_u_id", get_param("u_id"));
Is $tpl actually an defined as an object some place in the file? If this snippet is inside of a function, $tpl might need to be made global.
> 184- $pf_id = get_param("f_id"); > 185- $tpl->set_var("editFileError", ""); > 186- }
> Get_param is a function to get the variable "u_id" that would have been sent > back with the page url (e.g.: page.php?u_id=3993)
-Brian
-- PGP is spoken here: 0xE4D0C7C8 Please do not carbon copy me on list replies.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]