Re: [PHP] problem with php-4.3.2 and gblib 2 on apache server
On Thursday 10 July 2003 09:41, Tim Grote wrote: I updated my linux apache server to php-4.3.2. It works fine but the promised 'embedded' gdlib 2 doesnt seem to work. gd_info always ends in 'call to undefined function'. Can anybody tell me what's wrong or how to get gdlib 2 working? Was php compiled with gd support? manual Image functions for info. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Lewis's Law of Travel: The first piece of luggage out of the chute doesn't belong to anyone, ever. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Blatant newbie question - killing a session
Hi, this is my first question to the list and ... Yes I'm a newbie, verrry wet behind the ears. I am trying to set up a secured site under IIS. I have done pretty well by my standard to get to where I have. Authoursed users can access the site, unauthorised ones get sent elsewhere. So, I am now up to testing the various security combinations and its driving me mad that the session persists when I'm testing bad logins. How or where does one set up a session extuinguisher? After one two or n attempts I want to kill the entire session and start afresh - note this is in testig only, the way it works now is great for live. Tia Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] saving BMP image
Hi! I'd like to ask if there is any function for saving image into (windows) BMP format (not wbmp - which is wireless BMP). e.g. imagejpg() will save jpg file Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] suexec
Hi! Is there a way to use suexec with a non-cgi version of php? Or is there any other way to do the same job as suexec would do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: shoutcast communication
Hello! I have a PHP class here that can fetch that information for you from the XML sheet provided by the server. I'll send it to you if you want, I forgot where I downloaded it (you could check www.hotscripts.com though). //Simon Ben Paul wrote: Hello, I am currently streaming via shoutcast once a week, what i would like to do is basically talk to my shoutcast server via the ip address and get the amount of listners etc. i know its possible, i was just wondering if any of you had done this and could point me in the right direction as i really havent a clue how this is done. Thanks Ben Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail() - how to attach file to the message???
no. i`m not trying to upload file on server. i want to send e-mail with attachments but if it's possible without using classes. i thought that file should be first uploaded and then send with e-mail as attachment, maybe uploading isn't correct... i don't know how to do it. szparag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL select
hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev id 1 f bla1 1 2 f bla2 1 3 f bla5 1 4 i bla6 1 so, when doesn'i exist component (id_k = component) type f so I want component with type i, but when doesn't exist type f noir i I don't want to select row with type z. jiri nemec, ICQ: 114651500 www.menea.cz - www strnky a aplikace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] download php
Hello php-general, some hacker just tries his luck everyday to get me pissed, is it possible to make php files not downloadable? or coded? or something? because some dude knows my passwords every time, and with them passes the shity security to main user, thank god not root. So is there any way? if anyone knows any links or resources, please reply, i'll check them, i need to put this to end P.S system is freebsd. Thank you!!! there are even more and more kids that want to be named haker, lookin at their age, could be even my son:) -- Best regards, Mantas mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] /etc/passwd
Hello php-general, my server is running freebsd 5.0 and yet i havent fixed bug that i knew long time ago, so can anyone point me with some links or resources about it, i could not find any good on google, maybe i don't know how to search. The problem is if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! P.S If someone knows good links please reply me! thanks a lot! ---Don't Get Mad, Ged Glad , Buy Gladware--- -- Best regards, Mantas mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mcrypt warning
Hi, Thursday, July 10, 2003, 12:41:28 AM, you wrote: DJ Hi All, DJ I have the following function: DJ function encrypt ($x) { DJ $ini = parse_ini_file ($GLOBALS['INI_PATH']); DJ $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); DJ $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), DJ MCRYPT_RIJNDAEL_256); DJ mcrypt_generic_init ($td, $ini[key], $iv); DJ $encrypted_data = mcrypt_generic ($td, $x); DJ mcrypt_generic_deinit ($td); DJ mcrypt_module_close ($td); DJ return bin2hex($encrypted_data); DJ } DJ I get the following PHP Warning in my logs, however, the code executes ok: DJ [Wed Jul 9 10:25:49 2003] [error] PHP Warning: mcrypt_generic_init(): Iv DJ size incorrect; supplied length: 0, needed: 8 in DJ /usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on DJ line 87 DJ I have read into mcrypt, tried a couple things, but nothing will get rid of DJ that error. Could someone show me what I've done wrong? DJ -Dan Joseph I use this to set iv to null so I don't need to worry about it :) $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] (pas d'objet)
Hi everyone, I would like to thank all the people that have answered my question and all the others that didn't have the time to answer it. As I have seen, the opinions on this point are quite different and the answer is not as evident as the technical director affirmed to me. Thank you. Sergio Giz a écrit : PHP is designed for rapid development of web applications. Manipulating relational database data is not its strong point. If I had a complicated database manipulation that could be done within and oracle stored procedure, and the database was large, or expected to get that way, I would strongly consider a stored proc, even if there was a simple alternative available via a short block of php, because the stored proc is going to be faster. This is no different than someone doing a select statement using a join, rather than selecting one table in php, iterating through the result set, and doing follow up select statements. In each case you would get the same data, but one method is intrinsically faster than the other. With that said... as the old saying goes to the man with a hammer, everything looks like a nail. It may be that the interviewer simply knows oracle better than anything else, and looks to solve all problems with pl/sql, and oracle does provide the capability to do relatively complete web applications completely in pl/sql. For many people the abilities of pl/sql are irrelevant, because they are not using oracle as the backend. -Original Message- From: RIVES Sergio SOFRECOM [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 12:44 AM To: phplist Subject: [PHP] (pas d'objet) Hi everyone, I have a doubt, an existential question on the PHP... Yesterday I had an entrevue for a job and I was quite surprised by the technical director that told me that he prefers coding PL/SQL subroutines better than in PHP embedding. The Oracle database on which he works is about 100 Go. The application is on a web server. It is like a startup structure. I told him that I prefer doing all the things I can do with PHP better than in PL/SQL. He told me that all treatments couldn't be done in PHP because of the size of the database and memory limitation. I am writing you this mail to know your point of view on that point if you have time to answer me. What would be then the limit of the PHP coding ? For such a database what would be the right parametrization of the PHP.ini ? is there only a right parametrization for such database ? Does anyone have some information on that limitation of the PHP ? any article ? Thanks in advance for your answers and time. Sergio -- 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] SQL select
I did not understand you much but would not this work? SELECT * FROM table WHERE typ='f' OR typ='i' Ji Nmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev id 1 f bla1 1 2 f bla2 1 3 f bla5 1 4 i bla6 1 so, when doesn'i exist component (id_k = component) type f so I want component with type i, but when doesn't exist type f noir i I don't want to select row with type z. jiri nemec, ICQ: 114651500 www.menea.cz - www strnky a aplikace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] download php
Do you use secure connection? Well, you should. Mantas Kriauciunas wrote: Hello php-general, some hacker just tries his luck everyday to get me pissed, is it possible to make php files not downloadable? or coded? or something? because some dude knows my passwords every time, and with them passes the shity security to main user, thank god not root. So is there any way? if anyone knows any links or resources, please reply, i'll check them, i need to put this to end P.S system is freebsd. Thank you!!! there are even more and more kids that want to be named haker, lookin at their age, could be even my son:) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SQL select
hi, JiøîÆèî eË wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev id 1 f bla1 1 2 f bla2 1 3 f bla5 1 4 i bla6 1 so, when doesn'i exist component (id_k = component) type f so I want component with type i, but when doesn't exist type f noir i I don't want to select row with type z. jiri nemec, ICQ: 114651500 www.menea.cz - www stránky a aplikace don't know, if i correctly understood, but how about this: SELECT * FROM `YourTable` WHERE `typ`=f OR `typ`=i ODER BY `typ`; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
Mantas Kriauciunas wrote: The problem is if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. Check if $id is valid. Exact way depends on the structure of the files. Example 1: All included files are in web root and are named something.html, something can contain letters, underscore, digits. if($id eregi('^[a-z0-9_]+\.html',$id)) include($id); Example 2: The included files split into several directories, which can contain letters, underscore, digits. if($id eregi('^[a-z0-9_]+/[a-z0-9_]+\.html',$id)) include($id); Sure, this assumes you have nothing to hide in your *.html files. So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! P.S If someone knows good links please reply me! thanks a lot! ---Don't Get Mad, Ged Glad , Buy Gladware--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suexec
Sure there is, the same way as in the cgi version. Safe mode must be off. Fejes Jozsef wrote: Hi! Is there a way to use suexec with a non-cgi version of php? Or is there any other way to do the same job as suexec would do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 10 Jul 2003 10:18:09 -0000 Issue 2167
php-general Digest 10 Jul 2003 10:18:09 - Issue 2167 Topics (messages 154646 through 154697): Windows 2k, Apache, MySQL, PHP 4.3.2, Smarty 154646 by: Michael Smith Returning values from functions 154647 by: Jason Giangrande 154648 by: David Nicholson 154649 by: Jason Giangrande 154650 by: Jennifer Goodie proxy... of a sorts. 154651 by: erythros 154652 by: David Nicholson Re: New to PHP 154653 by: Ow Mun Heng Re: include/require inside of function 154654 by: Ow Mun Heng MySQL Results - display issue :S 154655 by: Brenton Dobell 154660 by: Miles Thompson 154662 by: David Robley 154675 by: Philip Olson Re: TextArea vs. URLEncode/URLDecode/quotes 154656 by: Arcadius A. Re: session data missing 154657 by: ulf sundin Re: Object assignment 154658 by: Tom Rogers 154663 by: Tom Rogers problem with php-4.3.2 and gblib 2 on apache server 154659 by: Tim Grote 154682 by: Jason Wong Re: Using PHP with windows logon 154661 by: David Otton Handling Credit Card Payment 154664 by: Student4 154673 by: Ralph Guzman $_POST problem 154665 by: Micah Montoy 154666 by: Aaron Axelsen 154668 by: Micah Montoy 154669 by: Joe Harman 154670 by: Micah Montoy 154671 by: Aaron Axelsen 154672 by: Aaron Axelsen 154674 by: Philip Olson 154676 by: Joe Harman 154677 by: Micah Montoy 154678 by: Joe Harman 154679 by: Philip Olson 154680 by: myhan Re: Create a Report 154667 by: cavagnaro (REAL TUFFY ) Lat/Long Map Image Manipulation 154681 by: Joe Harman Blatant newbie question - killing a session 154683 by: Bruce Bruen saving BMP image 154684 by: jan suexec 154685 by: Fejes Jozsef 154697 by: Marek Kilimajer Re: shoutcast communication 154686 by: Simon Fredriksson Re: mail() - how to attach file to the message??? 154687 by: szparag SQL select 154688 by: Jiøí Nìmec 154693 by: Marek Kilimajer 154695 by: sven download php 154689 by: Mantas Kriauciunas 154694 by: Marek Kilimajer /etc/passwd 154690 by: Mantas Kriauciunas 154696 by: Marek Kilimajer Re: mcrypt warning 154691 by: Tom Rogers Re: (pas d'objet) 154692 by: RIVES Sergio SOFRECOM 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] -- ---BeginMessage--- Problem with Smarty. My application is giving me an error when i try to use smarty on a new WAMP install. Smarty is in my include path. Getting this error: *Fatal error*: Call to undefined function: () in *c:\htdocs\smarty\Smarty.class.php* on line *1658 *line 1658 is: $_source_return = $resource_func($resource_name, $template_source, $this); I think it has something to do with PHP not liking the $resource_fun being submitted for the function name. It works fine on my updated LAMP environment any help woudl be much appreciated. -Michael ---End Message--- ---BeginMessage--- I have a function that checks to see if a user has an active session and if so I'd like it to return the value of a variable (the variable $username). However, when I var_dump the variable it's value is NULL. Anyone know why? Here's the function: function auth_user($logged_in) { if (isset($logged_in)) { list($s_username, $hash) = explode(',',$logged_in); global $secret_word; if (md5($s_username.$secret_word) == $hash) { $username = $s_username; return $username; } else { die (You have tampered with your session.); } } else { die (Sorry, you are not logged in. Please log in and try again.); } } Here's the code that calls the function which is in another script. auth_user($_SESSION['login']); var_dump($username); Thanks, Jason Giangrande ---End Message--- ---BeginMessage--- Hello, This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 23:40, lines prefixed by '' were originally written by you. auth_user($_SESSION['login']); var_dump($username); You are not collecting the value that your function returns. Try: $username = auth_user($_SESSION['login']); var_dump($username); David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) ---End Message--- ---BeginMessage--- Thanks. I'm new to
Re: [PHP] Blatant newbie question - killing a session
You mean killing the session cookie? setcookie (session_name(), , time() - 3600); session_unset(); // or $_SESSION = array(); session_destroy(); Bruce Bruen wrote: Hi, this is my first question to the list and ... Yes I'm a newbie, verrry wet behind the ears. I am trying to set up a secured site under IIS. I have done pretty well by my standard to get to where I have. Authoursed users can access the site, unauthorised ones get sent elsewhere. So, I am now up to testing the various security combinations and its driving me mad that the session persists when I'm testing bad logins. How or where does one set up a session extuinguisher? After one two or n attempts I want to kill the entire session and start afresh - note this is in testig only, the way it works now is great for live. Tia Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session problems in php 4.3.2
Hello, I have a problem with php 4.3.2. I have a php code and i used sessions, that code works properly in php 4.3.0 and now after upgrade php to 4.3.2 version not work. Any ideas about this. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] /etc/passwd
Hello Marek, Thanks for the answer, but i think you misunderstood me because of my bad english. What i mean is the people with that code can access and view files on any place on my server and see the passwords stored in some files, decode them, and do stuff like that. I wanted to know how to prevent that from happening? If the people make file like this, how to protect myself so they could not view the /etc/passwd file? Thursday, July 10, 2003, 5:13:33 AM, you wrote: MK Mantas Kriauciunas wrote: The problem is if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. MK Check if $id is valid. Exact way depends on the structure of the files. MK Example 1: All included files are in web root and are named MK something.html, something can contain letters, underscore, digits. MK if($id eregi('^[a-z0-9_]+\.html',$id)) include($id); MK Example 2: The included files split into several directories, which can MK contain letters, underscore, digits. MK if($id eregi('^[a-z0-9_]+/[a-z0-9_]+\.html',$id)) include($id); MK Sure, this assumes you have nothing to hide in your *.html files. So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! P.S If someone knows good links please reply me! thanks a lot! ---Don't Get Mad, Ged Glad , Buy Gladware--- -- Best regards, Mantasmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: download php
So is there any way? http://www.turcksoft.com/en/e_mmc.htm Hope it helps... Nadim Attari -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Blatant newbie question - killing a session
session_destroy(); session_unset(); -Original Message- From: Bruce Bruen [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 4:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Blatant newbie question - killing a session Hi, this is my first question to the list and ... Yes I'm a newbie, verrry wet behind the ears. I am trying to set up a secured site under IIS. I have done pretty well by my standard to get to where I have. Authoursed users can access the site, unauthorised ones get sent elsewhere. So, I am now up to testing the various security combinations and its driving me mad that the session persists when I'm testing bad logins. How or where does one set up a session extuinguisher? After one two or n attempts I want to kill the entire session and start afresh - note this is in testig only, the way it works now is great for live. Tia Bruce -- 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] /etc/passwd
Exactly like I said, just check this: $id='/etc/passwd'; if($id eregi('^[a-z0-9_]+\.html',$id)) include($id); else die('Go away!'); The regular expression prevents anyone from accessing any file that is not in your web root (http://your.server.net/) or its name does contain any other character then letters, numbers or underscore or does not end with html extension. This is pretty strict so a chance you will miss something is 0. The syntex of the regular expression depend on your needs, I don't know them so I can't help you. Mantas Kriauciunas wrote: Hello Marek, Thanks for the answer, but i think you misunderstood me because of my bad english. What i mean is the people with that code can access and view files on any place on my server and see the passwords stored in some files, decode them, and do stuff like that. I wanted to know how to prevent that from happening? If the people make file like this, how to protect myself so they could not view the /etc/passwd file? Thursday, July 10, 2003, 5:13:33 AM, you wrote: MK Mantas Kriauciunas wrote: The problem is if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. MK Check if $id is valid. Exact way depends on the structure of the files. MK Example 1: All included files are in web root and are named MK something.html, something can contain letters, underscore, digits. MK if($id eregi('^[a-z0-9_]+\.html',$id)) include($id); MK Example 2: The included files split into several directories, which can MK contain letters, underscore, digits. MK if($id eregi('^[a-z0-9_]+/[a-z0-9_]+\.html',$id)) include($id); MK Sure, this assumes you have nothing to hide in your *.html files. So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! P.S If someone knows good links please reply me! thanks a lot! ---Don't Get Mad, Ged Glad , Buy Gladware--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session problems in php 4.3.2
On Thursday 10 July 2003 18:26, Tassos T wrote: I have a problem with php 4.3.2. I have a php code and i used sessions, that code works properly in php 4.3.0 and now after upgrade php to 4.3.2 version not work. Any ideas about this. - Read the release notes - Read the change log - Compare php.ini -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I've got an IDEA!! Why don't I STARE at you so HARD, you forget your SOCIAL SECURITY NUMBER!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suexec
Sure there is, the same way as in the cgi version. Safe mode must be off. Safe mode is off, suexec is turned on. In the logfiles, I see that suexec engine is turned on or something like that, the path is correct too. Suexec and the virtualhost are configured alright because for cgi programs, it does work: changes uid and reports this in the logfile without any errors. The problem is that it does nothing for *.php in the same virtualhost with the same configuration. No uid change, no message in the logfile (not even any errors). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail() - how to attach file to the message???
On Thursday 10 July 2003 16:22, szparag wrote: no. i`m not trying to upload file on server. i want to send e-mail with attachments but if it's possible without using classes. i thought that file should be first uploaded and then send with e-mail as attachment, maybe uploading isn't correct... i don't know how to do it. You said previously that you had downloaded some classes which allowed you to send mail with attachments. But you don't want to use those classes and want to write your own, but you don't know how. 1) Why don't you want to use those ready made classes? Why re-invent the wheel? 2) OK fine, you don't want to use those classes, so just study them to see how it's done then off you go. 3) Also the subject of how to attach file to email has been discussed many times in the past, refer to archives for code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I can't understand why a person will take a year or two to write a novel when he can easily buy one for a few dollars. -- Fred Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
On Thursday 10 July 2003 17:26, Mantas Kriauciunas wrote: my server is running freebsd 5.0 and yet i havent fixed bug that i knew long time ago, so can anyone point me with some links or resources about it, i could not find any good on google, maybe i don't know how to search. First of all it's not a bug. The problem is if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! You should only be allowing people to include files from pre-determined directories. So use explode() or basename() to extract the filename then prepend the pre-determined directory. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. -- Bertrand Russell */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] wamphp4, php5
how do i have to configure my httpd.conf to run both, php4 and php5 i have php4 in c:\php where schould i put the php5 stuff ? do i need only one php.ini or two? questions, questions, questions mfg. harry wiens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suexec
Sorry, my fault. I was wrong, suexec can work only for cgi. Fejes Jozsef wrote: Sure there is, the same way as in the cgi version. Safe mode must be off. Safe mode is off, suexec is turned on. In the logfiles, I see that suexec engine is turned on or something like that, the path is correct too. Suexec and the virtualhost are configured alright because for cgi programs, it does work: changes uid and reports this in the logfile without any errors. The problem is that it does nothing for *.php in the same virtualhost with the same configuration. No uid change, no message in the logfile (not even any errors). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
My method is: 1. check if id starts with / if(ereg(^\/, $id)) goaway; 2. check if there is .. in it if(ereg(\.\., $id)) goaway; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ANN: Metastorage generates form handling classes
Hello, Metastorage generates form handling classes In the continuation of the work to achieve further reduction of application development efforts, the new release of Metastorage is now capable of generating automatically classes that are able to handle Web forms that serve as user interface to create new persistent objects. Complete announcement article: http://www.meta-language.net/news-2003-07-10-metastorage.html Screenshots: http://www.meta-language.net/screenshots.html Note: although it is not mentioned, the code generated by Metastorage should work with PEAR::MDB via Metabase wrapper. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
Add a check for php files, or any other files you don't want anybody to include: if(ereg('php[0-9]$', $id)) goaway; Fejes Jozsef wrote: My method is: 1. check if id starts with / if(ereg(^\/, $id)) goaway; 2. check if there is .. in it if(ereg(\.\., $id)) goaway; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
At 13:45 10-7-03, Marek wrote: Add a check for php files, or any other files you don't want anybody to include: if(ereg('php[0-9]$', $id)) goaway; but what about '?' and '#' additions? $id=however_they_would_find_out/your_path/file.php?extra=x#loc; ? so maybe if(ereg('\.php', $id)) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
So how to make sure that no one can access other people files and server files? and is there any way that nobody would be able to download php files or how to make them look like code when they are downloaded. Thanks! I think he means How do I keep people who have access to upload their OWN php scripts to my server from accessing files outside their directory? :) Check out the following: http://www.php.net/manual/en/features.safe-mode.php#ini.open-basedir http://www.php.net/manual/en/security.php http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Get previous folder
Anyone know how I can stip off the end of a folder location, so that it will be a folder in the next level up? I want to turn something like this: /path/to/folder/MyFolder/ into somthing like this: /path/to/folder/ I just need to strip off the last folder and that is it. Can anyone help me out? I appreciate it. Thanks. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mssql.dll
Where is mssql.dll (not include in packages 4.1.2 / 4.2.3 / 4.3.2 ? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URGENT, READ AND REPLY IF IT'S FINE BY YOU.
muwangatapio [EMAIL PROTECTED] . Firstly, I am Muwanga tapio, the first son and the Asst. chiarman of (muwanga's farms zimbabwe,)and my father Mr.Tapio Andrew one of the black farmers in Zimbabwe who was recently murdered in the land dispute in my country zimbabwe. I got your contact through your country's classified email address book hence decided to write you, Before the death of my father, he took me to Johannesburg to deposit the sum of USD,6 million (Six million United States dollars only), in one of the private security company, as he foresaw the looming danger in Zimbabwe, this money was deposited in a box as personal effect to avoid much demurrage from the security company. This amount was meant for the purchase of equipment for a Poultry farming project in Zimbabwe before the introduction of the new Land Reform Act by Mr. Robert Mugabe wholly affecting the rich white farmers and targeting some few black farmers (i.e.my father mr. Ayagobe Robert)who are in surpport of the white farmers, and this resulted to the killing and mobbing by Zimbabwean war veterans who took advantage of the situation. It is against this background that, my family and I fled Zimbabwe for South Africa for safety but i am currently in the united kingdom(England) where i am seeking political asylum and am also looking for a reliable foreign partner who can stand as the beneficiary to claim this fund on my family's behalf since the law of united kingdom prohibits a refugee (asylum seeker) to open a bank account or be involved in any financial transaction throughout the territorial zone of united kingdom. I am faced with the responsibility of seeking for a genuine foreign partner whom we can transfer the beneficiaryship to without the knowledge of my government whom are bent on taking everything we have got. also the South African government seems to be playing along with them, I am also faced with the dilemma of moving this fund out of South Africa for fear of going through the same experience in future because both countries have similar political history. As a man trying to start life all over again, I am seeking for a partner whom I can entrust my future and that of my family in his hands, If you accept to assist us all I want you to do is to make an arrangements with the security company to clear the consignment (funds) from their affiliate office here in the united kingdom because i have already given directives for the consignment to be taking to the Netherlands from South Africa. But before then all modalities will have to be put in place, like change of ownership to the consignment. I have mapped out 5% of this money for all kinds of expenses incured in the process of this transaction, 20% for your assistance while the remaining 75% will be for my family and it will also be investment in your country. If you are willing to assist, please send to me the following informations,. Your full name, address, Passport or Drivers license number, your personal phone and fax number and Date of birth to enable me change the beneficiaryship to your name.Contact me with the E-mail address while I implore you to maintain absolute confidentiality required in this transaction.i have no phone for now,but if you have one i can always try to call you privately. Yours faithfully, Muwanga Tapio. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get previous folder
On Thursday 10 July 2003 20:03, Matt Palermo wrote: Anyone know how I can stip off the end of a folder location, so that it will be a folder in the next level up? I want to turn something like this: /path/to/folder/MyFolder/ into somthing like this: /path/to/folder/ I just need to strip off the last folder and that is it. Can anyone help me out? I appreciate it. Thanks. explode(), array_pop(), implode() or strrpos(), substr() are just some of the ways this can be done. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* sic transit discus mundi (From the System Administrator's Guide, by Lars Wirzenius) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mcrypt warning
Hi, I use this to set iv to null so I don't need to worry about it :) $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv); Ahh ok, I'll give that a try and let you know how it comes out. Thanks! -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get previous folder
Hello, This is a reply to an e-mail that you wrote on Thu, 10 Jul 2003 at 13:04, lines prefixed by '' were originally written by you. Anyone know how I can stip off the end of a folder location, so that it will be a folder in the next level up? I want to turn something like this: /path/to/folder/MyFolder/ into somthing like this: /path/to/folder/ I just need to strip off the last folder and that is it. Can anyone help me out? I appreciate it. Thanks. Matt Try $folder = /path/to/folder/MyFolder/; $upOneLevel = dirname($folder); // $folder now contains /path/to/folder/ For more info look at: http://uk2.php.net/manual/en/function.dirname.php HTH David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] too stupid to install php on windows
Hi there! I had a perfectly working installation of apache 1.23 and php4.12 - unfortunatly i got heavy problems with the mail() function that didnt seem to like my subjects and froms. anyway - i just de-installed apache and php and reinstalled the most recent versions (apache 1.27 and php 4.32) - i followed the very same way like always while installing: but i fail. i can´t start apache with php, actually i do not get any meaningful errormessage (the only thing is NET HELPMSG 3534) Anybody an idea what could be wrong? Or how i can just test the php.ini configuration on windows with errormessage output? thanks in advance, - Johannes Mit freundlichen Grüssen |*| |*| [Johannes Reichardt] |*| |*| Webaddict +49172/3895500 |*| gramba.net:typorized.com |*| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] too stupid to install php on windows
At 14:47 10-7-03, you wrote: NET HELPMSG 3534 So i asked google and i found http://www.webdesignforums.net/thread4300.html and there the suggestion was made to put the path for the module between quotes. otherwise the space in for example /program files/ causes this error. example: change LoadModule php4_module C:/Program Files/PHP/sapi/php4apache.dll to LoadModule php4_module C:/Program Files/PHP/sapi/php4apache.dll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: too stupid to install php on windows
hi, Johannes Reichardt wrote: Hi there! I had a perfectly working installation of apache 1.23 and php4.12 - unfortunatly i got heavy problems with the mail() function that didnt seem to like my subjects and froms. anyway - i just de-installed apache and php and reinstalled the most recent versions (apache 1.27 and php 4.32) - i followed the very same way like always while installing: but i fail. i can´t start apache with php, actually i do not get any meaningful errormessage (the only thing is NET HELPMSG 3534) the only thing i found for this: Z:\net helpmsg 3534 Der Dienst hat keinen Fehler gemeldet. ERLÄUTERUNG Der Dienst hat keinen Fehler angezeigt. MASSNAHME Versuchen Sie es später erneut. Falls das Problem weiter besteht, wenden Sie sich an den Netzwerkadministrator. sorry, i got a german windows version. shouldn't be the problem for you (mit freundlichen grüßen) ;-) anyway, the input at the commandline should bring a result. but i think your service didn't start correctly, but also didn't return an error. does your apache start without php? just comment the lines in httpd.conf. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please assist - been on this for hours - Permissions on server
But _why_ do you need to write to the root directory? Why not just write to a directory where you *do* have permission to write to? I can already do that. My problem is that I need to move or copy/delete the file from the place I do have permission to write to to the root. I have generated a PHP page but it is no good where it is, I need to automatically move this page and because the owner of the page is HTTPD and NoGROUP it doesn't let me. I get permission errors. I have tried chmod() and chown() the files I've written also to no avail. I'd really appreciate help because I don't know much at all about permissions, changing them or how I can automatically do this. Below is the code I have worked out up to now to generate the page. It's the part after the string which I have now tried about 60 different ways to adjust! function generate_page($formid, $pagename) { // Give the function the string to be generated including formid passed from // previous form $string = ?php \$SECTION_NAME = \goldfish_cms.php\; // include the files from output fns to get functions which design the page include ('output_fns.php'); db_connect(); \$query = \select * from goldfish_content where PageID='$formid'\; \$result = mysql_query(\$query) or die(\Error: Query failure withBR\$queryBR\.mysql_error()); while (\$array = mysql_fetch_array(\$result)) { \$HeadTitle = \\{\$array[\HeadTitle\]}\; \$PageTitle = \\{\$array[\Title\]}\; \$BodyText = \\{\$array[\BodyText\]}\; \$Picture1 = \\{\$array[\PictureOne\]}\; \$Picture2 = \\{\$array[\PictureTwo\]}\; \$CatID = \\{\$array[\CatID\]}\; } // carry the variable head title in the page and do the page header do_html_header(\$HeadTitle); // carry variables into do_html_index() function in output_fns. // Page title = The headline of the page // Body text = The text body, can include html commands. // Picture 1 = picture or graphic that appears above the title if required. // Picture 2 = Picture that appears right hand side on the basic output_fns // CatID = Category which is used for determining which links appear on each page // Section name = Allows you to specify extra functions to output_fns.php to be unique to the page (requires hard coding) do_html_index(\$PageTitle, \$BodyText, \$Picture1, \$Picture2, \$CatID, \$SECTION_NAME); // put the page footer in position do_html_footer(); ?; // Define the filename to write to. $filename = 'test.txt'; // Open the file for overwriting. $fp = fopen($filename, w); // Write the string to the file $write = fputs($fp, $string); // Close the file fclose($fp); // copy the page as a php file $fp2 = fopen($filename, r); $root = /home/root/; copy($filename, $root); // rename the filename in the root directory to the pagename rename($filename, $pagename.php); fclose($fp2); // end of function. } // call the functions. generate_page($formid, $pagename); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function is_executable
Hey guys, I made a class to work with file upload. I used the php function is_executable. and in php 4.2.x it works ok, on linux and on windows. Last week I update my php to 4.3.x and this function stop work. In fact I got this error. undefinied function. Does anyone can help? thanks
[PHP] IMAP issues
I have just recently written a complete webmail software using PHP, and need to implement features that determin whether the email has been read or not. The function imap_setflag_full can set the flag, but i have no way of seeing which e-mails have what flags. imap_search allows you to search the email headers for strings, but i have no way of knowing which emails had what flags. Basically i need to: when loading client, check to see if an e-mail has been looked at if no, set it to unread if yes, leave it when you read a message, set it to read. If anyone can help me on this, i would most appreciate it. It has been killing me all day:( Thanks:)
[PHP] Re: Get previous folder
... and what about dirname()? Matt Palermo wrote: Anyone know how I can stip off the end of a folder location, so that it will be a folder in the next level up? I want to turn something like this: /path/to/folder/MyFolder/ into somthing like this: /path/to/folder/ I just need to strip off the last folder and that is it. Can anyone help me out? I appreciate it. Thanks. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CHECKING IF A SESSION IS ACTIVE OR NOT
HI, I'm storing the sessions ids in a database table. I want to run a script that reads from the table every session id and check if this session is active or not. I know that session information is stored in a directory (/tmp by default) and removed from there when the session is closed. But if the user close his browser without deconnecting from the session the session file is still in the /tmp directory. How can i know if a session is still active or not !! ??? I have searched the session functions and didn't find anything that could help Thx for any Help N. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CHECKING IF A SESSION IS ACTIVE OR NOT
You don't realy need it. Session garbage colector removes old session files for you. Nagib Abi Fadel wrote: HI, I'm storing the sessions ids in a database table. I want to run a script that reads from the table every session id and check if this session is active or not. I know that session information is stored in a directory (/tmp by default) and removed from there when the session is closed. But if the user close his browser without deconnecting from the session the session file is still in the /tmp directory. How can i know if a session is still active or not !! ??? I have searched the session functions and didn't find anything that could help Thx for any Help N. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isset function problem
I have the following code : Quote: if (isset($SenderEmailAddress)){ mail($mailTo, $mailSubject, $Message); } Unquote All I want to do is that , if the $SenderEmailAddress is not entered, the mail() function should not run. However, if the $senderEmailAddress variable is not set, the error I get is No recipient addresses found in header Can someone help and tell me why I get this error? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /etc/passwd
Hi, if the make script ? if($id) include($id); ? and then just write test.php?id=/etc/passwd , they see all the file. Well, FreeBSD provides a way to jail webservers: Jails 8-) http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/jail.html with best regards -- Andreas Mendyk [EMAIL PROTECTED] - mobile +49 172 7111512 Uhlandstr. 7 D-73271 Holzmaden http://www.mendyk.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset function problem
What about the rest of the code? How is this variable defined? I have had this happen in some code before, I found that the variable was set to . Try using: if (isset($SenderEmailAddress) $SenderEmailAddress != ) { mail($mailTo, $mailSubject, $Message); } I have the following code : Quote: if (isset($SenderEmailAddress)){ mail($mailTo, $mailSubject, $Message); } Unquote All I want to do is that , if the $SenderEmailAddress is not entered, the mail() function should not run. However, if the $senderEmailAddress variable is not set, the error I get is No recipient addresses found in header Can someone help and tell me why I get this error? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Thanks, Dean E. Weimer http://www.dwiemer.org/ [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Windows 2k, Apache, MySQL, PHP 4.3.2, Smarty
--- Michael Smith [EMAIL PROTECTED] wrote: Problem with Smarty. My application is giving me an error when i try to use smarty on a new WAMP install. Smarty is in my include path. Getting this error: *Fatal error*: Call to undefined function: () in *c:\htdocs\smarty\Smarty.class.php* on line *1658 *line 1658 is: $_source_return = $resource_func($resource_name, $template_source, $this); shouldn't that be $_source_return = resource_func($resource_name, $template_source, $this); I assume resource_func() is not a variable... I think it has something to do with PHP not liking the $resource_fun being submitted for the function name. It works fine on my updated LAMP environment any help woudl be much appreciated. -Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Regex nightmare:(
Tim Steele wrote: i need to uses reg ex to change a href=url to a href=url target=_blank the brackets have to be represented using lt; and gt; I have tried so many ways, but none work. here is an example of my faliure. $body = preg_replace(/(href=\/?)(\w+)(gt;\/?)/e,'\\1'.'\\2'./'target=_blank/ '.'\\3', $body); Thanks did i understand you correct? you search in real html-code (with '' and '') and want to replace them later by 'lt;' and 'gt;'? - if so, your regex can't find any gt;. either you search for an '' or you use htmlspecialchars() or htmlentities() to convert these brackets before. - also, if in your href= stands a full url (with scheme://domain.tld) your '\w' doesn't work - what are the optonal escaped slashes for? '\/?' hope this helps for your start: $body = 'a href=http://www.url;'; $body = preg_replace ('/()(a href=[^]+)()/', 'lt;\\2 target=_blankgt;', $body); var_export($body); ciao SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset function problem
... or: if(!empty($SenderEmailAddress)) { ... } Dean E. Weimer wrote: What about the rest of the code? How is this variable defined? I have had this happen in some code before, I found that the variable was set to . Try using: if (isset($SenderEmailAddress) $SenderEmailAddress != ) { mail($mailTo, $mailSubject, $Message); } I have the following code : Quote: if (isset($SenderEmailAddress)){ mail($mailTo, $mailSubject, $Message); } Unquote All I want to do is that , if the $SenderEmailAddress is not entered, the mail() function should not run. However, if the $senderEmailAddress variable is not set, the error I get is No recipient addresses found in header Can someone help and tell me why I get this error? Thanks Denis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie array question
Hi All Im new to php and are getting a bit confused about the sybase_fetch_array function (i think that this is the same as mysql_fetch_array?). If i have a valid sql query that returns three the records 'john','jack' and 'mary' and i want to put that into an array where array[0]-john,array[1]-jack etc how do i do this? Im trying to use sybase_fetch_array as follows: $query = select name from names (where age '23''); $numero= sybase_connect(database , user , password ) or die (Unable to connect to database server); $result=sybase_query($query,$numero ); $names=sybase_fetch_array($result); I then try and do something like print $names[0]; but it doesnt work. Sorry if this is really basic any help would be greatly appreciated! - Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger
Re: [PHP] newbie array question
Hello, This is a reply to an e-mail that you wrote on Thu, 10 Jul 2003 at 15:30, lines prefixed by '' were originally written by you. If i have a valid sql query that returns three the records 'john','jack' and 'mary' and i want to put that into an array where array[0]-john,array[1]-jack etc how do i do this? Im trying to use sybase_fetch_array as follows: $query = select name from names (where age '23''); $numero= sybase_connect(database , user , password ) or die (Unable to connect to database server); $result=sybase_query($query,$numero ); $names=sybase_fetch_array($result); sybase_fetch_array will fetch one row of the result, if you want all three rows in one array you will need something like this... $allnames = array(); while($thisname = sybase_fetch_row($result)){ $allnames[] = $thisname[0]; } I have never used the sybase db functions though so I may be incorrect. All the best, David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newbie array question
try this: $query = select name from names (where age '23''); $numero= sybase_connect(database , user , password ) or die (Unable to connect to database server); $result=sybase_query($query,$numero ); while($temp=sybase_fetch_array($result)){ $names[] = $temp[name]; } mfg. harry wiens Bob pilly [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi All Im new to php and are getting a bit confused about the sybase_fetch_array function (i think that this is the same as mysql_fetch_array?). If i have a valid sql query that returns three the records 'john','jack' and 'mary' and i want to put that into an array where array[0]-john,array[1]-jack etc how do i do this? Im trying to use sybase_fetch_array as follows: $query = select name from names (where age '23''); $numero= sybase_connect(database , user , password ) or die (Unable to connect to database server); $result=sybase_query($query,$numero ); $names=sybase_fetch_array($result); I then try and do something like print $names[0]; but it doesnt work. Sorry if this is really basic any help would be greatly appreciated! - Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please assist - been on this for hours - Permissions on server
On Thursday 10 July 2003 21:04, Steve Jackson wrote: But _why_ do you need to write to the root directory? Why not just write to a directory where you *do* have permission to write to? I can already do that. My problem is that I need to move or copy/delete the file from the place I do have permission to write to to the root. I have generated a PHP page but it is no good where it is, I need to automatically move this page and because the owner of the page is HTTPD and NoGROUP it doesn't let me. I get permission errors. I have tried chmod() and chown() the files I've written also to no avail. I'd really appreciate help because I don't know much at all about permissions, changing them or how I can automatically do this. The root of the problem (pun intended) is that you're trying to write to the root (/) directory which is usually only possible if you're the root user. Again, the question is _why_ do you need to write to the root directory? Wouldn't your file function if it wasn't in the root directory? Without the system admin giving the required permissions what you're trying to do ought to be impossible (well, you might be able to find an exploit on the system that you can exploit). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Horngren's Observation: Among economists, the real world is often a special case. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] isset function problem
On Thursday 10 July 2003 21:53, Denis L. Menezes wrote: I have the following code : Quote: if (isset($SenderEmailAddress)){ mail($mailTo, $mailSubject, $Message); } Unquote All I want to do is that , if the $SenderEmailAddress is not entered, the mail() function should not run. However, if the $senderEmailAddress variable is not set, the error I get is No recipient addresses found in header Can someone help and tell me why I get this error? Use if (!empty(...)) instead. Depending on how you're getting your variable it may be set but empty. And where are you getting $mailTo? Isn't that supposed to contain the recipients? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Humor in the Court: Q: ...and what did he do then? A: He came home, and next morning he was dead. Q: So when he woke up the next morning he was dead? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mail() - how to attach file to the message???
You had an input tag in your email, so I assumed you were trying to upload the file. If the file is not already on the server, you *will* have to upload it before emailing it. But that's a whole other matter. If you look at the classes and see how they attach a file, you should be able to figure it out. Basically, you need to set the correct headers (content-type) and attach an encoded version of the file in the body of the email. An easy way to see what you need it to send yourself an email with an attachment and look at the raw source of the email you receive. It should look a bit like this (with a whole lot more headers in it): From: Mark [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: FW: test Content-Type: multipart/mixed; boundary=_=_NextPart_000_01C346F1.7A8C7496 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --_=_NextPart_000_01C346F1.7A8C7496 Content-Type: multipart/alternative; boundary=_=_NextPart_001_01C346F1.7A8C7496 --_=_NextPart_001_01C346F1.7A8C7496 Content-Type: text/plain; charset=iso-8859-1 This is the body of the email test.jpg --_=_NextPart_000_01C346F1.7A8C7496 Content-Type: image/jpeg; name=test.jpg Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=test.jpg /9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHR HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMj MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAJaAb AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAw AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKS ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmq . . . --_=_NextPart_000_01C346F1.7A8C7496-- --- szparag [EMAIL PROTECTED] wrote: no. i`m not trying to upload file on server. i want to send e-mail with attachments but if it's possible without using classes. i thought that file should be first uploaded and then send with e-mail as attachment, maybe uploading isn't correct... i don't know how to do it. szparag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with php-4.3.2 and gblib 2 on apache server
Yes, that was the problem. I found out earlier today. Thanks. - Original Message - From: Jason Wong [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Thursday, July 10, 2003 8:31 AM Subject: Re: [PHP] problem with php-4.3.2 and gblib 2 on apache server On Thursday 10 July 2003 09:41, Tim Grote wrote: I updated my linux apache server to php-4.3.2. It works fine but the promised 'embedded' gdlib 2 doesnt seem to work. gd_info always ends in 'call to undefined function'. Can anybody tell me what's wrong or how to get gdlib 2 working? Was php compiled with gd support? manual Image functions for info. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Lewis's Law of Travel: The first piece of luggage out of the chute doesn't belong to anyone, ever. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrading 4.2.2 to 4.3.2
Live server was previously a 4.0.4 install that we upgraded to 4.2.2 Am getting ready to upgrade it again to 4.3.2 and wish to verify some things. 1) any caveats to be aware of? 2) it appears from reading INSTALL that a seperate build isn't required if we want to run both dynamic and static, just run the dynamic install? 3) if the above (dynamic) is correct, will using an existing config.nice still work for the upgrade considering the config.nice is from 4.0.4 and freebsd has been patched and upgraded since then as well. file contained below config.nice file #! /bin/sh # # Created by configure ./configure \ --with-apxs=/usr/local/sbin/apxs \ --with-config-file-path=/usr/local/etc \ --enable-versioning \ --with-system-regex \ --disable-debug \ --enable-track-vars \ --without-gd \ --disable-pear \ --without-mysql \ --with-gd=/usr/local \ --with-ttf=/usr/local \ --with-zlib \ --with-mcrypt=/usr/local \ --with-mhash=/usr/local \ --with-imap=/usr/local \ --with-mysql=/usr/local \ --with-pgsql=/usr/local/pgsql \ --with-dbase \ --with-ldap=/usr/local \ --with-openssl=/usr \ --with-snmp=/usr/local \ --enable-ucd-snmp-hack \ --with-xml=/usr/local \ --enable-ftp \ --with-curl=/usr/local \ --with-gettext=/usr/local \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --enable-trans-sid \ --prefix=/usr/local \ i386--freebsd4.3 \ $@ /config.nice file Comments and feedback appreciated. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL select
Jiøí Nìmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev id 1 f bla1 1 2 f bla2 1 3 f bla5 1 4 i bla6 1 so, when doesn'i exist component (id_k = component) type f so I want component with type i, but when doesn't exist type f noir i I don't want to select row with type z. I don't think you can do what you want in a simple SQL statement. You seem to want to return rows based on what is in other rows of the same table. There may be ways to join the table to itself, but I'm not aware of a straightforward way to do this only in SQL. In PHP, it's probably not too tough. Just to be sure we all understand, I assume you want the following: -At most, one row for each id_k -If there is a row with an 'f' in the type column, return that row. -If there is no record with an 'f' in the type column for that id_k, and there is a record with an 'i', return that row. -If there is no record with an 'f', nor a record with an 'i' in the type column, do not return a row. Is that right? jiri nemec, ICQ: 114651500 www.menea.cz - www stránky a aplikace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
Can anyone help me with this code I just get someting about $end help me fix it Thanks Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73 title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($instal==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action == check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else if ($csiteex $user $pass) { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } ?
RE: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
You're missing at least one closing brace (}) -- the one that belongs with the else if ($login==check) { ten or so lines up from the bottom. --- Mark Roedel | Blessed is he who has learned to laugh Systems Programmer| at himself, for he shall never cease LeTourneau University | to be entertained. Longview, Texas, USA | -- John Powell -Original Message- From: Mark Clarkstone [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 10:38 AM To: [EMAIL PROTECTED] Subject: [PHP] HELP can someone tell me whats wrong here? (newbie) Can anyone help me with this code I just get someting about $end help me fix it Thanks Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73 title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($instal==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action == check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else if ($csiteex $user $pass) { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL select
Hmm. How about: SELECT DISTINCT id_k, name FROM tablename WHERE typ != 'z' ORDER BY typ ASC; Does that work? On Thu, 2003-07-10 at 11:29, Mark wrote: Ji Nmec wrote: hello, i have got a problem with SQL select: I have got a table such this: id_k typ name id 1 f bla1 1 2 f bla2 1 2 i bla3 1 3 z bla4 1 3 f bla5 1 4 i bla6 1 4 z bla7 1 5 z bla8 1 and id = 1 and I need select these rows: id_k typ nazev id 1 f bla1 1 2 f bla2 1 3 f bla5 1 4 i bla6 1 so, when doesn'i exist component (id_k = component) type f so I want component with type i, but when doesn't exist type f noir i I don't want to select row with type z. I don't think you can do what you want in a simple SQL statement. You seem to want to return rows based on what is in other rows of the same table. There may be ways to join the table to itself, but I'm not aware of a straightforward way to do this only in SQL. In PHP, it's probably not too tough. Just to be sure we all understand, I assume you want the following: -At most, one row for each id_k -If there is a row with an 'f' in the type column, return that row. -If there is no record with an 'f' in the type column for that id_k, and there is a record with an 'i', return that row. -If there is no record with an 'f', nor a record with an 'i' in the type column, do not return a row. Is that right? jiri nemec, ICQ: 114651500 www.menea.cz - www strnky a aplikace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CHECKING IF A SESSION IS ACTIVE OR NOT
There is no reliable way for the server (Apache, PHP, etc) to know when a user closes a session by closing his browser window. That's one reason why session-management sytems always employ a timeout on sessions. I don't know what the default timeout is for the PHP session-management system, but I believe you can set it. But that raises the question: If you are already storing session IDs in a database table, why don't you do your own session managment instead of using the PHP system? --John On Thursday 10 July 2003 09:42 am, Nagib Abi Fadel wrote: HI, I'm storing the sessions ids in a database table. I want to run a script that reads from the table every session id and check if this session is active or not. I know that session information is stored in a directory (/tmp by default) and removed from there when the session is closed. But if the user close his browser without deconnecting from the session the session file is still in the /tmp directory. How can i know if a session is still active or not !! ??? I have searched the session functions and didn't find anything that could help Thx for any Help N. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wronghere? (newbie)
Well for one thing, you've misspelled one of your variables... the if ($instal==0) should be, if I'm not incorrect, if ($install==0) Mark Clarkstone wrote: Can anyone help me with this code I just get someting about $end help me fix it Thanks Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73 title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($instal==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action == check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else if ($csiteex $user $pass) { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Object assignment
The array structure is the one suggested on the xml_parse_into_struct page user comments. Our example XML would parse into this: Array ( [ROOTELEMENT] = Array ( [0] = Array ( [ATTRIBUTES] = Array ( [ID] = 1 ) [RECORD] = Array ( [0] = Array ( [ATTRIBUTES] = Array ( [ID] = 1 ) [VALUE] = Value 1 ) [1] = Array ( [ATTRIBUTES] = Array ( [ID] = 2 ) [VALUE] = Value 2 ) ) ) ) ) And my source is here: http://www.healthtvchannel.org/test/php2xml.phps -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Thursday, July 10, 2003, 6:44:55 AM, you wrote: MG Tom: MG Thanks for the help. Using the array setup you described, I end up with the MG value of each record node being appended to a single instance of the MG parent node. And that single instance of the parent node is the final one MG that was parsed (the attributes verify this). The example I used below is MG outputting this: MG rootElement MG record id=2Value 1Value 2/record MG /rootElement MG Any ideas? Can you send me the bit of code or the array you are using so I can see better what you are doing :) Maybe I miss understood something -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Object assignment
Interesting -- the clone_node() function does make certain that each element gets its own representation in the output, for any XML I tested. I guess then my problem lies with how I'm looping through the aforementioned array structure to get the values themselves. Thanks, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Thursday, July 10, 2003, 6:44:55 AM, you wrote: MG Tom: MG Thanks for the help. Using the array setup you described, I end up with the MG value of each record node being appended to a single instance of the MG parent node. And that single instance of the parent node is the final one MG that was parsed (the attributes verify this). The example I used below is MG outputting this: MG rootElement MG record id=2Value 1Value 2/record MG /rootElement MG Any ideas? It seems we now have to clone nodes before using them. (php-4.3 +) I did this as a test: $test =array( 1=array('type'='record','value'='Value 1','id'=1), 2=array('type'='record','value'='Value 2','id'=2)); $elements = array(); $doc = domxml_new_doc(1.0); //create a dummy document ob_start(); echo END rootelement /rootelement END; $buffer = ob_get_contents(); ob_end_clean(); $doc = domxml_open_mem($buffer); //get the root element $ancestor = $doc-document_element(); //loop foreach($test as $val){ $key = $val['type']; $value = $val['value']; $id = $val['id']; if(!isset($elements[$key])){ $elements[$key] = $doc-create_element($key); } $thisChild = $ancestor-append_child($elements[$key]-clone_node());//clone $thisChild-set_attribute('id',$id); $txt = $doc-create_text_node($value); $thisChild-append_child($txt); } //end loop echo 'pre'; echo htmlentities($doc-dump_mem(true)); echo '/pre'; Gave me ?xml version=1.0? rootelement record id=1Value 1/recordrecord id=2Value 2/record/rootelement -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
OMG Your Right no wonder it didn't work lol Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well for one thing, you've misspelled one of your variables... the if ($instal==0) should be, if I'm not incorrect, if ($install==0) Mark Clarkstone wrote: Can anyone help me with this code I just get someting about $end help me fix it Thanks Parse error: parse error, unexpected $end in C:/apache/htdocs/test.php on line 73 title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($instal==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action == check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else if ($csiteex $user $pass) { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Continuing with HELP can someone tell me whats wrong here? (newbie)
now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
Where are you passing the variable install? I can't see it in your form. Perhaps look for $check instead of $install? Mark Clarkstone wrote: now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
else if ($userlogin $userpass == $admin $adpw) { this line probably isn't going to do what your thinking it will. you probably want either else if ($userlogin == $admin $userpass == $adpw) { or else if (strcasecmp($userlogin,$admin) == 0 strcasecmp($userpass,$adpw) == 0) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
Its in cpconf.php ? $l33t = C:/miniserve/Apache/conf/l33t.conf; $syspath = C:; $install = 0; $siteex = MySite.Org; $admin = mini; $adpw = serve; ? Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Where are you passing the variable install? I can't see it in your form. Perhaps look for $check instead of $install? Mark Clarkstone wrote: now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
Well you realize don't you that unless, on submit, install changes to 1, whenever you submit your form it's going to go right back to the initial page. Mark Clarkstone wrote: Its in cpconf.php ? $l33t = C:/miniserve/Apache/conf/l33t.conf; $syspath = C:; $install = 0; $siteex = MySite.Org; $admin = mini; $adpw = serve; ? Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Where are you passing the variable install? I can't see it in your form. Perhaps look for $check instead of $install? Mark Clarkstone wrote: now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using PPP with PHP
Good afternoon gurus and gurettes! Has any of you had any experience using PPP (Point-to-Point Protocol) with PHP? I need to work with it to establish a connection to a remote server on a remote network and was hoping that I could use PHP. Currently I can manually establish I dial-up using PPP over a modem. I would like to automate the process as much as possible. Any help would be grandly appreciated. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PPP with PHP
Umm, use exec() to call the dialing program? On Thu, 2003-07-10 at 13:22, Jay Blanchard wrote: Good afternoon gurus and gurettes! Has any of you had any experience using PPP (Point-to-Point Protocol) with PHP? I need to work with it to establish a connection to a remote server on a remote network and was hoping that I could use PHP. Currently I can manually establish I dial-up using PPP over a modem. I would like to automate the process as much as possible. Any help would be grandly appreciated. Jay -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP hosting with remote MySQL access allowed
I am in the process of developing a client side application that needs to speak to our remote databases. Does anybody know of a hosting solution that would allow me to have remote access to a MySQL database? I done some googling and found a quite a few hosting companies, but none of them that I have check have the information posted on their websites, so I had to submit an email question to them. Thanks Josh Minnie [EMAIL PROTECTED] There are 3 kinds of people in the worlds; those who can count and those who can't. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using PPP with PHP
[snip] Umm, use exec() to call the dialing program? [/snip] That works on the surface, but the PPP program returns some vital information about its connection status that is required for use by any subsequent file operations. The information is returned via STDOUT. Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] download php
You should also store passwords in a non-readable to the world directory. -Dan - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Mantas Kriauciunas [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, July 10, 2003 5:01 AM Subject: Re: [PHP] download php Do you use secure connection? Well, you should. Mantas Kriauciunas wrote: Hello php-general, some hacker just tries his luck everyday to get me pissed, is it possible to make php files not downloadable? or coded? or something? because some dude knows my passwords every time, and with them passes the shity security to main user, thank god not root. So is there any way? if anyone knows any links or resources, please reply, i'll check them, i need to put this to end P.S system is freebsd. Thank you!!! there are even more and more kids that want to be named haker, lookin at their age, could be even my son:) -- 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] Using PPP with PHP
[snip] Umm, use exec() to call the dialing program? [/snip] That works on the surface, but the PPP program returns some vital information about its connection status that is required for use by any subsequent file operations. The information is returned via STDOUT. so try system() instead. Or one of the other methods referenced in http://php.net/manual/en/function.exec.php - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running PHP4 and PHP5 together
Is there anyway I can use PHP4 and PHP5 (as modules, not cgi) together in Apache2 (Linux)? I've tried the --enable-versioning configure option with php, but I'm not quite sure what that does. I need PHP4 because Gallery apparently won't work with PHP5. If it's possible to load either php4 or php5 modules per virtualhost, that would be an acceptible alternative, too, but that didn't seem to work when I tried it. Thanks -Adam
Re: [PHP] mssql.dll
On Thursday, July 10, 2003, 3:03:43 PM, Alain wrote: AR Where is mssql.dll (not include in packages 4.1.2 / 4.2.3 / 4.3.2 ? Don't send your messages high priority. Its considered rude and bad list manners. mssql.dll comes with the MSSQL product. Its not part of the package. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Using PPP with PHP
On Thursday, July 10, 2003, 8:41:03 PM, Jay wrote: JB [snip] JB Umm, use exec() to call the dialing program? JB [/snip] JB That works on the surface, but the PPP program returns some vital JB information about its connection status that is required for use by any JB subsequent file operations. The information is returned via STDOUT. How about piping the output to a file and then checking that file with PHP? -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regexp problem
First, I need the code to replace the link in a string, like BASE HREF=www.google.com with BASE HREF=mystring ereg_replace('BASE HREF=\'(.*)'\', 'BASE HREF=\$my_string\', $old); That was the closest i got, but (.*) makes it take the first BASE HREF, and the last , which sucks. Can anyone help? Second, I hate asking for help on Regexps...I would like a tutorial online that steps me through one method of them at a time, and then lets me move on...kindof like math. You have to know the basics befor you can get advanced. Any help there either? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
Please use more intelligent and descriptive subjects for your posts. This HELP!!! nonsense is stupid. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
yes Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well you realize don't you that unless, on submit, install changes to 1, whenever you submit your form it's going to go right back to the initial page. Mark Clarkstone wrote: Its in cpconf.php ? $l33t = C:/miniserve/Apache/conf/l33t.conf; $syspath = C:; $install = 0; $siteex = MySite.Org; $admin = mini; $adpw = serve; ? Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Where are you passing the variable install? I can't see it in your form. Perhaps look for $check instead of $install? Mark Clarkstone wrote: now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Excel Parser
Hi all, Does anyone know of any free Excel parsing non-COM code available on the net? Just straight php driven? I've found a couple commercial solutions but would like to try this myself or save money. Thanks for any help. Johnny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Object assignment
Well I've made a signifigant improvement to this function, and it's now the parsing operation is only something like 26 lines. It works flawlessly (so far) for XML that does not have repeat element names on the same level. Which seems to be bad form anyway, using similar element names and distinguishing them with attributes. I'd still like the code to work with XML that did have similarly named elements in the same node level.. can you see anything in my DOMXML calls that might indicate the problem? Source: http://www.healthtvchannel.org/test/php2xml.phps -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Thursday, July 10, 2003, 6:44:55 AM, you wrote: MG Tom: MG Thanks for the help. Using the array setup you described, I end up with the MG value of each record node being appended to a single instance of the MG parent node. And that single instance of the parent node is the final one MG that was parsed (the attributes verify this). The example I used below is MG outputting this: MG rootElement MG record id=2Value 1Value 2/record MG /rootElement MG Any ideas? It seems we now have to clone nodes before using them. (php-4.3 +) I did this as a test: $test =array( 1=array('type'='record','value'='Value 1','id'=1), 2=array('type'='record','value'='Value 2','id'=2)); $elements = array(); $doc = domxml_new_doc(1.0); //create a dummy document ob_start(); echo END rootelement /rootelement END; $buffer = ob_get_contents(); ob_end_clean(); $doc = domxml_open_mem($buffer); //get the root element $ancestor = $doc-document_element(); //loop foreach($test as $val){ $key = $val['type']; $value = $val['value']; $id = $val['id']; if(!isset($elements[$key])){ $elements[$key] = $doc-create_element($key); } $thisChild = $ancestor-append_child($elements[$key]-clone_node());//clone $thisChild-set_attribute('id',$id); $txt = $doc-create_text_node($value); $thisChild-append_child($txt); } //end loop echo 'pre'; echo htmlentities($doc-dump_mem(true)); echo '/pre'; Gave me ?xml version=1.0? rootelement record id=1Value 1/recordrecord id=2Value 2/record/rootelement -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP can someone tell me whats wrong here? (newbie)
Oh well I am sorry your royal majesty - Original Message - From: Burhan Khalid [EMAIL PROTECTED] To: Mark Clarkstone [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, July 10, 2003 7:26 PM Subject: Re: [PHP] HELP can someone tell me whats wrong here? (newbie) Please use more intelligent and descriptive subjects for your posts. This HELP!!! nonsense is stupid. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Continuing with HELP can someone tell me whats wrong here? (newbie)
Mark Clarkstone wrote: yes Well since that's what you said happens, isn't that where you should look for the problem? My guess is that install isn't changing to 1. I would change your line to: if ( ($install == 0) (!$check) ) { instead of just: if ($install==0) { Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well you realize don't you that unless, on submit, install changes to 1, whenever you submit your form it's going to go right back to the initial page. Mark Clarkstone wrote: Its in cpconf.php ? $l33t = C:/miniserve/Apache/conf/l33t.conf; $syspath = C:; $install = 0; $siteex = MySite.Org; $admin = mini; $adpw = serve; ? Shena Delian O'Brien [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Where are you passing the variable install? I can't see it in your form. Perhaps look for $check instead of $install? Mark Clarkstone wrote: now the script works but won't write to the file just returns to the form. title Control Panel/title font face=\Tahoma\ size=\2\ ? require(cpconf.php); if ($install==0) { print pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel Installerbr br /bThis will install the control Panel/font/p form method=\POST\ action=\?action=check\ font face=\Tahoma\ size=\2\Please enter your site domain e.g. freesite.cjb.com (without a www or a dot please) leave as localhost if you are using it as a local testing server./fontbr input type=\text\ name=\csiteex\ size=\20\ value=\localhost\br br font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\user\ size=\20\br Passwordbr input type=\text\ name=\pass\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($action==check) { if (!$csiteex) { echo Please enter your domain; } else if (!$user) { echo Please enter a username; } else if (!$pass) { echo Please enter a password; } else { $data = ? \$l33t = \C:/miniserve/Apache/conf/l33t.conf\; \$syspath = \C:\; \$install = \1\; \$siteex = \$csiteex\; \$admin = \$user\; \$adpw = \$pass\; ?; $fp = fopen(cpconf.php,'w'); $fw = fwrite($fp,$data); fclose($fp); echo Done!; } } else if ($install ==1) { echo pfont size=\2\ face=\Tahoma\bWelcome to The Control Panel/b/font/p form method=\POST\ action=\?login=check\ font size=\2\ face=\Tahoma\Please enter a Username amp; password to access the areabr Usernamebr input type=\text\ name=\userlogin\ size=\20\br Passwordbr input type=\text\ name=\passlogin\ size=\20\/fontbr input type=\submit\ value=\Submit\ name=\B1\/p /form; } else if ($login==check) { if (!$userlogin !$passlogin) { echo Sorry but No Username or password was found; } else if ($userlogin $userpass == $admin $adpw) { include(admin.php); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Excel Parser
snip Does anyone know of any free Excel parsing non-COM code available on the net? Just straight php driven? /snip I have not tried any of these but there might be something in here you can use. http://www.phpclasses.org/search.html?words=Excelgo_search=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Excel Parser
There is a PEAR package called Spreadsheet_Excel_Writer, that is non-COM. It works great, only one problem. The max string length is 255 characters. For it you are not export any fields greater then 255 it works great. There is also an other excel class on www.phpclasses.org. Called php2excel I think, that works too. The PEAR one does formulas too. Mark. Johnny Martinez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Does anyone know of any free Excel parsing non-COM code available on the net? Just straight php driven? I've found a couple commercial solutions but would like to try this myself or save money. Thanks for any help. Johnny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Excel Parser
I've got a user that gets an Excel spreadsheet generated by a web app and I want to be able to import the data from the xls into our local database then work with it. -Original Message- From: Mark McCulligh [mailto:[EMAIL PROTECTED] Sent: Thursday, July 10, 2003 11:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Excel Parser There is a PEAR package called Spreadsheet_Excel_Writer, that is non-COM. It works great, only one problem. The max string length is 255 characters. For it you are not export any fields greater then 255 it works great. There is also an other excel class on www.phpclasses.org. Called php2excel I think, that works too. The PEAR one does formulas too. Mark. Johnny Martinez [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Does anyone know of any free Excel parsing non-COM code available on the net? Just straight php driven? I've found a couple commercial solutions but would like to try this myself or save money. Thanks for any help. Johnny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What's this talk about ASP to PHP?
I've read somewhere about some asptophp convertor/tool/methodology...?? Don't know what it is, that's why I'm asking. I've been asked to help out on a project which might include some already developed basic ASP code. I would rather do it in PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OnClick problem
Here's something I cant explain: I have a page with a form on it (checkboxes) and a hyperlink which is supposed to send the form to the server using: a href=# onClick=document.del.submit(); Trouble is that the link always points to the name of the previous page I came from. All pages are php generated on-the-fly. Is this a php problem? Anyone has a clue? I really don't want to use a submit button in this case. Regards, Andu Novac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OnClick problem
Hi, Here's something I cant explain: I have a page with a form on it (checkboxes) and a hyperlink which is supposed to send the form to the server using: a href=# onClick=document.del.submit(); Trouble is that the link always points to the name of the previous page I came from. All pages are php generated on-the-fly. Is this a php problem? Anyone has a clue? I really don't want to use a submit button in this case. Are you using the variable $_SERVER['PHP_SELF'] for your link target? -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What's this talk about ASP to PHP?
On 10 Jul 2003, Jonathan Villa wrote: I've read somewhere about some asptophp convertor/tool/methodology...?? Don't know what it is, that's why I'm asking. I've been asked to help out on a project which might include some already developed basic ASP code. I would rather do it in PHP. 2. Is there an ASP to PHP converter? http://www.php.net/manual/en/faq.languages.php Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php