[PHP] cURL
Hi, Can anyone point me out to some good resources on cURL?? Have to send 3 fields, Action,Username and Password for authentification to a Servlet and receive its response.. TIA, sands -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and XML
If its parsing xml using PHP is what u r looking for, chk out: http://www.phpbuilder.com/columns/joe2907.php3 http://www.zend.com/zend/art/parsing.php http://www.melonfire.com/community/columns/trog/archives.php -Original Message- From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 4 de Fevereiro de 2002 3:24 To: [EMAIL PROTECTED] Subject: [PHP] PHP and XML Hi, I'd appreciate any pointers you recommend to good sources of information on how to use PHP and XML. Thanks, Peter --- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SAX + attributes
thnx.. had figured it out :) thnx all the same.. sands -Original Message- From: Jon Farmer [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 4 de Fevereiro de 2002 9:26 To: Sandeep Murphy; [EMAIL PROTECTED] Subject: Re: [PHP] SAX + attributes can anyone tell me how I can retrieve attributes of a node using SAX parser in PHP?? Yes use a Start Element Handler. The attribues are passed to it as a associative array. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sockets
Hi, I am trying to access a remote file by opening a socket on port 80 but keep getting refused... The server does listen on port 80 as i can access it via browser... my code reads like this: ?php $Destination = http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Com municator; $Request = action=$actionusername=$unamepassword=$password; $cfgTimeOut = 20; $theURL = parse_url($Destination); $host = $theURL[host]; $path = $theURL[path]; $port = $theURL[port]; if ($port==) $port=80; $header = POST .$path. HTTP/1.0\r\n; $header .= Host: .$host.\r\n; $header .= Accept: */*\r\n; $header .= Accept-Language: en\r\n; $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n; $header .= Content-Type: text/xml\r\n; $header .= Content-Length: .strlen($Request).\r\n; $header .= Content: \r\n\r\n; $msg = $header. $Request ; $Response = ; echo $port; //echo $host; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E } else { echo Unable to access (.$Destination.).br; echo a href=\javascript:history.go(-1)\Try another/a;} print $response\n; print hello; ? any suggestions pl?? TIa, sands -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sockets
Hi, nope, its still not working.. Along with the Host and port, I Have to send 3 more fields, Action,Username and Password for authentification and it has to be Post for the Servlet does not respond to Get requests.. any more ideas pl??? Thnx... sands -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 4 de Fevereiro de 2002 15:25 To: Sandeep Murphy Cc: [EMAIL PROTECTED] Subject: Re: [PHP] sockets This should help you. It is the fsockopen version of what I posed about 6 hours ago. function getdata ($host, $port, $data) { $fp = fsockopen ( $host, $port, $ec, $es, 5.0); if ( !$fp ) { exit (ERROR $ec: $es\n); } fputs ($fp, $data); while ( !feof($fp) ) { $buffer = fgets ($fp,128); $string .= $buffer; } fclose ($fp); return $string; } sends $data to $host:$port and returns the response, until the connection is severed. something like getdata (www.php.net, 80, GET / HTTP/1.0\r\n\r\n) should work out well for you On Monday 04 February 2002 07:15, you wrote: Hi, I am trying to access a remote file by opening a socket on port 80 but keep getting refused... The server does listen on port 80 as i can access it via browser... my code reads like this: ?php $Destination = http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co m municator; $Request = action=$actionusername=$unamepassword=$password; $cfgTimeOut = 20; $theURL = parse_url($Destination); $host = $theURL[host]; $path = $theURL[path]; $port = $theURL[port]; if ($port==) $port=80; $header = POST .$path. HTTP/1.0\r\n; $header .= Host: .$host.\r\n; $header .= Accept: */*\r\n; $header .= Accept-Language: en\r\n; $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n; $header .= Content-Type: text/xml\r\n; $header .= Content-Length: .strlen($Request).\r\n; $header .= Content: \r\n\r\n; $msg = $header. $Request ; $Response = ; echo $port; //echo $host; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E } else { echo Unable to access (.$Destination.).br; echo a href=\javascript:history.go(-1)\Try another/a;} print $response\n; print hello; ? any suggestions pl?? TIa, sands -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sockets
srv157 Stands for the server same and 7001 is the port.. with www.google.com, get a request denied error... sands -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 4 de Fevereiro de 2002 16:01 To: Sandeep Murphy; [EMAIL PROTECTED] Subject: Re: [PHP] sockets The server does listen on port 80 as i can access it via browser... http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co m municator; Am I missing something here? What's srv157:7001? Why don't you first try http://www.google.com? Bogdan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-DOMxml
Hi all, I hv spent too much time trying to solve this by myself and hope someone out there can help me out.. I am trying to use the DOM xml parser to parse my xml data.. The problem is that the parser reads only the parent and child elements but when the child nodes repeat themselves inside of child nodes, the parser simply refuses to read them.. Can anyone give me a suggestion as to how I can resolve this?? thnx in adv to all.. Sands -- 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] Associative arrays... help
Hi, sorry for repeating this...didnt change the sub..:) Is there any way I can construct an associative array out of 3 other arrays?? like for eg. function parse() { appid[]; appnm[]; url[]; } I want to do something like this: function arr() { $applist = array(APPID =$appid, APP NAME=$appnm, URL =$url); foreach($applist as $valor) echo $key . $valor; } wud appreciate any help.. TIA, sands -- 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]
RE: [PHP] PHP commands and HTML combobox
Hi, Is there any way I can construct an associative array out of 3 other arrays?? like for eg. function parse() { appid[]; appnm[]; url[]; } I want to do something like this: function arr() { $applist = array(APPID =$appid, APP NAME=$appnm, URL =$url); foreach($applist as $valor) echo $key . $valor; } wud appreciate any help.. TIA, sands
[PHP] SAX + attributes
hi, can anyone tell me how I can retrieve attributes of a node using SAX parser in PHP?? TIA, sands -- 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]
RE: [PHP] How to call method from another class
first create an instance of class B like this... $test = new classB(); Now, u can refer to any function or method of classB like this: $test-hello(); // where hello() is a method of classB.. cheers, sands -Original Message- From: David Yee [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 28 de Janeiro de 2002 17:19 To: [EMAIL PROTECTED] Subject: [PHP] How to call method from another class If I have a PHP class (let's say it's called ClassA), how do I call a method from another class (ClassB) within ClassA? Thanks. David -- 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]
RE: [PHP] RE: Printing structure and data of array
hi, Thnx for the info but this is what I am using right now... It prints the contents of array one below the other... is not showing the format of the contents as i want...:( any more suggestions?? thnx, sands -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 12:43 To: PHP List Subject: Re: [PHP] RE: Printing structure and data of array Use this: function debugPrint($mVar, $bHtml) { if ($bHtml){ echo pre; print_r ($mVar); echo /pre; } else { print_r ($mVar); } } call it like this: debugPrint($yourVariable,1); This will print out any type (object,array,ressource,string...) - Original Message - From: Sandeep Murphy [EMAIL PROTECTED] To: 'Tim Ward' [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Tuesday, January 22, 2002 1:00 PM Subject: RE: [PHP] RE: Printing structure and data of array hi, how can I display the array exactly as it is the format specified??? like if their exists sub elements of elements, how could I represent them in a multidimensional format?? I went thru most of the array functions but unable to adapt any of them.. pl help.. TIA, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 21 de Janeiro de 2002 10:24 To: PHP List; Daniel Alsén Subject: [PHP] RE: Printing structure and data of array Foreach($array as $key=$value) ech0($key=$valuebr); Tim www.chessish.com http://www.chessish.com -- From: Daniel Alsén [SMTP:[EMAIL PROTECTED]] Sent: 20 January 2002 19:33 To: PHP List Subject: Printing structure and data of array Hi, i know i have this answered before. But i can´t find that mail in the archive. How do i print an array to see both the structure and the data within? (test = value, test2 = value2)... # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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] -- 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]
RE: [PHP] RE: Printing structure and data of array
nope... It continues to print in a single column indexed from 0 to It does not print the sub elements as sub elements. any more ideas??? regards, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 12:56 To: Sandeep Murphy; PHP List Subject: RE: [PHP] RE: Printing structure and data of array how about ... function ShowArray($array) { echo(ul); foreach ($array as $key=$value) { echo(li$key) if (is_array($value)) { ShowArray($value); } else { echo(=$value); } echo(/li) } echo(/ul); } // end of fn ShowArray Tim www.chessish.com -Original Message- From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 12:01 To: 'Tim Ward'; PHP List Subject: RE: [PHP] RE: Printing structure and data of array hi, how can I display the array exactly as it is the format specified??? like if their exists sub elements of elements, how could I represent them in a multidimensional format?? I went thru most of the array functions but unable to adapt any of them.. pl help.. TIA, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 21 de Janeiro de 2002 10:24 To: PHP List; Daniel Alsén Subject: [PHP] RE: Printing structure and data of array Foreach($array as $key=$value) ech0($key=$valuebr); Tim www.chessish.com http://www.chessish.com -- From: Daniel Alsén [SMTP:[EMAIL PROTECTED]] Sent: 20 January 2002 19:33 To: PHP List Subject: Printing structure and data of array Hi, i know i have this answered before. But i can´t find that mail in the archive. How do i print an array to see both the structure and the data within? (test = value, test2 = value2)... # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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]
RE: [PHP] RE: Printing structure and data of array
Hey! No need to apologise!!! If it werent for guys like u newbies like us would hv a head full of grey hair!! honestly, methinks u guys rock!! well, coming bak to the problem, I guess I have the posted the same problem a few times in this list and receiving none or different answers may i am asking a bit too much wud appreciate if anyone has the time to help me out...:) for clarity sake, i am going to explain my problem again If anything is missing, pl lemme know.. I have an XML tree which I am parsing using DOM... The tree has elements, sub elements and attributes like the following: app // MAIN APP (can hv any number of sub applications) namesan/name age23/age app// THIS IS AN SUB APPLICATION namesan/name age23/age url type=defaultyahoo.com/url /app /app app /app and so on... the elements are being stored consecutively in the array and displays them as such, which is not how I want The array shud output such that the main app and sub app are distinguishable from each other.. Thnx again... sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 14:48 To: Sandeep Murphy; PHP List Subject: RE: [PHP] RE: Printing structure and data of array I may have lost the original problem, but I thought you wanted a way of displaying the structure of an array hierarchy, e.g. $fred[0][0] = array(length=10, width=20); $fred[0][1] = array(length=20, width=30); $fred[0][2] = array(length=30, width=20); $fred[0][3] = Hello world; $fred[1] = another string; if this isn't what you're trying to do I apologise for misinterpreting the question 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: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 14:42 To: 'Tim Ward'; PHP List Subject: RE: [PHP] RE: Printing structure and data of array nope... It continues to print in a single column indexed from 0 to It does not print the sub elements as sub elements. any more ideas??? regards, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 12:56 To: Sandeep Murphy; PHP List Subject: RE: [PHP] RE: Printing structure and data of array how about ... function ShowArray($array) { echo(ul); foreach ($array as $key=$value) { echo(li$key) if (is_array($value)) { ShowArray($value); } else { echo(=$value); } echo(/li) } echo(/ul); } // end of fn ShowArray Tim www.chessish.com -Original Message- From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 12:01 To: 'Tim Ward'; PHP List Subject:RE: [PHP] RE: Printing structure and data of array hi, how can I display the array exactly as it is the format specified??? like if their exists sub elements of elements, how could I represent them in a multidimensional format?? I went thru most of the array functions but unable to adapt any of them.. pl help.. TIA, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 21 de Janeiro de 2002 10:24 To: PHP List; Daniel Alsén Subject: [PHP] RE: Printing structure and data of array Foreach($array as $key=$value) ech0($key=$valuebr); Tim www.chessish.com http://www.chessish.com -- From: Daniel Alsén [SMTP:[EMAIL PROTECTED]] Sent: 20 January 2002 19:33 To: PHP List Subject: Printing structure and data of array Hi, i know i have this answered before. But i can´t find that mail in the archive. How do i print an array to see both the structure and the data within? (test = value, test2 = value2)... # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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]
RE: [PHP] RE: Printing structure and data of array
exactly! fancier regular expression is what I am looking for here:) thnx anyway... if anyone else has any suggestions.. welcome... regards, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 16:13 To: Sandeep Murphy; Tim Ward; PHP List Subject: RE: [PHP] RE: Printing structure and data of array I understand now, your problem is not how display the array but how to get it in a meaningful structure in the first place i.e. $app[0][name] = san; $app[0][age] = 23; $app[0][app][name] = san; $app[0][app][age] = 23; etc. is that valid XML? (I'm not that up on XML and can't find anything in the docs). If so you'll need to do some fancier regular expression stuff than you already are to separate out the sub-application Tim www.chessish.com -Original Message- From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 15:25 To: 'Tim Ward'; PHP List Subject: RE: [PHP] RE: Printing structure and data of array Hey! No need to apologise!!! If it werent for guys like u newbies like us would hv a head full of grey hair!! honestly, methinks u guys rock!! well, coming bak to the problem, I guess I have the posted the same problem a few times in this list and receiving none or different answers may i am asking a bit too much wud appreciate if anyone has the time to help me out...:) for clarity sake, i am going to explain my problem again If anything is missing, pl lemme know.. I have an XML tree which I am parsing using DOM... The tree has elements, sub elements and attributes like the following: app // MAIN APP (can hv any number of sub applications) namesan/name age23/age app// THIS IS AN SUB APPLICATION namesan/name age23/age url type=defaultyahoo.com/url /app /app app /app and so on... the elements are being stored consecutively in the array and displays them as such, which is not how I want The array shud output such that the main app and sub app are distinguishable from each other.. Thnx again... sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 14:48 To: Sandeep Murphy; PHP List Subject: RE: [PHP] RE: Printing structure and data of array I may have lost the original problem, but I thought you wanted a way of displaying the structure of an array hierarchy, e.g. $fred[0][0] = array(length=10, width=20); $fred[0][1] = array(length=20, width=30); $fred[0][2] = array(length=30, width=20); $fred[0][3] = Hello world; $fred[1] = another string; if this isn't what you're trying to do I apologise for misinterpreting the question 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: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 14:42 To: 'Tim Ward'; PHP List Subject:RE: [PHP] RE: Printing structure and data of array nope... It continues to print in a single column indexed from 0 to It does not print the sub elements as sub elements. any more ideas??? regards, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: terça-feira, 22 de Janeiro de 2002 12:56 To: Sandeep Murphy; PHP List Subject: RE: [PHP] RE: Printing structure and data of array how about ... function ShowArray($array) { echo(ul); foreach ($array as $key=$value) { echo(li$key) if (is_array($value)) { ShowArray($value); } else { echo(=$value); } echo(/li) } echo(/ul); } // end of fn ShowArray Tim www.chessish.com -Original Message- From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] Sent: 22 January 2002 12:01 To: 'Tim Ward'; PHP List Subject: RE: [PHP] RE: Printing structure and data of array hi, how can I display the array exactly as it is the format specified??? like if their exists sub elements of elements, how could I represent them in a multidimensional format?? I went thru most of the array functions but unable to adapt any of them.. pl help.. TIA, sands -Original Message- From: Tim Ward [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 21 de Janeiro de 2002 10:24 To: PHP List; Daniel Alsén Subject: [PHP] RE: Printing structure and data of array Foreach($array as $key=$value) ech0($key=$valuebr); Tim www.chessish.com http://www.chessish.com -- From: Daniel Alsén [SMTP:[EMAIL PROTECTED]] Sent: 20 January 2002
[PHP] recursive
hi, I hv an XML tree with some elements which keep repeating.. As of now, I am able to print only the last element.. I need to make the loop recursive in order to print all the elements.. wud appreciate any help.. TIA, sands like this: app_info app_id001/app_id app_nameWORD/app_name app_info app_id002/app_id app_nameexcel/app_name /app_info app_info app_id003/app_id app_namePPt/app_name /app_info /app_info app_info app_id004/app_id app_nameZIP/app_name /app_info -- 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] associative arrays..help!
Hi, This is a long one so pl bear with me... I have an XML structure as follows: app_info app_id001/app_id app_nameWORD/app_name app_info //SUB APPLICATION app_id002/app_id app_nameexcel/app_name /app_info app_info app_id003/app_id app_namePPt/app_name /app_info /app_info app_info app_id004/app_id app_nameZIP/app_name /app_info Where there are sub elements of main elements... When I print the array contents, they are printed as Array ( [0] = DEMO_XML [1] = XML Output [2] = DEMODemo [3] = DEMO_AUTH [4] = XML Auth ) and so on whereas I need to make them as Array( [0] [APP] DEMO XML [SUB_APP] XML OUTPUT How can I achieve this?? any suggestions please My for loop reads like this: for($y_aux=0; $y_auxsizeof($nodes_aux); $y_aux++) { $this-appid[] = $nodes_aux[$y_aux]-content; print pre; print_r ($this-appid).br; print /pre; } TIA, sands -- 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] String to array ???
Hi, I have a for loop in which a variable $privid reads and stores the content from a xmlfile in the form of a string.. the string has 5 different values... I want to call this variable $privid outside the loop like this... for($y_au=0; $y_ausizeof($priv); $y_au++) { $this-privid = $childNodes[$y]-content ; print $this-privid; // here the variale privid stores and prints all the 5 values as a string.. } function id() { print $this-privid; // here only the last value of in the string is being printed ..WHY??? and how can I resolve this?? return $this-privid; // RETURNS ONLY THE LAST VALUE IN THE STRING.. Why?? } Thanks in adv.:) sands p.S: I tried using an array within the for loop (had posted yest about it..) but makes no diff.. -- 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] string to array??
hi, can i convert a string to an array?? if so how shud the syntax read?? Thnx, sands -- 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] thnx..
Hi guys!! Thnx a bunch, it worked out... I used the split function... Meanwhile, hv another question !! I hv a var $id declared within a function x of a class called A I need to access this var $id in another php file... I do the following: ?php require (example1.php); $news = new A(); // I want to something like this: print ($news-A-$id); //print ($news-id); ? How do i achieve this?? Thanks again to all of u!! sands -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 17 de Janeiro de 2002 12:41 Cc: [EMAIL PROTECTED] Subject: Re: [PHP] string to array?? You just have to remember that a string is simply a character array :) Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 17-01-02 at 12:57 * Steve Edberg said Actually, you can treat a string as an array without any further processing: $Globbot = 'dribcot'; echo $Globbot[0]; # echoes 'd' echo $Globbot[6]; # echoes 't' Check out 'String access by character' about halfway down the page at http://www.php.net/manual/en/language.types.string.php (or, in Portuguese, http://www.php.net/manual/pt_BR/language.types.string.php Hmmm. I didn't know that! Actually, using the [] syntax is deprecated - using {} is the new way - but I'm a creature of habit... Or that! - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8Rrz+HpvrrTa6L5oRAn4kAKCx41//DDBp/bPzPprs2Zls0xjGJgCgk5tz x16a8iDFuzEmsgSg5Iv/8Ms= =smoj -END PGP SIGNATURE- -- 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 message was virus checked with: SAVI 3.52 last updated 8th January 2002 *** -- Email: [EMAIL PROTECTED] [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] -- 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] Fatal error: Call to a member function on a non-object in example1.php on line 66
Hi, I keep getting this error Fatal error: Call to a member function on a non-object in /www/html/smurthy/example1.php on line 66 and simply unable to figure out why this is occuring.. 64 $root = $dom-root(); 65 $All_nodes = $root-children(); 66 $childNodes=$All_nodes [1]-children(); can anyone help me out pleaseee TIA, sands -- 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]
RE: [PHP] Fatal error: Call to a member function on a non-object in example 1.php on line 66
Hi, Thnx a lot for your suggestion.. Well the moment I removed the space the error disappeared but the page doesnt show any output ... tried trapping errors but none appears.. any further ideas pl!!! Thnx again, sands -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 17 de Janeiro de 2002 18:41 To: Sandeep Murphy; [EMAIL PROTECTED] Subject: Re: [PHP] Fatal error: Call to a member function on a non-object in example 1.php on line 66 First of all, make sure the $root-children() returns an array of objects. Second of all, remove the space between $All_nodes and [1]. Your code should look like: $childNodes=$All_nodes[1]-children(); If that does not work, you may have to create a temp var to use... $tmp = $All_nodes[1]; $childNodes=$tmp-children(); -Jason Garber IonZoft.com At 06:21 PM 1/17/2002 +, Sandeep Murphy wrote: Hi, I keep getting this error Fatal error: Call to a member function on a non-object in /www/html/smurthy/example1.php on line 66 and simply unable to figure out why this is occuring.. 64 $root = $dom-root(); 65 $All_nodes = $root-children(); 66 $childNodes=$All_nodes [1]-children(); can anyone help me out pleaseee TIA, sands -- 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] -- 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]
RE: [PHP] Fatal error: Call to a member function on a non-object (again)
hi again, One other strange thing that I didnt mention before.. if I insert(type) the xml data directly within the parser or refer to an external xml file, it runs fine but if I try to dynamically send the xml data to the parser , I repeatedly kept getting the fatal error .. thnx, sands -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 17 de Janeiro de 2002 18:41 To: Sandeep Murphy; [EMAIL PROTECTED] Subject: Re: [PHP] Fatal error: Call to a member function on a non-object in example 1.php on line 66 First of all, make sure the $root-children() returns an array of objects. Second of all, remove the space between $All_nodes and [1]. Your code should look like: $childNodes=$All_nodes[1]-children(); If that does not work, you may have to create a temp var to use... $tmp = $All_nodes[1]; $childNodes=$tmp-children(); -Jason Garber IonZoft.com At 06:21 PM 1/17/2002 +, Sandeep Murphy wrote: Hi, I keep getting this error Fatal error: Call to a member function on a non-object in /www/html/smurthy/example1.php on line 66 and simply unable to figure out why this is occuring.. 64 $root = $dom-root(); 65 $All_nodes = $root-children(); 66 $childNodes=$All_nodes [1]-children(); can anyone help me out pleaseee TIA, sands -- 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] -- 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] parsing xml/string
Hi, I have an xml output with tags like sessionid123/sessionid usersands/sands I could parse the output using expat to display it the way i want or as a string but what I need is to store the values separately in different variables like $id for sessionid, $user for user and so on.. to be manipulated later... Any suggestions?? TIa, sandeep -- 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] parser
hi, I have a PHP script which sends a authorisation request to a Servlet and receives a response in XML format. I have also created a parser (using both DOM as well as SAX) for parsing the output. My problem: The parser takes in input from an external xml file but the output from the servlet needs to be dynamically fed into the parser something like this: phpcomm.php ?php include_once ('xmlcommparser1.php'); --- --- --- $xmldata = $sysCurlReq-getSysCurlResp(); $appData = new XmlAppData ($xmldata); //print_r($appData-appArray) // display array contents ? $xmldata contains the output which is sent directly to the parser [B]xmlcommparser1.php[/B] The xmlcommparser1.php is not working.. I am trying to convert the parser into form of a class with a function which receives $xmldata... I am pasting the parser code below if anyone wants a look.. wud appreciate a lot if anyone can figure out where I am going wrong! TIA, sandeep xmlcommparser1.php ?php class XmlAppData { var $appArray; var $xmlData; var $xml_parser; var $depth = array(); function XmlAppData($xmldata) { $this-xmlData = $xmldata; $this-xml_set_element_handler(); } //$file = c:\apache\htdocs\a.xml; function startElement($parser, $name, $attrs) { global $depth; for ($i = 0; $i $depth[$parser]; $i++) { print ; } // print $name\n; // print $data; $depth[$parser]++; } function endElement($parser, $name) { global $depth; $depth[$parser]--; } var $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, startElement, endElement); if (!($fp = fopen($file, r))) { die(could not open XML input); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf(XML error: %s at line %d, xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } print $data; } xml_parser_free($xml_parser); ?
[PHP] xml dom support
hi, I am running PHPtriad on a win2k machine... when I run phpinfo() it displays XMLACTIVE but I keep getting an error Fatal error: Call to undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24 What needs to installed/configured ?? TIA, sandeep -- 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] php sockets!- urg!!!
Hi, I am opening a socket on a remote server(weblogic) and sending my username and psswd to authentify them... I figure my php is opening the socket as no errors r being trapped.. However the response is a blank page instead of an xml formatted response...why??? how can i rectify this?? Please helpp!!! TIA, sands my code is as below: ?php $uname = username; $password = password; ? ?php $Destination = http://srv157:7001/communicatorServlet;; $Request = username=$unamepassword=$password; $cfgTimeOut= 20; $theURL = parse_url($Destination); $host = $theURL[host]; $path = $theURL[path]; $port = $theURL[port]; if ($port==) $port=80; $header = GET .$path. HTTP/1.0\r\n; $header .= Host: .$host.\r\n; $header .= Accept: */*\r\n; $header .= Accept-Language: en\r\n; $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n; $header .= Content-Type: text/xml\r\n; $header .= Content-Length: .strlen($Request).\r\n; $header .= Content: \r\n\r\n; $msg = $header . $Request; $Response = ; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E } else { echo Unable to access servlet (.$Destination.).br; echo a href=\javascript:history.go(-1)\Try another/a;} print $response\n; print hello; ? -- 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] php,sockets-help!
Hi, I am opening a socket on a remote server(weblogic) and sending my username and psswd to authentify them... I figure my php is opening the socket as no errors r being trapped.. However the response is a blank page instead of an xml formatted response...why??? how can i rectify this?? Please helpp!!! TIA, sands my code is as below: ?php $uname = username; $password = password; ? ?php $Destination = http://srv157:7001/communicatorServlet;; $Request = username=$unamepassword=$password; $cfgTimeOut= 20; $theURL = parse_url($Destination); $host = $theURL[host]; $path = $theURL[path]; $port = $theURL[port]; if ($port==) $port=80; $header = GET .$path. HTTP/1.0\r\n; $header .= Host: .$host.\r\n; $header .= Accept: */*\r\n; $header .= Accept-Language: en\r\n; $header .= User-Agent: PHP/4.0.6 (Apache/1.3.20)\r\n\r\n; $header .= Content-Type: text/xml\r\n; $header .= Content-Length: .strlen($Request).\r\n; $header .= Content: \r\n\r\n; $msg = $header . $Request; $Response = ; // open a socket if(!$cfgTimeOut) // without timeout $fp = fsockopen($host,$port); else // with timeout $fp = fsockopen($host,$port, $errno, $errstr, $cfgTimeOut); if ($fp) { if (!fputs($fp,$msg,strlen($msg))) { return false; } // S E N D while (!feof($fp)) {$Response .= fgets($fp,32768);} fclose($fp); // R E C E I V E } else { echo Unable to access servlet (.$Destination.).br; echo a href=\javascript:history.go(-1)\Try another/a;} print $response\n; print hello; ? -- PHP Windows 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]
[PHP] Http request
Hi, Can anyone tellme how I can do a http request to a servlet from a PHP?? I mean, I have a username and password which I want to send in a string(variable) to a Servlet which authentifies it and responses back in XML format... any suggestions?? TIA, sandeep -- 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]
RE: [PHP] Regarding mail function
tet -Original Messa[Sandeep Murphy] ter ge- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 10:55 To: [EMAIL PROTECTED] Subject: [PHP] Regarding mail function Hi , My file name: bala.php --- ?php mail([EMAIL PROTECTED], hi friend, Hi, how are you? Expecting reply from you. -Bala); ? for the above program I am getting the following warning.. - Warning: Server Error in c:\www/bala.php on line 3 - I have changed in php.ini with my SMTP server (arabhi.wipro.com or 10.145.2.18) In outlook settings we give the username and password for our mail server. Is it required here also? could you please tell available headers for e-mail function? Is ther any headers like user name and password?? Any help greatly appreciable... Thanks in advance. -Balaji
[PHP] PHP + Windows 98 + Apache
Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- 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]
RE: [PHP] PHP + Windows 98 + Apache
hi, ok, heres what I did exactly... 1.Downloaded and extracted PHP version 4.1.1 to c:\php 2. Copied php4ts.dll to c:\windows\system (running win98) 3. php.ini-dist to c:\windows and renamed it to php.ini 4. Edited the php.ini as follows: changed the 'extension_dir' setting to point to my c:\php Set the 'doc_root' to point to my webservers document_root. c:\apache\htdocs 5. Copied the lines ( ScriptAlias /php/ c:/php4/ AddHandler application/x-httpd-php .php Action application/x-httpd-php3 /php-bin/php.exe) to my httpd.conf (tried placing these lines at the end first, then after the load module statements.. all in vain) 6. Restarted Apache any suggestions?? Thanks, sandeep -Original Message- From: Levon Ghazaryan [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 7 de Janeiro de 2002 11:39 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP + Windows 98 + Apache hm.. I also have Apache with PHP and mysql on my win 98 and it runs fine with both.. check ones more the configure steps to be done for php configuration or write detailed what steps have you gone thru configuring levon On Mon, 7 Jan 2002, Sandeep Murphy wrote: Hi all, I have installed Apache on my win 98 machine and it runs fine .. however, am unable to configure Apache to run with PHP. I installed the binary version of PHP and edited the httpd.conf file as instructed in the install.txt of php but am getting a browser (400) page not found error.. any suggestions are appreciated, TIA, Sandeep -- 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] -- 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] PHP, XML
hi, Does anyone know of a mailing list for PHP and XML or can I just pose them here?? Thanks, sandeep -- 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]