php-general Digest 1 May 2001 03:36:55 -0000 Issue 659 Topics (messages 50868 through 50943): Creating Graphs 50868 by: Mike Mike 50912 by: jarry 50913 by: Roger Ramirez Re: Get the title from an HTML page 50869 by: Matt Schroebel 50870 by: Tim Ward help me :) 50871 by: Arvydas 50915 by: Jason Mowat php 4.04pl1 & ldap 50872 by: Walgamotte, David 50874 by: Steve Werby Re: Command Line 50873 by: Steve Werby Update statement? 50875 by: Kurth Bemis 50877 by: Steve Werby Sort Question 50876 by: Brandon Orther Re: Update statement?:SOLVED 50878 by: Kurth Bemis replace functions add \ 50879 by: Kasten, Holger Re: template solutions? 50880 by: Michael Kimsal 50884 by: Steven Haryanto 50886 by: Michael Kimsal 50887 by: Steven Haryanto 50888 by: Michael Kimsal 50890 by: Fabian Raygosa 50891 by: Steven Haryanto 50894 by: Steven Haryanto 50896 by: Matt Schroebel 50902 by: Dave Goodrich 50904 by: Steven Haryanto 50909 by: Steven Haryanto Re: OT, but dual-boot operating system question 50881 by: Toby Miller 50882 by: Richard S. Crawford COM 50883 by: Hassan Arteaga 50919 by: Chris Anderson Re: php suck 50885 by: Geir Eivind Mork Re: can someone debug this vote.php script for me? 50889 by: Phillip Bow timezones 50892 by: Joe Stump 50898 by: Mark Maggelet 50899 by: Jon Rosenberg 50900 by: Frank M. Kromann 50903 by: Joe Stump 50905 by: Jon Rosenberg 50908 by: Mark Maggelet Re: Link Color Questions 50893 by: Joe Stump 50895 by: Ashley M. Kirchner GD and arrays 50897 by: Mike Wes Sort an array 50901 by: Brandon Orther 50918 by: Miles Thompson Re: suggestions for binary data in database 50906 by: Jason Stechschulte Re: Syntax for select statement 50907 by: Jason Stechschulte String Type Unknown 50910 by: Nathan Cook HELP! String Output Limit 50911 by: Niko Spyridonos 50914 by: CC Zona Problems with sprintf and swapping variables 50916 by: Edward McLain Browser Detection 50917 by: Tim Thorburn PHP 4.0.5 is out 50920 by: Zeev Suraski 50923 by: SHAWN 50928 by: Chris Fry 50933 by: Zeev Suraski Re: PHP 4.0.5 is out (output compression) 50921 by: Aaron Tuller 50932 by: Zeev Suraski Re: Best Practice-HTML In Database 50922 by: John Monfort Re: Please review our coding standards [ ideas ] 50924 by: Johnson, Kirk XML Parsing 50925 by: Michael Conley 50929 by: Fabian Raygosa Writing a file with break lines 50926 by: Augusto Cesar Castoldi 50938 by: Steve Werby Executing a PL/SQL Function 50927 by: Marcelo Dias de Toledo Programming PHP in a modular way 50930 by: Andreas Pucko 50940 by: Jason Beebe 50941 by: Michael Hall Recive Mail 50931 by: Manesh Arranging lists 50934 by: Peter Houchin 50935 by: Brian Tanner Re: Logging Into Sites (webgames) 50936 by: Fred 50937 by: Steve Werby 50943 by: Fred Re: Loading PHP module on Win98 50939 by: Benny upload/download of files (This is LONG) 50942 by: Tyler Longren 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] ----------------------------------------------------------------------
Hello, I was wonder if anyone knows of a place where I can get a good tutorial about making graphs for beginners using php. If so please let me know. Thank you --Mike __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Hi try this http://www.aditus.nu/jpgraph/index.php Jarry Uzytkownik "Mike Mike" <[EMAIL PROTECTED]> napisal w wiadomosci [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > I was wonder if anyone knows of a place where I can > get a good tutorial about making graphs for beginners > using php. > If so please let me know. > Thank you > --Mike > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.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] >
Check out Leon Atkinsons Core PHP Programming. He has a couple good examples on using pie charts and bar charts. ----- Original Message ----- From: "Mike Mike" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 11:39 AM Subject: [PHP] Creating Graphs > Hello, > I was wonder if anyone knows of a place where I can > get a good tutorial about making graphs for beginners > using php. > If so please let me know. > Thank you > --Mike > > __________________________________________________ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.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] >
You can find a function that does that at http://www.zend.com called Get Title Tag in the Code Gallery under the HTML catagory. > -----Original Message----- > From: Matthew Ralston [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 30, 2001 9:25 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Get the title from an HTML page > Basically I need to ge the text from in between the <title> tags. > Any ideas? >
$title = substr(stristr($filetext, "<title>"), 7); $title = substr($title , 0, strpos($title , "</title>")); Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Matthew Ralston [mailto:[EMAIL PROTECTED]] > Sent: 30 April 2001 14:25 > To: [EMAIL PROTECTED] > Subject: Get the title from an HTML page > > > I'll be loading the contents of an HTML page into a variable > and I need to > get the title of the from that variable. > > Basically I need to ge the text from in between the <title> tags. > Any ideas? > > Thanks, > > Matt > [EMAIL PROTECTED] > < www.mralston.co.uk /> > > >
Hello, i'm new in php but i have very difficult exercise.... i must make hierarchical menu witch can be released for example so : First i will get main menu : for example menu1, menu2, menu3... and these menu will have links (this must be released with <a href=""...) to others submenu : sub1, sub2, sub3 (each menu can have more than one sub menu), and these submenus will go deeper and deeper (depends from some parameters) so - the question is "How to make recursive menu ?" (menu mus be repaint after any click...) (I have an idea to make function that will "produce" recursive arrays...) P.S.sorry for poor english :) sincerely, Arvys.
Arvydas, I did something like this using a "tree" structure, using stacks. Each item on the stack could have 1 to 3 properties: Name, Parent, URL. If the object on the stack has only a Name property (i.e. Parent and URL are empty) it is assumed that this item is a root node. If the item has a Name and a Parent, is is a child node to the parent, and if it has a Name, Parent and URL, then it is a leaf node to the parent. For example: FolderA FolderB --FolderB(1) --FolderB(2) --ItemB(2)(1) I push onto my stack directory items that have the following properties: AddDirItem(FolderA) AddDirItem(FolderB) AddDirItem(FolderB(1), FolderB) AddDirItem(FolderB(2), FolderB) AddDirItem(ItemB(2)(1), FolderB(2), http://itemb21.whatever) Then, you loop through all of the items, setting the root items as the top of the tree, and continue nesting subitems until you get to a new root item. If you want, I can send you the PHP objects I used to implement this in a dynamic tree. It works quite well, and is extensible to 'n', where 'n' is the number of items allowed due to system/browser constraints. Cheers, Jason "Arvydas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > i'm new in php but i have very difficult exercise.... i must make hierarchical menu witch can be released for example so : > > First i will get main menu : for example menu1, menu2, menu3... and these menu will have links (this must be released with <a href=""...) to others submenu : sub1, sub2, sub3 (each menu can have more than one sub menu), and these submenus will go deeper and deeper (depends from some parameters) > so - the question is "How to make recursive menu ?" > (menu mus be repaint after any click...) > > (I have an idea to make function that will "produce" recursive arrays...) > > P.S.sorry for poor english :) > sincerely, > Arvys. >
Is LDAP support default or are there any ./configure options I need to know ? David
"Walgamotte, David" <[EMAIL PROTECTED]> wrote: > Is LDAP support default or are there any ./configure options I need to know Take a look at './configure --help'. You need to configure --with-ldap. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
"Randy Johnson" <[EMAIL PROTECTED]> wrote: > how do access arguments if I run a script from the command line > > example > php myscript.php arg1, arg2 They'll be located in the global array $argv[]. Include <?php phpinfo(); ?> in your script to see how to access them. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
hey i'm working on a shopping cart..but have hit a snag whit this statement.. function modify_quantity($table, $session, $itemid, $quantity) { $sql = "UPDATE $table SET quantity='$quantity' WHERE session='$session' AND itemid='$itemid'"; mysql_query("$sql"); } if there is a value in the db field "quantity" then after the statement is executed it is set to "0" here is my calling code. if ($action == "uq" || $action == "Update" ){ modify_quantity($table,$session,$itemid,$quanity); } and the requested url. http://www.harborfresh.com/retail/cart.php?itemid=21591&quantity=5&action=Update any ideas? ~kurth
"Kurth Bemis" <[EMAIL PROTECTED]> wrote: > function modify_quantity($table, $session, $itemid, $quantity) > { > $sql = "UPDATE $table SET quantity='$quantity' WHERE session='$session' > AND itemid='$itemid'"; > mysql_query("$sql"); Add 'echo $sql;' here (no quotes) and look at the output. If the RHS of quantity= is zero, then $quantity passed to modify_quantity is zero and that's the problem. > if there is a value in the db field "quantity" then after the statement is > executed it is set to "0" I think that $quantity is the problem. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Hello, I am doing a dir list of an ftp and using sort to sort the dir list alphabetically. What I am using now sorts it alphabetically but it sorts the capital letters then the lower case so a capital "Z" would come before a lower case "a" The Code I am using is: sort($complete_list); return $complete_list; Does someone know how I can sort an array alphabetically with the case insensitive sort? Thank You Brandon
At 01:03 PM 4/30/2001, Steve Werby wrote: I hate the letter "i" :-) it was missing when i passed quantity to the function ~kurth >"Kurth Bemis" <[EMAIL PROTECTED]> wrote: > > function modify_quantity($table, $session, $itemid, $quantity) > > { > > $sql = "UPDATE $table SET quantity='$quantity' WHERE session='$session' > > AND itemid='$itemid'"; > > mysql_query("$sql"); > >Add 'echo $sql;' here (no quotes) and look at the output. If the RHS of >quantity= is zero, then $quantity passed to modify_quantity is zero and >that's the problem. > > > if there is a value in the db field "quantity" then after the statement is > > executed it is set to "0" > >I think that $quantity is the problem. > >-- >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]
Hello, I have a strange problem. I tried ereg_rplace and str_replace: $to_test = 'This is a test'; $to_test = str_replace ("test","little test",$to_test); echo $to_test; the result is: "This is a \little test" Why does this happen?
Why not just use PHP in the template? That's kinda what it was made for. On Sun, 29 Apr 2001, Steven Haryanto wrote: > Does anyone know a rather advanced template solution in PHP? > At least one that supports loop and if (like HTML::Template), > and directives/commands would be nice (like Perl's Template > Toolkit). > > I am currently rolling my own, but still not happy with the > result of the design. I'd be happy to use one that is already > out there. > > Steve
Actually, not using a programming language is the point of template, since I do not want to expose anything other than some template 'variables' to the template. Steve At 5/1/2001 12:36 AM, Michael Kimsal wrote: >Why not just use PHP in the template? That's kinda what it was made for. > >On Sun, 29 Apr 2001, Steven Haryanto wrote: > > > Does anyone know a rather advanced template solution in PHP? > > At least one that supports loop and if (like HTML::Template), > > and directives/commands would be nice (like Perl's Template > > Toolkit). > > > > I am currently rolling my own, but still not happy with the > > result of the design. I'd be happy to use one that is already > > out there. > > > > Steve
No, you're asking for something with loops and IFs. That's a programming language. On Tue, 1 May 2001, Steven Haryanto wrote: > Actually, not using a programming language is the point of template, > since I do not want to expose anything other than some template > 'variables' to the template. > > Steve > > At 5/1/2001 12:36 AM, Michael Kimsal wrote: > >Why not just use PHP in the template? That's kinda what it was made for. > > > >On Sun, 29 Apr 2001, Steven Haryanto wrote: > > > > > Does anyone know a rather advanced template solution in PHP? > > > At least one that supports loop and if (like HTML::Template), > > > and directives/commands would be nice (like Perl's Template > > > Toolkit). > > > > > > I am currently rolling my own, but still not happy with the > > > result of the design. I'd be happy to use one that is already > > > out there. > > > > > > Steve >
See the philosophy behind HTML::Template for explanation on this: http://www.perlmonth.com/features/template/template.html?issue=11 Not everything with loops and IFs is a programming language. I would probably call PDF or RTF a programming language too if it were. Steve At 5/1/2001 01:10 AM, Michael Kimsal wrote: >No, you're asking for something with loops and IFs. That's a programming >language. > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > Actually, not using a programming language is the point of template, > > since I do not want to expose anything other than some template > > 'variables' to the template.
I understand completely what you're getting at already, but PHP is designed to do what you're asking to do. I know there are valid reaons for stripped down implementations, but can't think of too many. And actually, I would consider RTF or PDF to be languages unto themselves. There's a full syntax to use to get specific results, and if you're throwing conditionals in there, or variables, it's hard to see how it's not a language. Maybe not full-featured, but a language nonetheless. On Tue, 1 May 2001, Steven Haryanto wrote: > See the philosophy behind HTML::Template for explanation on this: > > http://www.perlmonth.com/features/template/template.html?issue=11 > > Not everything with loops and IFs is a programming language. I would > probably call PDF or RTF a programming language too if it were. > > Steve > > > At 5/1/2001 01:10 AM, Michael Kimsal wrote: > >No, you're asking for something with loops and IFs. That's a programming > >language. > > > > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > > > Actually, not using a programming language is the point of template, > > > since I do not want to expose anything other than some template > > > 'variables' to the template. > > > -- > 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 this is what you are looking for http://www.thewebmasters.net/php/FastTemplate.phtml ----- Original Message ----- From: "Steven Haryanto" <[EMAIL PROTECTED]> To: "Michael Kimsal" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 11:40 AM Subject: Re: [PHP] template solutions? > See the philosophy behind HTML::Template for explanation on this: > > http://www.perlmonth.com/features/template/template.html?issue=11 > > Not everything with loops and IFs is a programming language. I would > probably call PDF or RTF a programming language too if it were. > > Steve > > > At 5/1/2001 01:10 AM, Michael Kimsal wrote: > >No, you're asking for something with loops and IFs. That's a programming > >language. > > > > > >On Tue, 1 May 2001, Steven Haryanto wrote: > > > > > Actually, not using a programming language is the point of template, > > > since I do not want to expose anything other than some template > > > 'variables' to the template. > > > -- > 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]
At 5/1/2001 01:43 AM, Michael Kimsal wrote: >I understand completely what you're getting at already, but PHP is >designed to do what you're asking to do. > >I know there are valid reaons for stripped down implementations, but can't >think of too many. Clean separation of content and presentation? That is one strong point (for some people anyway). Ease of use? I want to let *other people* customize the web page to some extent, but surely do not want to require them to learn PHP. Security? I do not want other people to have access to the PHP runtime (where they can do nasty things like stealing my database password, etc). PHP currently does not support any restricted execution of user code whatsoever. For some applications, sometime I don't even want people to *know* that I am using PHP. >And actually, I would consider RTF or PDF to be >languages unto themselves. There's a full syntax to use to get specific >results, and if you're throwing conditionals in there, or variables, it's >hard to see how it's not a language. Maybe not full-featured, but a >language nonetheless. I agree. But you said earlier, "programming language". Programming languages are used to create *programs*. These perhaps can be loosely called "document languages". -- sh
At 5/1/2001 01:43 AM, Fabian Raygosa wrote: >Maybe this is what you are looking for >http://www.thewebmasters.net/php/FastTemplate.phtml Nope. I was looking for a template that supports loops and IFs. Someone pointed me to php dreamtime: http://www.phptemplates.org/ which is a cool project, by the way. Btw, I think I might need some extra "tags" to my template "language" so I'm going to hack this on by myself at the time being. Thanks, Steve
I'm using EasyTemplates from Web Application Development with PHP book by Tobias Ratschiller. It's quite simple, easy to modify, and I loop on a template, appending the html to a variable that I use elsewhere in another template. It really straightens out logic because you're building the pages bottom up, so to speak, and you know everything before you output any html. It came on the cd in the book. Not sure if it's on http://www.phpwizard.net/ or not. > -----Original Message----- > From: Steven Haryanto [mailto:[EMAIL PROTECTED]] > Sent: Sunday, April 29, 2001 7:55 AM > To: [EMAIL PROTECTED] > Subject: [PHP] template solutions? > Does anyone know a rather advanced template solution in PHP? > At least one that supports loop and if (like HTML::Template), > and directives/commands would be nice (like Perl's Template > Toolkit). >
On Monday, April 30, 2001, at 12:02 PM, Steven Haryanto wrote: > Security? I do not want other people to have access to the PHP runtime > (where they can do nasty things like stealing my database password, > etc). PHP currently does not support any restricted execution of user > code whatsoever. > in httpd.conf <VirtualHost 192.168.3.8> DocumentRoot /usr/local/www/thisUser ServerName thisUser.myServer.com php_value include_path /usr/local/www/thisUser/inc php_value open_basedir /usr/local/www/thisUser </VirtualHost> You could do a lot to control your users abilities/privleges in this way. Dave Goodrich Director of Interface Development Reality Based Learning Company 9521 NE Willows Road, Suite 100 Redmond, WA 98052 Toll Free 1-877-869-6603 ext. 237 Fax (425) 558-5655 [EMAIL PROTECTED] http://www.rblc.com
I was not referring to "safe mode". In other languages like Perl or Python, "safe execution" means that if I execute some code (or eval a code string supplied by user), I can restrict what kinds of operation is valid for it, or what kinds of variables are available to it. In PHP, if I have my database password in a global var $dbpass, I cannot prevent this code: eval('echo $dbpass'); from printing my database password. Well of course you could do unset($dbpass) or even unset($GLOBALS) or save it to somewhere else... But still I cannot even prevent things like this: eval('echo 1/0'); from stopping my own program because it generates an error that I cannot trap. Well, actually there is error handlers... Perhaps you can get your way around to make eval() more secure, but still I prefer not to trust a code string from user to be eval()'ed by my PHP script. Just letting a user modify a template and changing the look of a page is sufficient for me, since that is all the user is supposed to gain access to. Regards, Steve At 5/1/2001 02:23 AM, Dave Goodrich wrote: >On Monday, April 30, 2001, at 12:02 PM, Steven Haryanto wrote: > >>Security? I do not want other people to have access to the PHP runtime >>(where they can do nasty things like stealing my database password, >>etc). PHP currently does not support any restricted execution of user >>code whatsoever. >in httpd.conf > ><VirtualHost 192.168.3.8> > DocumentRoot /usr/local/www/thisUser > ServerName thisUser.myServer.com > php_value include_path /usr/local/www/thisUser/inc > php_value open_basedir /usr/local/www/thisUser ></VirtualHost> > >You could do a lot to control your users abilities/privleges in this way.
At 5/1/2001 03:05 AM, Dave Goodrich wrote: >>In PHP, if I have my database password in a global var $dbpass, >>I cannot prevent this code: >> >> eval('echo $dbpass'); >Never put your DBPass into a GLOBAL ;^) Hm, perhaps creating a function do_connect('hostname','user','pass') is safer? Good idea. >Agreed, it's not worth your time and hassle to try and predict >every possible circumstance a user might try. >Have you thought about some SSI and a few Javascripts? >depending on what you mean by "changing the look of a page" it might be easier. Mm. I still prefer a template, thank you :) >A stupid question but I gotta ask, have you looked through >freshmeat? lots of stuff like this done in Perl, Python, PHP. Yes, I have done a search on freshmeat and sourceforge for php templates. Btw, there are eazytemplates and php dreamtime that I've been told that supports ifs and loops. That's nice. Thanks to everybody who responded. Steve
Your safest bet would probably be to look into RedHat Linux. It's a fairly straight forward Linux distribution. It also includes the LILO boot loader which is one way to boot into more than one operating system on the same machine. ----- Original Message ----- From: "Chris Cocuzzo" <[EMAIL PROTECTED]> To: "PHP General List (E-mail)" <[EMAIL PROTECTED]> Sent: Saturday, April 28, 2001 12:36 PM Subject: [PHP]OT, but dual-boot operating system question > Hey, > > completely OT i know... > > In a few months when I put together for college, I'm considering doing a > dual-boot type system, with some windows OS, and also a unix OS. However, I > don't know that much about any free unix OS' that are out there. The two I > can think of to use would be Solaris and Linux. Can anyone give me some > advice on which to use, and also if possible point me to a site where I can > get information on doing this type of thing? > > 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]
Beware if you're using WinNT or Windows 2000. Neither one plays nice with LILO. At 01:41 PM 4/30/2001 -0400, Toby Miller wrote: >Your safest bet would probably be to look into RedHat Linux. It's a fairly >straight forward Linux distribution. It also includes the LILO boot loader >which is one way to boot into more than one operating system on the same >machine.
Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED]
Unfortunately VB 6.0 com components do not like to work outside of their ASP and VB bases. I've heard of a few people trying it, but I heard it was very difficult. I'd help more, but I've never used PHP with com, only with ASP Chris Anderson aka "Null" -------------------------------------------- PHP Developer / Nulltech PHP-GTK Grunt / gtk.php.net STA-DoD, TO and DDay Administrator / www.stronger.org DOD Co-Owner / www.dayofdefeat.com Zeroping Staff Member / www.zeroping.com Volition Programmer / www.Volition-net.com ----- Original Message ----- From: "Hassan Arteaga" <[EMAIL PROTECTED]> To: "Php (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 1:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [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]
On Sunday 29 April 2001 12:54, idban secandri wrote: > i found this when surfing this morning > http://www.phpsucks.net/ The site www.phpsucks.net is running Apache/1.3.17-twelveHTTP (Unix) PHP/4.0.4pl1 on Linux. is it just me or is it a mirror of the old php site with the text 'Hyped text Bloatcessor' ? but there are a aspsucks.com, cfsucks.com (if that ever points to cold fusion), perlsucks.com (which is a pro-php site), lifesucks.com, wifesucks.com, isucks.com, sucks.com and god knows what sucks and sucks not dot-com. so I wouldn't exacly be offended if anyone though anything sucked dot com cause everyone thinks it sucks no matter how good it is :) -- php developer / CoreTrek AS | "Besides, I think [Slackware] sounds Sandnes / Rogaland / Norway | better than 'Microsoft,' don't you?" (By web: http://www.moijk.net/ | Patrick Volkerding)
Its just a warning error. You can get rid of it by defining the variable, or just change your error settings to not report warnings. -- phill ""Joe Truong"" <[EMAIL PROTECTED]> wrote in message 9ce21h$s1n$[EMAIL PROTECTED]">news:9ce21h$s1n$[EMAIL PROTECTED]... > can some one debug this script for me... it say's "Warning: Undefined > variable: total in PHP_poll.php on line 63" > > thanxz alot!!! > > > > <?php > > // En: Begin PHP Code > > /*************************************************************************** > ***\ > > * PHP Poll Version 1.0 * > > * Copyright 2000 Frederic TYNDIUK (FTLS) All Rights Reserved. * > > * E-Mail: [EMAIL PROTECTED] Script License: GPL * > > * Created 02/28/2000 Last Modified 02/28/2000 * > > * Scripts Archive at: http://www.ftls.org/php/ * > > **************************************************************************** > ***/ > > // Necessary Variables: > > $RESULT_FILE_NAME = "poll_data.txt"; > > // En: Absolute path and name to file contain poll data. > > $QUESTION = "How do you like this Script?"; > > // En: Question Text. > > $ANSWER = array("Love it!", "Like it!", "Its okay..", "I dislike it", "I > hate it.."); > > // En: All answer. > > $IMG_DIR_URL = "./vote"; > > // En: URL Directory of poll graphs. > > $REVOTE_TIME = 3600; > > // En: Time (second) after people can revote, use cookies. > > // End Necessary Variables section > > /*************************************************************************** > ***/ > > if (!isset($vote) && !isset($result)) { > > echo "<FORM METHOD=\"POST\">\n"; > > echo "<TABLE CELLSPACING=0 CELLPADDING=2 BORDERCOLOR=#000000 > BORDER=1><TR><TD><TABLE WIDTH=\"100%\" BORDER=0>\n"; > > echo "<TR><TH colspan=\"3\">$QUESTION</TH></TR>\n"; > > while (list($key, $val) = each($ANSWER)) { > > echo "<TR><TD width=\"2%\"></TD><TD align=\"left\" width=\"96%\"><INPUT > TYPE=\"radio\" NAME=\"answer\" VALUE=\"$key\"> $val</TD><TD > width=\"2%\"></TD></TR>\n"; > > } > > echo "<TR><TD align=\"center\" colspan=\"3\"><INPUT TYPE=\"Submit\" > NAME=\"vote\" VALUE=\" Vote \">\n"; > > echo " <INPUT TYPE=\"Submit\" NAME=\"result\" VALUE=\" Result > \"></TD></TR>\n"; > > echo "</TABLE></TD></TR></TABLE></FORM>"; > > } else { > > $file_array = file($RESULT_FILE_NAME); // or error("Can not open > \$RESULT_FILE_NAME"); > > // En: Save result > > if ($answer < count($ANSWER) && $vote) { > > if (count($file_array) < count($ANSWER)) { > > $file_array = array("0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", > "0\n", "0\n"); > > } > > $old_answer = $file_array[$answer]; > > $old_answer = preg_replace("/\n\r*/", "", $old_answer); > > $file_array[$answer] = ($old_answer + 1)."\n"; > > $file = join('', $file_array); > > $fp = fopen("$RESULT_FILE_NAME", "w"); //or error("Can not write > \$RESULT_FILE_NAME"); > > flock($fp, 1); > > fputs($fp, $file); > > flock($fp, 3); > > fclose($fp); > > } > > // En: Display result > > while (list($key, $val) = each($file_array)) { > > $total += $val; > > } > > echo "<h2>PHP Poll vote results :</h2>"; > > echo "<TABLE CELLSPACING=0 CELLPADDING=2 WIDTH=400 BORDERCOLOR=#000000 > BORDER=1>"; > > echo "<tr><th>What</th><th>Percentage</th><th>Votes</th></tr>"; > > while (list($key, $val) = each($ANSWER)) { > > $percent = $file_array[$key] * 100 / $total; > > $percent_int = floor($percent); > > $percent_float = number_format($percent, 1); > > $fp += $percent_float; > > echo "<tr><td> $ANSWER[$key] </td><td><img height=9 > src=\"$IMG_DIR_URL/vote_left.gif\">"; > > echo "<img height=9 width=\"$percent_int\" > src=\"$IMG_DIR_URL/vote_middle.gif\">"; > > echo "<img height=9 src=\"$IMG_DIR_URL/vote_right.gif\"> $percent_float % > </td>"; > > echo "<td><CENTER>$file_array[$key]</CENTER></td></tr>"; > > } > > echo "</TABLE><br>"; > > } > > ?> > > > > > -- > 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 quick question regarding timezones ... On the local side a record is inserted into the DB by someone in Michigan, while the server rests in CA. Thus a three hour difference. The local mktime() will create a timestamp for say 9:00am when in reality it was entered at 12:00noon in MI. I have 2 character timezones for all my users so it should be easy to convert the two. putenv() won't work because of the fact that the timestamp created will be 9:00 no matter what timezone you put it in. So what needs to be done is some recognition that 10800 seconds needs to be added to adjust the PST timestamp to an EST timestamp. Are there any functions out ther that do this? --Joe Joe Stump <[EMAIL PROTECTED]> ------------------------------------------------------------------------ One is taught by experience to put a premium on those few people who can appreciate you for what you are.
On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) wrote: >I have a quick question regarding timezones ... > >On the local side a record is inserted into the DB by someone in >Michigan, while >the server rests in CA. Thus a three hour difference. The local >mktime() will >create a timestamp for say 9:00am when in reality it was entered at >12:00noon >in MI. I have 2 character timezones for all my users so it should be >easy to >convert the two. you could use gmmktime() instead and add or subtract the offset. $offsets=array(" "PST"=>1000, // not actual values "EST"=>-2000, "); $localtime=gmmktime()+$offsets[$timezone]; >putenv() won't work because of the fact that the timestamp created >will be >9:00 no matter what timezone you put it in. So what needs to be done >is some >recognition that 10800 seconds needs to be added to adjust the PST >timestamp >to an EST timestamp. Are there any functions out ther that do this? > >--Joe > >Joe Stump <[EMAIL PROTECTED]> >--------------------------------------------------------------------- >--- >One is taught by experience to put a premium on those >few people who can appreciate you for what you are. > > >-- >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: php-list- >[EMAIL PROTECTED]
This is how I do it: in DB: usertable username,etc,tzone where tzone = EST,PST,MNT,CNT when the user logs in just grab the tzone, register it in the session. Also make them constants, so you know if the server is in CA, then EST = 10800 now when they do something, all you have to do is calc the time. Like result = mktime() - EST Is this what you were talking about? Jon ----- Original Message ----- From: "Joe Stump" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 2:56 PM Subject: [PHP] timezones > I have a quick question regarding timezones ... > > On the local side a record is inserted into the DB by someone in Michigan, while > the server rests in CA. Thus a three hour difference. The local mktime() will > create a timestamp for say 9:00am when in reality it was entered at 12:00noon > in MI. I have 2 character timezones for all my users so it should be easy to > convert the two. > > putenv() won't work because of the fact that the timestamp created will be > 9:00 no matter what timezone you put it in. So what needs to be done is some > recognition that 10800 seconds needs to be added to adjust the PST timestamp > to an EST timestamp. Are there any functions out ther that do this? > > --Joe > > Joe Stump <[EMAIL PROTECTED]> > ------------------------------------------------------------------------ > One is taught by experience to put a premium on those > few people who can appreciate you for what you are. > > > -- > 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 would use gmktime() to create a UTC timestamp stored in the database, and then use the knowledge about each users timezone to convert this information when showing it. - Frank > I have a quick question regarding timezones ... > > On the local side a record is inserted into the DB by someone in Michigan, while > the server rests in CA. Thus a three hour difference. The local mktime() will > create a timestamp for say 9:00am when in reality it was entered at 12:00noon > in MI. I have 2 character timezones for all my users so it should be easy to > convert the two. > > putenv() won't work because of the fact that the timestamp created will be > 9:00 no matter what timezone you put it in. So what needs to be done is some > recognition that 10800 seconds needs to be added to adjust the PST timestamp > to an EST timestamp. Are there any functions out ther that do this? > > --Joe > > Joe Stump <[EMAIL PROTECTED]> > ------------------------------------------------------------------------ > One is taught by experience to put a premium on those > few people who can appreciate you for what you are. > > > -- > 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] > > >
Thanks to everyone who sent in the info. The problem is as follows: 1.) the mktime()'s are stored as PST in the DB. 2.) we have users ALL OVER the world - is there a place to find all of the timezones at? --Joe On Mon, Apr 30, 2001 at 12:11:55PM -0700, Mark Maggelet wrote: > On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) > wrote: > >I have a quick question regarding timezones ... > > > >On the local side a record is inserted into the DB by someone in > >Michigan, while > >the server rests in CA. Thus a three hour difference. The local > >mktime() will > >create a timestamp for say 9:00am when in reality it was entered at > >12:00noon > >in MI. I have 2 character timezones for all my users so it should be > >easy to > >convert the two. > > you could use gmmktime() instead and add or subtract the offset. > > $offsets=array(" > "PST"=>1000, // not actual values > "EST"=>-2000, > "); > > $localtime=gmmktime()+$offsets[$timezone]; > > >putenv() won't work because of the fact that the timestamp created > >will be > >9:00 no matter what timezone you put it in. So what needs to be done > >is some > >recognition that 10800 seconds needs to be added to adjust the PST > >timestamp > >to an EST timestamp. Are there any functions out ther that do this? > > > >--Joe > > > >Joe Stump <[EMAIL PROTECTED]> > >--------------------------------------------------------------------- > > >--- > >One is taught by experience to put a premium on those > >few people who can appreciate you for what you are. > > > > > >-- > >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: php-list- > >[EMAIL PROTECTED] > Joe Stump <[EMAIL PROTECTED]> ------------------------------------------------------------------------ Dyslexics of the world
http://www.worldtimeserver.com/ has them all..then you can just assign your constants to them in a way that makes sense to you ----- Original Message ----- From: "Joe Stump" <[EMAIL PROTECTED]> To: "Mark Maggelet" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 3:24 PM Subject: Re: [PHP] timezones > Thanks to everyone who sent in the info. The problem is as follows: > > 1.) the mktime()'s are stored as PST in the DB. > 2.) we have users ALL OVER the world - is there a place to find all of the > timezones at? > > --Joe > > On Mon, Apr 30, 2001 at 12:11:55PM -0700, Mark Maggelet wrote: > > On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) > > wrote: > > >I have a quick question regarding timezones ... > > > > > >On the local side a record is inserted into the DB by someone in > > >Michigan, while > > >the server rests in CA. Thus a three hour difference. The local > > >mktime() will > > >create a timestamp for say 9:00am when in reality it was entered at > > >12:00noon > > >in MI. I have 2 character timezones for all my users so it should be > > >easy to > > >convert the two. > > > > you could use gmmktime() instead and add or subtract the offset. > > > > $offsets=array(" > > "PST"=>1000, // not actual values > > "EST"=>-2000, > > "); > > > > $localtime=gmmktime()+$offsets[$timezone]; > > > > >putenv() won't work because of the fact that the timestamp created > > >will be > > >9:00 no matter what timezone you put it in. So what needs to be done > > >is some > > >recognition that 10800 seconds needs to be added to adjust the PST > > >timestamp > > >to an EST timestamp. Are there any functions out ther that do this? > > > > > >--Joe > > > > > >Joe Stump <[EMAIL PROTECTED]> > > >--------------------------------------------------------------------- > > > > >--- > > >One is taught by experience to put a premium on those > > >few people who can appreciate you for what you are. > > > > > > > > >-- > > >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: php-list- > > >[EMAIL PROTECTED] > > > > Joe Stump <[EMAIL PROTECTED]> > ------------------------------------------------------------------------ > Dyslexics of the world > > -- > 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] >
On Mon, 30 Apr 2001 14:24:20 -0500, Joe Stump ([EMAIL PROTECTED]) wrote: >Thanks to everyone who sent in the info. The problem is as follows: > >1.) the mktime()'s are stored as PST in the DB. they still could be just make your pst offset be 0 and every timezone offset be the difference in hours between them and pst*3600 >2.) we have users ALL OVER the world - is there a place to find all >of the timezones at? good luck, there's tons and some of them are wacky or don't honor daylight saving time. > >--Joe > >On Mon, Apr 30, 2001 at 12:11:55PM -0700, Mark Maggelet wrote: >> On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) >> wrote: >> >I have a quick question regarding timezones ... >> > >> >On the local side a record is inserted into the DB by someone in >> >Michigan, while >> >the server rests in CA. Thus a three hour difference. The local >> >mktime() will >> >create a timestamp for say 9:00am when in reality it was entered >>at >> >12:00noon >> >in MI. I have 2 character timezones for all my users so it should >>be >> >easy to >> >convert the two. >> >> you could use gmmktime() instead and add or subtract the offset. >> >> $offsets=array(" >> "PST"=>1000, // not actual values >> "EST"=>-2000, >> "); >> >> $localtime=gmmktime()+$offsets[$timezone]; >> >> >putenv() won't work because of the fact that the timestamp created >> >will be >> >9:00 no matter what timezone you put it in. So what needs to be >>done >> >is some >> >recognition that 10800 seconds needs to be added to adjust the PST >> >timestamp >> >to an EST timestamp. Are there any functions out ther that do >>this? >> > >> >--Joe >> > >> >Joe Stump <[EMAIL PROTECTED]> >> >------------------------------------------------------------------ >>--- >> >> >--- >> >One is taught by experience to put a premium on those >> >few people who can appreciate you for what you are. >> > >> > >> >-- >> >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: php-list- >> >[EMAIL PROTECTED] >> > >Joe Stump <[EMAIL PROTECTED]> >--------------------------------------------------------------------- >--- >Dyslexics of the world > >-- >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: php-list- >[EMAIL PROTECTED]
No you don't :) <a href="http://www.domain1.com"><font color="blue">url1</font></a> <a href="http://www.domain2.com"><font color="red">url2</font></a> <a href="http://www.domain3.com"><font color="yellow">url3</font></a> <a href="http://www.domain4.com"><font color="green">url4</font></a> --Joe On Sun, Apr 22, 2001 at 04:18:51PM -0500, Jeff Oien wrote: > You need to use style sheets: > http://www.awlonline.com/cseng/titles/0-201-41998-X/liebos/ > http://www.builder.com/Authoring/CSS/?tag=st.bl.7258.dir1.bl_CSS > http://www.wdvl.com/Authoring/Style/Sheets/ > Jeff Oien > > > Hi, > > > > I would like to know how to make different link in different color on > > one page. > > > > etc. www.domain1.com in blue color > > www.domain2.com in red color > > www.domain3.com in orange color > > > > Thank you for your help > > > > Mark > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] Joe Stump <[EMAIL PROTECTED]> ------------------------------------------------------------------------ It is impossible to love and be wise.
Joe Stump wrote: > No you don't :) > > <a href="http://www.domain1.com"><font color="blue">url1</font></a> > <a href="http://www.domain2.com"><font color="red">url2</font></a> > <a href="http://www.domain3.com"><font color="yellow">url3</font></a> > <a href="http://www.domain4.com"><font color="green">url4</font></a> > > On Sun, Apr 22, 2001 at 04:18:51PM -0500, Jeff Oien wrote: > > You need to use style sheets: > > http://www.awlonline.com/cseng/titles/0-201-41998-X/liebos/ > > http://www.builder.com/Authoring/CSS/?tag=st.bl.7258.dir1.bl_CSS > > http://www.wdvl.com/Authoring/Style/Sheets/ > > Jeff Oien The FONT tag has been depreciated. It still works, for backwards compatibility, but StyleSheet is the way to go. -- W | | I haven't lost my mind; it's backed up on tape somewhere. |____________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 SysAdmin / Websmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . eFax 248.671.0909 http://www.pcraft.com . 3550 Arapahoe Ave #6 .................. . . . . Boulder, CO 80303, USA
Hello, I have the following case. I am working on a PHP script which contains an array. Now I want to include a PHP created picture, which is a .php file (gd, now further called as the picture.php file). Till so far, everything is ok. The picture is created following as wished. Now , I want to include values in the picture.php file, which make use of an array which is used in the program above. - I am not able to get any array accessed in the picture.php file! P.S. I am able to access single values in the picture.php. I am also able to list out values of the araay in the script who calls the picture-php file. Can anybody give me a clue, how I can access the array in the picture.php ? Am I doing something wrong, or is this a bug (in that case I prefere a workaround). Regards, Mike Wes [EMAIL PROTECTED]
Hello, Is there a way to sort an array alphabetically? Brandon
The PHP online manual is very easy to use. Start at http://www.php.net/array and you'll find all the functions that act on array downl the left side of your browser, including a fantastically rich set of sort options. Miles At 12:19 PM 4/30/01 -0700, Brandon Orther wrote: >Hello, > >Is there a way to sort an array alphabetically? > >Brandon > >-- >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]
On Fri, Apr 27, 2001 at 03:24:36PM +0200, Ray Hilton wrote: > However, on the site, i am currently storing images in the database, purely > because i can. But i wonder, how much will the server load be affected when > pulling binary data out of the database? compared to the file system? i > assume its going to be quite a lot higher. DO you reckon it would be better > to scrap that and store the images on the file system? Yes, I certainly reckon that. Using the database can make organizing them easier, but I usually find it pretty easy to store images on the file system and only put the directory structure, filename in the database. It is much easier on the database too. -- Jason Stechschulte [EMAIL PROTECTED] -- Unix is like a toll road on which you have to stop every 50 feet to pay another nickel. But hey! You only feel 5 cents poorer each time. -- Larry Wall in <[EMAIL PROTECTED]>
On Fri, Apr 27, 2001 at 11:56:08AM -0400, Don Pro wrote: > $queryID = mysql_query("SELECT Country, Agent FROM Ports > WHERE Portname = '$portname'"); > > My question is, if the variable $portname has the ' character within in, > will this cause an error in my select statement? If the answer is > "Yes", can someone give me a more robust way of writing it using PHP? Yes. You could try this $queryID = mysql_query("SELECT Country, Agent FROM Ports WHERE Portname='".addslashes($portname)."'"); -- Jason Stechschulte [EMAIL PROTECTED] -- Suppose you're working on an optimizer to render \X unnecessary (or rather, redundant, which isn't the same thing in my book). -- Larry Wall in <[EMAIL PROTECTED]>
I have this string: 0ffffffac0ffffffed0005737200146a6176612e7574696c2e50726f7065727469657339120fffff fd07a70363e0ffffff980200014c000864656661756c74737400164c6a6176612f7574696c2f5072 6f706572746965733b787200136a6176612e7574696c2e486173687461626c65130ffffffbb0f252 14a0ffffffe40ffffffb803000246000a6c6f6164466163746f724900097468726573686f6c64787 03f4000000000000877080000000300000002740005696d61676574004a3c494d47205352433d226 87474703a2f2f6d6564696162616e6b2e656476656e74757265732e636f6d2f656476656e7475726 5732f6c6162732f627269636b735f7765622e6a7067223e740004746578747402024974206973206 96d706f7274616e7420746f20656d70686173697a652074686174206120666163696c697461746f7 220646f6573206e6f74206e65656420746f20626520616e2065787065727420696e2074686520766 172696f7573207375626a6563742061726561732c206275742073686f756c64206265636f6d65206 6616d696c6961722077697468207468652070726f6a6563747320616e64206d6174657269616c732 0746861742073747564656e74732077696c6c20626520646f696e672c20616e64206265206177617 265206f6620686f7720746f206765742068656c70206f72206c6f6f6b207570207465726d7320616 e6420616e73776572732e2020496e20706172746963756c61722c2066616d696c696172697479207 769746820746865204c45474f3c7375703e267265673b3c2f7375703e20656c656d656e747320697 320686967686c79207265636f6d6d656e6465642e20205043532068617320646576656c6f7065642 06120736570617261746520636f7572736520666f637573696e67206f6e2074686520757365206f6 620746865204c45474f3c7375703e267265673b3c2f7375703e206d6174657269616c732e2020416 c6c20666163696c697461746f72732073686f756c64207363686564756c652074696d6520746f207 4616b652074686973206164646974696f6e616c20636f757273652e7870 And I don't know what type it is. It is it a binary string? Can I convert it to text and if so, how? Thank You, Nathan Cook [EMAIL PROTECTED]
I am trying to display a variable that contains more than 255 characters but the output stops at approx. 255. I tried to find what restricts it. Couldn't find anything. I tried the "echo", "printf" commands even I tried using flush() just in case there was some buffer left. What is the solution? Niko Spyridonos Director of E-Business Services Chamerlik/CompuLogic http://www.designtech1.com/ T: (847) 679-5030 ext. 201 F: (847) 933-9413 C: (847) 980-7799
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Niko Spyridonos) wrote: > I am trying to display a variable that contains more than 255 characters but > the output stops at approx. 255. I tried to find what restricts it. Couldn't > find anything. I tried the "echo", "printf" commands even I tried using > flush() just in case there was some buffer left. Is the variable's content being pulled from a database? The fact that it's 255 chars sounds like it's coming from a char or varchar field set to its maximum length. -- CC
Ok.. now I hope that somebody can help with this one... I'm trying to write a form field on a webpage that makes data entry of ever changing fields easy.. In otherwords: Enter Style: You might enter: Hello %s, how are you today.. I am fine.. I here you are turning %d. Now this works when you pass sprintf($text, $name, $age); but if you in the text say. Happy %2/$d'th birthday %1/$s. like the docs says your supposed to do it doesn't work and all you see is: Happy $d'th birthday $s. What is up with this.. if you use %2/%d it sort of works, but it throws all my other variables out of whack.. any help with this would be appreciative.. later, Ed McLain [EMAIL PROTECTED]
Hi, Is it possible with PHP (3.0.16) to detect which browser a user has and then load an image based on the browser type? I've found the get_browser() command in the manual, but it doesn't look like that does what I want, or I could just be looking at it wrong. Has anyone tried this before? and if so, could you provide some assistance. Thank you -Tim
After a very long QA process, PHP 4.0.5 has finally been officially released. This is a maintenance version, with a lot of bug fixes from PHP 4.0.4pl1. Other than that, there aren't too many new features in this release, so it's mostly recommended for people that were experiencing one (or more) of the bugs that were fixed. Note that PHP 4.0.6 is also planned for the near future, featuring mostly bug fixes; This may affect your upgrade considerations. Notable features: - High performance output compression support and improved output buffering - Experimental FastCGI module - A lot of PEAR work - Significantly improved thread safety (users of multithreaded servers should definitely upgrade if they have earlier versions of PHP) Full list of changes is available at http://www.php.net/ChangeLog-4.php, and is also attached at the end of this letter. Thanks goes to the PHP QA team, which worked a lot to make sure that this release works as well as expected, and beyond. Special thanks to Mr. J, which managed to survive the long and thrilling QA process without getting a heart attack :) Zeev 30 Apr 2001, Version 4.0.5 - IMPORTANT: removed /F modifier handling from preg_replace(). Instead one should use new preg_replace_callback() function. (Andrei) - Added new php.ini directive: arg_separator.input which is used to tell PHP which characters are considered as argument separators in URLs. Renamed php.ini directive: arg_separator -> arg_separator.output (Jani) - Added FastCGI SAPI module. (Ben Mansell) - Added array_reduce(), which allows iterative reduction of an array to a single value via a callback function. (Andrei) - The imageloadfont function of the gd extension should be not platform dependent after this fix. ([EMAIL PROTECTED]) - Fixed a compatibility problem in some file functions (fgets, fputs, fread, fwrite). The ANSI standard says that if a file is opened in read/write mode, fseek() should be called before switching from reading to writing and vice versa. ([EMAIL PROTECTED]) - Fixed argument checking for call_user_func* functions and allowed specifying array($obj, 'method') syntax for call_user_func_array. (Andrei) - Fixed parent::method() to also work with runtime bindings. (Zeev, Zend Engine) - Implemented high-performance zlib-based output compression - see zlib.output_compression INI directive. (Zeev) - Improved ob_gzhandler() to support chunked output buffering - it's recommended to use it with 4KB chunks. (Zeev) - Fixed chunked output buffering. (Zeev) - Forced call_user_method() and call_user_method_array() to take the object argument by reference. (Andrei) - Fixed binding of ROWIDs in OCI8. (Thies) - Added PEAR/Cache as a generic Caching System. (Sebastian, PEAR/Cache) - Added IMAP quota support (imap_set_quota, imap_get_quota), enabled/added via c-client2000. (kalowsky) - Upgraded PCRE to version 3.4. (Andrei) - Added array_search which works similar to in_array but returns the key instead of a boolean. ([EMAIL PROTECTED]) - Fixed pgsql transaction support. (Stig, PEAR/DB) - Added new object VARIANT() to encapsulate values for use with the COM and DOTNET module. Therefore it is now possible to pass values by reference, convert php values to extended variant types (currency, date, idispatch, iunknown, ...) and define the codepage that should be used for unicode - conversion. - Improved overall speed of IRCG, added URL handling to message scanner. (Sascha) - Fixed some modules to allow using output-buffering. (Thies) - Added the chroot() function. (Derick) - PostgreSQL now does a rollback at the end of a request on every persistent connection. This is done by doing an "empty" transaction on the connection. This was advised by someone from the PostgreSQL core-team. (Thies) - Fixed PostgeSQL pg_connect() bug. We would sometimes close the default link by accident. (Patch by: [EMAIL PROTECTED]) - Improved OCI8 dead-session detection. (Patch by: George Schlossnagle) - Fixed get_meta_tags() multiline bug #4556. (Sean) - Prefer random() over *rand48(). (JimJag) - Sped up WDDX serialization 2x. (Andrei) - Added a new parameter to mail() which appends aditional command line parameters to the mail program. (Derick) - Added Udm_Clear_Search_Limits mnoGoSearch extension function. (gluke) - Fixed mnogosearch protos. Fixed mnogosearch functions return values. A bug with capital letters break search has been fixed. (gluke) - Static methods can now be called via call_user_method_* functions, e.g. call_user_method('method', 'class'), and also array('class', 'method') constructs (for array_walk(), for example). (Andrei, Zend Engine) - microtime() under Windows now returns accurate values. (James) - Added PREG_SPLIT_DELIM_CAPTURE flag to preg_split() that allows for Perl-like functionality of capturing parenthesized delimiter expression. (Andrei) - Fixed strip_tags() to not strip a lone > character. (Rasmus) - When using the ob_gzhandler() PHP now automagically also sets the Content-Lengh correctly which enables browsers to use the HTTP Keep-Alive feature. (Thies) - Improved handling of preg_replace() /F modifier so that it's possible to specify array($obj, 'method') construct as a replacement function. (Andrei) - Added mysql_get_client_info(), mysql_get_server_info(), mysql_get_proto_info(), and mysql_get_host_info() functions. (Sean) - Major change of the php pdf api. It could break some functions though backwards compatibility was tried to maintain. Adding some still missing functions as well. (Uwe) - Added mnoGoSearch extension - http://search.mnogo.ru. (Sergey K) - Allow URL encoding in DB usernames and passwords. (Stig, PEAR) - Added raiseError and setErrorHandling methods to PEAR class. (Stig, PEAR) - Added support for converting images from JPG/PNG on the fly with the GD extension, which is usefull for creating dynamic WAP-sites. (Derick) - Updated ext/mysql/libmysql to version 3.23.32; bug fixes. ([EMAIL PROTECTED]) - Fixed possible crash in all (non-pcre) regex functions. (Thies) - Improved str_replace() to accept an array for any parameter - similar to preg_replace(). (Andrei) - Fixed extract() to properly prefix numeric keys when EXTR_PREFIX_ALL is used. (Andrei) - Added EXTR_PREFIX_INVALID flag to extract() to automatically prefix string keys that do not constitute valid variable names. (Andrei) - BeOS patch from [EMAIL PROTECTED], modified somewhat by Rasmus. - Fixed the Apache module to overwrite PATH_TRANSLATED with SCRIPT_FILENAME, only if PATH_TRANSLATED is not previously set. (Zeev) - Fixed crash bug in highlight_string(). (Rasmus) - Added URL support for getimagesize() function. (Jani) - Added xslt_set_scheme_handler() function. ([EMAIL PROTECTED]) - Added the pg_lolseek and pg_lotell functions. (Derick) - Fixed wrong breaking with the wordwrap function. (Derick) - Fixed 'O' and 'r' flags of date() to have correct sign for timezone offset. (Andrei) - Changed 'Z' flag to date() to always return timezone offset with negative sign if it's west of UTC. (Andrei) - Added the HTML_Processor class which provides common functions for processing HTML. (Sterling) - Added localeconv() and strcoll() functions for localization. (Sean) - Added the xslt_set_base function. (Sterling) - Added support for Zeus 3.3.8. - Added odbc_error() and odbc_errormsg() functions. (Stig) - New extension for vpopmail - http://www.inter7.com/vpopmail, give it a try, but keep in mind that it is not ready for production environments. (David Croft, Boian Bonev) - Added sybase_get_last_message() to the Sybase CT module. (Jan Fedak) - Made ldap_list(), ldap_read() and ldap_search() do parallel search when first parameter is an array of link identifiers. (Stig Venaas) - Made fopen() of HTTP URL follow redirects, $http_response_header will contain all headers with empty string as delimiter. (Stig Venaas) - Added Console_Getopt class for parsing command-line args. (Andrei, PEAR) - Added an experimental version of the ZZipLib extension which provides the ability to read zip files. (Sterling) - Allow access to uploaded files in safe_mode. Beware that you can only read the file. If you copy it to new location the copy will not have the right UID and you script won't be able to access that copy. (Thies) - Changed extract() to check that prefixed name is a valid one. (Andrei) - Changed extract() to return the number of variables extracted. (Andrei) - Added ldap_rename() function. (Stig Venaas) - Made ldap_set_option() support controls. (Stig Venaas) - Changed ldap_search() and added functions ldap_parse_result(), ldap_first_reference(), ldap_next_reference() and ldap_parse_reference() to cope with LDAPv3 stuff like referrals and references. (Stig Venaas) - Fixed date('r') overflow. - Made the php.ini path reported in phpinfo() always point to the absolute path that was opened. (Zeev) - Made the INI mechanism thread safe. (Zeev, Zend Engine) - Changed setlocale() to use LC_* constants. (Jani) - ctype functions now follow the extension naming conventions. (Hartmut) - Added iconv() function (using libc or libiconv). (Stig) - Added ODBC_TYPE constant. (Stig) - Added the call_user_method_array function which allows you to call a method with an arbitrary number of parameters. (Sterling) - ext/odbc: IBM DB2 patch by Walter Franzini. <[EMAIL PROTECTED]> - Added extension for the cracklib library. (Alexander Feldman) -- Zeev Suraski <[EMAIL PROTECTED]> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
Is anyone else having problems with the Windows binary zip? I've downloaded it a couple times and it keeps saying that it's corrupt. Thanks! Shawn Sellars
Shawn, Had the same problem - looks like the zip file is corrupted - you could try zipfix but it's reporting that there are 88 bytes missing. Chris SHAWN wrote: > Is anyone else having problems with the Windows binary zip? I've downloaded > it a couple times and it keeps saying that it's corrupt. > > Thanks! > Shawn Sellars > > -- > 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 Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: [EMAIL PROTECTED] http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ********************************************************************** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed.
Apparently the zip is indeed broken. We'll try to get a fixed one up there soon. Sorry for the hassle, Zeev At 01:21 1/5/2001, SHAWN wrote: >Is anyone else having problems with the Windows binary zip? I've downloaded >it a couple times and it keeps saying that it's corrupt. > >Thanks! >Shawn Sellars > >-- >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] -- Zeev Suraski <[EMAIL PROTECTED]> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
>At 12:12 AM +0300 5/1/01, Zeev Suraski wrote: >- Implemented high-performance zlib-based output compression - see > zlib.output_compression INI directive. (Zeev) is this different from ob_gzhandler()? if so, how is it different? thanks. -aaron
Yes it is, it's much more efficient. Zeev At 01:05 1/5/2001, Aaron Tuller wrote: >>At 12:12 AM +0300 5/1/01, Zeev Suraski wrote: >>- Implemented high-performance zlib-based output compression - see >> zlib.output_compression INI directive. (Zeev) > >is this different from ob_gzhandler()? if so, how is it different? thanks. > >-aaron > >-- >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] -- Zeev Suraski <[EMAIL PROTECTED]> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/
Yes, I will need to provide searching capabilities. Basically, I'm creating an online referencing system with a db backend. A user will be able to search for a manual, and/or browse to a particular section of the manual. It's similar to the online PHP manual...at least, in concept. So, in the long run, which will be more beneficial: 1) HTML code inside the db fields? or 2) HTML URL inside the field? __________John Monfort_________________ _+-----------------------------------+_ P E P I E D E S I G N S www.pepiedesigns.com "The world is waiting, are you ready?" -+___________________________________+- On Mon, 30 Apr 2001, Mark Roedel wrote: > > -----Original Message----- > > From: John Monfort [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, April 29, 2001 10:40 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Best Practice-HTML In Database > > > > > > Hello everyone, > > > > I'm curious. Which is the better practice? > > > > 1) Insert the HTML page (...HTML code) in the database ? > > > > or > > > > 2) Insert a URL in the database field, that points to the > > HTML page? > > > > why? > > Will you ever want to do database-ish things with the contents of the > page? (Allow somebody to search for words or phrases in the body, for > example?) > > > --- > Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. > Systems Programmer / WebMaster || My schedule is already full." > LeTourneau University || -- Henry Kissinger > >
Steve, I am wondering what your reason is for item 4.2. Security, or otherwise? Personally, I like having various file extensions, for sorting files by content type. Thanks for putting this up here. Kirk > -----Original Message----- > From: Steven Haryanto [mailto:[EMAIL PROTECTED]] > Subject: [PHP] Please review our coding standards [ ideas ] > 4. File organization > -------------------- > 4.2 All PHP libraries and include files, is named with '.php' > extension (ie. > no '.lib', '.inc', etc.). Test scripts is named with > '.phpt' extension. >
I am posting information to a credit card processing server. This is done over HTTPS (with cURL) and seems to work fine. I get the response that I want from the server, which consists of an XML doc with about 20 tags and their corresponding values. I have gone through the mailing list and manuals, yet I still can't seem to figure out how to get each piece of the XML doc into their own variables. Here is the code I am using: $server = "https://www.creditcard.com"; $path = "xmlhttps/xtrans.asp"; $ch = curl_init(); $requestedurl = "$server" . "/$path"; curl_setopt($ch, CURLOPT_URL, "$requestedurl"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "$xmlstring"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); curl_close ($ch); This replies (as it should) with an XML doc like this: <RESPONSE><SERVICE>CC</SERVICE><SERVICE_TYPE>DEBIT</SERVICE_TYPE><SERVICE_SU BTYPE>AUTH</SERVICE_SUBTYPE><SERVICE_FORMAT>1010</SERVICE_FORMAT><TERMINAL_I D>PC-9999</TERMINAL_ID><PIN>1234</PIN><TRANSACTION_INDICATOR>7</TRANSACTION_ INDICATOR><AMOUNT>5</AMOUNT><ACCOUNT_NUMBER>1234</ACCOUNT_NUMBER><EXPIRATION >1202</EXPIRATION><FIRST_NAME>Michael</FIRST_NAME><LAST_NAME>Conley</LAST_NA ME><ADDRESS>PO BOX 59</ADDRESS><CITY>Auburn</CITY><STATE>CA</STATE><POSTAL_CODE>95604</POSTAL_C ODE><COUNTRY>USA</COUNTRY><PHONE></PHONE><OPERATOR>Somebody</OPERATOR><CURRE NCY_CODE>840</CURRENCY_CODE><TERMINAL_ID></TERMINAL_ID><USER_DATA_0></USER_D ATA_0><USER_DATA_1></USER_DATA_1><USER_DATA_2></USER_DATA_2><USER_DATA_3></U SER_DATA_3><USER_DATA_4></USER_DATA_4><USER_DATA_5></USER_DATA_5><USER_DATA_ 6></USER_DATA_6><USER_DATA_7></USER_DATA_7><USER_DATA_8></USER_DATA_8><USER_ DATA_9></USER_DATA_9><VERBOSE_RESPONSE></VERBOSE_RESPONSE><SERVICE_PROVIDER> 10</SERVICE_PROVIDER><TRANSACTION_ID>03509KQEGVHMGED4</TRANSACTION_ID><LOCAL _TIME>172823</LOCAL_TIME><LOCAL_DATE>04302001</LOCAL_DATE><EXCHANGE_RATE>1</ EXCHANGE_RATE><MRC>00</MRC><ARC>00</ARC><RESPONSE_TEXT>NO MATCH</RESPONSE_TEXT><APPROVAL_CODE>VITAL6</APPROVAL_CODE><AVS_RESPONSE>N</A VS_RESPONSE><COMMERCIAL_RESPONSE>0</COMMERCIAL_RESPONSE></RESPONSE> What I need to do now is get certain parts of the return string. How do I assign the value in the <APPROVAL_CODE> tags to the variable $approvalcode? I also need to get several other parts of the XML string assigned to variables so that I can use them elsewhere. I can't seem to figure out how to do this. I know that I need to change the "CURLOPT_RETURNTRANSFER" to "1" to allow the information to be placed somewhere other than the screen for processing, but after that I am not sure how to do this. I have gone through the mailing lists and through the docs online, but I'm having no luck. Any help is appreciated.
http://www.php.net/manual/en/ref.xml.php and http://www.phpbuilder.com/columns/joe20000907.php3 great palces to get you started on XML parseing try the second one first as it jumps right into it with xpat. phpbuilder also has stuff for the DOM XML as well. ----- Original Message ----- From: "Michael Conley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 3:21 PM Subject: [PHP] XML Parsing > I am posting information to a credit card processing server. This is done > over HTTPS (with cURL) and seems to work fine. I get the response that I > want from the server, which consists of an XML doc with about 20 tags and > their corresponding values. I have gone through the mailing list and > manuals, yet I still can't seem to figure out how to get each piece of the > XML doc into their own variables. > > Here is the code I am using: > > $server = "https://www.creditcard.com"; > $path = "xmlhttps/xtrans.asp"; > $ch = curl_init(); > $requestedurl = "$server" . "/$path"; > curl_setopt($ch, CURLOPT_URL, "$requestedurl"); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, "$xmlstring"); > curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); > > curl_close ($ch); > > This replies (as it should) with an XML doc like this: > > <RESPONSE><SERVICE>CC</SERVICE><SERVICE_TYPE>DEBIT</SERVICE_TYPE><SERVICE_SU > BTYPE>AUTH</SERVICE_SUBTYPE><SERVICE_FORMAT>1010</SERVICE_FORMAT><TERMINAL_I > D>PC-9999</TERMINAL_ID><PIN>1234</PIN><TRANSACTION_INDICATOR>7</TRANSACTION_ > INDICATOR><AMOUNT>5</AMOUNT><ACCOUNT_NUMBER>1234</ACCOUNT_NUMBER><EXPIRATION > >1202</EXPIRATION><FIRST_NAME>Michael</FIRST_NAME><LAST_NAME>Conley</LAST_NA > ME><ADDRESS>PO BOX > 59</ADDRESS><CITY>Auburn</CITY><STATE>CA</STATE><POSTAL_CODE>95604</POSTAL_C > ODE><COUNTRY>USA</COUNTRY><PHONE></PHONE><OPERATOR>Somebody</OPERATOR><CURRE > NCY_CODE>840</CURRENCY_CODE><TERMINAL_ID></TERMINAL_ID><USER_DATA_0></USER_D > ATA_0><USER_DATA_1></USER_DATA_1><USER_DATA_2></USER_DATA_2><USER_DATA_3></U > SER_DATA_3><USER_DATA_4></USER_DATA_4><USER_DATA_5></USER_DATA_5><USER_DATA_ > 6></USER_DATA_6><USER_DATA_7></USER_DATA_7><USER_DATA_8></USER_DATA_8><USER_ > DATA_9></USER_DATA_9><VERBOSE_RESPONSE></VERBOSE_RESPONSE><SERVICE_PROVIDER> > 10</SERVICE_PROVIDER><TRANSACTION_ID>03509KQEGVHMGED4</TRANSACTION_ID><LOCAL > _TIME>172823</LOCAL_TIME><LOCAL_DATE>04302001</LOCAL_DATE><EXCHANGE_RATE>1</ > EXCHANGE_RATE><MRC>00</MRC><ARC>00</ARC><RESPONSE_TEXT>NO > MATCH</RESPONSE_TEXT><APPROVAL_CODE>VITAL6</APPROVAL_CODE><AVS_RESPONSE>N</A > VS_RESPONSE><COMMERCIAL_RESPONSE>0</COMMERCIAL_RESPONSE></RESPONSE> > > What I need to do now is get certain parts of the return string. How do I > assign the value in the <APPROVAL_CODE> tags to the variable $approvalcode? > I also need to get several other parts of the XML string assigned to > variables so that I can use them elsewhere. I can't seem to figure out how > to do this. I know that I need to change the "CURLOPT_RETURNTRANSFER" to > "1" to allow the information to be placed somewhere other than the screen > for processing, but after that I am not sure how to do this. I have gone > through the mailing lists and through the docs online, but I'm having no > luck. > > Any help is appreciated. > > > > > ---------------------------------------------------------------------------- ---- > -- > 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 can I write a file like "list.txt", I get a lot of information from mysql, and I have to put with line of mysql in this txt file. (rewrite). How can I do that? I tried to put "\n" but it didn't worked. regards, Augusto Cesar Castoldi
"Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote: > How can I write a file like "list.txt", I get a lot of information from > mysql, and I have to put with line of mysql in this txt file. (rewrite). > > How can I do that? > > I tried to put "\n" but it didn't worked. "\n" works for me. Perhaps you should post some of your code. Be sure "\n" is within double quotes; if it's in single quotes it won't work. Here's a line of code from a script I wrote that works. fwrite( $fout, "Date: $h_date\n" ); -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Here is the code: $stmt = OCIParse($conn,"BEGIN prontolog.pc_int.pedido(:p_cgc_lweb, :p_id_cliente, :p_id_pedido, :p_id_transp, :p_contrato, :p_dt_emissao, :p_dt_chegada, :p_dt_entrega, :p_vl_frete, :c_nome, :c_fone1, :c_fone2, :c_fax, :c_email, :c_endereco_f, :c_bairro_f, :c_cep_f, :c_cidade_f, :c_estado_f, :c_nome_e, :c_endereco_e, :c_bairro_e, :c_cep_e, :c_cidade_e, :c_estado_e, :p_id_conpag, :v_observa); END;"); OCIBindByName($stmt, ":p_cgc_lweb", &$p_cgc_lweb, 150); OCIBindByName($stmt, ":p_id_cliente", &$p_id_cliente, 150); OCIBindByName($stmt, ":p_id_pedido", &$p_id_pedido, 150); . . . $p_cgc_lweb = "04284227000167"; $p_id_cliente = "29334988800"; $p_id_pedido = "0001"; $p_id_transp = "00926551000180"; $p_contrato = "numero do contrato da transportadora"; $p_dt_emissao = date("Y-m-d H:i:s"); $p_dt_chegada = date("Y-m-d H:i:s"); . . . OCIExecute($stmt); print "(($v_observa))"; prontolog is the schema pc_int is the package pedido is the function And this is the exacly output ---//--- Warning: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00221: 'PEDIDO' is not a procedure or is undefined ORA-06550: line 1, column 7: PL/SQL: Statement ignored in /www/htdocs/mariamercado/teste.phtml on line 64 (()) ---//--- Can I execute functions ? If yes, what may be wrong ? Thank you very much, -- Marcelo Dias de Toledo N-Web E-Commerce - http://www.nweb.com.br mailto:[EMAIL PROTECTED] Phone: 55 71 341-8474 - Fax: 55 71 341-8480
Hello, I am a newi in PHP. Currently I am creating my first site. I would like to programm it modularly. I tryed it, but I came to the point, that I have everything in one file with a huge amount of tables. What would be the best way to build a site with a navigation on the left and content on the right. The question is.. what is the proper syntax to open the next content from the menu. Open it in the same file, or open a new one?? Thanks Andy
---This is header.php-------- <html> <head> <title>My Site</title> </head> <body> <table width="100%" border="0" <tr><td colspan="2"> <img src="images/mybanner.gif"> //this is the banner/header img </td></tr> <tr><td width="175"> //this is where the left navigation goes <a href="about.php">About Us</a><br> // a link more links here </td> <td> ---- end header.php--- ---start footer.php ---- </td> </tr> </table> <table width="100%"> <tr><td> <center> Footer Here, Copyright Etc. </td> </tr> </table> </body> </html> ---- end footer.php ----- ---index.php (or any other page) ---- <? include('header.php'); //include the header ?> the body (large space right of the nav) goes here. <? include('footer.php'); //include the footer ?> ---- end index.php --------- easy cheesey. just break up the html logically. you don't need it all in one file. break up pages like you would static html. hope this was what you were wanting to know. > -----Original Message----- > From: Andreas Pucko [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 30, 2001 4:08 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Programming PHP in a modular way > > > Hello, > > I am a newi in PHP. Currently I am creating my first site. > > I would like to programm it modularly. I tryed it, but I came to > the point, > that I have everything in one file with a huge amount of tables. > > What would be the best way to build a site with a navigation on > the left and > content on the right. > > The question is.. what is the proper syntax to open the next content from > the menu. Open it in > the same file, or open a new one?? > > Thanks > > Andy > > > -- > 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] >
Use include(); Mick On Mon, 30 Apr 2001, Andreas Pucko wrote: > Hello, > > I am a newi in PHP. Currently I am creating my first site. > > I would like to programm it modularly. I tryed it, but I came to the point, > that I have everything in one file with a huge amount of tables. > > What would be the best way to build a site with a navigation on the left and > content on the right. > > The question is.. what is the proper syntax to open the next content from > the menu. Open it in > the same file, or open a new one?? > > Thanks > > Andy > > > -- > 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] > >
Where is the option to recive mail?
Hi, I've got a select box that gets vaules from a DB, now I want these value to be displayed in a certain order that's NOT relating to their id nor in alphabetical order .. can some one suggest a way this might be done?? At present my select box looks like this : <form name="select" method="post" action="machine.php"> <select name="system" size="1"> <?php $query ="SELECT DISTINCT system FROM 1machine ORDER BY system"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ echo '<option value="'.$row[system].'">'.$row[system].'</option><br>'; } ?> </select> <input type="submit" name="select" value="select"> </form> Peter Houchin [EMAIL PROTECTED] ========================================================= _____ __ /\ /_/_/_\ / |_/ \ /_/_/_ __ __ __ __ / \ \_/_/_\ /_/ /_/ /_/ /_/ \ _ / ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ \_//_/_/ /_/_/_/ /_/ \/_/ v ________ ________________________________________ /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /_/_ _/_/ ______ __ __ /_/ ____ __ ______ /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ ========================================================= Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 ************* We rent the dot in .COM! **************
You'll have to assign some sort of order to them using an integer tag column or something similar... and then order by that when you select.... That's my best suggestion. -Brian http://www.zaam.com ""Peter Houchin"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > I've got a select box that gets vaules from a DB, now I want these value to be displayed in a certain order that's NOT relating to their id nor in alphabetical order .. can some one suggest a way this might be done?? > > At present my select box looks like this : > > <form name="select" method="post" action="machine.php"> > <select name="system" size="1"> > <?php > $query ="SELECT DISTINCT system FROM 1machine ORDER BY system"; > $result = mysql_query($query); > > while($row = mysql_fetch_array($result)){ > echo '<option value="'.$row[system].'">'.$row[system].'</option><br>'; > } > ?> > </select> > <input type="submit" name="select" value="select"> > </form> > > Peter Houchin > [EMAIL PROTECTED] > ========================================================= > _____ __ /\ > /_/_/_\ / |_/ \ > /_/_/_ __ __ __ __ / \ > \_/_/_\ /_/ /_/ /_/ /_/ \ _ / > ___\_\_\/ /_/_/_/ /_//\/_/ \_/ \/\_/ > \_//_/_/ /_/_/_/ /_/ \/_/ v > ________ ________________________________________ > /_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > /_/_ _/_/ ______ __ __ /_/ ____ __ ______ > /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\ /_/ /_/_/_/ > /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ > /_/ \_\/_/_/_/ /_/ \/_/ /_/ /_/ \_\/_/_/_//_/_/_/ > ========================================================= > Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 > ************* We rent the dot in .COM! ************** >
I want to log into a game and access a page and parse it. To Log into the game, youd have to use a form, so how do I do this in PHP? If anyone has any ideas, or information, please help. ~Fred [EMAIL PROTECTED] ICQ 19551338
"Fred" <[EMAIL PROTECTED]> wrote: > I want to log into a game and access a page and parse it. > To Log into the game, youd have to use a form, so how do I do this in PHP? Using CURL functions you can post to a URL and grab the output. You have to compile PHP --with-curl after installing CURL first. You can also use fsockopen(). -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
Thank you, ill look into fsocks at php.net. ~Fred "Steve Werby" <[EMAIL PROTECTED]> wrote in message 096501c0d1dd$d324dd40$6501a8c0@workstation7">news:096501c0d1dd$d324dd40$6501a8c0@workstation7... > "Fred" <[EMAIL PROTECTED]> wrote: > > I want to log into a game and access a page and parse it. > > To Log into the game, youd have to use a form, so how do I do this in PHP? > > Using CURL functions you can post to a URL and grab the output. You have to > compile PHP --with-curl after installing CURL first. You can also use > fsockopen(). > > -- > 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 downloaded the distribution from www.php.net, so it's from the same distribution but it doesn't work. What should I do? Regards; Benny. -----Original Message----- From: Phil Driscoll [mailto:[EMAIL PROTECTED]] Sent: 30 April 2001 15:54 To: Benny; [EMAIL PROTECTED] Subject: Re: [PHP] Loading PHP module on Win98 The dbase module you are trying to install does not match the version of php. If you get the extension from the same distribution as the php modules then it should work. You can get the full distribution zip for 4.0.4pl1 from the downloads page at www.php.net at the moment. You may be able to get 4.0.5 later today if all goes to plan. Cheers PS When you do get it working you still may have problems since you have configured PWS to use the ISAPI module which you may find to be pretty unstable. I would advise use of the CGI version of PHP if things are a bit flakey. -- Phil Driscoll Dial Solutions +44 (0)113 294 5112 http://www.dialsolutions.com http://www.dtonline.org -- 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 everyone, Here's my problem: I need to be able to upload some info about an mp3 to a database (name, filename, size, and file_type). I can do this already, and it works just fine. After the info is added to the database, the mp3 is uploaded to music/$binFile_name. Here's the code I have to put info into the db and upload the file to the music directory: $data = addslashes(fread(fopen($binFile, "r"), filesize($binFile))); $strDescription = addslashes(nl2br($txtDescription)); $album_sql = mysql_query("SELECT * FROM albums WHERE id = '$album_id' AND artist_id = '$artist_id'"); $album = mysql_fetch_object($album_sql); $sql = "INSERT INTO music (artist_id, artist, album_id, album_title, track_name, track_number, mp3_type, description, filename, filesize, filetype) VALUES ('$artist_id', '$artist', '$album_id', '$album->album_title', '$track_name', '$track_number', '$mp3_type', '$strDescription', '$binFile_name', '$binFile_size', '$binFile_type')"; $result = mysql_query($sql, $db); mysql_free_result($result); $len = strlen($data); if ($fp = fopen("../../music/$binFile_name", "wb")) { if ($size = fwrite($fp, $data, $len)) { print "<font face=Arial size=2>Thanks, $binFile_name has been added to our database.</font>"; fclose ($fp); } else { print "<font face=Arial size=2>$binFile_name couldn't be written to, perhaps some permissions are wrong?"; } } else { print "<font face=Arial size=2>$binFile_name couldn't be opened (or created), please try again.</font>"; } One problem begins when trying to play that MP3. When I try to play the MP3, it NEVER plays. Is there some headers that need to be sent while uploading the file? Here's the code I use to let users download the mp3: while ($row = mysql_fetch_array($sql)) { $artist = $row["artist"]; $artist_id = $row["artist_id"]; $id = $row["id"]; $track_name = $row["track_name"]; $type = $row["mp3_type"]; $filename = $row["filename"]; if ($alternate == "1") { $color = "#ffffff"; $alternate = "2"; } else { $color = "$color1"; $alternate = "1"; } print "<tr bgcolor=$color><td width=33%><a href=bands.php?option=View%20Band&id=$artist_id><font face=Arial size=2 color=#000000>$artist</font></a></td><td width=33%><A href='music/$filename'><font face=Arial size=2 color=#000000>$track_name</font></a></td><td width=34%>$type</td></tr>"; } So the final dl link ends up being: <a href='music/filename.mp3'>Track Name</a> I can download this in IE, but it still won't play, and when I do a "Save Target As" the file name is all screwed up. If the link was this: <a href="http://localhost/sweetleaf/music/Provoke - Quick Blast.mp3>Quick Blast</a> you'd think the filename I'd download would be "Provoke - Quick Blast.mp3". When doing a Save Link As, this is the filename: ProvokQuicBlast.mp3. Any ideas why? Also, when downloading in NS, I get this: The parameter is incorrect. Any idea what that means? thanks for sitting through all of this. I hope you can offer me some help. :) Regards, Tyler Longren P.S. If you'd like more of my code to look @, just let me know.