[PHP] Apple Mac Power PC problem
Hi all, I noticed on a clients Apple Mac Power PC that his php driven website wasn't working for him. It wasn't loading up at all, in fact it was returning an error that the URL could not be found. I discovered a quick fix for the problem, that is to create a index.html file and run a meta refresh to index.php, this seems to work. Something in the headers php sends seems to screw up Power PC's resolving method. The headers I send are: header('P3P: CP=NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'); header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Cache-control: private); header(Pragma: no-cache); and what's being received is: HTTP/1.1·200·OK Date:·Thu,·01·Apr·2004·08:46:00·GMT Server:·Apache/1.3.27·(Unix)··(Red-Hat/Linux)·mod_jk/1.2.0·mod_perl/1.26·PHP /4.3.3·FrontPage/5.0.2·mod_ssl/2.8.12·OpenSSL/0.9.6bX-Powered-By:·PHP/4.3.3 Set-Cookie:·PHPSESSID=8ebf6b7d4895473a054bb8f50b2a66dd;·path=/ Expires:·Mon,·26·Jul·1997·05:00:00·GMT Cache-Control:·private Pragma:·no-cache P3P:·CP=NOI·ADM·DEV·PSAi·COM·NAV·OUR·OTRo·STP·IND·DEM Last-Modified:·Thu,·01·Apr·2004·08:46:00·GMT Connection:·close Content-Type:·text/html Is there anything in these headers that could cause Power PC's to fail resolution? Thank. Marc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Include Errors
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I recently upgraded from 4.3.4 to 4.3.5 and now I get some errors. When I try to include a URL that is not abosulte, for example http://somewebsite.com I get the following chunk of errors: Warning: main(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /path/to/index.php on line 386 Warning: main(http://some.url/gallery/block-random.php): failed to open stream: Resource temporarily unavailable in /path/to/index.php on line 386 Warning: main(): Failed opening 'http://some.url/gallery/block-random.php' for inclusion (include_path='.:/path/to/php/lib/php') in /path/to/index.php on line 386 Any ideas or suggetsions are greatly welcome. Thanks. - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBQGvUKbrnDjSLw9ADEQLbEQCfRd1fjICqnS3Fotu4X3Pf08QvbOMAnim1 fCN+YXqDK6oQ/un4H68fv07K =Fh9f -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] april mop in phpinfo()
Hello php-general, Happy april mop ... look at your phpinfo() :) whose picture is it ? -- Best regards, adwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Configuration Variable user_agent
Hallo ! I run PHP 4.1.2. I want to set the user_agent which gets sent along when fetching file via the fopen(...) call. Normally this is PHP/VERISON in my case PHP/4.1.2 I want to set a different user_agent. I tried to set the variable user_agent in the php.ini file. But the variable doesn't show up when I view a phpinfo(...) page. I also tried to set user_agent using the function ini_set(varname, value) during runtime but this didn't work either Was this directive removed ? I didn't find anything in the archives. Any suggestions ? greets, Bernhard -- - Bernhard Kraft [EMAIL PROTECTED] MOKKA MEDIENAGENTUR GMBH Mariahilferstrasse 170 1150 Wien T: 01 895 33 33 50 M: 0676 560 14 14 F: 01 895 33 33 20 www.mokka.at - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compiling new modules in PHP - required to remove old installation?
I currently follow the following steps when I need to compile a new module in PHP: 1) Delete old source folders for APACHE and PHP (/usr/local/src) 2) Stop APACHE service 3) Delete the installation directories (/usr/local/apache /usr/local/php4) 4) Re-configure APACHE 5) Re-configure PHP; make; make install 6) APACHE make and make install 7) Copy the original httpd.conf file to the installation directory (/usr/local/apache/conf/) 8) Start apache Then all works fine. If I leave out any of the above steps, the re-compilation doesnt work. Is there an easier way or do I need to do this each time? (process takes about 30mins each time) Running RH9 Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Domain Name ?
Hi List, I asked this a while back but have lost the replies :-( $domain = http://www.foo.com;; I want to strip our every thing and be left with only foo to use in my function. I think its multiple str_replace but have forgotten how to do it. Thank you in advance for any help Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.645 / Virus Database: 413 - Release Date: 28/03/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Domain Name ?
The easy way... $domain = http://www.foo.com;; $domain = explode('.', $domain); $foo = $domain['1']; -Original Message- From: Dave Carrera [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 1:30 AM To: [EMAIL PROTECTED] Subject: [PHP] Domain Name ? Hi List, I asked this a while back but have lost the replies :-( $domain = http://www.foo.com;; I want to strip our every thing and be left with only foo to use in my function. I think its multiple str_replace but have forgotten how to do it. Thank you in advance for any help Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.645 / Virus Database: 413 - Release Date: 28/03/2004 -- 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] Domain Name ?
On Thursday 01 April 2004 17:29, Dave Carrera wrote: I asked this a while back but have lost the replies :-( archives? -- 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 -- /* Bradley's Bromide: If computers get too powerful, we can organize them into a committee -- that will do them in. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compiling new modules in PHP - required to remove old installation?
On Thursday 01 April 2004 17:19, Terence wrote: I currently follow the following steps when I need to compile a new module in PHP: [snip] Then all works fine. If I leave out any of the above steps, the re-compilation doesnt work. Is there an easier way or do I need to do this each time? (process takes about 30mins each time) 1) Remove old php source directory 2) Extract a new one 3) ./configure ... 4) make 5) Stop apache 6) make install 7) Start apache -- 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 wish a robot would get elected president. That way, when he came to town, we could all take a shot at him and not feel too bad. -- Jack Handley */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Flash MX
Hello PHPeople, I have to send data to flash. Should i use the urlencode() or the rawurlencode() function to encode the data? Thx, Nadim Attari -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Flash MX
I do allot of php to flash communication in my work and I have found that wddx is by far the easiest and best way to transfer large and small amounts of both simple and complex data Dave -Original Message- From: Nadim Attari [mailto:[EMAIL PROTECTED] Sent: 01 April 2004 12:08 PM To: [EMAIL PROTECTED] Subject: [PHP] Flash MX Hello PHPeople, I have to send data to flash. Should i use the urlencode() or the rawurlencode() function to encode the data? Thx, Nadim Attari -- 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] 'Content-Type: text/plain; charset=utf-8'
?php header ('Content-Type: text/plain; charset=utf-8'); echo Hi there; ? I need to echo a plain txt on my page, without any HTML tags. my problem, when I run it on my apache, the save/open screen pops up. What's wrong please help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML Parsing
Hi Folks, I've got an XML output from a website (http://tawl.holiday.co.uk/EntryPoints/TopXasXML.aspx?WebsiteGUID=E325538D-5 B1E-4EC6-B888-35EB46418DB9) and want to display it's output on one of my pages I've looked at using the PHP XML Parse functions, however, I'm not certain how to get it working Do I need something like PEAR? Or is it easier? Can someone give me a pointer please? Cheers Nunners -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and HTTPS POSTs
Well, I remember I did a project for a company and in my development machine I didn't configured HTTPS but the production environtment use HTTPS... I never heard anything wrong about it and the application had some huge forms. By then I was using PHP 4.0.6 and then PHP 4.1.X. Try this: Send an HTTP POST request to the server and in the PHP code put this: print pre_REQUEST:\n; print_r($_REQUEST); print _POST:\n; print_r($_POST); print /pre; If you use a web form with the POST method both arrays should be the same. BTW, what version of web server and PHP are you using?? -William El mi? 31-03-2004 a las 23:14, Chris Streeter escribió: Has anyone had any problems with the $_POST super global not working in a HTTPS environment? My code works perfectly fine through a unsecured HTTP POST but when I do an HTTPS POST it only handles a few variable (I think 15 or 16). Any more than that and it looses all the $_POSTed variables. Has anyone seen this and more importantly know the fix for the problem? Thank you. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] XML Parsing
I found the XML_Tree class really easy to use, highly recommend it. -Original Message- From: Nunners [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 10:40 PM To: [EMAIL PROTECTED] Subject: [PHP] XML Parsing Hi Folks, I've got an XML output from a website (http://tawl.holiday.co.uk/EntryPoints/TopXasXML.aspx?WebsiteGUID= E325538D-5 B1E-4EC6-B888-35EB46418DB9) and want to display it's output on one of my pages I've looked at using the PHP XML Parse functions, however, I'm not certain how to get it working Do I need something like PEAR? Or is it easier? Can someone give me a pointer please? Cheers Nunners -- 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] XML Parsing
Is there a way of doing this without installing PEAR? I.e. a decent PHP Class? -Original Message- From: electroteque [mailto:[EMAIL PROTECTED] Sent: 01 April 2004 13:52 To: Nunners; [EMAIL PROTECTED] Subject: RE: [PHP] XML Parsing I found the XML_Tree class really easy to use, highly recommend it. -Original Message- From: Nunners [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 10:40 PM To: [EMAIL PROTECTED] Subject: [PHP] XML Parsing Hi Folks, I've got an XML output from a website (http://tawl.holiday.co.uk/EntryPoints/TopXasXML.aspx?WebsiteGUID= E325538D-5 B1E-4EC6-B888-35EB46418DB9) and want to display it's output on one of my pages I've looked at using the PHP XML Parse functions, however, I'm not certain how to get it working Do I need something like PEAR? Or is it easier? Can someone give me a pointer please? Cheers Nunners -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I think this is a bug...cant use exec commands.
May be you can look at exec() function: http://www.php.net/manual/en/function.exec.php I know this doesn't solve the problem but gives you an option to workaround the problem. The curious thing about the warning message is: where are the backquotes in your code?? -William El jue, 01-04-2004 a las 01:54, Brian Duke escribió: I can't seem to use the shell_exec() command. Here is the program: ?php $data = shell_exec(free -b); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $dataArray = explode(' ',$data); $total = $dataArray[16]; $used = $dataArray[17]; echo $used.chr(10); echo $total.chr(10); ? I can make this script executable via chmod 700 mem.php and run it directly via the command line. Only then I can get it to work on my redhat 9 machine. The problem is I call this script from another script to plot out the data on MRTG graphs. I expect to see something like : [EMAIL PROTECTED] php-4.3.2]# php /var/www/html/swap/mem.php 246789242 512689734 [EMAIL PROTECTED] php-4.3.2]# But in fact I get the warning : [EMAIL PROTECTED] php-4.3.2]# php /var/www/html/swap/mem.php Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/html/swap/swap.php on line 3 [EMAIL PROTECTED] php-4.3.2]# The warning would be applicable if any php.ini file on my system had Safe Mode enabled. As the bug people said shell_exec() == ``. But that applies if anywhere on my box safemode was enabled. I have spent 4 solid days looking and verifying there is no safe mode enabled on my box. It's an internal monitoring server there is absolutely no need for safe mode. This is what is in my PHP.ini ; Safe Mode ; safe_mode = Off safe_mode_gid = Off Can someone tell me if they can run that script on their *nix machine? I'm running php 4.32 apache 2.0 server on a up-to-date redhat 9 server. I don't think this script can be run from another program. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I think this is a bug...cant use exec commands.
[snip] May be you can look at exec() function: http://www.php.net/manual/en/function.exec.php [/snip] From that page... Note: When safe mode is enabled, you can only execute executables within the safe_mode_exec_dir. For practical reasons it is currently not allowed to have .. components in the path to the executable. Warning With safe mode enabled, all words following the initial command string are treated as a single argument. Thus, echo y | echo x becomes echo y | echo x. [snip from original] Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/html/swap/swap.php on line 3 [/snip] He goes on to say that safe mode is not enabled on his machine in his php.ini, but perhaps he has more than one and is looking at the wrong one. What is thelocation of the php.ini when you run phpinfo()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Domain Name ?
On 4/1/2004 11:58:01 AM, Ralph Guzman ([EMAIL PROTECTED]) wrote: The easy way... $domain = http://www.foo.com;; $domain = explode('.', $domain); $foo = $domain['1']; Yep, thats the easy and good solution, but be warned if a subdomain is used or if www is not put eg: http://foo.com you will get crappy results. HTH Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'Content-Type: text/plain; charset=utf-8'
On Thu, Apr 01, 2004 at 01:55:50PM +0300, nabil wrote: ?php header ('Content-Type: text/plain; charset=utf-8'); echo Hi there; ? I need to echo a plain txt on my page, without any HTML tags. my problem, when I run it on my apache, the save/open screen pops up. What's wrong please help this works fine for me, cutting and pasteing your example. - rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Domain Name ?
How about RTFM ? http://de2.php.net/parse_url Ryan A wrote: On 4/1/2004 11:58:01 AM, Ralph Guzman ([EMAIL PROTECTED]) wrote: The easy way... $domain = http://www.foo.com;; $domain = explode('.', $domain); $foo = $domain['1']; Yep, thats the easy and good solution, but be warned if a subdomain is used or if www is not put eg: http://foo.com you will get crappy results. HTH Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Domain Name ?
On 4/1/2004 3:57:57 PM, [EMAIL PROTECTED] wrote: How about RTFM ? http://de2.php.net/parse_url Was that RTFM for me? or for the guy who originally wrote or for the first guy who replied? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apple Mac Power PC problem
There is no problem with Power PC's or the headers. I've been using PHP and Apache for a few years now on Macs without a problem. What it sounds like is that they did not configure Apache to allow index.php as a default directory index page. As I recall, Apache defaults to only allowing index.html or index.htm as a default directory page, you need to add index.php to the configuration file. On Apr 1, 2004, at 3:24 AM, Marc Greenstock wrote: Hi all, I noticed on a clients Apple Mac Power PC that his php driven website wasn't working for him. It wasn't loading up at all, in fact it was returning an error that the URL could not be found. I discovered a quick fix for the problem, that is to create a index.html file and run a meta refresh to index.php, this seems to work. Something in the headers php sends seems to screw up Power PC's resolving method. The headers I send are: header('P3P: CP=NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'); header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Cache-control: private); header(Pragma: no-cache); and what's being received is: HTTP/1.1·200·OK Date:·Thu,·01·Apr·2004·08:46:00·GMT Server:·Apache/1.3.27·(Unix)··(Red-Hat/Linux)·mod_jk/1.2.0·mod_perl/ 1.26·PHP /4.3.3·FrontPage/5.0.2·mod_ssl/2.8.12·OpenSSL/0.9.6bX-Powered-By:·PHP/ 4.3.3 Set-Cookie:·PHPSESSID=8ebf6b7d4895473a054bb8f50b2a66dd;·path=/ Expires:·Mon,·26·Jul·1997·05:00:00·GMT Cache-Control:·private Pragma:·no-cache P3P:·CP=NOI·ADM·DEV·PSAi·COM·NAV·OUR·OTRo·STP·IND·DEM Last-Modified:·Thu,·01·Apr·2004·08:46:00·GMT Connection:·close Content-Type:·text/html Is there anything in these headers that could cause Power PC's to fail resolution? Thank. Marc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Domain Name ?
From: Ryan A [EMAIL PROTECTED] On 4/1/2004 3:57:57 PM, [EMAIL PROTECTED] wrote: How about RTFM ? http://de2.php.net/parse_url Was that RTFM for me? or for the guy who originally wrote or for the first guy who replied? It's always for you Ryan. Have you read your questions?!?!? ;) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hello
Try this, or nothing! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hello
Hello. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 3:14 PM Subject: [PHP] hello Try this, or nothing! -- 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] Domain Name ?
On 4/1/2004 3:57:57 PM, [EMAIL PROTECTED] wrote: How about RTFM ? http://de2.php.net/parse_url Was that RTFM for me? or for the guy who originally wrote or for the first guy who replied? It's always for you Ryan. Have you read your questions?!?!? ;) ---John Holmes... Hey John, Thats the funny part, I guess you are pipeing in withoug seeing the original post. If you look at the original post you will see that I *didn't* ask the question. The original question was posted by a dude who forgot something and was answered by another dude, I just added to that answer and got this (rtfm) reply cc'ed to me (original to the list) so was puzzled Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Relative Url
Is there anyway that i can get a url relative to my server for a script that is being run?? The script is being included in mulitple files and $_SERVER['SCRIPT_NAME'] just gives me the name of the file that is including the other scripts. Also $_SERVER['SCRIPT_FILENAME'] is returning nothing. Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creditcard transactions
Hi all, Does anybody know a good start to search for information about creditcard transactions handled by php? I've tried Google, but I didn't find relevant information. Rolf /// / Suicidal twin kills sister by mistake!/ /// -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie Guide] For the benefit of new members
Ma Siva Kumar said: 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html Though I've been using newsgroups since '95 and though I'd read this page before, it's helpful to review it. I can see a few mistakes I'd made as recently as a few months ago on another list :-) This post's subject should read [Newbie and Experienced User Guide] LOL Thanks, /dev/idal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Domain Name ?
This was going for the guy that started this thread :p John W. Holmes wrote: From: Ryan A [EMAIL PROTECTED] On 4/1/2004 3:57:57 PM, [EMAIL PROTECTED] wrote: How about RTFM ? http://de2.php.net/parse_url Was that RTFM for me? or for the guy who originally wrote or for the first guy who replied? It's always for you Ryan. Have you read your questions?!?!? ;) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Errors
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Allow_url_fopen is turned on - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com - -Original Message- From: Nikolay Bachiyski [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 3:01 AM To: Aaron Axelsen Subject: Re: [PHP] Include Errors On April, 01 2004 ?. 11:41 Aaron Axelsen [EMAIL PROTECTED] wrote -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I recently upgraded from 4.3.4 to 4.3.5 and now I get some errors. When I try to include a URL that is not abosulte, for example http://somewebsite.com I get the following chunk of errors: Warning: main(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /path/to/index.php on line 386 Warning: main(http://some.url/gallery/block-random.php): failed to open stream: Resource temporarily unavailable in /path/to/index.php on line 386 Warning: main(): Failed opening 'http://some.url/gallery/block-random.php' for inclusion (include_path='.:/path/to/php/lib/php') in /path/to/index.php on line 386 Any ideas or suggetsions are greatly welcome. Thanks. - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBQGvUKbrnDjSLw9ADEQLbEQCfRd1fjICqnS3Fotu4X3Pf08QvbOMAnim1 fCN+YXqDK6oQ/un4H68fv07K =Fh9f -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hello, Aaron, Are you sure allow_url_fopen in your php.ini is on? Although the default value is on it could either have been changed or you might be using your older php.ini file. Regards, Nikolay -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBQGw99rrnDjSLw9ADEQJbJgCbBQHJhjKfvY1NKH609eIyo9NEnmYAn1q7 5R7N/8lWbB3adQxRnIOJXnor =kyQH -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP loading
Please help me, Is it possible with php to load immedeatly pictures into a website by users (by use of a ftp-statement) ? I mean: so that any user on my website can add a picture to that website which is immedeatly visible on that webiste? If this is possible, where can I find the code for my problem? Thanks for helping. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] elementary question about reading an array ...
Greetings. In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) My elementary question is: how do I reference one item in the array? For instance, if I want $fullname = Kent Huffman how can I write that statement? I thought $fullname = $db[0]['fullname' would work. It obviously doesn't, and I've tried a dozen other things, including RTFM and several other tutorials, to no avail. Can someone help? Thanks. p.s. and since I've exposed my ignorance on this subject, can anyone point moint me to a good tutorial on the subject of arrays? I've tried to find one that would help, I swear I did, but while I'm beginning to understand the assignment of values to an array, the reading of them (as in this example) still baffles me ... thanks again for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] elementary question about reading an array ...
[snip] In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) My elementary question is: how do I reference one item in the array? For instance, if I want $fullname = Kent Huffman how can I write that statement? I thought $fullname = $db[0]['fullname' would work. It obviously doesn't, and I've tried a dozen other things, including RTFM and several other tutorials, to no avail. [/snip] this will display a single element $fullname = $db['fullname']; echo fullname; you can just echo $db['fullname']; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP loading
Lieve Vissenaeken wrote: Please help me, Is it possible with php to load immedeatly pictures into a website by users (by use of a ftp-statement) ? I mean: so that any user on my website can add a picture to that website which is immedeatly visible on that webiste? If this is possible, where can I find the code for my problem? Not sure if I understood your question correctly. Do you want to create a web based ftp client? or do you just want to let your users upload their pictures on to your website. If it's the latter surely all you need is standard http file uploads (described in detail right at the start of the php manual). FTP is more complicated but the manual entries for the php ftp functions look good. -- Raditha Dissanayake. - http://www.radinks.com/print/upload.php SFTP, FTP and HTTP File Upload solutions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FTP loading
Lieve Vissenaeken wrote: Please help me, Is it possible with php to load immedeatly pictures into a website by users (by use of a ftp-statement) ? I mean: so that any user on my website can add a picture to that website which is immedeatly visible on that webiste? If this is possible, where can I find the code for my problem? Thanks for helping. http://ca.php.net/features.file-upload -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] elementary question about reading an array ...
[snip] In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) My elementary question is: how do I reference one item in the array? For instance, if I want $fullname = Kent Huffman how can I write that statement? I thought $fullname = $db[0]['fullname' would work. It obviously doesn't, and I've tried a dozen other things, including RTFM and several other tutorials, to no avail. [/snip] this will display a single element $fullname = $db['fullname']; echo fullname; you can just echo $db['fullname']; That's what I thought at first, but that's not working ... in fact, I just copied and pasted both your snippets, and neither of them worked here odd, isn't it? What the heck am I doing wrong here ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] elementary question about reading an array ...
Hello Kenn, Thursday, April 1, 2004, 5:38:37 PM, you wrote: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = KM That's what I thought at first, but that's not working ... in fact, I KM just copied and pasted both your snippets, and neither of them worked KM here odd, isn't it? KM What the heck am I doing wrong here ? Nothing.. the array appears to contain an Object (called bc). Try this to see if it'll show more details: var_dump($arrayname); and wrap it in pre tags or something, so the formatting makes sense! -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] elementary question about reading an array ...
Yet again maybe one would check the output before replying: Array ( [0] = bc Object ( [fullname] = Kent Huffman ... ) ) This is what we see: echo $db['fullname']; // nope echo $db[0]-fullname // ah !!! -- red Kenn Murrah wrote: [snip] [snip] In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) My elementary question is: how do I reference one item in the array? For instance, if I want $fullname = Kent Huffman how can I write that statement? I thought $fullname = $db[0]['fullname' would work. It obviously doesn't, and I've tried a dozen other things, including RTFM and several other tutorials, to no avail. [/snip] this will display a single element $fullname = $db['fullname']; echo fullname; you can just echo $db['fullname']; That's what I thought at first, but that's not working ... in fact, I just copied and pasted both your snippets, and neither of them worked here odd, isn't it? What the heck am I doing wrong here ? [snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] elementary question about reading an array ...
From: Kenn Murrah [EMAIL PROTECTED] In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) You have an array of objects. Try this: echo $db[0]-fullname; ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] elementary question about reading an array ...
[snip] You have an array of objects. Try this: echo $db[0]-fullname; [/snip] Crap, I missed that...sorry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] elementary question about reading an array ...
You can always count on this list ... the winning answer was echo $db[0]-fullname // ah !!! thanks to everyone who helped me... Red Wingate wrote: Yet again maybe one would check the output before replying: Array ( [0] = bc Object ( [fullname] = Kent Huffman ... ) ) This is what we see: echo $db['fullname']; // nope echo $db[0]-fullname // ah !!! -- red Kenn Murrah wrote: [snip] [snip] In code that I did not create (and do not entirely understand), an array ($db) was created which, if displayed with print_r($db), shows the following: Array ( [0] = bc Object ( [fullname] = Kent Huffman [industry] = Technology Solutions [url] = /tsi [address1] = 2300 W. Plano Parkway [city] = Plano [state] = TX [zip] = 75075 [country] = USA [direct] = +1 (972) 577 3890 [email] = [EMAIL PROTECTED] [orderID] = PSC5 [financialdeptID] = MARCO10 [quantity] = 250 [messagetoprinter] = [shippingmethod] = FedEx Express Saver [ship2name] = Kent Huffman [ship2address1] = 2300 W. Plano Parkway [ship2address2] = [ship2city] = Plano [ship2state] = TX [ship2zip] = 75075 [ship2country] = USA [ship2phone] = +1 (972) 577 3890 ) ) My elementary question is: how do I reference one item in the array? For instance, if I want $fullname = Kent Huffman how can I write that statement? I thought $fullname = $db[0]['fullname' would work. It obviously doesn't, and I've tried a dozen other things, including RTFM and several other tutorials, to no avail. [/snip] this will display a single element $fullname = $db['fullname']; echo fullname; you can just echo $db['fullname']; That's what I thought at first, but that's not working ... in fact, I just copied and pasted both your snippets, and neither of them worked here odd, isn't it? What the heck am I doing wrong here ? [snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Relative Url
--- Chris Thomas [EMAIL PROTECTED] wrote: Is there anyway that i can get a url relative to my server for a script that is being run?? $relative_url = '/'; That's a relative URL to your document root. What are you wanting, exactly? Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying a money datatype from mssql
How do I correctly display a money datatype from a mssql db? I've looked through the archives and come up empty, and google doesn't seem to have anything worth mentioning. My query is; SELECT od.price, od.inventorycost, om.totalamount FROM orderhistorymaster as om, orderhistorydetail as od WHERE om.ordernumber = od.ordernumber and om.customernumber = '$custnum' and od.entrydate = om.entrydate and om.entrydate between '$startdate' and '$enddate' ORDER BY om.entrydate When I run the query, for the fields 'price' and 'totalamount', I get a return of; Price 1.59149684322E-310 Total Amount 5.41108926696E-309 So I tried; SELECT cast(od.price as decimal(10,2)), cast(od.inventorycost as decimal(10,2)), cast(om.totalamount as decimal(10,2)) But php didn't like that. In Query Analyzer they come up; Price .7500 Total Amount 25.5000 My last resort would be to go into the db and do a conversion there but I really don't want to do that. How can I convert these to represent a readable dollar figure? alex hogan ** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. **
RE: [PHP] Displaying a money datatype from mssql
[snip] My last resort would be to go into the db and do a conversion there but I really don't want to do that. How can I convert these to represent a readable dollar figure? [/snip] start with http://www.php.net/number_format -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Displaying a money datatype from mssql
[snip] My last resort would be to go into the db and do a conversion there but I really don't want to do that. How can I convert these to represent a readable dollar figure? [/snip] start with http://www.php.net/number_format I tried that and it converted the values to 0.00. I know I'm missing something simple in the conversion. alex ** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. **
RE: [PHP] [Newbie Guide] For the benefit of new members
Chris de Vidal mailto:[EMAIL PROTECTED] on Thursday, April 01, 2004 7:20 AM said: Though I've been using newsgroups since '95 and though I'd read this page before, it's helpful to review it. I can see a few mistakes I'd made as recently as a few months ago on another list :-) This post's subject should read [Newbie and Experienced User Guide] LOL more like Newbie and Chris de Vidal User Guide talk about LOL! chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hello
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Thursday, April 01, 2004 6:14 AM said: Try this, or nothing! ok, will do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Domain Name ?
On Thu, 01 Apr 2004 15:57:57 +0200, Red Wingate [EMAIL PROTECTED] wrote: How about RTFM ? http://de2.php.net/parse_url That doesnt solve anything. perhaps you should RTFQ first Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Checkdnsrr ?
On Thu, 1 Apr 2004 08:30:57 +0100, Dave Carrera [EMAIL PROTECTED] wrote: Hi List, Is using checkdnsrr a good way to tell if a domain name is available ? If I ask checkdnsrr to look for 'NS' records and the result comes back as false then dose that mean a domain name is available to use ? No. A domain can be registered and not have any dns entries at all. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple image manager app?
I often travel and would like to be able to upload digital photos to my server (either using a simple multiple file upload (one that I can select multiple file using the windows file dialog, or some other method that's idiot proof) and simply save them to my hard disk, or to a mysql database. Is there a simple set of scripts available for that? I've searched the web and only found lots of references to how to build a huge table with a bunch of browse... buttons to select single files at a time to upload images in an array which doesn't seem like a meaningful solution. I haven't been able to figure out how to allow multiple selects in the windows file dialog box either. Is that possble using php and the html forms? Thanks, Jeff. --- Jeff D. Hamann Forest Informatics, Inc. PO Box 1421 Corvallis, Oregon USA 97339-1421 541-754-1428 [EMAIL PROTECTED] www.forestinformatics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I think this is a bug...cant use exec commands.
On Wed, 31 Mar 2004 23:54:52 -0700, Brian Duke [EMAIL PROTECTED] wrote: I can't seem to use the shell_exec() command. ... [EMAIL PROTECTED] php-4.3.2]# php /var/www/html/swap/mem.php Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/html/swap/swap.php on line 3 ... This is what is in my PHP.ini ; Safe Mode ; safe_mode = Off safe_mode_gid = Off safe_mode can be set in your apache.conf or a .htaccess file, check the values of these from the output of phpinfo() in the same directory your trying to run shell_exec(). Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5rc1 + [x]inetd : how to really close stdin/stdout?
Hi there. I'm using php5rc1 to write scripts launched by xinetd on a Linux Fedora system. My problem is to close stdin and stdout to really break the socket from the remote end to release a remote resource while I'm doing a long processing locally. It seems that opening php://std[in/out] is some kind of dup(2) of the corresponding streams and thus I never can really break stdin/stdout. Is there some solution that I did not see? Or do I have to expect php5rcX to be changed not to do this kind of dup(2) of the streams the first time that there are opened ? Thanks! Bernard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple image manager app?
On Thursday 01 April 2004 09:41 am, Jeff D. Hamann wrote: I often travel and would like to be able to upload digital photos to my server (either using a simple multiple file upload (one that I can select multiple file using the windows file dialog, or some other method that's idiot proof) and simply save them to my hard disk, or to a mysql database. Is there a simple set of scripts available for that? I've searched the web and only found lots of references to how to build a huge table with a bunch of browse... buttons to select single files at a time to upload images in an array which doesn't seem like a meaningful solution. I haven't been able to figure out how to allow multiple selects in the windows file dialog box either. Is that possble using php and the html forms? check out gallery: http://gallery.menalto.com/ it is pretty easy to setup, and works very well, and is very easy to use. gabe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple image manager app?
On Thursday 01 April 2004 09:41 am, Jeff D. Hamann wrote: I often travel and would like to be able to upload digital photos to my server (either using a simple multiple file upload (one that I can select multiple file using the windows file dialog, or some other method that's idiot proof) and simply save them to my hard disk, or to a mysql database. Is there a simple set of scripts available for that? I've searched the web and only found lots of references to how to build a huge table with a bunch of browse... buttons to select single files at a time to upload images in an array which doesn't seem like a meaningful solution. I haven't been able to figure out how to allow multiple selects in the windows file dialog box either. Is that possble using php and the html forms? especially neat is their Java application for uploading images to your site. this soves the multiple selects problem. gabe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: simple image manager app?
Gabriel Guzman wrote: On Thursday 01 April 2004 09:41 am, Jeff D. Hamann wrote: I often travel and would like to be able to upload digital photos to my server (either using a simple multiple file upload (one that I can select multiple file using the windows file dialog, or some other method that's idiot proof) and simply save them to my hard disk, or to a mysql database. Is there a simple set of scripts available for that? I've searched the web and only found lots of references to how to build a huge table with a bunch of browse... buttons to select single files at a time to upload images in an array which doesn't seem like a meaningful solution. I haven't been able to figure out how to allow multiple selects in the windows file dialog box either. Is that possble using php and the html forms? check out gallery: http://gallery.menalto.com/ it is pretty easy to setup, and works very well, and is very easy to use. gabe. That still doesn't allow what Jeff wants to do! HTML file upload forms only allow you to select one file at a time. Some software (such as Gallery) allows you to upload a zip file containing multiple images. Gallery also allows you to connect with the very useful Gallery Remote, which does allow you to upload multiple files at once. HTH, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Tricky array question
Hi there, I am trying to get continent and country info out of an xml file. There is a continent element to each country element. Now I do have an array with the continent info and one with the country info. The goal is to be able to output all countries sorted after continents. So I do have: $results[]-countryContinent $results[]-countryName I tryed to group those values, to do array searches and more, but somehow it looks like that there must be a way more easy way to do this. Maybe someone has a good hint how to solve that. Thanx for any help, merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Relative Url
Is there anyway that i can get a url relative to my server for a script that is being run?? The script is being included in mulitple files and $_SERVER['SCRIPT_NAME'] just gives me the name of the file that is including the other scripts. Also $_SERVER['SCRIPT_FILENAME'] is returning nothing. I'm not completely sure I know what you're after. If you're looking to get the http path to an included file, this should work: ?php $http_path = http://; . $_SERVER['SERVER_NAME'] . str_replace( $_SERVER['DOCUMENT_ROOT'], , __FILE__ ); ? If you're in windows I don't think the replace would work, because the docroot's slashes go one way and the __FILE__ slashes go the other. You'd use something like strtr( __FILE__, \\, / ) before the replacement to fix that. Cheers, Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] .ini of .conf file generate/parser solution?
Anyone know of a php script that can dynamically build and maintain my own kind of conf file (like a smb.conf or httpd.conf) but I make up the content. Thanks, -Eric Wood -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session/mysql problems
hi I created a login script and originally was using php4.3.3 to write the script with. Then I found out that it had to be rewritten for php4.0.4pl1. I think when rewriting it for the older version it got messed up somehow and cant quite spot the error/problem in it. can anybody help here?? the query runs right for some reason (i.e. connection works) and query when echoed on the screen is right but for some reason the query comes back NULL?? even though there are valid users in the usertable?? here is the whole login script code: i have the actuall lines commented out and echo/print_r lines in place for debugging reasons: [code] ?php session_start(); include(libs/conf.db); //connection works since no errors are reported by mysql mysql_connect($host, $mysqluser, $mysqlpwd)||die(mysql_error()); mysql_select_db($db); $UserExists=mysql_query(select * from rnjresort_users where username='$_POST[username]' and pwd=md5($_POST[password])); //$UserExists returns no valid resource id so something is //going wrong if($UserExists) { $_SESSION['username']=$_POST['username']; print_r($_SESSION); print_r($_POST); echo $UserExists; //header(location: deletepost.php); } else { print_r($_SESSION);//is empty of course //following query echoes exactly the way i want it to so no //errors here that i can see echo select * from $UserTable where username='$_POST[username]' and pwd=md5($_POST[password]); //header(location: login.html); } ? tnx...
[PHP] Inserting string - need to trim comma
Hi - I'm trying to create a very basic function that add the results of a form to my database. I have this code so far, with $table being the table name and the $data is an exact copy of the $_POST array. function insert($table, $data) { $sql = INSERT INTO .$table. SET ; foreach ($data as $k=$v) { $sql.= $k. = '.$v.', ; } $sql.=;; $result = mysql_query($sql); } The only problem with the statement is the appended comma to each iteration - the statement generates a mysql error with the extra comma at the end of the statement. This seems like an easy fix -any ideas? Any help would be greatly appreciated... http://www.phreshdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
snip function insert($table, $data) { $sql = INSERT INTO .$table. SET ; foreach ($data as $k=$v) { $sql.= $k. = '.$v.', ; } $sql.=;; $result = mysql_query($sql); } The only problem with the statement is the appended comma to each iteration - the statement generates a mysql error with the extra comma at the end of the statement. This seems like an easy fix -any ideas? Any help would be greatly appreciated... /snip http://www.php.net/rtrim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tricky array question
Merlin wrote: Hi there, I am trying to get continent and country info out of an xml file. There is a continent element to each country element. Now I do have an array with the continent info and one with the country info. The goal is to be able to output all countries sorted after continents. So I do have: $results[]-countryContinent $results[]-countryName I tryed to group those values, to do array searches and more, but somehow it looks like that there must be a way more easy way to do this. Maybe someone has a good hint how to solve that. Thanx for any help, merlin I would suggest parsing the XML data such that you have an array of continents, and each element of said array is an array with two elements - the first being the contintent name and the second array containing all countries within that continent. So, after parsing the file you would have: $contintents[0] = array('North America',array('Canada','United States','Mexico')); $contintents[1] = array('South America',array('Ecuador','Chile','Peru','Columbia','Brazil')); etc. etc. HTH. Pablo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
--- Doug Parker [EMAIL PROTECTED] wrote: function insert($table, $data) { $sql = INSERT INTO .$table. SET ; foreach ($data as $k=$v) { $sql.= $k. = '.$v.', ; } $sql.=;; $result = mysql_query($sql); } The only problem with the statement is the appended comma to each iteration - the statement generates a mysql error with the extra comma at the end of the statement. You can usually avoid this type of problem in the first place with implode(). Something like this (untested): sql = insert into $table set ; $pairs = array(); foreach ($data as $key = $value) { $pairs[] = $key = '$value'; } $sql .= implode(',' $pairs); --- Matt Matijevich [EMAIL PROTECTED] wrote: http://www.php.net/rtrim rtrim() trims whitespace, not commas. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quote for Job
Was wondering if anybody who needs some money can give me a quote on a job. It is over my head to do. We need a Web Based Email program for an internal server written in PHP if at all possible but will consider other languages if needed. They liked Squirrelmail, but they need it to do something that Squirrelmail doesn't do. No it doesn't need to be even close to the functionality of Squirrelmail. The program will reside on the same server and run over the web. The server will be: 1. RHEL ES 3.x 2. Dual Xeon 2.4ghz 3. 2 gig of ram 4. php 4.3.2 or above (version can be changed if absolutely needed) 5. Sendmail version 8.12.10 or above. 6. Apache 2.0.46 or above If you need any other details, please ask. This is what it needs to do: 1. Be able to receive mail. (pop into their account on this server only). 2. Be able to reply to mail. 3. Be able to send and receive attachments. 4. Be able to CC: and BCC: 5. Login with just the username password of the user on the server. (not [EMAIL PROTECTED]) 6. Be able to send out to ONLY users specified in a MySQL database. What that basically will be is 15,000 email clients on the server. There will be a criteria that if they are from missouri, they will only be able to email to other users that are from missouri or to the main email address of the company headquarters. They will not be able to email out from the server to anyplace else on the internet and can not POP in from anyplace else. They will have to come through this program. This is where the MySQL database comes in. When they go to send out an email, it must check the (probably) state field to make sure that who they are sending to matches the same state as theirs. 7. The main company's login needs to be able to email to all users on the system or to just specific users. 8. When an email is deleted, it does not go into a trash can, it is just gone with no possibility of retrieval. 9. Anything else that you can think of might be something they would think of. But before it is added you would need to consult with me first to see if it is needed. For instance. I almost forgot to add #4 above to allow for CCing and BCCing. Knowing this company, they will want to be able to change it in the future. So we would probably go back to the person who writes it in the future to make changes. For instance..They might decide that they want to allow one of the users from missouri to be able to email one or more of the users from Kansas. Basically it needs you or I to be able to change it half way easily. If you need any other details, please ask. Please send your quotes (price and time required) directly to [EMAIL PROTECTED] with a subject of Quote for Job. If it weren't for the receiving part of this, I could write it myself because it would be a simple form to me then. If it weren't for the limitation on the people that a person can send to, Squirrelmail or many of the other email clients out there would work just fine. Thank You Steve Buehler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
snip --- Matt Matijevich [EMAIL PROTECTED] wrote: http://www.php.net/rtrim rtrim() trims whitespace, not commas. Hope that helps. Chris /snip string rtrim ( string str [, string charlist]) there is a second optional paremeter you can add to rtrim rtrim($var,','); will take any trailing commas off of the end -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
implode() worked perfectly. thanks - doug - Original Message - From: Chris Shiflett [EMAIL PROTECTED] To: Doug Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:19 PM Subject: Re: [PHP] Inserting string - need to trim comma --- Doug Parker [EMAIL PROTECTED] wrote: function insert($table, $data) { $sql = INSERT INTO .$table. SET ; foreach ($data as $k=$v) { $sql.= $k. = '.$v.', ; } $sql.=;; $result = mysql_query($sql); } The only problem with the statement is the appended comma to each iteration - the statement generates a mysql error with the extra comma at the end of the statement. You can usually avoid this type of problem in the first place with implode(). Something like this (untested): sql = insert into $table set ; $pairs = array(); foreach ($data as $key = $value) { $pairs[] = $key = '$value'; } $sql .= implode(',' $pairs); --- Matt Matijevich [EMAIL PROTECTED] wrote: http://www.php.net/rtrim rtrim() trims whitespace, not commas. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tricky array question
Apr 1 at 8:13pm, Merlin wrote: I am trying to get continent and country info out of an xml file. There is a continent element to each country element. Now I do have an array with the continent info and one with the country info. The goal is to be able to output all countries sorted after continents. $results[]-countryContinent $results[]-countryName First, although this does work, I don't know if it's what you want to do. You'll end up with a structure like this: Array ( [0] = stdClass Object ( [countryContinent] = North America ) [1] = stdClass Object ( [countryName] = Canada ) ) Not very useful, as you've found. I tryed to group those values, to do array searches and more, but somehow it looks like that there must be a way more easy way to do this. I think this is along the lines of what you want to do: $continent = 'North America'; $landmass[$continent][] = 'Canada'; $landmass[$continent][] = 'United States'; $landmass[$continent][] = 'Mexico'; $continent = 'Asia'; $landmass[$continent][] = 'Japan'; $landmass[$continent][] = 'China'; $landmass[$continent][] = 'Korea'; // sort continents then countries ksort($landmass); // use ksort() to sort by key foreach($landmass as $conti = $cntry) { sort($landmass[$conti]); } print_r($landmass); There's your array, just loop over it as you like, to do your output. If you're reading an XML file, you might look into PEAR, which has packages for parsing and building data structures of XML data. -- Kelly Hallman // Ultrafancy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] .ini of .conf file generate/parser solution?
From: Eric Wood [EMAIL PROTECTED] Anyone know of a php script that can dynamically build and maintain my own kind of conf file (like a smb.conf or httpd.conf) but I make up the content. I'm sure PEAR has something, PEAR::conf or something like that. You can use parse_ini_file() to read the file, btw. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
From: Matt Matijevich [EMAIL PROTECTED] snip function insert($table, $data) { $sql = INSERT INTO .$table. SET ; foreach ($data as $k=$v) { $sql.= $k. = '.$v.', ; } $sql.=;; Take out the above line; you don't need to add the semi-colon $result = mysql_query($sql); } The only problem with the statement is the appended comma to each iteration - the statement generates a mysql error with the extra comma at the end of the statement. This seems like an easy fix -any ideas? Any help would be greatly appreciated... /snip http://www.php.net/rtrim rtrim() removes whitespace, not commas. Use $sql = substr($sql,0,-2); to strip off the last two characters (comma and space). ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Inserting string - need to trim comma
--- John W. Holmes [EMAIL PROTECTED] wrote: http://www.php.net/rtrim rtrim() removes whitespace, not commas. That's exactly what I thought (and said). :-) Matt corrected me by pointing out a second, optional argument added in 4.1.0 where you can specify one or more characters to include in the trimming (so, whitespace + whatever characters you specify will be trimmed). Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing variables from Flash to PHP
Hi - I am an IIS, PHP 4.3 new user running on Win2k server. I need to pass a variable ( $flash = 1 ) back out to my PHP script and can't find any examples of this working after 2 days of looking. I can't get a urldecode to work and I don't want a WDDX because I don't see pertinent WinOS examples on the .org website. Other methods I've tried included running a getURL(change_flash_value.php) script in Flash - the PHP script didn't execute and the value of $flash didn't change in keeping. Has anyone got a working example they can share with me? Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passing variables from Flash to PHP
-Original Message- From: Edward Tilley [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: [PHP] Passing variables from Flash to PHP Hi - I am an IIS, PHP 4.3 new user running on Win2k server. I need to pass a variable ( $flash = 1 ) back out to my PHP script and can't find any examples of this working after 2 days of looking. I can't get a urldecode to work and I don't want a WDDX because I don't see pertinent WinOS examples on the .org website. Other methods I've tried included running a getURL(change_flash_value.php) script in Flash - the PHP script didn't execute and the value of $flash didn't change in keeping. Has anyone got a working example they can share with me? Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Have you looked into Flash Remoting? http://www.amfphp.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Creditcard transactions
Rolf Van De Krol wrote: Hi all, Does anybody know a good start to search for information about creditcard transactions handled by php? I've tried Google, but I didn't find relevant information. Rolf /// / Suicidal twin kills sister by mistake!/ /// http://pear.php.net/package/Payment_Process is a good place to start, even though it's still in beta. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Logo with a dog?
Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? -- Adrian Madrid http://www.hyperxmedia.com HyperX Media 45 West 9000 South, Unit 2 Sandy, UT 84020 Office: 801.566.0670 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
--- Adrian Madrid [EMAIL PROTECTED] wrote: Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? Happy April Fools Day. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
snip Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? /snip April Fools easter egg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
Matt Matijevich wrote: snip Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? /snip April Fools easter egg Man, I thought I was getting my server compromised Man, you start coding and 8 hours later you can't take a joke! LOL Thanks, -- Adrian Madrid http://www.hyperxmedia.com HyperX Media 45 West 9000 South, Unit 2 Sandy, UT 84020 Office: 801.566.0670 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
The picture that comes up on my machine is a guy's head with two pencils stuck in his nose Matt Matijevich wrote: snip Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? /snip April Fools easter egg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
--- Jason S Motes [EMAIL PROTECTED] wrote: The picture that comes up on my machine is a guy's head with two pencils stuck in his nose That's Thies. You need to upgrade. :-) Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Inserting string - need to trim comma
Hi, Friday, April 2, 2004, 5:10:29 AM, you wrote: MM snip MM function insert($table, $data) { MM $sql = INSERT INTO .$table. SET ; MM foreach ($data as $k=$v) { MM $sql.= $k. = '.$v.', ; MM } MM $sql.=;; MM $result = mysql_query($sql); MM } MM The only problem with the statement is the appended comma to each MM iteration - the statement generates a mysql error with the extra comma MM at MM the end of the statement. This seems like an easy fix -any ideas? MM Any help would be greatly appreciated... MM /snip MM http://www.php.net/rtrim Change the logic slightly: function insert($table, $data) { $set = ''; foreach ($data as $k=$v) { $set .= (empty($set))? '',', '; //only need comma if not empty $set .= $k. = '.$v.'; } if(!empty($set){ $sql = INSERT INTO .$table. SET .$set; $result = mysql_query($sql); } } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Logo with a dog?
On Thu, 2004-04-01 at 18:26, Jason S Motes wrote: The picture that comes up on my machine is a guy's head with two pencils stuck in his nose Matt Matijevich wrote: snip Has anybody had the PHP logo in phpinfo() appear with a picture of a dog? /snip April Fools easter egg Too funny. You used to be able to get that by using domain.com/?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session help please?
Probably a stupid question. I figured I could do something like $_SESSION['test'] = 5 and refer to $test on other pages however I cannot. The reason I thought I could do this is because I can do $_SESSION['test'] = $_POST['test'] and be able to refer to just $test on other pages. Is the correct way to do this to make sure that I have somewhere session_register['test'] Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session help please?
--- Paul [EMAIL PROTECTED] wrote: I figured I could do something like $_SESSION['test'] = 5 and refer to $test on other pages however I cannot. The reason I thought I could do this is because I can do $_SESSION['test'] = $_POST['test'] and be able to refer to just $test on other pages. This is because you probably have register_globals enabled, so the value of test in the user POST request is available to you as both: $_POST['test'] and $test It has nothing to do with you also setting $_SESSION['test']. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and HTTPS POSTs
Has anyone had any problems with the $_POST super global not working in a HTTPS environment? My code works perfectly fine through a unsecured HTTP POST but when I do an HTTPS POST it only handles a few variable (I think 15 or 16). Any more than that and it looses all the $_POSTed variables. Has anyone seen this and more importantly know the fix for the problem? May or may not be the same, but I certainly wasted a couple days this week tracking down similar problems. Turns out it was an IE bug when using Apache/mod_ssl. There's a fix listed on the mod_ssl site - I just added the following to an .htaccess file or the apache configuration file... SetEnvIf User-Agent .MSIE. nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 -- Jack Baty Fusionary Media - http://fusionary.com/ Weblog - http://jackbaty.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Database sessions and file sessions
Is it possible for database sessions and file system sessions to co-exist on the same server? I have an application that HAS to have database sessions and another application that requires file system sessions. The database sessions is configured from the php.ini if that matters any. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to retrieve dir file list from an internet server folder?
Is it possible to retrieve dir file list from an internet server folder from within a php program? In the browser, the http:// page displays Index of and a list of files. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apple Mac Power PC problem
Hey Brent, The problem isn't within the server, the http.conf file accepts index.php as the first default file. The server is on a linux machine, and the mac is just a desktop connected to the internet. When i try to access the site on the mac, it says it can't find the url. I instantly thought it was a dns problem, but I pinged it at port 80 and it worked fine. I then proceeded to access some of the sites on the server that are purly html, that worked fine. Eventually I put a meta refresh on a page on one of the sites that was working to take it to the one that wasn't, that worked, and now the site is working fine from now on. But when I try a few other sites on the mac they don't work, same headers as the last. meta refreshing seems to work of course, but I need to find out why this is happening. marc Brent Baisley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] There is no problem with Power PC's or the headers. I've been using PHP and Apache for a few years now on Macs without a problem. What it sounds like is that they did not configure Apache to allow index.php as a default directory index page. As I recall, Apache defaults to only allowing index.html or index.htm as a default directory page, you need to add index.php to the configuration file. On Apr 1, 2004, at 3:24 AM, Marc Greenstock wrote: Hi all, I noticed on a clients Apple Mac Power PC that his php driven website wasn't working for him. It wasn't loading up at all, in fact it was returning an error that the URL could not be found. I discovered a quick fix for the problem, that is to create a index.html file and run a meta refresh to index.php, this seems to work. Something in the headers php sends seems to screw up Power PC's resolving method. The headers I send are: header('P3P: CP=NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'); header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); header(Cache-Control: no-store, no-cache, must-revalidate); header(Cache-Control: post-check=0, pre-check=0, false); header(Cache-control: private); header(Pragma: no-cache); and what's being received is: HTTP/1.1·200·OK Date:·Thu,·01·Apr·2004·08:46:00·GMT Server:·Apache/1.3.27·(Unix)··(Red-Hat/Linux)·mod_jk/1.2.0·mod_perl/ 1.26·PHP /4.3.3·FrontPage/5.0.2·mod_ssl/2.8.12·OpenSSL/0.9.6bX-Powered-By:·PHP/ 4.3.3 Set-Cookie:·PHPSESSID=8ebf6b7d4895473a054bb8f50b2a66dd;·path=/ Expires:·Mon,·26·Jul·1997·05:00:00·GMT Cache-Control:·private Pragma:·no-cache P3P:·CP=NOI·ADM·DEV·PSAi·COM·NAV·OUR·OTRo·STP·IND·DEM Last-Modified:·Thu,·01·Apr·2004·08:46:00·GMT Connection:·close Content-Type:·text/html Is there anything in these headers that could cause Power PC's to fail resolution? Thank. Marc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [php] php reply to email
How might I email into my php script. I have created a little BBS and would like to combine the functionality of an emailing list, a bit like Yahoo groups. Every time there is a post on my BBS, subscribed users get a copy. But, they would like to reply to the email, not click on a URL. When they email the list a message, how can I display it on my php-BBS page? It is possible. How? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [php] php reply to email
Hello, On 04/02/2004 02:11 AM, John Taylor-Johnston wrote: How might I email into my php script. I have created a little BBS and would like to combine the functionality of an emailing list, a bit like Yahoo groups. Every time there is a post on my BBS, subscribed users get a copy. But, they would like to reply to the email, not click on a URL. When they email the list a message, how can I display it on my php-BBS page? It is possible. How? You can always make that e-mail Reply-To: header specify the address of a POP3 mailbox that you can poll regularly with a PHP script to fetch its contents and post in your BBS. In that can you may want to try this POP3 class to fetch your messages: http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying a money datatype from mssql
Hi, Friday, April 2, 2004, 2:55:41 AM, you wrote: AH How do I correctly display a money datatype from a mssql db? AH I've looked through the archives and come up empty, and google doesn't seem AH to have anything worth mentioning. AH My query is; AH SELECT od.price, od.inventorycost, om.totalamount AH FROM orderhistorymaster as om, orderhistorydetail as od AH WHERE om.ordernumber = od.ordernumber and AHom.customernumber = '$custnum' and AHod.entrydate = om.entrydate and om.entrydate between AH'$startdate' and '$enddate' AH ORDER BY om.entrydate AH When I run the query, for the fields 'price' and 'totalamount', I get a AH return of; AH Price AH 1.59149684322E-310 AH Total Amount AH 5.41108926696E-309 AH So I tried; AH SELECT cast(od.price as decimal(10,2)), cast(od.inventorycost as AH decimal(10,2)), cast(om.totalamount as decimal(10,2)) AH But php didn't like that. AH In Query Analyzer they come up; AH Price AH .7500 AH Total Amount AH 25.5000 AH My last resort would be to go into the db and do a conversion there but I AH really don't want to do that. AH How can I convert these to represent a readable dollar figure? AH alex hogan AH ** AH The contents of this e-mail and any files transmitted with it are AH confidential and intended solely for the use of the individual or AH entity to whom it is addressed. The views stated herein do not AH necessarily represent the view of the company. If you are not the AH intended recipient of this e-mail you may not copy, forward, AH disclose, or otherwise use it or any part of it in any form AH whatsoever. If you have received this e-mail in error please AH e-mail the sender. AH ** I always store money values as cents in integers then /100 when I need dollar values. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I think this is a bug...cant use exec commands.
I tell you the truth. I have only 1 php.ini. There are other ini files I have looked at but I have not found anything in them about safe mode. Everything has been double or triple checked. Still not able run any shell_exec commands from the command line. I need the output from free so if I use exec() ?php exec(free -b, $data, $result); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $dataArray = explode(' ',$data); $total = $dataArray[16]; $used = $dataArray[17]; echo $used.chr(10); echo $total.chr(10); ? Exec complains that free is not in /usr/local/php/bin/ directory. ( I think that's the directory but whatever it was, it wasn't pointing at the web directory where my script is.) Really someone should try this script. It's harmless. 'Free' is a nix command. And BTW [snip from original] Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/html/swap/mem.php on line 3 [/snip] Is how that line should read. The complaint is about the script I an\m running called mem.php. Originally named swap.php. I wasn't paying close enough attention when I cut from the bugs.php.net page and pasted. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I think this is a bug...cant use exec commands.
On Friday 02 April 2004 13:57, Brian Duke wrote: I tell you the truth. I have only 1 php.ini. There are other ini files I have looked at but I have not found anything in them about safe mode. What are these other ini files you've looked at? Everything has been double or triple checked. Still not able run any shell_exec commands from the command line. How are you executing this script? Via a webserver or directly using the php executable? If the former use phpinfo() to find out where php thinks it's php.ini should be found, if the latter use php -i. Once you've determined where your php.ini should be examine its safe_mode settings. -- 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 -- /* There is always one thing to remember: writers are always selling somebody out. -- Joan Didion, Slouching Towards Bethlehem */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() question
Hello. My users can send email from their web pages using mail(). But the email is sent from [EMAIL PROTECTED], I dont want them to attempt to send bulk, so I wonder if there is any way to identify the system user sending the email. I use postfix, and I know that postfix gets connected from user apache, but is there anyway to pass an argument to postfix, for example, some $_SERVER var to identify the script location, or something like that. Any help will be greatly appreciated. Thanks in advamce. H Marino -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() question
Thanks for your answer. Don't you know if there is a way to redefine the mail() function in the php.ini file without touching the source code. Something like prepending a file for every script parsed in the server and redefine there several functions or something like that. Thanks! On Fri, 2 Apr 2004 07:46:48 +0100, Duncan Hill wrote: On Friday 02 April 2004 07:39, Hernan Marino wrote: Hello. My users can send email from their web pages using mail(). But the email is sent from [EMAIL PROTECTED], I dont want them to attempt to send bulk, so I wonder if there is any way to identify the Consider removing the mail() function, and requiring they they use SMTP connections. I believe one of the external mail classes supports authenticated SMTP, so with that you could tell who was sending the mail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() question
sorry. lazy me. there is auto_prepend_file in php.ini I'll see if it works. Thanks! On Fri, 2 Apr 2004 03:51:18 -0300, Hernan Marino wrote: Thanks for your answer. Don't you know if there is a way to redefine the mail() function in the php.ini file without touching the source code. Something like prepending a file for every script parsed in the server and redefine there several functions or something like that. Thanks! On Fri, 2 Apr 2004 07:46:48 +0100, Duncan Hill wrote: On Friday 02 April 2004 07:39, Hernan Marino wrote: Hello. My users can send email from their web pages using mail(). But the email is sent from [EMAIL PROTECTED], I dont want them to attempt to send bulk, so I wonder if there is any way to identify the Consider removing the mail() function, and requiring they they use SMTP connections. I believe one of the external mail classes supports authenticated SMTP, so with that you could tell who was sending the mail. -- 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] I think this is a bug...cant use exec commands.
Ok here is my php.ini. directly from /etc/php.ini ; Safe Mode ; safe_mode = Off ; By default, Safe Mode does a UID compare check when ; opening files. If you want to relax this to a GID compare, ; then turn on safe_mode_gid. safe_mode_gid = Off ; When safe_mode is on, UID/GID checks are bypassed when ; including files from this directory and its subdirectories. ; (directory must also be in include_path or full path must ; be used when including) safe_mode_include_dir = ; When safe_mode is on, only executables located in the safe_mode_exec_dir ; will be allowed to be executed via the exec family of functions. safe_mode_exec_dir = /var/www/html/swap/ I am on a redhat 9.0 machine so I use the locate command after a fresh updatedb andf this is all the ini files I was talking about. [EMAIL PROTECTED] swap]# updatedb [EMAIL PROTECTED] swap]# locate php.ini /etc/php.ini /etc/php.ini.rpmsave /root/php-4.3.4/php.ini-recommended /root/php.ini.rpmsave /home/bduke/downloads/php/php-4.3.5/pear/tests/php.ini.tst /home/bduke/downloads/php/php-4.3.5/php.ini-recommended /home/bduke/downloads/php/php-4.3.5/php.ini-dist The php-4.3.5 in not installed yet. I just downloaded it and untarred the contents in my download directory. We run the program via the web it's for MRTG graphs. I was using an example I found on the web. Here is the result when I change line 1 using exec() [EMAIL PROTECTED] swap]# cat swap.php ?php exec(free -b, $data, $result); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $dataArray = explode(' ',$data); $total = $dataArray[16]; $used = $dataArray[17]; echo $used.chr(10); echo $total.chr(10); ? [EMAIL PROTECTED] swap]# php mem.php sh: line 1: /usr/local/php/bin/free: No such file or directory [EMAIL PROTECTED] swap]# pwd /var/www/html/swap [EMAIL PROTECTED] swap]# ls ./free ./free [EMAIL PROTECTED] swap]# The MRTG will call the program via a cgi script. It calls this program only when the data is requested that way we save on cycle time. -Original Message- From: Jason Wong What are these other ini files you've looked at? How are you executing this script? Via a webserver or directly using the php executable? If the former use phpinfo() to find out where php thinks it's php.ini should be found, if the latter use php -i. Once you've determined where your php.ini should be examine its safe_mode settings. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] I think this is a bug...cant use exec commands.
Oops I catted the wrong file. But the file is exactly the same as mem.php. [EMAIL PROTECTED] swap]# cat mem.php ?php exec(free -b, $data, $result); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $dataArray = explode(' ',$data); $total = $dataArray[16]; $used = $dataArray[17]; echo $used.chr(10); echo $total.chr(10); ? -Original Message- From: Brian Duke [mailto:[EMAIL PROTECTED] Sent: Friday, April 02, 2004 12:21 AM To: 'Jason Wong'; [EMAIL PROTECTED] Subject: RE: [PHP] I think this is a bug...cant use exec commands. Ok here is my php.ini. directly from /etc/php.ini ; Safe Mode ; safe_mode = Off ; By default, Safe Mode does a UID compare check when ; opening files. If you want to relax this to a GID compare, ; then turn on safe_mode_gid. safe_mode_gid = Off ; When safe_mode is on, UID/GID checks are bypassed when ; including files from this directory and its subdirectories. ; (directory must also be in include_path or full path must ; be used when including) safe_mode_include_dir = ; When safe_mode is on, only executables located in the safe_mode_exec_dir ; will be allowed to be executed via the exec family of functions. safe_mode_exec_dir = /var/www/html/swap/ I am on a redhat 9.0 machine so I use the locate command after a fresh updatedb andf this is all the ini files I was talking about. [EMAIL PROTECTED] swap]# updatedb [EMAIL PROTECTED] swap]# locate php.ini /etc/php.ini /etc/php.ini.rpmsave /root/php-4.3.4/php.ini-recommended /root/php.ini.rpmsave /home/bduke/downloads/php/php-4.3.5/pear/tests/php.ini.tst /home/bduke/downloads/php/php-4.3.5/php.ini-recommended /home/bduke/downloads/php/php-4.3.5/php.ini-dist The php-4.3.5 in not installed yet. I just downloaded it and untarred the contents in my download directory. We run the program via the web it's for MRTG graphs. I was using an example I found on the web. Here is the result when I change line 1 using exec() [EMAIL PROTECTED] swap]# cat swap.php ?php exec(free -b, $data, $result); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $data = str_replace(' ',' ',$data); $dataArray = explode(' ',$data); $total = $dataArray[16]; $used = $dataArray[17]; echo $used.chr(10); echo $total.chr(10); ? [EMAIL PROTECTED] swap]# php mem.php sh: line 1: /usr/local/php/bin/free: No such file or directory [EMAIL PROTECTED] swap]# pwd /var/www/html/swap [EMAIL PROTECTED] swap]# ls ./free ./free [EMAIL PROTECTED] swap]# The MRTG will call the program via a cgi script. It calls this program only when the data is requested that way we save on cycle time. -Original Message- From: Jason Wong What are these other ini files you've looked at? How are you executing this script? Via a webserver or directly using the php executable? If the former use phpinfo() to find out where php thinks it's php.ini should be found, if the latter use php -i. Once you've determined where your php.ini should be examine its safe_mode settings. -- 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] parsing xml the right way
Hi there, I think I am parsing xml documents the wrong way. There must be a better way to access the results laterone like objects. For example I would like to search in a free form for a city name inside an xml document and php should return the country name and continent. This is the xml structure: Country size=4 countryNameAndorra/countryName countryCodeAD/countryCode countryContinentEurope/countryContinent Cities size=4 cityEncamp/city cityEscaldes-Engordany/city cityOrdino/city citySoldeu/city /Cities /Country Has anybody a good hint for me? Thanx in advance, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php