php-general Digest 6 Apr 2001 23:40:36 -0000 Issue 612 Topics (messages 47430 through 47526): Re: Nearly all (1755) PHP functions in a text file 47430 by: maatt 47458 by: Phillip Bow 47460 by: Jason Lotito 47484 by: Johnson, Kirk Date formatting 47431 by: Matt Davis 47438 by: Joe Sheble (Wizaerd) 47459 by: Joe Stump Re: problem: php-document in netscape is oly downloadable 47432 by: B. van Ouwerkerk problem loading php4-document 47433 by: MMATTES.de.ibm.com 47434 by: Altunergil, Oktay Re: Array problem 47435 by: Mark Roedel 47455 by: Joe Stump mssql_pconnect issues? 47436 by: Michael Kimsal 47437 by: Kees Hoekzema 47449 by: Michael Kimsal 47483 by: Kees Hoekzema Help w/Error Message 47439 by: Toni Barskile 47440 by: Joe Sheble (Wizaerd) 47441 by: Renze Munnik Re: Problem with each() 47442 by: David Minor String in a string 47443 by: Mike 47445 by: Jon Haworth 47447 by: Martin Cabrera Diaubalick 47451 by: Phil Driscoll Re: Error message 47444 by: Toni Barskile 47450 by: Renze Munnik Table Relationships 47446 by: David Smith function return 47448 by: Kurth Bemis 47456 by: Adrian Murphy 47524 by: Plutarck Apache Win32 sapi error 47452 by: Yurais Fernandez Leal Re: function and global problems 47453 by: Steve Werby Problem with newline and email 47454 by: Pierre-Yves Lemaire 47520 by: Plutarck Re: Variables 47457 by: Joe Stump 47461 by: Jon Haworth 47468 by: Cheng, Kynan (London) 47506 by: Jonathan Sharp Which is better?? 47462 by: Curtis 47463 by: Michael Kimsal 47486 by: Felix Kronlage 47505 by: Jonathan Sharp Nested for() loops? 47464 by: jvoth.mobiltex.com 47465 by: Joe Stump 47467 by: Johnson, Kirk 47518 by: Plutarck PHP/MySQL Code 47466 by: Jeff Oien 47469 by: Steve Werby 47470 by: Jon Haworth 47471 by: Brian S. Dunworth 47472 by: Jeff Oien 47473 by: long huynh 47477 by: Steve Werby Re: Nested for() loops? -> Now Multi Dimension Arrays 47474 by: jvoth.mobiltex.com 47475 by: Joe Stump "odbc_result", long data get cut off???? 47476 by: Scott Fletcher Virtual Hosts on Solaris with iPlanet Enterprise 47478 by: Tom Freeman No character set? 47479 by: Leon Mergen Help please. 47480 by: Chris 47481 by: Johnson, Kirk 47485 by: Chris 47488 by: Steve Werby Newsletter on the way..stuck in the moment! 47482 by: Dhaval Desai 47487 by: Steve Werby 47503 by: Boaz Yahav 47516 by: Miles Thompson bug in php4 with postgres? 47489 by: Kristopher Yates 47514 by: Martķn Marqués Close Window script 47490 by: Wee Chua 47492 by: Lindsay Adams 47493 by: Sam Masiello 47494 by: Pierre-Yves Lemaire Extension_dir in php.ini? 47491 by: Lindsay Adams FORM <input type=image ...> with a posting value 47495 by: Jared Howard 47496 by: Johnson, Kirk 47497 by: Johnson, Kirk Again about PHP + IRC 47498 by: Marius Petravičius 47519 by: Plutarck FastTemplate strange Error 47499 by: Gustavo Vieira Goncalves Coelho Rios PHP Magazines? 47500 by: Chris Anderson 47517 by: Miles Thompson Decode ?iso strings? 47501 by: Jeroen Geusebroek Tutorial for a php based chat enviroment 47502 by: Lars Reith mail() limit? 47504 by: Chris 47513 by: Boaz Yahav Re: Array of words in textfile? 47507 by: Jonathan Sharp Re: Building an array from a URL 47508 by: Jonathan Sharp Looking for members in the Twin Cities 47509 by: Chris Moewes-Bystrom Print or Echo. 47510 by: Sterling 47511 by: Joe Stump 47512 by: Jeff Oien 47515 by: Alexander Wagner Re: close tcp-IP connection before php-skript finishes 47521 by: Plutarck fwrite() 47522 by: Augusto Cesar Castoldi 47525 by: Richard Update: 1767 functions! 47523 by: Plutarck escape characters 47526 by: Adam Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Dammit, that's great Plutarck. Been wanting to write a documentating script for ages, that basically took the output from show_source() and added links to all the functions in the online manual, as well as any functions defined in the script or includes. Will be handy for a tutorial series I'm doing: users could then just point-and-click at the bits of the script they don't understand. All I needed to get going with it was a list of all the pre-defined functions. And here it is! Matt ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9ajqk2$ll4$[EMAIL PROTECTED]">news:9ajqk2$ll4$[EMAIL PROTECTED]... > First of all I use Edit Plus, which uses a list of PHP functions to know > what words to highlight in the code. > > Well now that I have a seriously throbbing headache, I've done it. Finally. > > If you use a program that needs a list of functions for syntax highlighting, > I've finally got one that has every function according to PHP > get_defined_functions (includes quite a few undocumented functions), the PHP > manual, and quite a few others it failed to mention but should be > highlighted. unset() is a good example, along with print/echo, I managed to > put it together. Every entry on it's own line (so it's seperated by "\n"). > > My head feels like it is being used as the repository for Anna Nichole > Smith's silicone breast implants (both failed and spare parts for future > use). > > In any case, there are 1755 entries in the blasted thing. If it's in the PHP > manual or get_defined_functions, it's in there. And damn is that alot. > > Here is the link to the text file: > http://crazyoddball.hypermart.net/php.stx.txt > > > However I learned so many cool things with so many functions I'd like to > use, but I have a severe headache and have to go to work (I'll be in a car > the whole time, so no computer) in one hour, and I haven't slept. > > And I'm not getting paid for this either. > > Ah yes, this is GeekLife. But I have no caffiene in my system. So this is > the GranolaGeekLife...GGL...giggle? > > > > Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be > useful. > > I certainly hope so, because compiling the whole thing was overkill if I'm > the only one that will use it :) > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Geez Plutarck where are all the GTK functions? :) Just kidding this is great and I am gonna snarf a copy to use locally. -- phill ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9ajqk2$ll4$[EMAIL PROTECTED]">news:9ajqk2$ll4$[EMAIL PROTECTED]... > First of all I use Edit Plus, which uses a list of PHP functions to know > what words to highlight in the code. > > Well now that I have a seriously throbbing headache, I've done it. Finally. > > If you use a program that needs a list of functions for syntax highlighting, > I've finally got one that has every function according to PHP > get_defined_functions (includes quite a few undocumented functions), the PHP > manual, and quite a few others it failed to mention but should be > highlighted. unset() is a good example, along with print/echo, I managed to > put it together. Every entry on it's own line (so it's seperated by "\n"). > > My head feels like it is being used as the repository for Anna Nichole > Smith's silicone breast implants (both failed and spare parts for future > use). > > In any case, there are 1755 entries in the blasted thing. If it's in the PHP > manual or get_defined_functions, it's in there. And damn is that alot. > > Here is the link to the text file: > http://crazyoddball.hypermart.net/php.stx.txt > > > However I learned so many cool things with so many functions I'd like to > use, but I have a severe headache and have to go to work (I'll be in a car > the whole time, so no computer) in one hour, and I haven't slept. > > And I'm not getting paid for this either. > > Ah yes, this is GeekLife. But I have no caffiene in my system. So this is > the GranolaGeekLife...GGL...giggle? > > > > Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be > useful. > > I certainly hope so, because compiling the whole thing was overkill if I'm > the only one that will use it :) > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
WoW. That is UberGeek! I am humbled....cool...fear not, good sir, for that list will become very handy indeed. Jason Lotito www.NewbieNetwork.net Where those who can, teach; and those who can, learn. > -----Original Message----- > From: Plutarck [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 12:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Nearly all (1755) PHP functions in a text file > > > First of all I use Edit Plus, which uses a list of PHP functions to know > what words to highlight in the code. > > Well now that I have a seriously throbbing headache, I've done > it. Finally. > > If you use a program that needs a list of functions for syntax > highlighting, > I've finally got one that has every function according to PHP > get_defined_functions (includes quite a few undocumented > functions), the PHP > manual, and quite a few others it failed to mention but should be > highlighted. unset() is a good example, along with print/echo, I > managed to > put it together. Every entry on it's own line (so it's seperated by "\n"). > > My head feels like it is being used as the repository for Anna Nichole > Smith's silicone breast implants (both failed and spare parts for future > use). > > In any case, there are 1755 entries in the blasted thing. If it's > in the PHP > manual or get_defined_functions, it's in there. And damn is that alot. > > Here is the link to the text file: > http://crazyoddball.hypermart.net/php.stx.txt > > > However I learned so many cool things with so many functions I'd like to > use, but I have a severe headache and have to go to work (I'll be in a car > the whole time, so no computer) in one hour, and I haven't slept. > > And I'm not getting paid for this either. > > Ah yes, this is GeekLife. But I have no caffiene in my system. So this is > the GranolaGeekLife...GGL...giggle? > > > > Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be > useful. > > I certainly hope so, because compiling the whole thing was overkill if I'm > the only one that will use it :) > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
So, now that you've seen 'em all, which one is your favorite? :) Kirk > -----Original Message----- > From: Plutarck [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 1:17 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Nearly all (1755) PHP functions in a text file > In any case, there are 1755 entries in the blasted thing. If > it's in the PHP > manual or get_defined_functions, it's in there. And damn is that alot. >
Hi I am trying to format a date extracted from my DB. I have run my query and then have used the following to get my row data while ($row = mysql_fetch_array($sql_result)) { $title = $row["message_title"]; $message = $row["message"]; $event = $row["date_of_event"]; $shortevent = date ("D j M", $event); I am trying to take $event and make it diplay like this "FRI 06 APR" using the date function. Although $event outputs like this "2001-04-06 00:00:00" $shortevent outputs "Thu 1 Jan" which is unix epoch date. Does anybody know what I am doiing wrong its probably something really simple but I cant see what. Matt.
Something I almost always do when pulling dates from a mySQL table is format the date column in the query itself using the mySQL function DATE_FORMAT()... At 01:13 PM 4/6/01 +0100, Matt Davis wrote: >Hi I am trying to format a date extracted from my DB. I have run my query >and then have used the following to get my row data > > while ($row = mysql_fetch_array($sql_result)) { > $title = $row["message_title"]; > $message = $row["message"]; > $event = $row["date_of_event"]; > > $shortevent = date ("D j M", $event); > >I am trying to take $event and make it diplay like this "FRI 06 APR" using >the date function. Although $event outputs like this "2001-04-06 00:00:00" >$shortevent outputs "Thu 1 Jan" which is unix epoch date. > >Does anybody know what I am doiing wrong its probably something really >simple but I cant see what. > >Matt. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
You need a UNIX timestamp for the second argument in date() - thus you need to first convert your $even into a timestamp (number of seconds past 1970). <? $event = '2001-03-15 24:03:34'; list($date,$time) = explode(' ',$event); list($year,$month,$day) = explode('-',$date); list($hour,$min,$sec) = explode(':',$time); $foo = mktime($hour,$min,$sec,$month,$day,$year)."\n"; echo date("D j M",$foo); ?> That would work ... --Joe On Fri, Apr 06, 2001 at 01:13:59PM +0100, Matt Davis wrote: > Hi I am trying to format a date extracted from my DB. I have run my query > and then have used the following to get my row data > > while ($row = mysql_fetch_array($sql_result)) { > $title = $row["message_title"]; > $message = $row["message"]; > $event = $row["date_of_event"]; > > $shortevent = date ("D j M", $event); > > I am trying to take $event and make it diplay like this "FRI 06 APR" using > the date function. Although $event outputs like this "2001-04-06 00:00:00" > $shortevent outputs "Thu 1 Jan" which is unix epoch date. > > Does anybody know what I am doiing wrong its probably something really > simple but I cant see what. > > Matt. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] /******************************************************************************\ * 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." * \******************************************************************************/
>Now we can see the php3-documents in the browser(NS4.7). >In opposition to that the php4-documents are only downloadable. >Is there any setting that is not described in the manual we have to do >therewith the browser can show us both types of php? Do in your httpd.conf for .php3 the same as for .php Then .php3 will also be parsed. Bye, B.
Hi All, We have successfully installed php3 and php4 under AIX4.3.3 with Apache1.3.19. Now we can see the php3-documents in the browser(NS4.7). In opposition to that the php4-documents are only downloadable. Is there any setting that is not described in the manual we have to do therewith the browser can show us both types of php? Thanks for help, Markus Mattes IT-Services and Solutions GmbH business unit: e-security IBM Global Services Company Phone : +49-221-304-2738 or -2561, FAX: -2518 Gustav-Heinemann-Ufer 120-122, D-50968 Köln e-mail: [EMAIL PROTECTED]
in .....conf/httpd.conf Do the following; # For example, the PHP 3.x module (not part of the Apache distribution - see # http://www.php.net) will typically use: # AddType application/x-httpd-php3 .php3 .php #or whatever extensions. AddType application/x-httpd-php3-source .phps # # And for PHP 4.x, use: # AddType application/x-httpd-php .php4 .phtml #or whatever extension as long as it's different than the #settings for the php3 files AddType application/x-httpd-php-source .phps -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 7:22 AM To: [EMAIL PROTECTED] Subject: [PHP] problem loading php4-document Hi All, We have successfully installed php3 and php4 under AIX4.3.3 with Apache1.3.19. Now we can see the php3-documents in the browser(NS4.7). In opposition to that the php4-documents are only downloadable. Is there any setting that is not described in the manual we have to do therewith the browser can show us both types of php? Thanks for help, Markus Mattes IT-Services and Solutions GmbH business unit: e-security IBM Global Services Company Phone : +49-221-304-2738 or -2561, FAX: -2518 Gustav-Heinemann-Ufer 120-122, D-50968 Köln e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 3:20 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Array problem > > > I am having big problems with merging two arrays. I just > can't seem to get my head around it. > > I have two arrays which I wish to merge, but I want to > EXCLUDE duplicate values. > > Any suggestions, as my numerous attempts have proved > unsuccessful. I expect my approach would probably be to merge the two arrays together, then call array_unique() on the result. --- Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University || -- Henry Kissinger
This would work ... <? $arrA = array(1,2,3,4,5,6); $arrB = array(9,8,7,6,5); // pick an arbitrary one to start with ... for($i = 0 ; $i <= sizeof($arrB) ; ++$i) if(!in_array($arrB[$i],$arrA)) $arrA[] = $arrB[$i]; ?> --Joe On Fri, Apr 06, 2001 at 09:19:52AM +0100, Alexis Antonakis wrote: > Hi, > > I am having big problems with merging two arrays. I just can't seem to get > my head around it. > > I have two arrays which I wish to merge, but I want to EXCLUDE duplicate > values. > > Any suggestions, as my numerous attempts have proved unsuccessful. > > BTW I'm using PHP4. > > Many thanks > Alexis > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] /******************************************************************************\ * 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." * \******************************************************************************/
Very strange. I've noticed some integrity issues using mssql_pconnect, but we don't explicitly use transactions in any case, so it may not even go that deep. I wonder if the odbc functions have this issue - anyone have any ideas? [EMAIL PROTECTED] wrote: > Hello Michael > > Some people have reported with the ADODB database class library that they > were having problems with inserts and updates when using mssql_pconnect. > Switching to regular mssql_connect the problems disappeared. > > I suspect it has something to do with persistent connections having > inconsistent transaction handling settings. Eg. > > - Connection A is setup by user 1 to use transactions. > - Connection B is setup by user 2 not to use transactions. > - Connection A is reused by user 2, who thinks he doesn't need > transactions, but connection A actually requires a commit to work because > of user 1's previous setting... > > People using Interbase have reported this problem also. > > Regards, john
Have you already tried to patch the Zend/zend_list.c file and recompile it? there is a known problem with persistent connections, read this: http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=8810708445e328bb& seekd=939114469#939114469 and this: http://marc.theaimsgroup.com/?l=php-dev&m=97858730928909&w=2 it sure helped here, from the more than 40k errors with mysql we went down to approx 1000 errors/daily. Kees -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Namens Michael Kimsal Verzonden: Friday, April 06, 2001 3:40 PM Aan: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Onderwerp: [PHP] mssql_pconnect issues? Very strange. I've noticed some integrity issues using mssql_pconnect, but we don't explicitly use transactions in any case, so it may not even go that deep. I wonder if the odbc functions have this issue - anyone have any ideas? [EMAIL PROTECTED] wrote: > Hello Michael > > Some people have reported with the ADODB database class library that they > were having problems with inserts and updates when using mssql_pconnect. > Switching to regular mssql_connect the problems disappeared. > > I suspect it has something to do with persistent connections having > inconsistent transaction handling settings. Eg. > > - Connection A is setup by user 1 to use transactions. > - Connection B is setup by user 2 not to use transactions. > - Connection A is reused by user 2, who thinks he doesn't need > transactions, but connection A actually requires a commit to work because > of user 1's previous setting... > > People using Interbase have reported this problem also. > > Regards, john -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Wouldn't this have made it in PHP 4.0.4 by now? Or am I reading 2001-01-04 wrong? (january 4?) Kees Hoekzema wrote: > Have you already tried to patch the Zend/zend_list.c file and recompile it? > there is a known problem with persistent connections, > read this: > http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=8810708445e328bb& > seekd=939114469#939114469 > > and this: http://marc.theaimsgroup.com/?l=php-dev&m=97858730928909&w=2 > > it sure helped here, from the more than 40k errors with mysql we went > down to approx 1000 errors/daily. > > Kees > > -----Oorspronkelijk bericht----- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]Namens > Michael Kimsal > Verzonden: Friday, April 06, 2001 3:40 PM > Aan: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED] > Onderwerp: [PHP] mssql_pconnect issues? > > Very strange. I've noticed some integrity issues using mssql_pconnect, > but we don't explicitly use transactions in any case, so it may not > even go that deep. > > I wonder if the odbc functions have this issue - anyone have any ideas? > > [EMAIL PROTECTED] wrote: > > > Hello Michael > > > > Some people have reported with the ADODB database class library that they > > were having problems with inserts and updates when using mssql_pconnect. > > Switching to regular mssql_connect the problems disappeared. > > > > I suspect it has something to do with persistent connections having > > inconsistent transaction handling settings. Eg. > > > > - Connection A is setup by user 1 to use transactions. > > - Connection B is setup by user 2 not to use transactions. > > - Connection A is reused by user 2, who thinks he doesn't need > > transactions, but connection A actually requires a commit to work because > > of user 1's previous setting... > > > > People using Interbase have reported this problem also. > > > > Regards, john > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
maybe, but fact is that it isn't in php404pl1, and it usefull if you use persistent connections :) Kees -----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Namens Michael Kimsal Verzonden: Friday, April 06, 2001 5:12 PM Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] mssql_pconnect issues? Wouldn't this have made it in PHP 4.0.4 by now? Or am I reading 2001-01-04 wrong? (january 4?) Kees Hoekzema wrote: > Have you already tried to patch the Zend/zend_list.c file and recompile it? > there is a known problem with persistent connections, > read this: > http://groups.google.com/groups?hl=en&lr=&safe=off&ic=1&th=8810708445e328bb& > seekd=939114469#939114469 > > and this: http://marc.theaimsgroup.com/?l=php-dev&m=97858730928909&w=2 > > it sure helped here, from the more than 40k errors with mysql we went > down to approx 1000 errors/daily. > > Kees > > -----Oorspronkelijk bericht----- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]Namens > Michael Kimsal > Verzonden: Friday, April 06, 2001 3:40 PM > Aan: [EMAIL PROTECTED] > CC: [EMAIL PROTECTED] > Onderwerp: [PHP] mssql_pconnect issues? > > Very strange. I've noticed some integrity issues using mssql_pconnect, > but we don't explicitly use transactions in any case, so it may not > even go that deep. > > I wonder if the odbc functions have this issue - anyone have any ideas? > > [EMAIL PROTECTED] wrote: > > > Hello Michael > > > > Some people have reported with the ADODB database class library that they > > were having problems with inserts and updates when using mssql_pconnect. > > Switching to regular mssql_connect the problems disappeared. > > > > I suspect it has something to do with persistent connections having > > inconsistent transaction handling settings. Eg. > > > > - Connection A is setup by user 1 to use transactions. > > - Connection B is setup by user 2 not to use transactions. > > - Connection A is reused by user 2, who thinks he doesn't need > > transactions, but connection A actually requires a commit to work because > > of user 1's previous setting... > > > > People using Interbase have reported this problem also. > > > > Regards, john > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi: Can someone please explain the following error message? ERROR 1052: Column: 'compid' in field list is ambiguous Here's my mySQL statement: $sql="SELECT fname, lname, compid, status, dept, room, bldg, phone, ticket_num, compid, date_rpt, request_type, hardware, model, dci, dci_num,software_type, software_pkg, problem, comments, entered_by FROM users, tickets WHERE users.compid = tickets.compid ORDER BY lname"; Thanks in Advance Toni _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
In your query you have compid specified twice. If this field is named the same in two seperate tables, preface your fieldnames with the table names... >$sql="SELECT fname, lname, users.compid, status, dept, room, bldg, phone, >ticket_num, tickets.compid, date_rpt, request_type, hardware, model, dci, >dci_num,software_type, software_pkg, problem, comments, entered_by >FROM users, tickets >WHERE users.compid = tickets.compid >ORDER BY lname"; At 10:04 AM 4/6/01 -0400, Toni Barskile wrote: >Hi: > >Can someone please explain the following error message? > >ERROR 1052: Column: 'compid' in field list is ambiguous > >Here's my mySQL statement: > >$sql="SELECT fname, lname, compid, status, dept, room, bldg, phone, >ticket_num, compid, date_rpt, request_type, hardware, model, dci, >dci_num,software_type, software_pkg, problem, comments, entered_by >FROM users, tickets >WHERE users.compid = tickets.compid >ORDER BY lname"; > > >Thanks in Advance > >Toni >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Toni Barskile wrote: > > Hi: > > Can someone please explain the following error message? > > ERROR 1052: Column: 'compid' in field list is ambiguous > > Here's my mySQL statement: > > $sql="SELECT fname, lname, compid, status, dept, room, bldg, phone, > ticket_num, compid, date_rpt, request_type, hardware, model, dci, > dci_num,software_type, software_pkg, problem, comments, entered_by > FROM users, tickets > WHERE users.compid = tickets.compid > ORDER BY lname"; > > Thanks in Advance > > Toni > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] You select from two tables that both have a column named 'compid'. Your computer doesn't know which one of them it should use. So, you should make that decision for 'm: SELECT users.compid or SELECT tickets.compid -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
well, that didn't work either. Same error. Show me where my thinking is wrong, if I've got an array ($HTTP_POST_VARS) in this case. and $HTTP_POST_VARS[var_list] is an array and the first entry in the array. if I did $x = each($HTTP_POST_VARS) in a while loop, the first combination that is returned is $x[0] with value of 'var_list' and $x[1] with value of 'Array'. In the first instance, I passed the name of the array ($HTTP_POST_VARS) to each(), so in this instance I would again pass the name of the array to each() to pull the value pairs out of it. This would mean that $each_array2 = each($each_array[0]), not $each_array[1]. Am I way off? > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > > }print("key: $each_array[0] value: $each_array[1]"); > } > }When I get to an array within HTTP_POST_VARS, it prints: > }key: var_name value: Array > } > }ok, but when I try to do an each on that array: (and maybe this is where I > }am wrong) > }$each_array2 = each($each_array[0]) > } > > There's your problem.. Your trying to do each(..) on, what in your > example above, is set to "var_name" ... > > Try changing that to: > > $each_array2 = each($each_array[1]); > > It's the second variable in your example that's an Array, (or it may > just be a string set to the word "Array".. Who knows?.. =) > > -- > Jeff Carnahan - [EMAIL PROTECTED]
How do I find out if a string is contained in a string. I just need true/false. Thanks [EMAIL PROTECTED]
Mike, You could investigate the functions strstr (www.php.net/strstr) and stristr (www.php.net/stristr), it sounds like they're what you're after. HTH Jon -----Original Message----- From: Mike [mailto:[EMAIL PROTECTED]] Sent: 06 April 2001 15:42 To: [EMAIL PROTECTED] Subject: [PHP] String in a string How do I find out if a string is contained in a string. I just need true/false. Thanks [EMAIL PROTECTED] ********************************************************************** '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' **********************************************************************
Hello Mike, try preg_match See http://www.php.net/manual/en/function.preg-match.php HTH Regards ----- Original Message ----- > From: Mike <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, April 06, 2001 4:42 PM > Subject: [PHP] String in a string > > > > How do I find out if a string is contained in a string. I just need > > true/false. > > Thanks > > [EMAIL PROTECTED] > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > >
>try preg_match A bit of a big hammer for cracking nuts. strstr and stristr will tax your server much more lightly, and, no doubt, do the job quicker as well. Cheers -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org
Thanks for everyone's help w/the error message thing. I got my SQL statement working, but it's not returning any rows. I noticed that there's nothing in my compid field in the 2nd table. Does anyone know how I might go about automatically filling in the value in the 2nd table when someone enters data in the 1st table? I hope this question makes sense... Toni _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com
Toni Barskile wrote: > > Thanks for everyone's help w/the error message thing. > > I got my SQL statement working, but it's not returning any rows. I noticed > that there's nothing in my compid field in the 2nd table. Does anyone know > how I might go about automatically filling in the value in the 2nd table > when someone enters data in the 1st table? I hope this question makes > sense... > > Toni > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] I don't know what your db exactly is, or what you want to do... but it pretty much sounds like something for a foreign key. If you don't like that option, you'll have to change your code (PHP or sp, wherever you do it) that inserts the data. That function should then also insert/update the data in the other table. -- * R&zE: *************************** ** Renze Munnik ** ** E: [EMAIL PROTECTED] ** M: +31 6 218 111 43 ***************************
I have two table one categories, two with relationship to table one... Example: Table 1 catid category 1 General Gaming News 2 Combat Flight Simulator 3 B-17 Flying Fortress 4 IL-2 Sturmovik 5 Crimson Skies 6 European Air War Table Two id date category desc 1 2001-04-04 14:41:33 1 Shrapnel Games.... I want to call the data from table two and if 1 matches 1 in first table it shows "General Gaming News" instead of just 1. understand? please reply to email since not a list member... David Smith Indy Web Design http://www.indywebdesign.com
i'm trying to make all my include files into functions for manageability. I have one function that i'd like to get to work.....heres teh code.. <?php $db = mysql_pconnect("localhost", "user" ,"pass"); mysql_select_db("database",$db); ?> i had it in a function and had the function return $db.....but didn't work.....any ideas? ~kurth
should work(works for me).probly something simple. <?php function conn(){ $db = mysql_pconnect("localhost", "" ,""); mysql_select_db("database",$db); return $db; } $db = conn(); $result= mysql_query("select * from table",$db); while($myrow=MySQL_fetch_array($result)) { $thing=$myrow["item"]; echo "$thing <br> "; } ?> ----- Original Message ----- From: Kurth Bemis <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 06, 2001 4:10 PM Subject: [PHP] function return > > i'm trying to make all my include files into functions for > manageability. I have one function that i'd like to get to work.....heres > teh code.. > > <?php > $db = mysql_pconnect("localhost", "user" ,"pass"); > mysql_select_db("database",$db); > ?> > > i had it in a function and had the function return $db.....but didn't > work.....any ideas? > > ~kurth > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I usually declare $db as global in the function, so I can just execute the function and continue with my querys. -- Plutarck Should be working on something... ...but forgot what it was. "Kurth Bemis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > i'm trying to make all my include files into functions for > manageability. I have one function that i'd like to get to work.....heres > teh code.. > > <?php > $db = mysql_pconnect("localhost", "user" ,"pass"); > mysql_select_db("database",$db); > ?> > > i had it in a function and had the function return $db.....but didn't > work.....any ideas? > > ~kurth > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi there Trying to run apache with support for PHP 4.0.4pl1 as a module I set up eveything and when I launch apache it dies with an error like this APACHE caused an invalid page fault in module MSVCRT.DLL at 017f:780102ba. Registers: EAX=ffffffff CS=017f EIP=780102ba EFLGS=00010206 EBX=7800bb73 SS=0187 ESP=0063da04 EBP=0063dc58 ECX=ffffffff DS=0187 ESI=7ffffffe FS=1377 EDX=7fffffff ES=0187 EDI=1003027d GS=0000 Bytes at CS:EIP: 80 38 00 74 03 40 eb f1 2b c1 e9 85 fe ff ff c7 Stack dump: 00000001 78037c88 7800bb50 780012d9 00000000 0063dc1c 7800ef03 7802e248 ffffffff 0063da64 780012d9 00000000 00000001 bff95b52 00b60000 00b62aa2 Can someone give me a glue ? regardsyurais PD: Email me directly please, I'm not subscribed to the list
"Richard Kurth" <[EMAIL PROTECTED]> wrote: > I can not seem to get this figuered out I whant to run this function to pull > data out of a file and thin use the data in the rest of the program. When I > do this I get a Parse error: parse error in > c:/httpd/htdocs/autosetup/auto/test.php on line 25 <snip> > } > getdata( ) > > echo $domain; <--This is line 25 which is outside of the function </snip> getdata(); // Don't forget the semicolon. As a general rule, missing semicolons ";" and braces "}" on lines above those mentioned in the error output are often culprits for parse errors. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Hello, ok I am getting completely crazy here, I use this to make shure outlook will display newlines correctly. But now I found out that exchange is jumping 2 lines at every newline with this... $msg = str_replace ( "\n", "\r\n", $msg ); My question, what sould I use in order to send a long message, wich is coming multiple db fields to a text file to php mail(), so it will be formatted nicely on all email client? Or, is it possible? Any piece of code, tutorial, newsletter script, good wiches or old grandma's soup would be so appreciated! py + ====================== + Pierre-Yves Lem@ire + E-MedHosting.com + (514) 729-8100 + [EMAIL PROTECTED] + ======================
Doesn't either just "\r" or just "\n" work? Then again I've never tried using them, but I can't imagine that newline and carriage return doesn't force a new line. You could always send an HTML mail and use <br> instead? -- Plutarck Should be working on something... ...but forgot what it was. "Pierre-Yves Lemaire" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > ok I am getting completely crazy here, I use this to make shure > outlook will display newlines correctly. But now I found out > that exchange is jumping 2 lines at every newline with this... > $msg = str_replace ( "\n", "\r\n", $msg ); > > My question, what sould I use in order to send a long message, > wich is coming multiple db fields to a text file to php mail(), > so it will be formatted nicely on all email client? > Or, is it possible? > > > Any piece of code, tutorial, newsletter script, good wiches or > old grandma's soup would be so appreciated! > > py > > > > > > > + ====================== > + Pierre-Yves Lem@ire > + E-MedHosting.com > + (514) 729-8100 > + [EMAIL PROTECTED] > + ====================== > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I'm not sure about Freeserve, but I don't think that Geocities supports PHP on their webpages (at least not for users ...). --Joe On Fri, Apr 06, 2001 at 10:05:14AM +0100, Cheng, Kynan (London) wrote: > Hello, > > Can anyone help me to achieve this using PHP: > > I would like to have a personal photographic portfolio site with thumbnails. > Clicking on the thumbnail would bring up another page which has an enlarged > version of the photo on a standard 'template page'. In other words the > photo src is a variable. > > Thing is I know not much about PHP/CGI/JS and I am using free ISPs like > Freeserve (UK) and Yahoo Geocities, so I don't know what is the best way to > approach this. > > Thanks for any pointers. > > Kynan > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] /******************************************************************************\ * 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." * \******************************************************************************/
But members.evolt.org does, along with MySQL, Cold Fusion, and a heap of other goodies. HTH Jon -----Original Message----- From: Joe Stump [mailto:[EMAIL PROTECTED]] Sent: 06 April 2001 17:03 I'm not sure about Freeserve, but I don't think that Geocities supports PHP on their webpages (at least not for users ...). --Joe On Fri, Apr 06, 2001 at 10:05:14AM +0100, Cheng, Kynan (London) wrote: > Hello, > > Can anyone help me to achieve this using PHP: > > I would like to have a personal photographic portfolio site with thumbnails. > Clicking on the thumbnail would bring up another page which has an enlarged > version of the photo on a standard 'template page'. In other words the > photo src is a variable. > > Thing is I know not much about PHP/CGI/JS and I am using free ISPs like > Freeserve (UK) and Yahoo Geocities, so I don't know what is the best way to > approach this. > > Thanks for any pointers. > > Kynan ********************************************************************** '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' **********************************************************************
Thanks for the tips guys, but I'm also new to the coding... can anyone tell me what the script to accept the variable might be? Geocities does do lots of Cgi scripts - is that better/easier? > -----Original Message----- > From: Jon Haworth [SMTP:[EMAIL PROTECTED]] > Sent: 06 April 2001 17:20 > To: '[EMAIL PROTECTED]' > Subject: RE: [PHP] Variables > > But members.evolt.org does, along with MySQL, Cold Fusion, and a heap of > other goodies. > > HTH > Jon > > -----Original Message----- > From: Joe Stump [mailto:[EMAIL PROTECTED]] > Sent: 06 April 2001 17:03 > > I'm not sure about Freeserve, but I don't think that Geocities supports > PHP > on their webpages (at least not for users ...). > > --Joe > > On Fri, Apr 06, 2001 at 10:05:14AM +0100, Cheng, Kynan (London) wrote: > > Hello, > > > > Can anyone help me to achieve this using PHP: > > > > I would like to have a personal photographic portfolio site with > thumbnails. > > Clicking on the thumbnail would bring up another page which has an > enlarged > > version of the photo on a standard 'template page'. In other words the > > photo src is a variable. > > > > Thing is I know not much about PHP/CGI/JS and I am using free ISPs like > > Freeserve (UK) and Yahoo Geocities, so I don't know what is the best way > to > > approach this. > > > > Thanks for any pointers. > > > > Kynan > > > ********************************************************************** > '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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Have you looked at php.net/manual/ ? Just read through the variables portion and it goes over it. -js > -----Original Message----- > From: Cheng, Kynan (London) [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 9:54 AM > To: '[EMAIL PROTECTED]' > Subject: RE: [PHP] Variables > > > Thanks for the tips guys, > but I'm also new to the coding... > can anyone tell me what the script to accept the variable might be? > > > Geocities does do lots of Cgi scripts - is that better/easier? > > > -----Original Message----- > > From: Jon Haworth [SMTP:[EMAIL PROTECTED]] > > Sent: 06 April 2001 17:20 > > To: '[EMAIL PROTECTED]' > > Subject: RE: [PHP] Variables > > > > But members.evolt.org does, along with MySQL, Cold Fusion, and a heap of > > other goodies. > > > > HTH > > Jon > > > > -----Original Message----- > > From: Joe Stump [mailto:[EMAIL PROTECTED]] > > Sent: 06 April 2001 17:03 > > > > I'm not sure about Freeserve, but I don't think that Geocities supports > > PHP > > on their webpages (at least not for users ...). > > > > --Joe > > > > On Fri, Apr 06, 2001 at 10:05:14AM +0100, Cheng, Kynan (London) wrote: > > > Hello, > > > > > > Can anyone help me to achieve this using PHP: > > > > > > I would like to have a personal photographic portfolio site with > > thumbnails. > > > Clicking on the thumbnail would bring up another page which has an > > enlarged > > > version of the photo on a standard 'template page'. In other > words the > > > photo src is a variable. > > > > > > Thing is I know not much about PHP/CGI/JS and I am using free > ISPs like > > > Freeserve (UK) and Yahoo Geocities, so I don't know what is > the best way > > to > > > approach this. > > > > > > Thanks for any pointers. > > > > > > Kynan > > > > > > ********************************************************************** > > '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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >
Hello, I am wondering witch way is that best to go with my forms.. Self Referenceing or have the data sent to another page for the processing. i.e. (option one) My forms page is named "submit.phtml" <form action="submit.phtml" method="post"> OR (option two) My forms page name is "enterdata.phtml" <form action="submit.phtml" method="post"> and it uses another page to submit the data. that displays "DATA SUBMITTED" Make sense? The reason I ask is that I am having problems making a field REQUIRED with option one. But all of my forms are set up that way. Thanks for any input. Curtis
Why are you having problems with option one? That one makes more sense to me, because you can have the FORM in only one file, and show error messages/etc on the same page as the form. psuedo-code <? if (submitted) { check values if no errors(redirect to next page) if errors } ?> <?= $errors;?> <form> SHOW FORM STUFF HERE also include submitted values so if there are errors we'll see them an not have to reinput everything <input type="hidden" name="submitted" value="yes"> </form> ?> Self-referencing seems to be the way to go, imo. Curtis wrote: > <snip> > The reason I ask is that I am having problems making a field REQUIRED > with option one. > But all of my forms are set up that way. > > Thanks for any input.
On Fri, Apr 06, 2001 at 12:27:22PM -0400, Curtis wrote: > Self Referenceing or have the data sent to another page for the > processing. I usually do self-referencing, since this way I have everything in one place, don't rely on two scripts, don't need to open two files in my editor etc. :) -fkr -- gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0 8A48 0D31 9BD3 D9AC 74D0 |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE | |all your base are belong to us | shame on me | fkr@IRCnet |
> My forms page is named "submit.phtml" > <form action="submit.phtml" method="post"> and if you use the <? echo $PHP_SELF; ?> then you don't even need to wory about the file name, as it will always submit to itself... <form action="<? echo $PHP_SELF; ?>" method="POST"> -js > -----Original Message----- > From: Curtis [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 9:27 AM > To: php > Subject: [PHP] Which is better?? > > > Hello, > > I am wondering witch way is that best to go with my forms.. > > Self Referenceing or have the data sent to another page for the > processing. > > i.e. > (option one) > My forms page is named "submit.phtml" > <form action="submit.phtml" method="post"> > > OR > (option two) > My forms page name is "enterdata.phtml" > <form action="submit.phtml" method="post"> > > and it uses another page to submit the data. > that displays "DATA SUBMITTED" > > Make sense? > > The reason I ask is that I am having problems making a field REQUIRED > with option one. > But all of my forms are set up that way. > > Thanks for any input. > > Curtis > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >
Howdy Y'all! I'm trying to figure out why I'm having so much difficulty with nested for loops. As a test, I did this and it doesn't work. The script simply doesn't give any output. <? error_reporting(E_ALL); for( $i=0; $i<10; $i++ ) for( $j=0; $j<10; $j++ ) { $res = $i * $j; print(" result = $res <br>"); } ?> If I remove the inner loop then it works fine but that's useless. I am hoping to figure out how to make this work since I need to populate a 2 dimensional array with results from multiple database queries. Any ideas? Anything obviously wrong? Thanks in advance! John
A copy and paste into foo.php and then a php -q foo.php yielded results for me. --Joe On Fri, Apr 06, 2001 at 10:44:59AM -0600, [EMAIL PROTECTED] wrote: > Howdy Y'all! > > I'm trying to figure out why I'm having so much difficulty with > nested for loops. > > As a test, I did this and it doesn't work. The script simply doesn't > give any output. > > <? > error_reporting(E_ALL); > > for( $i=0; $i<10; $i++ ) > for( $j=0; $j<10; $j++ ) > { > $res = $i * $j; > print(" result = $res <br>"); > } > ?> > > If I remove the inner loop then it works fine but that's useless. > > I am hoping to figure out how to make this work since I need to > populate a 2 dimensional array with results from multiple database > queries. > > Any ideas? Anything obviously wrong? > > Thanks in advance! > John > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] /******************************************************************************\ * 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." * \******************************************************************************/
I cut and pasted your code and it worked fine - ??? kirk > As a test, I did this and it doesn't work. The script simply doesn't > give any output. > > <? > error_reporting(E_ALL); > > for( $i=0; $i<10; $i++ ) > for( $j=0; $j<10; $j++ ) > { > $res = $i * $j; > print(" result = $res <br>"); > } > ?> > > If I remove the inner loop then it works fine but that's useless. >
While it's apparently not always required, I always reccommend (and always do it personally) that you use a bracket around every function. So it should lool like this: <? error_reporting(E_ALL); for( $i=0; $i<10; $i++ ) { for( $j=0; $j<10; $j++ ) { $res = $i * $j; print(" result = $res <br>"); } } ?> It makes it easier to see where the loops begin and where they end, and it stops most types of errors from appearing. -- Plutarck Should be working on something... ...but forgot what it was. <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Howdy Y'all! > > I'm trying to figure out why I'm having so much difficulty with > nested for loops. > > As a test, I did this and it doesn't work. The script simply doesn't > give any output. > > <? > error_reporting(E_ALL); > > for( $i=0; $i<10; $i++ ) > for( $j=0; $j<10; $j++ ) > { > $res = $i * $j; > print(" result = $res <br>"); > } > ?> > > If I remove the inner loop then it works fine but that's useless. > > I am hoping to figure out how to make this work since I need to > populate a 2 dimensional array with results from multiple database > queries. > > Any ideas? Anything obviously wrong? > > Thanks in advance! > John > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
This code won't work. I'm trying to get an error if the username is entered incorrectly but it won't go through the if brackets. I even tried printing out $num and it's 0. I also tried if ($num = "0") { if ($num = '0') { <?php include("connect.php"); $result=mysql_query("select * from table where username='$username'",$connection) or die ("Can't do it"); $num = mysql_numrows($result); if ($num = 0) { print "<html>error message etc. exit; } Jeff Oien
"Jeff Oien" <[EMAIL PROTECTED]> wrote: > This code won't work. I'm trying to get an error if the username > is entered incorrectly but it won't go through the if brackets. I even > tried printing out $num and it's 0. I also tried > if ($num = "0") { > if ($num = '0') { The single "=" sets the variable $num to that value. A double "==" is an equality comparison operator - that's what you want in this case. Also, since mysql_numrows() returns a number, not a string, you don't need quots around the 0. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
The comparison operator is ==. = means "assign". Try: if ($num == 0) { foo(bar, baz); } AFAIK what your code means is "assign 0 to $num and then, if that worked, print the error message." HTH Jon -----Original Message----- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: 06 April 2001 17:51 To: PHP Subject: [PHP] PHP/MySQL Code This code won't work. I'm trying to get an error if the username is entered incorrectly but it won't go through the if brackets. I even tried printing out $num and it's 0. I also tried if ($num = "0") { if ($num = '0') { <?php include("connect.php"); $result=mysql_query("select * from table where username='$username'",$connection) or die ("Can't do it"); $num = mysql_numrows($result); if ($num = 0) { print "<html>error message etc. exit; } Jeff Oien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ********************************************************************** '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' **********************************************************************
At 11:51 AM 4/6/01 -0500, Jeff Oien wrote: >if ($num = 0) { > print "<html>error message etc. > exit; >} This "conditional" will always run. you are assigning $num the value of zero within your if() statement, and that assignation actually happens, so the result is "true" and the braced statements run. Try: if ($num == 0) { print "blah blah blah, etc.\n" exit; } - Brian ------------------------------------- Brian S. Dunworth Sr. Software Development Engineer Oracle Database Administrator The Printing House, Ltd. (850) 875-1500 x225 <[EMAIL PROTECTED]> -------------------------------------
> "Jeff Oien" <[EMAIL PROTECTED]> wrote: > > This code won't work. I'm trying to get an error if the username > > is entered incorrectly but it won't go through the if brackets. I even > > tried printing out $num and it's 0. I also tried > > if ($num = "0") { > > if ($num = '0') { > > The single "=" sets the variable $num to that value. A double "==" is an > equality comparison operator - that's what you want in this case. Also, > since mysql_numrows() returns a number, not a string, you don't need quots > around the 0. > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ Ah, one of those repeated rookie mistakes. Thanks for helping me out. Jeff Oien
I think the function should be mysql_num_rows. There's an mSQL function msql_numrows, but for MySQL it needs the second underscore in between 'num' and 'rows'. > $num = mysql_numrows($result);
"long huynh" <[EMAIL PROTECTED]> wrote: > I think the function should be mysql_num_rows. There's an mSQL function > msql_numrows, but for MySQL it needs the second underscore in between 'num' > and 'rows'. > > > $num = mysql_numrows($result); Either will work. mysql_numrows() is the old name of the function from previous PHP versions. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Joe Stump wrote: > > A copy and paste into foo.php and then a php -q foo.php yielded results for > me. Yeah, it's giving me results too today. I don't know what went wrong yesterday. To extend my question, I'm trying to work with multidimensional arrays. For example, I would like to do this: <? error_reporting(E_ALL); $target_array = array(); echo "starting <br>"; for( $i=0; $i<5; $i++ ) for( $j=0; $j<5; $j++ ) { $res = $i * $j; $target_array[$i][$j] = $res; print("result = $target_array[$i][$j] <br>"); } echo "done"; ?> And this is my result today: starting result = Array[0] result = Array[1] result = Array[2] result = Array[3] result = Array[4] result = Array[0] result = Array[1] result = Array[2] result = Array[3] result = Array[4] result = Array[0] result = Array[1] result = Array[2] result = Array[3] result = Array[4] result = Array[0] result = Array[1] result = Array[2] result = Array[3] result = Array[4] result = Array[0] result = Array[1] result = Array[2] result = Array[3] result = Array[4] done My thinking is that PHP ought to be like C when doing simple stuff like this. I must have something wrong with the declaration of the array. How do you declare a multidimensional array??!!?? How do you work with it then??? Thanks in advance!! John
You just do something like this: <? $arr = array(0,23,4,2,1); for($i = 0 ; $i < 10 ; ++$i) $arrB[] = $arr; while(list(,$my_array) = each($arrB)) while(list($key,$val) = each($my_array)) echo $key.' -> '.$val."\n"; ?> Just throw arrays into arrays :O) --Joe On Fri, Apr 06, 2001 at 11:18:19AM -0600, [EMAIL PROTECTED] wrote: > > > Joe Stump wrote: > > > > A copy and paste into foo.php and then a php -q foo.php yielded results for > > me. > > Yeah, it's giving me results too today. I don't know what went wrong > yesterday. > > To extend my question, I'm trying to work with multidimensional arrays. > > For example, I would like to do this: > > <? > error_reporting(E_ALL); > > $target_array = array(); > > echo "starting <br>"; > > for( $i=0; $i<5; $i++ ) > for( $j=0; $j<5; $j++ ) > { > $res = $i * $j; > $target_array[$i][$j] = $res; > print("result = $target_array[$i][$j] <br>"); > } > echo "done"; > ?> > > And this is my result today: > starting > result = Array[0] > result = Array[1] > result = Array[2] > result = Array[3] > result = Array[4] > result = Array[0] > result = Array[1] > result = Array[2] > result = Array[3] > result = Array[4] > result = Array[0] > result = Array[1] > result = Array[2] > result = Array[3] > result = Array[4] > result = Array[0] > result = Array[1] > result = Array[2] > result = Array[3] > result = Array[4] > result = Array[0] > result = Array[1] > result = Array[2] > result = Array[3] > result = Array[4] > done > > My thinking is that PHP ought to be like C when doing simple stuff like > this. > I must have something wrong with the declaration of the array. > > How do you declare a multidimensional array??!!?? > How do you work with it then??? > > Thanks in advance!! > > John /******************************************************************************\ * 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." * \******************************************************************************/
Hi! I found an interesting PHP issues here. I use the "odbc_result_all" or "odbc_fetch_row" or "odbc_result" to display the data in any column in a row. What I got is that a very long data on a column box doesn't show them all on the website. The MS-SQL database showed all of the data in that field. Here's what it's look like (On the Website) Address the following issues: 1. In order to us this printer with Deal Pack, you must download and install an Epson FX-100 printer driver (see Deal Pack Help for details). 2. In order to us this printer with Deal Pack, you must change some of the de (MS-SQL) Address the following issues: 1. In order to use this printer with Deal Pack, you must download and install an Epson FX-100 printer driver (see Deal Pack Help for details). 2. In order to use this printer with Deal Pack, you must change some of the default printer settings within the printer (see Deal Pack Help for details). --------------------------------------------- What do I need to fix that? PHP is suppose to show them all, not part of it. When the data get too long, it get cut off. Thanks, Scott
Does anyone know the way to make php4 running as NSAPI, work with named virtuals? It seems to work only if it is a real virtual (with its own IP) and not a named virtual. Any help is greatly appreciated Tom Freeman Web Analyst StellarRAD Systems an Everest Global Technologies Company p | 636.625.5839 e | [EMAIL PROTECTED] http://www.stellarrad.com
Hello all, Today, I compiled my PHP as CGI, since I want to use some PHP scripts in cron jobs. Shouldn't be too hard, I tought, and compiled with ./configure --with-mysql For some strange reason, it does not work. Look at this: [root@blazebox cron]# php ./missiles.php File 'NONEXISTENT/charsets/?.conf' not found (Errcode: 2) Character set '#7' is not a compiled character set and is not specified in the 'NONEXISTENT/charsets/Index' file X-Powered-By: PHP/4.0.4pl1 Content-type: text/html <br> <b>Warning</b>: MySQL Connection Failed: Can't initialize character set 7 (path: default) in <b>./missiles.php</b> on line <b>5</b><br> [root@blazebox cron]# Anyone has any idea what is causing this problem, and if/how I can fix it? Thanks in advance, _________________________________________ Leon Mergen [EMAIL PROTECTED] President of Operations BlazeBox, Inc. ICQ: 55677353
Hi, I am trying to find some info on upgrading from php3 to php4. I can't seem to find any docs about upgrading, just installing. Is this the same thing? Do I have to re-compile apache just to go from php3 to php4? Thanks, Chris.
http://www.php.net/manual/en/migration4.php > -----Original Message----- > From: Chris [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 12:19 PM > To: php > Subject: [PHP] Help please. > > > Hi, > I am trying to find some info on upgrading from php3 to php4. > I can't seem to find any docs about upgrading, just > installing. Is this the same thing? > Do I have to re-compile apache just to go from php3 to php4? > > Thanks, > Chris.
Yes, thank you, but this has nothing to do with what I asked, this is about CODE migration. > http://www.php.net/manual/en/migration4.php > > > -----Original Message----- > > From: Chris [mailto:[EMAIL PROTECTED]] > > Sent: Friday, April 06, 2001 12:19 PM > > To: php > > Subject: [PHP] Help please. > > > > > > Hi, > > I am trying to find some info on upgrading from php3 to php4. > > I can't seem to find any docs about upgrading, just > > installing. Is this the same thing? > > Do I have to re-compile apache just to go from php3 to php4? > > > > Thanks, > > Chris. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED]
"Chris" <[EMAIL PROTECTED]> wrote: > I am trying to find some info on upgrading from php3 to php4. > I can't seem to find any docs about upgrading, just installing. > Is this the same thing? > Do I have to re-compile apache just to go from php3 to php4? Upgrading from PHP3 to PHP4 consists of installing PHP4. You can install php with apxs (--with-apxs flag) in which case you don't need to recompile Apache or you can recompile Apache and install it as a static module directly in the Apache binary. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Hi! Well, I want to send an email to about 300 people. The problem is that if I use this method people can see all the email address of the people whoever it is sent to. <?php $connect = mysql_connect(); $query = "select email from news"; $execute = mysql_db_query("uaegraduate", $query); while($r = mysql_fetch_array($execute)) { $email = $r['email']; $add .= $email . ","; } $headers = "From: [EMAIL PROTECTED]<[EMAIL PROTECTED]>\n"; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; $subject = "hey"; $to = "$add"; $mailmessage = "hey this is the message"; $mailsomeone = mail($to, $subject, $mailmessage, $headers); if($mailsomeone) { echo "Success"; } ?> If I use the above method, all the email address will apear in the to: like this:- To:[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED] and goes on for 300 entries. Is there any way I can stop this from happening yet the mails reaching their destination. Thank You Cheers!~ Dhaval Desai __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
"Dhaval Desai" <[EMAIL PROTECTED]> wrote: > Well, I want to send an email to about 300 people. The > problem is that if I use this method people can see > all the email address of the people whoever it is sent > to. Add the addresses to the bcc: field instead of the to: field. I believe this is covered in an example right in the manual. See mail() in the manual online. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
300 recipients is allot. I would not use a script for so many. Why don't you use a program that was designed to send many emails such as Group Mail : http://www.sellshareware.com/CustomView.asp?PrID=34604&AfID=2407&PageID=1 I use it to send mail to tens of thousands of recipients and it's great. Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: Steve Werby [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 8:41 PM To: Dhaval Desai; [EMAIL PROTECTED] Subject: Re: [PHP] Newsletter on the way..stuck in the moment! "Dhaval Desai" <[EMAIL PROTECTED]> wrote: > Well, I want to send an email to about 300 people. The > problem is that if I use this method people can see > all the email address of the people whoever it is sent > to. Add the addresses to the bcc: field instead of the to: field. I believe this is covered in an example right in the manual. See mail() in the manual online. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
BCC - blind carbon copy Miles At 11:23 AM 4/6/01 -0700, Dhaval Desai wrote: >Hi! > >Well, I want to send an email to about 300 people. The >problem is that if I use this method people can see >all the email address of the people whoever it is sent >to. > > ><?php > >$connect = mysql_connect(); >$query = "select email from news"; >$execute = mysql_db_query("uaegraduate", $query); >while($r = mysql_fetch_array($execute)) >{ >$email = $r['email']; >$add .= $email . ","; >} > > >$headers = "From: >[EMAIL PROTECTED]<[EMAIL PROTECTED]>\n"; >$headers .= "Content-Type: text/html; >charset=iso-8859-1\n"; > >$subject = "hey"; >$to = "$add"; >$mailmessage = "hey this is the message"; > >$mailsomeone = mail($to, $subject, $mailmessage, >$headers); > >if($mailsomeone) >{ >echo "Success"; >} > >?> > > >If I use the above method, all the email address will >apear in the to: like this:- >To:[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED] > >and goes on for 300 entries. > > >Is there any way I can stop this from happening yet >the mails reaching their destination. > > >Thank You > >Cheers!~ >Dhaval Desai > >__________________________________________________ >Do You Yahoo!? >Get email at your own domain with Yahoo! Mail. >http://personal.mail.yahoo.com/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
How come sometimes I get this message and sometimes I dont? [Fri Apr 6 13:49:15 2001] [error] PHP Warning: 3 is not a valid PostgreSQL lin k resource in /usr/local/apache/htdocs/ltt-dev/htdocs/formproc.php3 on line 134 It worked fine until I upgraded to PHP4 and now a bunch of code is broken - so I'm having to rewrite it. That really sucks. Anybody else have this problem? I really would like to get in touch with someone who uses postgres with php but i dont know any one else that uses this software. Any help is appreciated kris
On Friday 06 April 2001 21:44, Kristopher Yates wrote: > How come sometimes I get this message and sometimes I dont? > > [Fri Apr 6 13:49:15 2001] [error] PHP Warning: 3 is not a valid > PostgreSQL lin > k resource in /usr/local/apache/htdocs/ltt-dev/htdocs/formproc.php3 > on line 134 > > It worked fine until I upgraded to PHP4 and now a bunch of code is > broken - so I'm having to rewrite it. That really sucks. Anybody > else have this problem? I really would like to get in touch with > someone who uses postgres with php but i dont know any one else > that uses this software. Any help is appreciated Yes, I heard about the bug. It seems that PHP, when it closes de connection, it closes connections which he shouldn't close. I heard someone say that using non-persistent connections solved the problem. Te bug has already been reported (some time ago), and it may be fixxed. Test the latest CVS. Saludos... :-) -- El mejor sistema operativo es aquel que te da de comer. Cuida tu dieta. ----------------------------------------------------------------- Martin Marques | [EMAIL PROTECTED] Programador, Administrador | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------
Hi all, Can anyone tell me how to write a script to close the current opened window with hyperlink? Thank you. Calvin Chua Systems Analyst InterClean Equipment, Inc. 734-975-2967 www.InterClean.com
This is offtopic, but easy User javascript Make your link = <a href="javascript:window.close();">linked item </a> If you are wanting to do it with PHP, stop. PHP is server side only http is connectionless, the server can't tell the client to close it's window. On 4/6/01 11:45 AM, "Wee Chua" <[EMAIL PROTECTED]> wrote: > Hi all, > Can anyone tell me how to write a script to close the current opened window > with hyperlink? Thank you. > > Calvin Chua > Systems Analyst > InterClean Equipment, Inc. > 734-975-2967 > www.InterClean.com >
You need to do this using Javascript since it is a client side function. window.close() is the function you are looking for. HTH Sam Masiello Systems Analyst Chek.Com (716) 853-1362 x289 [EMAIL PROTECTED] -----Original Message----- From: Wee Chua [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 2:46 PM To: PHP (E-mail) Subject: [PHP] Close Window script Hi all, Can anyone tell me how to write a script to close the current opened window with hyperlink? Thank you. Calvin Chua Systems Analyst InterClean Equipment, Inc. 734-975-2967 www.InterClean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
You could do it only in javavascript or in php echo "<a href=\"javascript://\" OnClick=\"self.close\">Close this window</a>\n"; py At 02:45 PM 4/6/01 -0400, you wrote: >Hi all, >Can anyone tell me how to write a script to close the current opened window >with hyperlink? Thank you. > >Calvin Chua >Systems Analyst >InterClean Equipment, Inc. >734-975-2967 >www.InterClean.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] + ====================== + Pierre-Yves Lem@ire + E-MedHosting.com + (514) 729-8100 + [EMAIL PROTECTED] + ======================
Okay, you may call me an idiot all you want, But if the extension_dir= ./ In php.ini And PHP is loaded as an apxs module in apache, then just where does ./ point to? ServerRoot? DocumentRoot? Some other directory? Having a major brain **** in getting my .so into the right place. Also, how can I compile libpdf.so (version 3) to work with PHP4.0.4pl1? If I have to go backwards in PHP (say to 4.0.3pl1) to be able to get PDF support compiled into PHP (because it just isn't working for me on 4.0.4pl1) then somebody please tell me that. I have read through all the suggestions in the list archive I have downloaded the latest versions of files pertaining to pdf and 4.0.4pl1 from cvs.php.net and yet, I still get the problem, during ./configure, of it complaing about my version 3 pdflib, not being version 3 because it can't find pdf_show_boxed(). I _NEED_ pdf support, so any help in choosing the right set of versions would be greatly helpful! Thanks gang! Ps- yes, I also changed ext/crypt.c php_srand... On line 150(or thereabouts) to make php work at all on my box (Qube2)
I have a page with multiple form submit buttons that carry different values to do different functions and such. <form name="bidfile" method=post action="<?=$ME?>"> <input type=submit name="mode" value="Edit Contacts"> <input type=submit name="mode" value="Add Products"> <input type=text name="something" value="<?=$something?>"> ... </form> <? switch (nvl($mode)) { case "Edit Contacts" : save_changes($HTTP_POST_VARS); add_contact_info($bid_id); break; case "Add Products" : save_changes($HTTP_POST_VARS); add_bid_items($bid_id); break; ... } ?> Which works great!! However, I grow tiresome of the typical button "look", and in my attempt to use an image instead: <input type=image name="mode" value="Edit Contacts" src="contacts.png"> failed. Is there a way to do this? I have changed my stylesheet to have the form inputs and whatnot to view smaller which I like. But not small enough in some instances, forcing me to look to other ways, such as an image. So as I asked before, is there a way to do this or any other suggestions?
Yes, but you no longer check the value of "value" to determine which button was clicked. Instead, give each button a unique *name* attribute, then check if $name_x is set. The browser returns the x,y coordinates of the point where the user clicks the button, in variables named name_x and name_y. So, <input type=submit name="modeEdit" value="Edit Contacts"> <input type=submit name="modeAdd" value="Add Products"> if($modeEdit_x) blah elseif ($modeAdd_x) blah Kirk > -----Original Message----- > From: Jared Howard [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 06, 2001 1:07 PM > To: [EMAIL PROTECTED] > Subject: [PHP] FORM <input type=image ...> with a posting value > > > I have a page with multiple form submit buttons that carry > different values > to do different functions and such. > > <form name="bidfile" method=post action="<?=$ME?>"> > <input type=submit name="mode" value="Edit Contacts"> > <input type=submit name="mode" value="Add Products"> > <input type=text name="something" value="<?=$something?>"> > ... > </form> > Which works great!! However, I grow tiresome of the typical > button "look", > and in my attempt to use an image instead: > > <input type=image name="mode" value="Edit Contacts" > src="contacts.png"> > > failed. Is there a way to do this?
Oops. You do need the type=image and src= attributes, instead of what I wrote in the example. Good thing it's Friday :) > -----Original Message----- > From: Johnson, Kirk > Sent: Friday, April 06, 2001 1:29 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP] FORM <input type=image ...> with a posting value > > > Yes, but you no longer check the value of "value" to > determine which button > was clicked. Instead, give each button a unique *name* > attribute, then check > if $name_x is set. The browser returns the x,y coordinates of > the point > where the user clicks the button, in variables named name_x > and name_y. > > So, > > <input type=submit name="modeEdit" value="Edit Contacts"> > <input type=submit name="modeAdd" value="Add Products"> > > if($modeEdit_x) > blah > elseif ($modeAdd_x) > blah > > Kirk > > > -----Original Message----- > > From: Jared Howard [mailto:[EMAIL PROTECTED]] > > Sent: Friday, April 06, 2001 1:07 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] FORM <input type=image ...> with a posting value > > > > > > I have a page with multiple form submit buttons that carry > > different values > > to do different functions and such. > > > > <form name="bidfile" method=post action="<?=$ME?>"> > > <input type=submit name="mode" value="Edit Contacts"> > > <input type=submit name="mode" value="Add Products"> > > <input type=text name="something" value="<?=$something?>"> > > ... > > </form> > > > Which works great!! However, I grow tiresome of the typical > > button "look", > > and in my attempt to use an image instead: > > > > <input type=image name="mode" value="Edit Contacts" > > src="contacts.png"> > > > > failed. Is there a way to do this? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] >
Hello php, Soeey but I can't find anyexample abot PHP + IRC.. Please help me..... _________________ 2001 m. balandžio 6 d. Marius [EMAIL PROTECTED]
Check out phpwizard.net http://phpwizard.net/projects/phpIRC/ By reading through their code you can probably learn alot of what you want to know. -- Plutarck Should be working on something... ...but forgot what it was. "Marius Petravičius" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello php, > > Soeey but I can't find anyexample abot PHP + IRC.. > Please help me..... > > _________________ > 2001 m. balandžio 6 d. > Marius > [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
Hi folks, i writing in order to get a simple problem i am facing with FastTemplate PHP lib. I am trying to get my template parsed, but when i access the url, i get an error: Warning: Undefined property: table in /usr/home/grios/.public_html/php_inc/FastTemplate.inc on line 376 0 0 1 10 2 20 3 30 4 40 5 50 6 60 7 70 8 80 9 90 Here is my t.php: <? require ("FastTemplate.inc"); $tpl = new FastTemplate("tpl"); $tpl->define(array("table" => "t.tpl")); $tpl->define_dynamic("row", "table"); for ($i = 0; $i < 10; $i++) { $tpl->assign(array("NUMBER" => $i, "RESULT" => $i * 10)); $tpl->parse("ROWS", ".row"); } $tpl->parse("MAIN", "table"); $tpl->FastPrint(); ?> Here is my template t.tpl: <table> <!-- BEGIN DYNAMIC BLOCK: row --> <tr> <td>{NUMBER}</td> <td>{RESULT}</td> </tr> <!-- END DYNAMIC BLOCK: row --> </table> Very simple, no? But what is wrong? May some one in this mailing list help me?
Are there any PHP magazines stateside? I see all kinds of ASP mags, but none for PHP
None that I know of, but with PHP Advisor publications would not have anyone to suck up to. And where would the advertising stream be? This list, archives and the tutorial articles are more than adequate, in my opinion. Miles Thompson At 01:15 PM 4/3/01 -0400, Chris Anderson wrote: >Are there any PHP magazines stateside? I see all kinds of ASP mags, but >none for PHP
Hello, I'm creating a mailinglist archive in PHP, and all is going very well. I'm planning to release it open source when version 1.0 is ready. I have a question, when i get emails and parse them sometimes the name of the sender is in this format: =?iso-8859-13?B?TWFyaXVzIFBldHJhdmnoaXVz?= How do i decode this? Same goes for mime messages, is there any excisting code that decodes mime messages? Thanks for the help, Jeroen Geusebroek
Hi, has someone an idea where to find a tutorial to build a php based chat enviroment (both implementation and, very important, the logical background) Many thank in advance Lars ;-) __________________________________________________________________ Do You Yahoo!? Gesendet von Yahoo! Mail - http://mail.yahoo.de
Hi, Does anyone know if and what the limit is of bcc that can be used in the mail() function? Hundreds, thousands? Thanks, Chris
IMHO, it's not the mail() limit but rather the SMTP protocol limit and it seems to vary between different OS's. I wouldn't go for more than 50 emails in one Bcc. You need to take into consideration that the email length vary and that there may be 50 emails that sum up to 500 chars and some can be 10,000 chars... Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: Chris [mailto:[EMAIL PROTECTED]] Sent: Friday, April 06, 2001 10:47 PM To: php Subject: [PHP] mail() limit? Hi, Does anyone know if and what the limit is of bcc that can be used in the mail() function? Hundreds, thousands? Thanks, Chris
If you're splitting by a defined pattern (such as a space " ") explode is quite a bit faster...and i believe that if you need reg exps. you can use split() (which will take a regex as the pattern)... -js > -----Original Message----- > From: Plutarck [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 05, 2001 11:11 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Array of words in textfile? > > > If they are all in a format like that, first just read the text file with > fopen/fread into one big string. > > Then use: > > $refined_string = explode(" ", $bigstring); > > That's the main way to do it, but the preferable way is using a regular > expression with either the ereg or preg functions. > > > -- > Plutarck > Should be working on something... > ....but forgot what it was. > > > "Jan Grafström" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi! > > I want to read a textfile (cat, dog, rat,) and get it like this: > > $namesArray = array("cat,", "dog,", "rat,"); > > If I can do this than I can go on and make changes in my array. > > Like the examples in php manual. > > > > > > Thanks in advance for any tips. > > > > Regards > > Jan > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > >
can you just use a POST instead of a get? seems it might be cleaner in this case... -js > -----Original Message----- > From: Plutarck [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 05, 2001 11:22 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Building an array from a URL > > > You'll probably want to play with the following function: > > http://www.php.net/manual/en/function.parse-url.php > > > -- > Plutarck > Should be working on something... > ....but forgot what it was. > > > "Mike Gifford" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello, > > > > I'm trying to build an array out of data submitted from a URL. > > > > Essentially, I want to pull certain records out of a database which have > been > > selected on another form. > > > > The URL presently looks like this: > > > superRSS.phtml?150=1150&superRSS166=1166&superRSS168=1168&superRS > S175=1188 > > > > I'd like to take these independent variables and merge them > into a single > array: > > $array_superRSS = implode (":", $superRSS[]); > > > > So I can then pipe these values directly into another function: > > > > while ($array_superRSS) { > > display_superRSS($array_superRSS[]); > > } > > > > Obviously I'm missing a step or two here, but would really appreciate > someone > > filling in some of the gaps. > > > > Thanks! > > > > Mike > > -- > > Mike Gifford, OpenConcept Consulting, http://openconcept.ca > > Offering everything your organization needs for an effective web site. > > Featured Client: http://www.aboriginalrightscoalition.ca/ > > If a book doesn't make us better, then what on earth is it for? - Alice > Walker > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > >
We are looking for members for the Twin Cities PHP User Group. Interested parties can see http://www.moewes.com/tcphpug.html or http://www.phpusergroups.org/groups.phtml?id=3&menu=groups -- Chris Moewes-Bystrom [EMAIL PROTECTED] http://teamstore.com
H- Just a quick question. Is there any difference between using print or echo? >From what I have read and seen there isn't any. Than why the two different commands? Thanks. -Sterling
> Than why the two different commands? Simple - some people come from C which uses print ... others come from languages that use echo. It fosters adaptation by other programmers. --Joe > > Thanks. > -Sterling > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] /******************************************************************************\ * 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." * \******************************************************************************/
> H- > > Just a quick question. > > Is there any difference between using print or echo? > > >From what I have read and seen there isn't any. > Than why the two different commands? > > Thanks. > -Sterling See this: http://www.php.net/manual/en/function.print.php "As for a print vs. echo, echo gives you more options, such as being able to continue output on multiple lines like an <<EOT in perl. Look at the above notes. With print you would not be able to accomplish this." Jeff Oien
Jeff Oien wrote: > "As for a print vs. echo, echo gives you more options, > such as being able to continue output on multiple lines > like an <<EOT in perl. Look at the above notes. With print > you would not be able to accomplish this." There's another difference. print() returns true on success and false when called after a connection abort. Echo doesn't, and that's why it's slightly (very slightly) faster. regards Wagner -- Assumption is the mother of all fuck-ups.
Genius! Thank thank thankyou! If I wasn't well rested I'd kiss you. Or more appropriately, I'd kiss the person that programmed that function in the first place...*rubs hands* Oh the fun I'm going to have figuring a way to actually use this for anything other than mail()... -- Plutarck Should be working on something... ...but forgot what it was. ""Steve Werby"" <[EMAIL PROTECTED]> wrote in message 01b501c0be46$14cb7480$6501a8c0@workstation7">news:01b501c0be46$14cb7480$6501a8c0@workstation7... > "Peter Kuppelwieser" <[EMAIL PROTECTED]> wrote: > > I have an problem with on of our scripts, and some caching proxy servers > > > > the script produces output, then it does a flush(), > > After this, the script does a sleep(10) and then it does a db-query > without > > producing html output. > > > > normally the browsers get the page after the flush() command > > but on some proxy servers, the page is forwarded to the browser > > only after the proxy server has terminated the connection to the apache > > webserver (after the 10 secs). > > > > my question: > > > > Is it possible to terminate the tcpIP connection, before the php script > ends? > > (I think this would solve my problem) > > Perhaps register_shutdown_function() will do the trick. I've used it on > scripts where a call to an external command or long DB operation took a long > time, but didn't affect the browser output. > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
I have a textarea and I want to save the textarea text into a file. Then I put this in the html: <INPUT NAME="arqcliente" TYPE="file"> And this in action of php: $fd = fopen("Augusto.wri", "w" ); fwrite($fd, $conteudo); fclose( $fd ); But I'm having a big problem on this. Is the text has this caracter ("), the PHP add "\" before. So the number of (\) double every time that I want to update the file via textarea. How can I solve this problem? regards, Augusto
Check out .htmlspecialchars(..) .removeslashes() .stripslashes() - Richard "Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message Pine.GSO.4.10.10104062012140.20277-100000@venus">news:Pine.GSO.4.10.10104062012140.20277-100000@venus... > I have a textarea and I want to save the textarea text into a file. Then I > put this in the html: > > <INPUT NAME="arqcliente" TYPE="file"> > > And this in action of php: > > $fd = fopen("Augusto.wri", "w" ); > fwrite($fd, $conteudo); > fclose( $fd ); > > But I'm having a big problem on this. Is the text has this caracter ("), > the PHP add "\" before. > > So the number of (\) double every time that I want to update the file via > textarea. > > How can I solve this problem? > > regards, > > Augusto > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
*sigh* I just discovered http://www.php.net/manual-lookup.php again, which happens to list all the ones found in the manual. But, it doesn't have them all, so my time wasn't wasted! But I did discover a few I missed, so now there are about 1767 functions listed! The list is valid for all functions up to 4.0.4pl1, and supports the vast majority of functions in 4.0.5, even though it isn't even out yet! Haha! And when I finally figure out how to install a new version of PHP, I might just update it too if I missed anything ;) -- Plutarck Should be working on something... ...but forgot what it was. ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9ajqk2$ll4$[EMAIL PROTECTED]">news:9ajqk2$ll4$[EMAIL PROTECTED]... > First of all I use Edit Plus, which uses a list of PHP functions to know > what words to highlight in the code. > > Well now that I have a seriously throbbing headache, I've done it. Finally. > > If you use a program that needs a list of functions for syntax highlighting, > I've finally got one that has every function according to PHP > get_defined_functions (includes quite a few undocumented functions), the PHP > manual, and quite a few others it failed to mention but should be > highlighted. unset() is a good example, along with print/echo, I managed to > put it together. Every entry on it's own line (so it's seperated by "\n"). > > My head feels like it is being used as the repository for Anna Nichole > Smith's silicone breast implants (both failed and spare parts for future > use). > > In any case, there are 1755 entries in the blasted thing. If it's in the PHP > manual or get_defined_functions, it's in there. And damn is that alot. > > Here is the link to the text file: > http://crazyoddball.hypermart.net/php.stx.txt > > > However I learned so many cool things with so many functions I'd like to > use, but I have a severe headache and have to go to work (I'll be in a car > the whole time, so no computer) in one hour, and I haven't slept. > > And I'm not getting paid for this either. > > Ah yes, this is GeekLife. But I have no caffiene in my system. So this is > the GranolaGeekLife...GGL...giggle? > > > > Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be > useful. > > I certainly hope so, because compiling the whole thing was overkill if I'm > the only one that will use it :) > > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] >
what is a list of all the characters that have to be escaped?