|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Thu Aug 09 2001 - 15:25:56 CDT
php-general Digest 9 Aug 2001 20:25:56 -0000 Issue 806
Topics (messages 61957 through 62042):
post problems
61957 by: L Melville
61961 by: Henrik Hansen
Re: CGI error
61958 by: karthik
61959 by: Phil Driscoll
61971 by: Steve Brett
62005 by: cprenato.netscape.net
how to create directory through php on linux platform??
61960 by: Balaji Ankem
61962 by: Pavel Jartsev
caching and IE 5
61963 by: Karl Phillipson
61966 by: Daniel James
61967 by: Lawrence.Sheed.dfait-maeci.gc.ca
61969 by: Karl Phillipson
Return Adress
61964 by: Jean-Arthur Silve
62009 by: billfarr.ages.com
how 2 read an non-existing file?! (I need help)
61965 by: Tribun
61987 by: elias
Re: I need everyones opinon!
61968 by: Neil Kimber
62000 by: Philip Hallstrom
Re: MySQL connection
61970 by: BRACK
61988 by: Sean C. McCarthy
61992 by: Matthew Loff
62040 by: Bjorn Van Simaeys
62041 by: BRACK
rename problem...
61972 by: Martin
62008 by: billfarr.ages.com
MySQL: Select ALL
61973 by: Tarrant Costelloe
61974 by: B. van Ouwerkerk
61976 by: Daniel Rezny
61977 by: Karl Phillipson
Installing PHP
61975 by: webmaster uva
IE Download twice from DB
61978 by: Ben-Nes Michael
PHP ext
61979 by: Boaz Yahav
61980 by: Ben-Nes Michael
61984 by: B. van Ouwerkerk
61986 by: Andreas D. Landmark
Re: Bug #12670 Updated: CGI error]
61981 by: cprenato.netscape.net
Re: Apache Directives
61982 by: Christian Reiniger
Re: subroutines?
61983 by: Christian Reiniger
62004 by: billfarr.ages.com
62020 by: Steve Werby
Re: require using url
61985 by: Christian Reiniger
Php page
61989 by: Wee Chua
61990 by: Pavel Jartsev
regular expressions and mySQL
61991 by: Joe Sheble \(Wizaerd\)
Sockets in Win98.
61993 by: Michael Quinn
61994 by: Tyler Longren
Re: PHP in corporate settings?
61995 by: billfarr.ages.com
62002 by: Sean C. McCarthy
62006 by: Rasmus Lerdorf
62007 by: Sean C. McCarthy
62030 by: Jeff Lewis
62031 by: scott [gts]
62032 by: Sascha Schumann
62033 by: Merio, Quinn
62034 by: Sheridan Saint-Michel
62036 by: Mark Maggelet
62038 by: Tom Carter
Copy function usage ?
61996 by: Tamas Bucsu
61997 by: Jon Farmer
61999 by: scott [gts]
testing..
61998 by: Scott Fletcher
Sorting Dates in this format: Jul 21 2001
62001 by: Chris
62013 by: Ron Wills
Form POST problem with Netscape 6
62003 by: Peter Fekkes
User authentication
62010 by: De Bodemschat - Geologisch Verzendhuis
help, weird include problem with functions
62011 by: Jaxon
62012 by: Jaxon
62014 by: Clayton Dukes
62016 by: Renze Munnik
62021 by: Jaxon
62026 by: Renze Munnik
62027 by: Jaxon
correct date
62015 by: DrWebPat.aol.com
62018 by: Renze Munnik
correct date (cont.)
62017 by: DrWebPat.aol.com
62023 by: Renze Munnik
RedHat 7.1
62019 by: Scott Pathel
62022 by: Scott Pathel
62024 by: Greg Donald
62025 by: billfarr.ages.com
charset win1251
62028 by: BRACK
ISO 900x Document Control System
62029 by: Seth Northrop
Be an expert! (ADV)
62035 by: nobody.nexus.sourcedns.com
development to ISP migration headache
62037 by: duirfire.leary.csoft.net
62039 by: duirfire.leary.csoft.net
62042 by: duirfire
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi,
I am using post to pass information to a php script ie;-
www..../mypage.phtml?var=3
on the page that is being passed the data i am testing for the occurence of
var with;-
if($var).......
this is generating a warning if var is not passed to the page, as I do not
always want to pass the data to it, how can i test for the occurence of var
and respond to it from within the called page?
thanks in advance
attached mail follows:
lee.melville
lineone.net (L Melville) wrote:
> Hi,
>
> I am using post to pass information to a php script ie;-
>
> www..../mypage.phtml?var=3
>
> on the page that is being passed the data i am testing for the occurence of
> var with;-
>
> if($var).......
>
> this is generating a warning if var is not passed to the page, as I do not
> always want to pass the data to it, how can i test for the occurence of var
> and respond to it from within the called page?
maybe you need to globalize your var on the page where it's posted to?
if (isset($var)) {
echo "var is set";
}
-- Henrik Hansen
attached mail follows:
Hi,
In install.txt there seems to be settings on how to install under various web servers.
There is nothing on CGI errors etc.
And i have followed the procedure which was given in install.txt for configuring PHP.
Still this problem occurs.
Help, Karthik.
----- Original Message -----
From: "Phil Driscoll" <phil
dialsolutions.co.uk>
To: "karthik" <karthik
ccipl.com>; <php-general
lists.php.net>
Sent: Thursday, August 09, 2001 1:50 PM
Subject: Re: [PHP] CGI error
> On Thursday 09 August 2001 07:47, karthik wrote:
> > Hi,
> >
> > I am running PHP 4.06 on Windows 2000 with IIS 5. I am running PHP in
CGI
> > mode.
> >
> > I seem to be getting "CGI Error
> > The specified CGI application misbehaved by not returning a complete set
of
> > HTTP headers. The headers it did return are: "
> >
> >
> > Why is this error happening ?
>
> Read, and follow the instructions on this matter as documented towards the
> end of the install.txt file which came with your distribution.
>
> Cheers
> --
> Phil Driscoll
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
On Thursday 09 August 2001 09:46, karthik wrote: > Hi, > > In install.txt there seems to be settings on how to install under various > web servers.
Well what about this bit:
You have installed PHP, but when try to access a php script file via your browser, you get the error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
This error message means that php failed to output anything at all. From the command line hange to the directory containing php.exe. Run php.exe -i If php has any problems running, then a suitable error message will be displayed which will give you a clue as to what needs to be done next. If you get a screen full of html codes (the output of the phpinfo() function) then php is working ok.
Once php is working at the command line, try accessing the php script via the browser again. If it still fails then it could be one of the following:
file permissions on your php script, php.exe, php4ts.dll, php.ini or any php extensions you are trying to load are such that the anonymous internet user ISUR_<machinename> cannot access them.
The script file does not exist (or possibly isn't where you think it is relative to your web root directory). Note that for IIS you can trap this error by ticking the 'check file exists' box when setting up the script mappings in the Internet Services Manager. If a script file does not exist then the server will return a 404 error instead. There is also the additional benefit that IIS will do any authentication required for you based on the NTLanMan permissions on your script file.
-- Phil Driscoll
attached mail follows:
i tend to get this error when the page being called doesn't exist.
check the link and the file name
Steve
"Phil Driscoll" <phil
dialsolutions.co.uk> wrote in message
news:01080909463405.04245
linux...
> On Thursday 09 August 2001 09:46, karthik wrote:
> > Hi,
> >
> > In install.txt there seems to be settings on how to install under
various
> > web servers.
>
> Well what about this bit:
>
> You have installed PHP, but when try to access a php script file via
your
> browser, you get the error:
> cgi error:
> The specified CGI application misbehaved by not returning a complete
set of
> HTTP headers. The headers it did return are:
>
> This error message means that php failed to output anything at all.
> From the command line hange to the directory containing php.exe. Run
> php.exe -i
> If php has any problems running, then a suitable
> error message will be displayed which will give you a clue as to what
> needs to
> be done next. If you get a screen full of html codes (the output of the
> phpinfo() function) then php is working ok.
>
> Once php is working at the command line, try accessing the php script
via
> the browser again.
> If it still fails then it could be one of the following:
>
> file permissions on your php script, php.exe, php4ts.dll, php.ini or
any
> php
> extensions you are trying to load are such that the anonymous internet
user
> ISUR_<machinename> cannot access them.
>
> The script file does not exist (or possibly isn't where you think it is
> relative to your web root directory). Note that for IIS you can trap
this
> error by ticking
> the 'check file exists' box when setting up the script mappings in the
> Internet Services
> Manager. If a script file does not exist then the server will return a
404
> error instead.
> There is also the additional benefit that IIS will do any
authentication
> required for you
> based on the NTLanMan permissions on your script file.
> --
> Phil Driscoll
attached mail follows:
I'm trying to call a page write in PHP for windows 98 with PWS and I received the following error:
Please help me.
Thanks.
ID: 12670
Updated by: cynic
Reported By: cprenato
netscape.net
Old Status: Open
Status: Bogus
Bug Type: PWS related
Operating System: Win98
PHP Version: 4.0.6
New Comment:
ask support questions in php-general
lists.php.net
not a bug
Previous Comments: ------------------------------------------------------------------------
[2001-08-08 23:41:51] cprenato
netscape.net
Hi folks,
After install PHP when I try to open in a URL the address: http://casa/IISSamples/Default/exemplo.php I receive the following error:
Error 403 of HTTP 403.1 Forbided: forbided execution access
...
the original message is in portuguese, I've to translate.
PS. The contents of exemplo.php is:
<?php phpinfo();?>
On command line the php.exe -i works.
Thanks for your help.
------------------------------------------------------------------------
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop
Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
attached mail follows:
Hi! dear friends, how to create directory through php on linux platform?? and how to give permissions to the directory.
Thanks in advance.
Regards -Balaji
- text/plain attachment: Wipro_Disclaimer.txt
attached mail follows:
> Balaji Ankem wrote: > > Hi! dear friends, > how to create directory through php on linux platform??
http://www.php.net/manual/en/function.mkdir.php
> > and how to give permissions to the directory. >
http://www.php.net/manual/en/function.chmod.php
-- Pavel a.k.a. Papi
attached mail follows:
Is anyone else having fun and games with IE 5.0 and caching?
I have the no-cache code (below) before anything else in my index file. Following that an include file is pulled in that has a form with a text input field that echos the date and time.
Whenever I refresh the page the time does not update to reflect the current time, it sticks with the time that was displayed when the page was first loaded. Even when I close the browser and reopen it the time remains the same. Any pointers on this issue?
<?php header ("Expires: Mon, 14 Jul 1963 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); ?>
<input type="text" name="search_name" value="<?php echo "SEARCH ".date("F jS Y G:m A") ?>">
Thx in advance.
Karl
attached mail follows:
Date: Thu, 9 Aug 2001 19:47:12 +1000 (EST) From: Daniel James <twigman
netbreeze.com.au>
To: Karl Phillipson <Karl
SaffronHill.com>
cc: "'php-general
lists.php.net'" <php-general
lists.php.net>
Message-ID: <Pine.LNX.4.21.0108091944140.22782-100000
toksik.netbreeze.com.au>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: Re: [PHP] caching and IE 5
On Thu, 9 Aug 2001, Karl Phillipson wrote:
> Is anyone else having fun and games with IE 5.0 and caching? > > I have the no-cache code (below) before anything else in my index file. > Following that an include file is pulled in that has a form with a text > input field that echos the date and time. > > Whenever I refresh the page the time does not update to reflect the current > time, it sticks with the time that was displayed when the page was first > loaded. > Even when I close the browser and reopen it the time remains the same. Any > pointers on this issue? > > <?php > header ("Expires: Mon, 14 Jul 1963 05:00:00 GMT"); // Date in the past > header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always > modified > header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 > header ("Pragma: no-cache"); > ?> > > > <input type="text" name="search_name" value="<?php echo "SEARCH > ".date("F jS Y G:m A") ?>"> > > Thx in advance. > > Karl >
I do something messy when nothing else works... get ready for it.... hehe
<a href="<?=$PHP_SELF?>?iesux=<?=rand(100000,200000)?>">Click here to refresh</a>
Told you it was ugly.
Twigman...
attached mail follows:
Try this
<head> <META Http-Equiv="Cache-Control" Content="no-cache"> <META Http-Equiv="Pragma" Content="no-cache"> <META Http-Equiv="Expires" Content="0"> </head>
works for me - try loading www.shanghaiguide.com/main/index.php3 - should do time, and display a different image every time.
cheers,
lawrence.
-----Original Message-----
From: Karl Phillipson [mailto:Karl
SaffronHill.com]
Sent: August 9, 2001 5:21 PM
To: 'php-general
lists.php.net'
Subject: [PHP] caching and IE 5
Is anyone else having fun and games with IE 5.0 and caching?
I have the no-cache code (below) before anything else in my index file. Following that an include file is pulled in that has a form with a text input field that echos the date and time.
Whenever I refresh the page the time does not update to reflect the current time, it sticks with the time that was displayed when the page was first loaded. Even when I close the browser and reopen it the time remains the same. Any pointers on this issue?
<?php header ("Expires: Mon, 14 Jul 1963 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); ?>
<input type="text" name="search_name" value="<?php echo "SEARCH ".date("F jS Y G:m A") ?>">
Thx in advance.
Karl
attached mail follows:
Hmmm, I substituted the date("F jS Y G:m A") function for a time() function and this works fine, on refresh the updated timestamp is visible.
(btw system is apache 1.20 running on Hed Rat 7.1 - php 4.05)
Can anyone explain why the time() function refreshes and returns the correct value but the date("F jS Y G:m A") does not??
Seems the problem might not be an IE5 caching issue at all ??
Regs,
Karl
========================== Karl Phillipson PHP SQL Programmer
Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL
Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318
-----Original Message-----
From: Lawrence.Sheed
dfait-maeci.gc.ca
[mailto:Lawrence.Sheed
dfait-maeci.gc.ca]
Sent: 09 August 2001 10:37
To: Karl
SaffronHill.com
Cc: php-general
lists.php.net
Subject: RE: [PHP] caching and IE 5
Try this
<head> <META Http-Equiv="Cache-Control" Content="no-cache"> <META Http-Equiv="Pragma" Content="no-cache"> <META Http-Equiv="Expires" Content="0"> </head>
works for me - try loading www.shanghaiguide.com/main/index.php3 - should do time, and display a different image every time.
cheers,
lawrence.
-----Original Message-----
From: Karl Phillipson [mailto:Karl
SaffronHill.com]
Sent: August 9, 2001 5:21 PM
To: 'php-general
lists.php.net'
Subject: [PHP] caching and IE 5
Is anyone else having fun and games with IE 5.0 and caching?
I have the no-cache code (below) before anything else in my index file. Following that an include file is pulled in that has a form with a text input field that echos the date and time.
Whenever I refresh the page the time does not update to reflect the current time, it sticks with the time that was displayed when the page was first loaded. Even when I close the browser and reopen it the time remains the same. Any pointers on this issue?
<?php header ("Expires: Mon, 14 Jul 1963 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); ?>
<input type="text" name="search_name" value="<?php echo "SEARCH ".date("F jS Y G:m A") ?>">
Thx in advance.
Karl
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-Id: <5.1.0.14.0.20010809111620.04c1c110
mail.eurovox.fr>
Date: Thu, 09 Aug 2001 11:23:19 +0200
To: php-general
lists.php.net
From: Jean-Arthur Silve <jeanarthur
eurovox.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable
Subject: Return Adress
Hi !
I ve got a problem with the mail function :
My http server (Apache) is running as user "web" and php is compiled as a=20 module.
When I send a mail with the mail function and, for example, the recipient=20
does not exists, the return message is sent to web
mydomain.xxx
I would like the error messages are sent to another email adress.
I tried with the mail header "Return-path: anotheraddress
mydomain.xxx" but=
=20
the error messages keep going to web
mydomain.xxx
My code is :
$head=3D"From: ".$EMAILADMIN."\nReturn-Path: anotheraddress
mydomain.xxx\n";
mail($to,$sub,$msg,$head);
Is there a way to force the error messages to go to another email adress ? Another header ? If it's sendmail that change the return address, is there a way to prevent= =20 this ?
Thanks !
jean-arthur
--------------------------------------------------------------- EuroVox 4, place F=E9lix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr ----------------------------------------------------------------
attached mail follows:
Hey, there...
I ran into this yesterday along with learning a heap more PHP. Adding a
"Reply-To: xxx
yyy.dom" header seemed to work fine.
Hope this helps, Bill
-----Original Message-----
From: Jean-Arthur Silve [mailto:jeanarthur
eurovox.fr]
Sent: Thursday, August 09, 2001 5:23 AM
To: php-general
lists.php.net
Subject: [PHP] Return Adress
Hi !
I ve got a problem with the mail function :
My http server (Apache) is running as user "web" and php is compiled as a module.
When I send a mail with the mail function and, for example, the recipient
does not exists, the return message is sent to web
mydomain.xxx
I would like the error messages are sent to another email adress.
I tried with the mail header "Return-path: anotheraddress
mydomain.xxx" but
the error messages keep going to web
mydomain.xxx
My code is :
$head="From: ".$EMAILADMIN."\nReturn-Path: anotheraddress
mydomain.xxx\n";
mail($to,$sub,$msg,$head);
Is there a way to force the error messages to go to another email adress ? Another header ? If it's sendmail that change the return address, is there a way to prevent this ?
Thanks !
jean-arthur
--------------------------------------------------------------- EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr ----------------------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-ID: <20010809093538.55862.qmail
pb1.pair.com>
To: php-general
lists.php.net
From: "Tribun" <mail
tribun.de>
Date: Thu, 9 Aug 2001 11:33:52 +0200
Subject: how 2 read an non-existing file?! (I need help)
the following problem:
I want to read out, if the firstname is a boy's name or a girl's name...
therefore I've written this code: (which allready works)
------------------ <snap> -------------------
$fppen('http://www.vornamenlexikon.de/main/suchen.asp?kriterium=search&B1 =Suchen&action=searchnow&searchby='.$name,"r"); if($fp){ $datenead($fp,100000); fclose($fp); $male='/m.gif'; $female='/w.gif'; if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){ if(strpos($daten,$male)>strpos($daten,$female))$result='w'; else $result='m'; }else if(strpos($daten,$female)>0)$result='w'; else if(strpos($daten,$male)>0)$result='m'; } if(empty($result)){
$fppen('http://www.kindername.de/'.strtolower(substr($name,0,1)).'-namen. htm',"r"); if($fp){ $namen ray(); $datenead($fp,100000); fclose($fp);
$daten=strstr($daten,'<font size="4" face="Verdana, Arial, Helvetica, sans-serif"><B>VORNAMEN MIT'); for($cnt $daten=substr(strstr($daten,'<tr>'),4); $tag=substr($daten,0,strpos($daten,'</tr>')); if(strpos($tag,'</td>')>0){ $x1=substr(strstr($tag,'<td>'),4); while(strpos($x1,' ')>0)$x1=str_replace(' ',' ',$x1);//TAB while(strpos($x1,' ')>0)$x1=str_replace(' ',' ',$x1);//DBLSPACE $x1=trim($x1); for($istrpos($x1,'<td>')>0;$i++){
$field=strtolower(trim(strip_tags(substr($x1,0,strpos($x1,'</td>'))))); if($i=1)$namen[$cnt] ray($field); else if($i=2)$namen[$cnt]['gender']=trim($field); else if($i=3){ while(strpos($field,',')>0){ array_push($namen[$cnt],substr($field,0,strpos($field,','))); $field=substr(strstr($field,','),1); } array_push($namen[$cnt],$field); }else if($i=4){ if(in_array($name,$namen[$cnt]))$result=$namen[$cnt]['gender']; } $x1=substr(strstr($x1,'<td>'),4); } } } } } ------------------ </snap> -------------------
This code works, but I wanted to include another Datebase (Yahoo)
So I included this function:
------------------ <snap> -------------------
$fp=
fopen('http://babynames.pregnancy.yahoo.com/bnfname?n='.$name,"r");
if($fp){
$datenead($fp,10000);
fclose($fp);
$male='boy';
$female='girl';
if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){
if(strpos($daten,$male)>strpos($daten,$female))$result='w';
else $result='m';
}else if(strpos($daten,$female)>0)$result='w';
else if(strpos($daten,$male)>0)$result='m';
}
------------------ </snap> -------------------
But this code has no effect. It returns only an Error (404)
The reason therefore is, that the targetting URL does'nt exist:
Try this URL's
http://babynames.pregnancy.yahoo.com/bnfname?n=Patrick or http://babynames.pregnancy.yahoo.com/bnfname.htm?n=Patrick http://babynames.pregnancy.yahoo.com/bnfname.?n=Patrick http://babynames.pregnancy.yahoo.com/bnfnameBLABLA?n=Patrick
In a Browser its not nessesary to type in the correct Name "bnfname". So you can add what ever you want, but the result is the same (it works)
But the problem is, to downloading this file, because then the reason is an 404-Error (not existing)
Does anybody know an answer to this problem???
How can I download this file anyway... and read out the information I want?
Thanks, Tribun (Patrick)
--- www.mp3o.netPS: I know. its not the best english ;)
attached mail follows:
As for snap two, try echoing the filename you're trying to fopen: do: $fn = "http://babynames.pregnancy.yahoo.com/bnfname?n=$name" echo "$fn\n"; $fp = fopen($fn, "r");
Weird...maybe this yahoo service was doing at that moment?
"Tribun" <mail
tribun.de> wrote in message
news:20010809093538.55862.qmail
pb1.pair.com...
> the following problem:
>
> I want to read out, if the firstname is a boy's name or a girl's name...
>
> therefore I've written this code: (which allready works)
>
> ------------------ <snap> -------------------
>
>
$fp=fopen('http://www.vornamenlexikon.de/main/suchen.asp?kriterium=search&B1
> =Suchen&action=searchnow&searchby='.$name,"r");
> if($fp){
> $daten=fread($fp,100000);
> fclose($fp);
> $male='/m.gif';
> $female='/w.gif';
> if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){
> if(strpos($daten,$male)>strpos($daten,$female))$result='w';
> else $result='m';
> }else if(strpos($daten,$female)>0)$result='w';
> else if(strpos($daten,$male)>0)$result='m';
> }
> if(empty($result)){
>
>
$fp=fopen('http://www.kindername.de/'.strtolower(substr($name,0,1)).'-namen.
> htm',"r");
> if($fp){
> $namen=array();
> $daten=fread($fp,100000);
> fclose($fp);
>
> $daten=strstr($daten,'<font size="4" face="Verdana, Arial, Helvetica,
> sans-serif"><B>VORNAMEN MIT');
> for($cnt=0;strpos($daten,'<tr>')>0;$cnt++){
> $daten=substr(strstr($daten,'<tr>'),4);
> $tag=substr($daten,0,strpos($daten,'</tr>'));
> if(strpos($tag,'</td>')>0){
> $x1=substr(strstr($tag,'<td>'),4);
> while(strpos($x1,' ')>0)$x1=str_replace(' ',' ',$x1);//TAB
> while(strpos($x1,' ')>0)$x1=str_replace(' ',' ',$x1);//DBLSPACE
> $x1=trim($x1);
> for($i=1;strpos($x1,'<td>')>0;$i++){
>
> $field=strtolower(trim(strip_tags(substr($x1,0,strpos($x1,'</td>')))));
> if($i==1)$namen[$cnt]=array($field);
> else if($i==2)$namen[$cnt]['gender']=trim($field);
> else if($i==3){
> while(strpos($field,',')>0){
> array_push($namen[$cnt],substr($field,0,strpos($field,',')));
> $field=substr(strstr($field,','),1);
> }
> array_push($namen[$cnt],$field);
> }else if($i==4){
> if(in_array($name,$namen[$cnt]))$result=$namen[$cnt]['gender'];
> }
> $x1=substr(strstr($x1,'<td>'),4);
> } } } } }
> ------------------ </snap> -------------------
>
> This code works, but I wanted to include another Datebase (Yahoo)
>
> So I included this function:
>
> ------------------ <snap> -------------------
> $fp=
fopen('http://babynames.pregnancy.yahoo.com/bnfname?n='.$name,"r");
> if($fp){
> $daten=fread($fp,10000);
> fclose($fp);
> $male='boy';
> $female='girl';
> if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){
> if(strpos($daten,$male)>strpos($daten,$female))$result='w';
> else $result='m';
> }else if(strpos($daten,$female)>0)$result='w';
> else if(strpos($daten,$male)>0)$result='m';
> }
> ------------------ </snap> -------------------
>
> But this code has no effect. It returns only an Error (404)
>
> The reason therefore is, that the targetting URL does'nt
> exist:
>
> Try this URL's
>
> http://babynames.pregnancy.yahoo.com/bnfname?n=Patrick
> or
> http://babynames.pregnancy.yahoo.com/bnfname.htm?n=Patrick
> http://babynames.pregnancy.yahoo.com/bnfname.?n=Patrick
> http://babynames.pregnancy.yahoo.com/bnfnameBLABLA?n=Patrick
>
> In a Browser its not nessesary to type in the correct Name
> "bnfname". So you can add what ever you want, but the result
> is the same (it works)
>
> But the problem is, to downloading this file, because then the reason
> is an 404-Error (not existing)
>
> Does anybody know an answer to this problem???
>
> How can I download this file anyway... and read out the information
> I want?
>
>
>
> Thanks,
> Tribun (Patrick)
> ---
> www.mp3o.net
>
>
> PS: I know. its not the best english ;)
>
>
>
attached mail follows:
Not sure I fully understand you. I'm assuming that you mean that you prefix each member method with a particular string that relates to the class. By doing this you lose a key strength of OOP. Namely the ability to write polymorphic code.
In effect, you would not be able to do the following:
class A { function print() { print("A"); } }
class B { function print() { print("B"); } }
$arrObjects[1]= new A(); $arrObjects[2]= new B();
foreach ($arrObjects as $key->$value) { $value->print(); // This is the polymorphic piece - the object type is decided at run-time }
If you methods were called A_print() and B_print() then you would not be able to build generic code as above.
-----Original Message-----
From: Scott Mebberson [mailto:scott
redbluedesign.com]
Sent: 09 August 2001 08:20
To: php-general
lists.php.net
Subject: [PHP] I need everyones opinon!
Hi Guys,
When naming classes and function's within the class(and even functions(probably more so?)) do you use a common string infront of everything? For example HM_function_name()
The reason I am asking is because what if you want to easily intergrate a class/function with lots of other classes/function and then you find out there is two with the same name?
Any thoughts on this would be good!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I think it is a good idea for class names, but not for function names as
he points out below...
So in the example below you'd want:
class PH_A ....
class PH_B ....
Since my initials are PH... and that's probably going to be unique or at
least more unique than just "A" and "B" so it will be easier to
integrate with other classes.
-philip
In article <OAEEKIKEIHKOPGHNDHJJOELHDNAA.neil.kimber
flytxt.com>,
Neil Kimber <neil.kimber
flytxt.com> wrote:
>
>Not sure I fully understand you. I'm assuming that you mean that you prefix
>each member method with a particular string that relates to the class.
>By doing this you lose a key strength of OOP. Namely the ability to write
>polymorphic code.
>
>In effect, you would not be able to do the following:
>
>class A
> {
> function print()
> {
> print("A");
> }
> }
>
>class B
> {
> function print()
> {
> print("B");
> }
> }
>
>
>$arrObjects[1]= new A();
>$arrObjects[2]= new B();
>
>foreach ($arrObjects as $key->$value)
> {
> $value->print(); // This is the polymorphic piece - the object type is
>decided at run-time
> }
>
>
>If you methods were called A_print() and B_print() then you would not be
>able to build generic code as above.
>
>
>
>-----Original Message-----
>From: Scott Mebberson [mailto:scott
redbluedesign.com]
>Sent: 09 August 2001 08:20
>To: php-general
lists.php.net
>Subject: I need everyones opinon!
>
>
>Hi Guys,
>
>When naming classes and function's within the class(and even
>functions(probably more so?)) do you use a common string infront of
>everything? For example HM_function_name()
>
>The reason I am asking is because what if you want to easily intergrate a
>class/function with lots of other classes/function and then you find out
>there is two with the same name?
>
>Any thoughts on this would be good!
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
I have tested again what I said yesterday and found that if I have problems in PHP support in Apache then all my information (username and password) are seing simly on the screen, so it's not about dead SQL server but PHP.
However, I went through all docs that I have on this topic and found that the only solution of this is to put included "connect.php/inc" outside of htdocs directory and configure your php.ini such a way that one outsider directory would be accepted and only by php call.
Hope I didn't mess up this time so you are able to understand what I mean... =))
Thank you for the help anyway, just be aware of this PHP prob when you pick up provider.
Youri On 8 Aug 2001, at 19:33, Attila Strauss wrote:
> hi,
>
> there are 2 ways.
>
> 1. you hardcore the user/password in the php.ini file.
> 2. u do a simply error checking like :
>
> <?php
> $connect = mysql_connect($host, $user, $pass);
> if(!$connect)
> {
> print "connection failed";
> }
>
> ?>
>
> of course you could also do like kinda header("Location: http://host"); instead of print "connection failed".
>
> i hope i could help you.
>
> best regards
> attila strauss
>
>
>
>
> > Hey Jouri,
> >
> >
> > I don't agree with this one. I tested it out on my
> > localhost and got the two error messages I told you I
> > was going to get:
> >
> > Warning: Unknown MySQL Server Host...
> > Warning: MySQL Connection Failed...
> >
> > No usernames/passwords. I have to say however that I
> > always include my connect.php file. Maybe that's a
> > secure way to connect without anyone seeing your
> > password in case of sqlserver problems.
> >
> >
> > Greetz,
> > Bjorn Van Simaeys
> > www.bvsenterprises.com
> >
> >
> >
> >
> > --- BRACK <brak
nettaxi.com> wrote:
> > > If you have Apache and MySQL servers make this
> > > experiment -
> > > start Apache but "forget" to start SQL and go to
> > > your site
> > > http://localhost/... you will see yourself all the
> > > information on the
> > > screen.
> > >
> > > Youri
> > >
> > > On 7 Aug 2001, at 12:53, Ryan Christensen wrote:
> > >
> > > > I'm curious as to how the "hacker" would see all
> > > this information (the
> > > > username.. password, etc..) just by going to a
> > > site where the SQL backend
> > > > was down?
> > > >
> > > > Ryan
> > > >
> > > > > -----Original Message-----
> > > > > From: BRACK [mailto:brak
nettaxi.com]
> > > > > Sent: Tuesday, August 07, 2001 12:36 PM
> > > > > To: php-general
lists.php.net
> > > > > Subject: [PHP] MySQL connection
> > > > >
> > > > >
> > > > > I just wanned to bring the issue of security of
> > > MySQL connection:
> > > > >
> > > > > Let us imagine that SQL server was down for some
> > > hours (of
> > > > > course without us knowing it) and at the same
> > > hours our SQL site
> > > > > was visited by some kind of hacker, he can s
> ee
> > > on his screen all
> > > > > our SQL connection info like username,
> > > password, and database
> > > > > name. You may hide this information in different
> > > file than the file
> > > > > that your users open then the hacker will see
> > > something like
> > > > > "include("connect.inc");" or
> > > "require("connect.inc");" (of course IF
> > > > > server is down). So you may only imagine the
> > > consequences of
> > > > > this visit of the hacker. What can we do to
> > > protect our sensitive
> > > > > information if SQL server is down?
> > > > >
> > > > > Youri
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, e-mail:
> > > php-general-unsubscribe
lists.php.net
> > > > > For additional commands, e-mail:
> > > php-general-help
lists.php.net
> > > > > To contact the list administrators, e-mail:
> > > php-list-admin
lists.php.net
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > > php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail:
> > > php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> > > php-list-admin
lists.php.net
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
>
attached mail follows:
Hi All,
Also a good advice is to restrict the access to the files where you include your login/pass. Give permissions to only the PHP user, I mean the user that runs the php process (in unix/linux make a ps axu and look at the user column). Then change the file permissions to just that user (unix chown and chmod, more info 'man chmod' and 'man chown'). If you are using W9x/ME you're out of luck.
Hope this helps.
Sean C. McCarthy SCI, S.L. (www.sci-spain.com)
BRACK wrote:
>
> I have tested again what I said yesterday and found that if I have
> problems in PHP support in Apache then all my information
> (username and password) are seing simly on the screen, so it's not
> about dead SQL server but PHP.
>
> However, I went through all docs that I have on this topic and found
> that the only solution of this is to put included "connect.php/inc"
> outside of htdocs directory and configure your php.ini such a way
> that one outsider directory would be accepted and only by php call.
>
> Hope I didn't mess up this time so you are able to understand what
> I mean... =))
>
> Thank you for the help anyway, just be aware of this PHP prob
> when you pick up provider.
>
> Youri
> On 8 Aug 2001, at 19:33, Attila Strauss wrote:
>
> > hi,
> >
> > there are 2 ways.
> >
> > 1. you hardcore the user/password in the php.ini file.
> > 2. u do a simply error checking like :
> >
> > <?php
> > $connect = mysql_connect($host, $user, $pass);
> > if(!$connect)
> > {
> > print "connection failed";
> > }
> >
> > ?>
> >
> > of course you could also do like kinda header("Location: http://host"); instead of print "connection failed".
> >
> > i hope i could help you.
> >
> > best regards
> > attila strauss
> >
> >
> >
> >
> > > Hey Jouri,
> > >
> > >
> > > I don't agree with this one. I tested it out on my
> > > localhost and got the two error messages I told you I
> > > was going to get:
> > >
> > > Warning: Unknown MySQL Server Host...
> > > Warning: MySQL Connection Failed...
> > >
> > > No usernames/passwords. I have to say however that I
> > > always include my connect.php file. Maybe that's a
> > > secure way to connect without anyone seeing your
> > > password in case of sqlserver problems.
> > >
> > >
> > > Greetz,
> > > Bjorn Van Simaeys
> > > www.bvsenterprises.com
> > >
> > >
> > >
> > >
> > > --- BRACK <brak
nettaxi.com> wrote:
> > > > If you have Apache and MySQL servers make this
> > > > experiment -
> > > > start Apache but "forget" to start SQL and go to
> > > > your site
> > > > http://localhost/... you will see yourself all the
> > > > information on the
> > > > screen.
> > > >
> > > > Youri
> > > >
> > > > On 7 Aug 2001, at 12:53, Ryan Christensen wrote:
> > > >
> > > > > I'm curious as to how the "hacker" would see all
> > > > this information (the
> > > > > username.. password, etc..) just by going to a
> > > > site where the SQL backend
> > > > > was down?
> > > > >
> > > > > Ryan
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: BRACK [mailto:brak
nettaxi.com]
> > > > > > Sent: Tuesday, August 07, 2001 12:36 PM
> > > > > > To: php-general
lists.php.net
> > > > > > Subject: [PHP] MySQL connection
> > > > > >
> > > > > >
> > > > > > I just wanned to bring the issue of security of
> > > > MySQL connection:
> > > > > >
> > > > > > Let us imagine that SQL server was down for some
> > > > hours (of
> > > > > > course without us knowing it) and at the same
> > > > hours our SQL site
> > > > > > was visited by some kind of hacker, he can s
> > ee
> > > > on his screen all
> > > > > > our SQL connection info like username,
> > > > password, and database
> > > > > > name. You may hide this information in different
> > > > file than the file
> > > > > > that your users open then the hacker will see
> > > > something like
> > > > > > "include("connect.inc");" or
> > > > "require("connect.inc");" (of course IF
> > > > > > server is down). So you may only imagine the
> > > > consequences of
> > > > > > this visit of the hacker. What can we do to
> > > > protect our sensitive
> > > > > > information if SQL server is down?
> > > > > >
> > > > > > Youri
> > > > > >
> > > > > > --
> > > > > > PHP General Mailing List (http://www.php.net/)
> > > > > > To unsubscribe, e-mail:
> > > > php-general-unsubscribe
lists.php.net
> > > > > > For additional commands, e-mail:
> > > > php-general-help
lists.php.net
> > > > > > To contact the list administrators, e-mail:
> > > > php-list-admin
lists.php.net
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail:
> > > > php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail:
> > > > php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
> > > > php-list-admin
lists.php.net
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute with Yahoo! Messenger
> > > http://phonecard.yahoo.com/
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> > >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
How exactly is the username/password from the mysql_connect() call shown to the browser?
I normally just get a PHP error when the db connection can't be made. No code is shown, just a line number. If, in your case, PHP dumps the source code to the browser window when the db connection won't work, then something has to be wrong. :)
--Matt
-----Original Message-----
From: BRACK [mailto:brak
nettaxi.com]
Sent: Thursday, August 09, 2001 5:57 AM
To: Attila Strauss
Cc: php-general
lists.php.net
Subject: Re: [PHP] MySQL connection
I have tested again what I said yesterday and found that if I have problems in PHP support in Apache then all my information (username and password) are seing simly on the screen, so it's not about dead SQL server but PHP.
However, I went through all docs that I have on this topic and found that the only solution of this is to put included "connect.php/inc" outside of htdocs directory and configure your php.ini such a way that one outsider directory would be accepted and only by php call.
Hope I didn't mess up this time so you are able to understand what I mean... =))
Thank you for the help anyway, just be aware of this PHP prob when you pick up provider.
Youri On 8 Aug 2001, at 19:33, Attila Strauss wrote:
> hi, > > there are 2 ways. > > 1. you hardcore the user/password in the php.ini file. > 2. u do a simply error checking like : > > <?php > $connect = mysql_connect($host, $user, $pass); > if(!$connect) > { > print "connection failed"; > } > > ?> > > of course you could also do like kinda header("Location: http://host"); instead of print "connection failed". > > i hope i could help you. > > best regards > attila strauss > > > > > > Hey Jouri, > > > > > > I don't agree with this one. I tested it out on my localhost and got
> > the two error messages I told you I was going to get:
> >
> > Warning: Unknown MySQL Server Host...
> > Warning: MySQL Connection Failed...
> >
> > No usernames/passwords. I have to say however that I
> > always include my connect.php file. Maybe that's a
> > secure way to connect without anyone seeing your
> > password in case of sqlserver problems.
> >
> >
> > Greetz,
> > Bjorn Van Simaeys
> > www.bvsenterprises.com
> >
> >
> >
> >
> > --- BRACK <brak
nettaxi.com> wrote:
> > > If you have Apache and MySQL servers make this
> > > experiment -
> > > start Apache but "forget" to start SQL and go to
> > > your site
> > > http://localhost/... you will see yourself all the
> > > information on the
> > > screen.
> > >
> > > Youri
> > >
> > > On 7 Aug 2001, at 12:53, Ryan Christensen wrote:
> > >
> > > > I'm curious as to how the "hacker" would see all
> > > this information (the
> > > > username.. password, etc..) just by going to a
> > > site where the SQL backend
> > > > was down?
> > > >
> > > > Ryan
> > > >
> > > > > -----Original Message-----
> > > > > From: BRACK [mailto:brak
nettaxi.com]
> > > > > Sent: Tuesday, August 07, 2001 12:36 PM
> > > > > To: php-general
lists.php.net
> > > > > Subject: [PHP] MySQL connection
> > > > >
> > > > >
> > > > > I just wanned to bring the issue of security of
> > > MySQL connection:
> > > > >
> > > > > Let us imagine that SQL server was down for some
> > > hours (of
> > > > > course without us knowing it) and at the same
> > > hours our SQL site
> > > > > was visited by some kind of hacker, he can s
> ee
> > > on his screen all
> > > > > our SQL connection info like username,
> > > password, and database
> > > > > name. You may hide this information in different
> > > file than the file
> > > > > that your users open then the hacker will see
> > > something like
> > > > > "include("connect.inc");" or
> > > "require("connect.inc");" (of course IF
> > > > > server is down). So you may only imagine the
> > > consequences of
> > > > > this visit of the hacker. What can we do to
> > > protect our sensitive
> > > > > information if SQL server is down?
> > > > >
> > > > > Youri
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, e-mail:
> > > php-general-unsubscribe
lists.php.net
> > > > > For additional commands, e-mail:
> > > php-general-help
lists.php.net
> > > > > To contact the list administrators, e-mail:
> > > php-list-admin
lists.php.net
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail:
> > > php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
> > > php-list-admin
lists.php.net
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute with Yahoo!
> > Messenger http://phonecard.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net To
> > contact the list administrators, e-mail:
> > php-list-admin
lists.php.net
> >
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hey Youri,
Could you let us know what file extension you use for you php files? And give us the exact code/error message you get on screen. Of course you can hide your username/pass with xxxxx.
Thanks Bjorn Van Simaeys www.bvsenterprises.com
--- Matthew Loff <matt
willetts.com> wrote:
>
> How exactly is the username/password from the
> mysql_connect() call shown
> to the browser?
>
> I normally just get a PHP error when the db
> connection can't be made.
> No code is shown, just a line number. If, in your
> case, PHP dumps the
> source code to the browser window when the db
> connection won't work,
> then something has to be wrong. :)
>
> --Matt
>
>
> -----Original Message-----
> From: BRACK [mailto:brak
nettaxi.com]
> Sent: Thursday, August 09, 2001 5:57 AM
> To: Attila Strauss
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] MySQL connection
>
>
> I have tested again what I said yesterday and found
> that if I have
> problems in PHP support in Apache then all my
> information
> (username and password) are seing simly on the
> screen, so it's not
> about dead SQL server but PHP.
>
> However, I went through all docs that I have on this
> topic and found
> that the only solution of this is to put included
> "connect.php/inc"
> outside of htdocs directory and configure your
> php.ini such a way
> that one outsider directory would be accepted and
> only by php call.
>
> Hope I didn't mess up this time so you are able to
> understand what
> I mean... =))
>
> Thank you for the help anyway, just be aware of
> this PHP prob
> when you pick up provider.
>
> Youri
> On 8 Aug 2001, at 19:33, Attila Strauss wrote:
>
> > hi,
> >
> > there are 2 ways.
> >
> > 1. you hardcore the user/password in the php.ini
> file.
> > 2. u do a simply error checking like :
> >
> > <?php
> > $connect = mysql_connect($host, $user, $pass);
> > if(!$connect)
> > {
> > print "connection failed";
> > }
> >
> > ?>
> >
> > of course you could also do like kinda
> header("Location:
> http://host"); instead of print "connection
> failed".
> >
> > i hope i could help you.
> >
> > best regards
> > attila strauss
> >
> >
> >
> >
> > > Hey Jouri,
> > >
> > >
> > > I don't agree with this one. I tested it out on
> my localhost and got
>
> > > the two error messages I told you I was going to
> get:
> > >
> > > Warning: Unknown MySQL Server Host...
> > > Warning: MySQL Connection Failed...
> > >
> > > No usernames/passwords. I have to say however
> that I
> > > always include my connect.php file. Maybe that's
> a
> > > secure way to connect without anyone seeing your
> > > password in case of sqlserver problems.
> > >
> > >
> > > Greetz,
> > > Bjorn Van Simaeys
> > > www.bvsenterprises.com
> > >
> > >
> > >
> > >
> > > --- BRACK <brak
nettaxi.com> wrote:
> > > > If you have Apache and MySQL servers make this
> > > > experiment -
> > > > start Apache but "forget" to start SQL and go
> to
> > > > your site
> > > > http://localhost/... you will see yourself all
> the
> > > > information on the
> > > > screen.
> > > >
> > > > Youri
> > > >
> > > > On 7 Aug 2001, at 12:53, Ryan Christensen
> wrote:
> > > >
> > > > > I'm curious as to how the "hacker" would see
> all
> > > > this information (the
> > > > > username.. password, etc..) just by going to
> a
> > > > site where the SQL backend
> > > > > was down?
> > > > >
> > > > > Ryan
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: BRACK [mailto:brak
nettaxi.com]
> > > > > > Sent: Tuesday, August 07, 2001 12:36 PM
> > > > > > To: php-general
lists.php.net
> > > > > > Subject: [PHP] MySQL connection
> > > > > >
> > > > > >
> > > > > > I just wanned to bring the issue of
> security of
> > > > MySQL connection:
> > > > > >
> > > > > > Let us imagine that SQL server was down
> for some
> > > > hours (of
> > > > > > course without us knowing it) and at the
> same
> > > > hours our SQL site
> > > > > > was visited by some kind of hacker, he can
> s
> > ee
> > > > on his screen all
> > > > > > our SQL connection info like username,
> > > > password, and database
> > > > > > name. You may hide this information in
> different
> > > > file than the file
> > > > > > that your users open then the hacker will
> see
> > > > something like
> > > > > > "include("connect.inc");" or
> > > > "require("connect.inc");" (of course IF
> > > > > > server is down). So you may only imagine
> the
> > > > consequences of
> > > > > > this visit of the hacker. What can we do
> to
> > > > protect our sensitive
> > > > > > information if SQL server is down?
> > > > > >
> > > > > > Youri
> > > > > >
> > > > > > --
> > > > > > PHP General Mailing List
> (http://www.php.net/)
> > > > > > To unsubscribe, e-mail:
> > > > php-general-unsubscribe
lists.php.net
> > > > > > For additional commands, e-mail:
> > > > php-general-help
lists.php.net
> > > > > > To contact the list administrators,
> e-mail:
> > > > php-list-admin
lists.php.net
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail:
> > > > php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
> > > > php-list-admin
lists.php.net
> > > >
>
=== message truncated ===
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
attached mail follows:
Ohh, I don't get any error messages, BUT if I have my php functions not working properly I can see the sourse of php code on my browser. If I use extention .inc for including my connection- variables file then browser attempts to download this file which is not better then first. I searched the net on this topic and found a LOT of information about this problem and the best that I found is here I just want you to be aware of this problem, play with your server to understand my worry:
FROM: Johnny Withers DATE: 04/30/2001 08:21:46 SUBJECT: RE: Password security Put it in an include file, like.. dbconnect.inc Then add this to your httpd.conf file: <Files ~ "\.inc$"> Order allow,deny Deny from all </Files> keeps people from downloading your .inc files. And also, make the .inc file readable only by the web server and no one else. Cheers. --------------------- Johnny Withers <EMAIL: PROTECTED> p. 601.853.0211 c. 601.209.4985 -----Original Message----- From: oltra jean-michel [mailto:<EMAIL: PROTECTED>] Sent: Monday, April 30, 2001 10:03 AM To: Philippe Louis Houze Cc: <EMAIL: PROTECTED> Subject: Re: Password security On Sun, 29 Apr 2001, Philippe Louis Houze wrote: > Date: Sun, 29 Apr 2001 10:56:52 -0400 > From: Philippe Louis Houze <<EMAIL: PROTECTED>> > To: <EMAIL: PROTECTED> > Subject: Re: Password security > > Hi, > > How do you keep MySQL password out of view of "visitors" when needed in PHP to access the db. The password is in plain english in all the php files, and can be easily downloaded by anyone. > > Philippe > > ex: > > <? mysql_connect("host", "user", "password"); > mysql_select_db("database"); > ?> <? include("variables.php3"); $link = mysql_connect($db_server,$db_login,$db_password); mysql_select_db($db,$link); ?> and in variables.php3 file <? $db_server = "host"; $db_login = "user"; $db_password = "mypassword"; $db = "database"; ?> and protect include-directory with .htaccess
-- jean-michel --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <<EMAIL: PROTECTED>> To unsubscribe, e-mail <mysql-unsubscribe-johnny=<EMAIL: PROTECTED>> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <<EMAIL: PROTECTED>> To unsubscribe, e-mail <mysql-unsubscribe-archiver=<EMAIL: PROTECTED>> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.phpOn 9 Aug 2001, at 13:04, Bjorn Van Simaeys wrote:
> Hey Youri, > > > Could you let us know what file extension you use for > you php files? And give us the exact code/error > message you get on screen. Of course you can hide your > username/pass with xxxxx. > > > Thanks > Bjorn Van Simaeys > www.bvsenterprises.com > > > > --- Matthew Loff <matt
willetts.com> wrote: > > > > How exactly is the username/password from the > > mysql_connect() call shown > > to the browser? > > > > I normally just get a PHP error when the db > > connection can't be made. > > No code is shown, just a line number. If, in your > > case, PHP dumps the > > source code to the browser window when the db > > connection won't work, > > then something has to be wrong. :) > > > > --Matt > > > > > > -----Original Message----- > > From: BRACK [mailto:brak
nettaxi.com] > > Sent: Thursday, August 09, 2001 5:57 AM > > To: Attila Strauss > > Cc: php-general
lists.php.net > > Subject: Re: [PHP] MySQL connection > > > > > > I have tested again what I said yesterday and found > > that if I have > > problems in PHP support in Apache then all my > > information > > (username and password) are seing simly on the > > screen, so it's not > > about dead SQL server but PHP. > > > > However, I went through all docs that I have on this > > topic and found > > that the only solution of this is to put included > > "connect.php/inc" > > outside of htdocs directory and configure your > > php.ini such a way > > that one outsider directory would be accepted and > > only by php call. > > > > Hope I didn't mess up this time so you are able to > > understand what > > I mean... =)) > > > > Thank you for the help anyway, just be aware of > > this PHP prob > > when you pick up provider. > > > > Youri > > On 8 Aug 2001, at 19:33, Attila Strauss wrote: > > > > > hi, > > > > > > there are 2 ways. > > > > > > 1. you hardcore the user/password in the php.ini > > file. > > > 2. u do a simply error checking like : > > > > > > <?php > > > $connect = mysql_connect($host, $user, $pass); > > > if(!$connect) > > > { > > > print "connection failed"; > > > } > > > > > > ?> > > > > > > of course you could also do like kinda > > header("Location: > > http://host"); instead of print "connection > > failed". > > > > > > i hope i could help you. > > > > > > best regards > > > attila strauss > > > > > > > > > > > > > > > > Hey Jouri, > > > > > > > > > > > > I don't agree with this one. I tested it out on > > my localhost and got > > > > > > the two error messages I told you I was going to > > get: > > > > > > > > Warning: Unknown MySQL Server Host... > > > > Warning: MySQL Connection Failed... > > > > > > > > No usernames/passwords. I have to say however > > that I > > > > always include my connect.php file. Maybe that's > > a > > > > secure way to connect without anyone seeing your > > > > password in case of sqlserver problems. > > > > > > > > > > > > Greetz, > > > > Bjorn Van Simaeys > > > > www.bvsenterprises.com > > > > > > > > > > > > > > > > > > > > --- BRACK <brak
nettaxi.com> wrote: > > > > > If you have Apache and MySQL servers make this > > > > > experiment - > > > > > start Apache but "forget" to start SQL and go > > to > > > > > your site > > > > > http://localhost/... you will see yourself all > > the > > > > > information on the > > > > > screen. > > > > > > > > > > Youri > > > > > > > > > > On 7 Aug 2001, at 12:53, Ryan Christensen > > wrote: > > > > > > > > > > > I'm curious as to how the "hacker" would see > > all > > > > > this information (the > > > > > > username.. password, etc..) just by going to > > a > > > > > site where the SQL backend > > > > > > was down? > > > > > > > > > > > > Ryan > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: BRACK [mailto:brak
nettaxi.com] > > > > > > > Sent: Tuesday, August 07, 2001 12:36 PM > > > > > > > To: php-general
lists.php.net > > > > > > > Subject: [PHP] MySQL connection > > > > > > > > > > > > > > > > > > > > > I just wanned to bring the issue of > > security of > > > > > MySQL connection: > > > > > > > > > > > > > > Let us imagine that SQL server was down > > for some > > > > > hours (of > > > > > > > course without us knowing it) and at the > > same > > > > > hours our SQL site > > > > > > > was visited by some kind of hacker, he can > > s > > > ee > > > > > on his screen all > > > > > > > our SQL connection info like username, > > > > > password, and database > > > > > > > name. You may hide this information in > > different > > > > > file than the file > > > > > > > that your users open then the hacker will > > see > > > > > something like > > > > > > > "include("connect.inc");" or > > > > > "require("connect.inc");" (of course IF > > > > > > > server is down). So you may only imagine > > the > > > > > consequences of > > > > > > > this visit of the hacker. What can we do > > to > > > > > protect our sensitive > > > > > > > information if SQL server is down? > > > > > > > > > > > > > > Youri > > > > > > > > > > > > > > -- > > > > > > > PHP General Mailing List > > (http://www.php.net/) > > > > > > > To unsubscribe, e-mail: > > > > > php-general-unsubscribe
lists.php.net > > > > > > > For additional commands, e-mail: > > > > > php-general-help
lists.php.net > > > > > > > To contact the list administrators, > > e-mail: > > > > > php-list-admin
lists.php.net > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, e-mail: > > php-general-unsubscribe
lists.php.net > > > > > For additional commands, e-mail: > > > > > php-general-help
lists.php.net > > > > > To contact the list administrators, e-mail: > > > > > php-list-admin
lists.php.net > > > > > > > > === message truncated === > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/
attached mail follows:
Hi! When i'm trying to run this script: <?
rename("document.htm", "testing.htm");
?>
I get this error:
Warning: Rename failed (Permission denied) in C:\Inetpub\WEBS\mysko\uploads\rename.php on line 4
The directoy has change permissions. What am i donig wrong...?
/martin
attached mail follows:
Hi Martin,
Question: who actually OWNS the document? Does it have your logname and group? If you're trying to do a rename from the server, remember that the server generally runs as "apache" or "nobody"... and to coin a phrase, "nobody" owns nothing.
If you're trying to manipulate files in your own home directory (or http_docs or whatever suffices as your servable area), you have just about two choices. Either make the documents you're working with owned by nobody (not really a good idea) or make a virtual web server in Apache that has the appropriate User and Group directives to make that virtual server run "as" you on your behalf. About 5 minutes of httpd.conf configuration and a quick DNS trick.
We've all tripped-up on this one at one time or another. It's not much setup either way, but whatever you do, make sure that YOUR security and the security of your server come before all other considerations.
Best regards, Bill
-----Original Message-----
From: Martin [mailto:martin.sandin
plus.idg.se]
Sent: Thursday, August 09, 2001 7:20 AM
To: php-general
lists.php.net
Subject: [PHP] rename problem...
Hi! When i'm trying to run this script: <?
rename("document.htm", "testing.htm");
?>
I get this error:
Warning: Rename failed (Permission denied) in C:\Inetpub\WEBS\mysko\uploads\rename.php on line 4
The directoy has change permissions. What am i donig wrong...?
/martin
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-ID: <B8DC55700B11DA4F8AA61B2803F3D1A80DC4A5
insure-ems.insur-e.net>
From: Tarrant Costelloe <tcostelloe
insur-e.net>
To: "'php-general
lists.php.net'" <php-general
lists.php.net>
Date: Thu, 9 Aug 2001 12:14:25 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Subject: MySQL: Select ALL
When saying; mysql_query("SELECT username FROM users",$db); it only show's one of the first users in the column "users". Could someone please tell me how to make it print out the complete column list of usernames. I have tried mysql_query("SELECT username(*) FROM users",$db); - but no luck.
Thanks Taz
attached mail follows:
> but no luck.
Take a look at one of the tutorials.. Many can be found on the links page you can click to on www.php.net This will help you to find the info you need and also answer the next question you're going to ask.
Bye,
B.
attached mail follows:
Hello Tarrant,
Thursday, August 09, 2001, 1:14:25 PM, you wrote:
TC> When saying; mysql_query("SELECT username FROM users",$db); it only show's TC> one of the first users in the column "users". TC> Could someone please tell me how to make it print out the complete column TC> list of usernames. I have tried mysql_query("SELECT username(*) FROM TC> users",$db); - but no luck.
For example: $query=mysql_query("SELECT username FROM users",$db); while ($row=mysql_fetch_array($query)) { echo $row["username"]; }
And B. van Ouwerkerk is right with his suggestion about manuals and archive. I know that this problem was here a lot of times.
But anyway I hope it helps
-- Best regards, Daniel mailto:danielrezny.sk
attached mail follows:
if(!($result=mysql_db_query("SELECT username FROM users" $db))) { print "Error getting rows"; exit(); }
while($row=mysql_fetch_array($result)) { $username=$row["username"]; print "$username<br>"; }
mysql_free_result($result);
kp
========================== Karl Phillipson PHP SQL Programmer
Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL
Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318
-----Original Message-----
From: Tarrant Costelloe [mailto:tcostelloe
insur-e.net]
Sent: 09 August 2001 12:14
To: 'php-general
lists.php.net'
Subject: [PHP] MySQL: Select ALL
When saying; mysql_query("SELECT username FROM users",$db); it only show's one of the first users in the column "users". Could someone please tell me how to make it print out the complete column list of usernames. I have tried mysql_query("SELECT username(*) FROM users",$db); - but no luck.
Thanks Taz
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-ID: <02e101c120c5$854a74e0$b216589d
ges.uva.es>
From: "webmaster uva" <webmaster
uva.es>
To: "php" <php-general
lists.php.net>
Date: Thu, 9 Aug 2001 13:22:05 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_02DE_01C120D6.48C70FE0"
Subject: Installing PHP
------=_NextPart_000_02DE_01C120D6.48C70FE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello, I'm trying to install PHP 4.0.5 in a Solaris machine with web server = Netscape Enterprise Server. I have problems with the file libphp4.so
conf_init: Error running init function load-modules: dlopen of = /opt/netscape/iplanet4/bin/libphp4.so failed (ld.so.1: ns-httpd: fatal: = relocat ion error: file /opt/netscape/iplanet4/bin/libphp4.so: symbol = elf_version: referenced symbol not found)
What's wrong?
Thanks.
F=E9lix Garc=EDa Renedo
mailto:felix
uva.es
mailto:webmaster
uva.es
Tfn: 983-423000 Ext. 26520
Fax: 983-423271
Centro de Telecomunicaciones e Informatica
Universidad de Valladolid
Espa=F1a
------=_NextPart_000_02DE_01C120D6.48C70FE0--
attached mail follows:
Hi All
I store files on MYSQL server but when I try to pull them out ( show them on screen or download ) with IE it download them twice before showing them up :(
I played with the headers (adding, removing) with no success. by the way in Netscape its work fine.
here is the last code tried:
<? $query = "select * from files where issue_id='$id'"; $result = mysql_query ($query) or die ("Invalid query");
$data =
MYSQL_RESULT($result,0, "file_data");
$type =
MYSQL_RESULT($result,0, "file_type");
$file_name =
MYSQL_RESULT($result,0, "file_name");
$file_size =
MYSQL_RESULT($result,0, "file_size");
// # To force save file //header("Content-disposition: attachment; filename=\"$file_name\"");
Header("Content-type: $type"); header("Content-Length: $file_size"); header("Content-Disposition: inline; filename=$file_name");
echo $data; ?>
-------------------------- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il --------------------------
attached mail follows:
Hi
Where in php.ini do you set it so that .html files will also run php?
Sincerely
berber
attached mail follows:
look at the apache conf file and not in php.ini file
----- Original Message -----
From: "Boaz Yahav" <berber
netvision.net.il>
To: "PHP General (E-mail)" <php-general
lists.php.net>
Sent: Thursday, August 09, 2001 4:00 PM
Subject: [PHP] PHP ext
Hi
Where in php.ini do you set it so that .html files will also run php?
Sincerely
berber
-------------------------- Canaan Surfing Ltd. Internet Service Providers Ben-Nes Michael - Manager Tel: 972-4-6991122 http://sites.canaan.co.il --------------------------
attached mail follows:
>Where in php.ini do you set it so that .html files will also run php?
You don't.
httpd.conf is the place to look. It says something about what Apache has to do with .php and .php3 .. so.. add .html
Bye,
B.
attached mail follows:
At 09.08.2001 13:17, B. van Ouwerkerk wrote:
>>Where in php.ini do you set it so that .html files will also run php? > >You don't. > >httpd.conf is the place to look. It says something about what Apache has >to do with .php and .php3 .. so.. add .html > >Bye,
AddType application/x-httpd-php .php .html (this line should be there already, so don't add it, update it!). (substitute x-httpd-php with x-httpd-php3 for php3)
Further you might want to modify your DirectoryIndex statement to include index.php (and/or index.php3).
This is more related to php-install than php-general though, keep in mind for the future...
--
Andreas D Landmark / noXtension
Real Time, adj.:
Here and now, as opposed to fake time, which only occurs there
and then.
attached mail follows:
Sorry I thought that this is a bug. Thanks.
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop
Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
attached mail follows:
ID: 12670
Updated by: cynic
Reported By: cprenato
netscape.net
Old Status: Open
Status: Bogus
Bug Type: PWS related
Operating System: Win98
PHP Version: 4.0.6
New Comment:
ask support questions in php-general
lists.php.net
not a bug
Previous Comments: ------------------------------------------------------------------------
[2001-08-08 23:41:51] cprenato
netscape.net
Hi folks,
After install PHP when I try to open in a URL the address: http://casa/IISSamples/Default/exemplo.php I receive the following error:
Error 403 of HTTP 403.1 Forbided: forbided execution access
...
the original message is in portuguese, I've to translate.
PS. The contents of exemplo.php is:
<?php phpinfo();?>
On command line the php.exe -i works.
Thanks for your help.
------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=12670&edit=2
attached mail follows:
On Wednesday 08 August 2001 00:00, Sean Cook wrote: > I am trying to figure out a way to run an application such that > regardless of the url I achieve the same results. This is similar to > the way apache/mod_perl works ... example > > <Location /login/> > SetHandler perl-script > PerlHandler somehandler::foo > </Location> > > now anything that access /login/salkdfjaslkjf gets redirected executed > through somehandler::foo
<Location /login> ForceType application/x-httpd-php </Location>
Now /login* URLs execute the PHP script "/login", which gets the complete URI as $REQUEST_URI
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)"World domination. Fast." (Linus Torvalds about Linux)
attached mail follows:
On Wednesday 08 August 2001 01:37, CGI GUY wrote: > How does PHP compensate for an apparent lack of > traditional subroutines (as with Perl, etc.)? It seems > like I'm going to have to script separate pages for > ea. set of processes in my search (i.e., print FORM, > print results for SEARCH, > print DETAILS, etc.). Please tell me I'm mistaken!
http://www.php.net/manual/en/functions.php http://www.php.net/manual/en/function.require-once.php http://www.php.net/manual/en/control-structures.switch.php http://www.php.net/manual/en/language.oop.php
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)"World domination. Fast." (Linus Torvalds about Linux)
attached mail follows:
Hi again,
As a new PHP convert, I ran into this same problem (below) yesterday while designing a form. ASP programmers (if they're THINKING) will use subs to keep "if" blocks tidy. In ASP, I'd use something like:
If Request.ServerVariables( "REQUEST_METHOD" ) = "GET" Then DisplayForm Else SendFormData End If
which at first I replaced with: if ( getenv( "REQUEST_METHOD" ) == "GET" ) { display_form(); } else { send_email(); } ...making functions out of what used to be subroutines. All well-and-good, except my global variables disappeared and nothing I could do (even declaring the few important ones explicitly global) seemed to allow me to get at the variable contents.
I wound up compromising by sending just the bits I needed in the function INTO the function like so:
$MyURI = $SCRIPT_NAME; $TheFormVars = $HTTP_POST_VARS; if ( getenv( "REQUEST_METHOD" ) == "GET" ) { display_form( $MyURI ); } else { send_email( $TheFormVars, $ThisWebServerFQDN ); }
Seems a bit tacky at first, but it works (properly!) and that's all that counts. I can do much more with PHP functions just as they are than I ever could with ASP; moreover, I have much more secure control of what gets exposed where. To me, a beautiful compromise since at no point is there ever an actual email address exposed to the outside world. My "Support Topic" selection box contains arbitrary codes that allow me to generate the appropriate email address on the fly.
Hope my experience will be helpful to other noobies making the Big Transition.
Best regards, Bill
-----Original Message-----
From: Christian Reiniger [mailto:creinig
mayn.de]
Sent: Thursday, August 09, 2001 8:21 AM
To: CGI GUY; php-general
lists.php.net
Subject: Re: [PHP] subroutines?
On Wednesday 08 August 2001 01:37, CGI GUY wrote: > How does PHP compensate for an apparent lack of > traditional subroutines (as with Perl, etc.)? It seems > like I'm going to have to script separate pages for > ea. set of processes in my search (i.e., print FORM, > print results for SEARCH, > print DETAILS, etc.). Please tell me I'm mistaken!
http://www.php.net/manual/en/functions.php http://www.php.net/manual/en/function.require-once.php http://www.php.net/manual/en/control-structures.switch.php http://www.php.net/manual/en/language.oop.php
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)"World domination. Fast." (Linus Torvalds about Linux)
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-ID: <052301c120f7$185418a0$6501a8c0
workstation7>
From: "Steve Werby" <steve-lists
befriend.com>
To: <billfarr
ages.com>, <php-general
lists.php.net>
Date: Thu, 9 Aug 2001 13:16:27 -0400
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] subroutines?
<billfarr
ages.com> wrote:
> As a new PHP convert, I ran into this same problem (below) yesterday while
> designing a form. ASP programmers (if they're THINKING) will use subs to
> keep "if" blocks tidy. In ASP, I'd use something like:
>
> If Request.ServerVariables( "REQUEST_METHOD" ) = "GET" Then
> DisplayForm
> Else
> SendFormData
> End If
>
> which at first I replaced with:
> if ( getenv( "REQUEST_METHOD" ) == "GET" ) {
> display_form();
> } else {
> send_email();
> }
> ...making functions out of what used to be subroutines. All
well-and-good,
> except my global variables disappeared and nothing I could do (even
> declaring the few important ones explicitly global) seemed to allow me to
> get at the variable contents.
Bill,
You need to declare the variables global within each function that access them or access the variable via the $GLOBALS array.
$var = 'something';
function go() { return $GLOBALS["var"]; }
or
function go() { global $var;
return $var; }
echo go();
-- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/
attached mail follows:
On Wednesday 08 August 2001 18:08, Nigel_Soon
advanis.ca wrote:
> I'm having a problem using require with a url. What I'm trying to do is > have a php script on a server that calls a file on another server using > require. The file that is called on the other server contains php > functions that the calling php script uses. > > I my attempts so far I get: > Fatal error: Call to undefined function: login() in > /usr/home/nigels/public_html/survey01/survey.php on line 51 > > survey.php is the script that has the require line: > require("http://host.server.com/functions.php");
That means your server does a HHTP request to http://host.server.com/functions.php , get's back the *output* of functions.php and includes that (assuming host.server.com uses PHP).
-- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/)"World domination. Fast." (Linus Torvalds about Linux)
attached mail follows:
Hi all, what is the best software to make banner ads? Are there any free or evaluation trail available? I want to make the banner ads on my PHP page. Thank you.
Calvin Chua
attached mail follows:
Wee Chua wrote: > > Hi all, > what is the best software to make banner ads? Are there any free or > evaluation trail available? I want to make the banner ads on my PHP page. > Thank you. > > Calvin Chua
Maybe this helps you a little: http://freshmeat.net/search/?site=Freshmeat&q=php+banner§ion=projects
-- Pavel a.k.a. Papi
attached mail follows:
I know this would probably be better placed on the mySQL mailing list, but alas I do not subscribe to it and am hesitant to do so to ask one question. Enough PHP users use mySQL that perhaps the answer could be found here.
In searching through a text field in a mySQL database, I would like to search for a keyword and return that record as a resultset, obvious no? However, I do not want the search to return true if the search word or phrase falls within an HTML tag contained within the text. The field in question will contain some basic HTML tags but I don't want them searched, just the freeform text.
What would be the best approach? I'm not all that well versed in regular expressions, well let's face it, I probably couldn't put a regular expression together if my life depended on it, and any assistance would be greatly appreciated.
attached mail follows:
Hi,
Have been trying to open a socket with PHP on Windows98 and get a call to undefined function error for the socket function. Does the Win32 version of PHP come with socket support.
BTW: Using PHP 4.10
Thanks in advance.
M
attached mail follows:
If you get the "call to undefined function" error, I'd say that it doesn't have the socket functions built in. I'm not positive, that'd be my guess though.
Tyler Longren
Captain Jack Communications
tyler
captainjack.com
www.captainjack.com
On Thu, 09 Aug 2001 15:19:40 +0100
"Michael Quinn" <michaelq
dol.ie> wrote:
> Hi,
>
> Have been trying to open a socket with PHP on Windows98 and get a call
> to undefined function error for the socket function. Does the Win32
> version of PHP come with socket support.
>
> BTW: Using PHP 4.10
>
> Thanks in advance.
>
> M
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Bjorn and Julio, you've got it right.
I've now a contract with Volvo Aero Services for web design and multivalue database support. Ever since Volvo bought AGES, it's been a huge technological step backwards from Linux and PHP to M$ and ASP. The big companies DON'T CARE that M$ puts out a security-hole-ridden, barely documented, admin-intensive product. And of course, management don't care--they don't have to deal with the day-to-day grind of trying to keep Win and its attendant components up and going.
In my own business I've seen how the use of open-source, solid, proudly-written-and-supported software takes great amounts of time away from administrative busy-work and gives it back in the form of more time to develop new products and sales. It's a very simple equation, actually. As a super-small businessman, anything (like Apache and PHP) that puts time and money back on MY side of the tally-board is a Good Thing.
I call the sort of problem we're discussing the "In-Flight Syndrome." You know, where a Big Corporate Executive goes on a junket somewhere and sees a glossy ad in a glossy in-flight magazine and arrives back at the home office to insist that current baby-and-bathwater be thrown out in favour of something glossy but wholly inappropriate. Or, "If I haven't seen in in a glossy magazine, it isn't what the Joneses are doing, therefore neither will we."
In VAS's situation, it's SAP. Now, mind you, SAP has no component that even remotely deals with the way aircraft parts brokerages actually do business. There's no module for FAA repairs, no way to deal with special consignment deals, and worst, no way to deal with the all-important documentation. In this business, "no documentation" equals "no sale."
Would YOU get on an aircraft if you suspected that undocumented parts were on it? I think not and I wouldn't get on it either. Airlines simply won't buy from brokers who cannot prove the authenticity and condition of life-limited parts.
But that hasn't stopped Volvo in the least. Obviously, corporate Powers That Be in Sweden are conveniently immune to such things as the law (Thou shalt document well all thy parts back to birth). The corporate philosophy is "If it runs on Windows, then it's Good Thing and We Must Use It," however inappropriate.
Face it: most large businesses have more dollars than sense. This sort of problem isn't limited to PHP, Apache, or Open Source products in general. Plain, honest horse-sense is what's missing. I see it happening at VAS and I see it happening it a lot of other large companies.
If the people in charge of IT took a good look at what's available and appropriate, there would be a lot more money made and a lot more happy technicians. "Happy technician" will also probably be loyal and productive. My prediction is that those of us who embrace Open Source and place such products in our businesses to limit downtime and administrative burdens will be the most profitable in the upcoming years.
Conversely, those like Volvo Aero, who insist on throwing good money after bad, will likely be out of business soon. The Cult of Microsoft is still strong in upper management, simply because they don't know (and are unwilling to countenance) any better.
That's what I call a self-correcting problem :-)
Respectfully to all, Bill
-----Original Message-----
From: Bjorn Van Simaeys [mailto:cyberplasma
yahoo.com]
Sent: Wednesday, August 08, 2001 6:15 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Re: PHP in corporate settings?
That's right. I have been working for a large computer company (2800 people), and my project manager had never even heard about PHP and such.
Bjorn Van Simaeys
--- Inércia Sensorial <inerte
hotmail.com> wrote:
> I don't think the problem is the open source
> nature. Corporate people
> usually do not see flaws on it. But they do not see
> the advantages too
> because there is little advertising.
>
> --
>
>
> Julio Nobrega.
>
> 2B||!BB - That's the question.
>
> "Jeff Lewis" <jeff
hyrum.net> wrote in message
> news:00dd01c1203b$60d62210$76a1a8c0
LEWISJCIT...
> I still rarely ever see PHP mentioned in job
> listings and the like.
> Especially here in Canada I find it very hard to
> find any kinds of contacts
> for companies using PHP. My previous employer that
> I was with for 3+ years
> insisted on Micro$oft products and wanted to go with
> ASP.
>
> My current employer, a HUGE media/newspaper in
> Ontario goes with strictly
> Java.
>
> Is it that people still are hesitant to go wth open
> source based technology?
>
> Jeff Lewis
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Message-ID: <3B72B630.7E84745C
sci-spain.com>
Date: Thu, 09 Aug 2001 17:11:28 +0100
From: "Sean C. McCarthy" <smccarthy
sci-spain.com>
MIME-Version: 1.0
To: Jeff Lewis <jeff
hyrum.net>
Cc: php-general
lists.php.net
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Re: [PHP] PHP in corporate settings?
Jeff Lewis wrote: > > I still rarely ever see PHP mentioned in job listings and the like. Especially here in Canada I find it very hard to find any kinds of contacts for companies using PHP. My previous employer that I was with for 3+ years insisted on Micro$oft products and wanted to go with ASP. > > My current employer, a HUGE media/newspaper in Ontario goes with strictly Java. > > Is it that people still are hesitant to go wth open source based technology? > > Jeff Lewis
Hi All,
Just one point Java is actually open source, because you can get the source code for the JVM. It is not GPL what means that if you want to make money with it you have to pay for it (but after all Sun is a bussiness, and bussiness are for making money).
One question how many programmers, technicians, support companies there aree for Microsoft Products? and now how many of them there are for PHP, open source, GPL? and I mean BIG companies. Beleive it or not certification is important. People fear to get stuck with something that anybody knows how to use.
Maybe not all the time they choose it for this same reason.
You might want to check this out http://www2.linuxjournal.com/lj-issues/issue85/index.html
Sean C. McCarthy SCI, S.L. (www.sci-spain.com)
BTW: I use Linux for work and home, and I like things like PHP ;-)
attached mail follows:
> Just one point Java is actually open source, because you can get the > source code for the JVM. It is not GPL what means that if you want to > make money with it you have to pay for it (but after all Sun is a > bussiness, and bussiness are for making money).
Access to source code has very little to do with being "Open Source". Access to source code is 1 out of 9 requirements for something to be open source. Please see http://www.opensource.org/docs/definition.html
-Rasmus
attached mail follows:
Rasmus Lerdorf wrote: > > > Just one point Java is actually open source, because you can get the > > source code for the JVM. It is not GPL what means that if you want to > > make money with it you have to pay for it (but after all Sun is a > > bussiness, and bussiness are for making money). > > Access to source code has very little to do with being "Open Source". > Access to source code is 1 out of 9 requirements for something to be open > source. Please see http://www.opensource.org/docs/definition.html > > -Rasmus
Ok sorry about that. I read "open source" and not Open Source as OSD ;-)
Sean C. McCarthy SCI, S.L. (www.sci-spain.com)
attached mail follows:
Yes I had wondered if someone was going to make that claim :)
So far I haven't seen much in perl or Java that I CAN'T do in PHP. The user community is much more helpful, the PHP manual online is IMO simply amazing. I love that guide :)
I just rarely see any jobs posted for PHP. Mostly ASP and Java.....
Jeff
----- Original Message -----
From: "Rasmus Lerdorf" <rasmus
php.net>
To: "Sean C. McCarthy" <smccarthy
sci-spain.com>
Cc: <php-general
lists.php.net>
Sent: Thursday, August 09, 2001 12:20 PM
Subject: Re: [PHP] PHP in corporate settings?
> > Just one point Java is actually open source, because you can get the > > source code for the JVM. It is not GPL what means that if you want to > > make money with it you have to pay for it (but after all Sun is a > > bussiness, and bussiness are for making money). > > Access to source code has very little to do with being "Open Source". > Access to source code is 1 out of 9 requirements for something to be open > source. Please see http://www.opensource.org/docs/definition.html > > -Rasmus
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
a big reason i use PHP as much as i do is becuase of the excellent documentation and ease of finding it all...
> -----Original Message-----
> From: Jeff Lewis [mailto:jeff
hyrum.net]
> Sent: Thursday, August 09, 2001 1:02 PM
> To: Rasmus Lerdorf; Sean C. McCarthy
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] PHP in corporate settings?
>
>
> Yes I had wondered if someone was going to make that claim :)
>
> So far I haven't seen much in perl or Java that I CAN'T do in PHP. The user
> community is much more helpful, the PHP manual online is IMO simply amazing.
> I love that guide :)
>
> I just rarely see any jobs posted for PHP. Mostly ASP and Java.....
>
> Jeff
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus
php.net>
> To: "Sean C. McCarthy" <smccarthy
sci-spain.com>
> Cc: <php-general
lists.php.net>
> Sent: Thursday, August 09, 2001 12:20 PM
> Subject: Re: [PHP] PHP in corporate settings?
>
>
> > > Just one point Java is actually open source, because you can get the
> > > source code for the JVM. It is not GPL what means that if you want to
> > > make money with it you have to pay for it (but after all Sun is a
> > > bussiness, and bussiness are for making money).
> >
> > Access to source code has very little to do with being "Open Source".
> > Access to source code is 1 out of 9 requirements for something to be open
> > source. Please see http://www.opensource.org/docs/definition.html
> >
> > -Rasmus
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBO3LXhMaXTGgZdrSUEQJfmACfY9aepUvwf1fl7VJbFJwk1OEvdR4AnRDF i3qL9uw4YnlYFAS+UjXyRtX2 =yQlA -----END PGP SIGNATURE-----
attached mail follows:
On Thu, 9 Aug 2001, Jeff Lewis wrote:
> Yes I had wondered if someone was going to make that claim :) > > So far I haven't seen much in perl or Java that I CAN'T do in PHP. The user > community is much more helpful, the PHP manual online is IMO simply amazing. > I love that guide :) > > I just rarely see any jobs posted for PHP. Mostly ASP and Java.....
Just a plug for my favorite country.. :)
There are tons of jobs in Germany for PHP developers.. some of the largest CMS providers who sell systems for 20K-200K EUR deploy PHP and they often have a growing need for more developers.
Germany is generally quite open towards PHP and related technologies; the first dedicated PHP conference was held in Germany last year; second, the Government is actually pushing the development of open-source technologies and actively participates in certain events and open-source conferences; third, Germany has now a full-blown registered association which will actively work on the promotion of PHP.
- Sascha Experience IRCG http://schumann.cx/ http://schumann.cx/ircg
attached mail follows:
Agreed! Kudos to the persons responsible for creating the php manual. It is imho, the most concise and accessible documentation of any technology that i have used on the net. The technology is astounding as well! I know i am rapidly becoming an evangelist :)
q.
Subject: RE: [PHP] PHP in corporate settings?
a big reason i use PHP as much as i do is becuase of the excellent documentation and ease of finding it all...
attached mail follows:
Bzzzt...Wrong! But thank you for playing. If you read the FAQ on Sun's "Open Source" website not only do they admit Java is not open source, but they sort of tip toe around whether or not it ever will be.
http://www.sunsource.net/faq.html#Java
Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com
<Snip> > Just one point Java is actually open source, because you can get the > source code for the JVM. It is not GPL what means that if you want to > make money with it you have to pay for it (but after all Sun is a > bussiness, and bussiness are for making money). <Snip> > Sean C. McCarthy > SCI, S.L. (www.sci-spain.com)
attached mail follows:
On Thu, 09 Aug 2001 14:30:43 -0500, Sheridan Saint-Michel
(webmaster
foxjet.com) wrote:
>Bzzzt...Wrong! But thank you for playing. If you read the FAQ on
>Sun's "Open Source" website not only do they admit Java is not
>open source, but they sort of tip toe around whether or not it ever
>will be.
well, I think it depends on if you're talking about java the language, java the jvm, or java the bytecode compiler. which of these do you need to be open source. I know of at least one open source jvm (kaffe), and I believe IBM may have released an open source compiler
>http://www.sunsource.net/faq.html#Java
>
>Sheridan Saint-Michel
>Website Administrator
>FoxJet, an ITW Company
>www.foxjet.com
>
>
><Snip>
>> Just one point Java is actually open source, because you can get
>>the
>> source code for the JVM. It is not GPL what means that if you want
>>to
>> make money with it you have to pay for it (but after all Sun is a
>> bussiness, and bussiness are for making money).
><Snip>
>> Sean C. McCarthy
>> SCI, S.L. (www.sci-spain.com)
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>For additional commands, e-mail: php-general-help
lists.php.net
>To contact the list administrators, e-mail: php-list-
>admin
lists.php.net
attached mail follows:
In my experience Scandinavia (well nordic really, can't forget finland) and germany (and a few other european countries...notably not england) are much more open to open source (no pun intended) to open source and the like.. their concerns are sensible ones. Something in the mentality. northern america/UK etc are much more short-sighted in their perspective.
Just a norwegians point of view, thats all.......
> On Thu, 9 Aug 2001, Jeff Lewis wrote:
>
> > Yes I had wondered if someone was going to make that claim :)
> >
> > So far I haven't seen much in perl or Java that I CAN'T do in PHP. The
user
> > community is much more helpful, the PHP manual online is IMO simply
amazing.
> > I love that guide :)
> >
> > I just rarely see any jobs posted for PHP. Mostly ASP and Java.....
>
> Just a plug for my favorite country.. :)
>
> There are tons of jobs in Germany for PHP developers.. some
> of the largest CMS providers who sell systems for 20K-200K
> EUR deploy PHP and they often have a growing need for more
> developers.
>
> Germany is generally quite open towards PHP and related
> technologies; the first dedicated PHP conference was held in
> Germany last year; second, the Government is actually pushing
> the development of open-source technologies and actively
> participates in certain events and open-source conferences;
> third, Germany has now a full-blown registered association
> which will actively work on the promotion of PHP.
>
> - Sascha Experience IRCG
> http://schumann.cx/ http://schumann.cx/ircg
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi guys,
I have a problem that's killin' me. As I'm not very good at Linux I don't know how to set the properties of the folder pics to be able to use the copy function. (If I'm right and the problem is not some else) Please help. Here's the code:
if (file_exists($userfile)) { copy("$userfile","pics/".$userfile); } else { echo "Nem sikerül a következő file-t feltölteni:".$userfile; }
thx
Tamas Bucsu
attached mail follows:
From: "Jon Farmer" <jonfarmer
enta.net>
To: "Tamas Bucsu" <ta.bucsu
orion-infotech.com>, <php-general
lists.php.net>
Date: Thu, 9 Aug 2001 16:40:59 +0100
Message-ID: <OOEBLEHOEDLBKALJPPJCIEKHCAAA.jonfarmer
enta.net>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Subject: RE: [PHP] Copy function usage ?
You need to make sure that what ever user the webserver/php runs under has permissions to read from the source folder/file and write permission for the destination folder/file.
Common users for apache/php are "nobody" or "apache"
regards
Jon
Jon Farmer Systems Programmer Entanet International Ltd www.enta.net Tel 01952 428969 Mob 07968 524175
-----Original Message-----
From: Tamas Bucsu [mailto:ta.bucsu
orion-infotech.com]
Sent: 09 August 2001 16:36
To: php-general
lists.php.net
Subject: [PHP] Copy function usage ?
Hi guys,
I have a problem that's killin' me. As I'm not very good at Linux I don't know how to set the properties of the folder pics to be able to use the copy function. (If I'm right and the problem is not some else) Please help. Here's the code:
if (file_exists($userfile)) { copy("$userfile","pics/".$userfile); } else { echo "Nem sikerül a következő file-t feltölteni:".$userfile; }
thx
Tamas Bucsu
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
look in httpd.conf to get the user name, then chown the directory to that user
ex.
chown apache:apache ./dir/ chmod 755 ./dir/
and make sure that you change permissions to all files that you write into the directory to be read-write only (not executable), chown 644 filename
and that you put newly uploaded files into a directory *outside* the document root of your webserver (so some random person cannot just upload any random file to your server and have immediate access to it)
> -----Original Message-----
> From: Jon Farmer [mailto:jonfarmer
enta.net]
> Sent: Thursday, August 09, 2001 11:41 AM
> To: Tamas Bucsu; php-general
lists.php.net
> Subject: RE: [PHP] Copy function usage ?
>
>
> You need to make sure that what ever user the webserver/php runs under has
> permissions to read from the source folder/file and write permission for the
> destination folder/file.
>
> Common users for apache/php are "nobody" or "apache"
>
> regards
>
> Jon
>
> Jon Farmer
> Systems Programmer
> Entanet International Ltd www.enta.net
> Tel 01952 428969
> Mob 07968 524175
>
> -----Original Message-----
> From: Tamas Bucsu [mailto:ta.bucsu
orion-infotech.com]
> Sent: 09 August 2001 16:36
> To: php-general
lists.php.net
> Subject: [PHP] Copy function usage ?
>
>
> Hi guys,
>
> I have a problem that's killin' me. As I'm not very good at Linux I don't
> know how to set the properties of the folder pics to be able to use the copy
> function. (If I'm right and the problem is not some else) Please help.
> Here's the code:
>
> if (file_exists($userfile)) {
> copy("$userfile","pics/".$userfile);
> } else {
> echo "Nem sikerül a következő file-t feltölteni:".$userfile;
> }
>
> thx
>
> Tamas Bucsu
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
-----BEGIN PGP SIGNATURE----- Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBO3KwG8aXTGgZdrSUEQLcsACfaWVByz/Q+Tu5WZgWp+JkwZ+mkOMAnRlG TTQNXq4GlF6pDxl+ufAbNoZw =1pnp -----END PGP SIGNATURE-----
attached mail follows:
Testing!
attached mail follows:
I have a bunch of dates like this: Jul 24 2001 Jul 31 2001 Aug 7 2001
I need to sort it from oldest to newest, but I can't devise a way that works. And they are text fields in MySQL so that won't sort it correctly either. Can anyone point me in the right direction?
attached mail follows:
To: php-general
lists.php.net, Chris <chrisderson
ameritech.net>
Message-ID: <3B72C08A.2992CC4C
dmscontrol.com>
Date: Thu, 09 Aug 2001 09:55:38 -0700
From: Ron Wills <ron
dmscontrol.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Re: Sorting Dates in this format: Jul 21 2001
Hey Chris
If the text field only contains dates, I'd suggest converting it to a DATE type the use DATE_FORMAT in your SELECT statement to return the format needed. This also lets MySQL sort it for you, ie:
SELECT DATE_FORMAT(date, '%b %e %Y') FROM your_table ORDER DESC BY date
Right off hand I don't think there's a simple way to sort it in PHP. If you want to keep it as a text field then you'll probable have to parce the dates and sort it accordingly, ie:
foreach ($dates as $date) $parced_dates[] = split(' ', $date);
// Your own sort functions sort_by_years($parced_dates); sort_by_months($parced_dates); sort_by_days($parced_dates);
I hope this helps
Chris wrote:
> I have a bunch of dates like this: > Jul 24 2001 > Jul 31 2001 > Aug 7 2001 > > I need to sort it from oldest to newest, but I can't devise a way that works. And they are text fields in MySQL so that won't sort it correctly either. Can anyone point me in the right direction?
-- Ron Wills DMS Control Programmer rondmscontrol.com
attached mail follows:
Hi,
I use a few forms on my websites, one of them is to log in onto the site.
These sites all work well in MSIE and Netscape 3 and 4.7 BUT in Netscap 6 (6.0, 6.01 and 6.1) there is a strange effect: The result page starts loading but the loading is broken before the end of the page. The php scrips are completed (results are in the database, emails are send out etc.) and the page is generated but simply doesn't tranfer completely.
For one form, the transfer always breaks at the same point, which is a fferent point for different forms. I cannot look into the transmitted source because netscape does a reload on "view source" which is not performed for dynamic pages....
Anyone seen this before? Does anyone have a qlue where to look for? (It looks to me like a header problem, but I have no idea what kind of header problem..)
Thanks in advance!
Peter.
attached mail follows:
From: "De Bodemschat - Geologisch Verzendhuis" <info
bodemschat.nl>
To: <php-general
lists.php.net>
Date: Thu, 9 Aug 2001 18:41:45 +0200
Message-ID: <NFBBIMGMILHKEFJEGPJJOEPJCDAA.info
bodemschat.nl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Subject: User authentication
Hello,
I set up a user-auth script that checks $PHP_AUTH_USER & $PHP_AUTH_PW against a db with login/pwd information, but on the server my site is hosted this doens't work because PHP runns as cgi.
How do I do this with PHP running as a cgi?
Thanks in advance. Regards
Bart
attached mail follows:
can anyone tell me why this doesn't work?? assuming I have these three files:
settings.php is: <?php $bar="someval"; ?>
page.php is: <?php require("settings.php"); echo "$bar from page.php"; //this works!!! include "function.php"; ?>
function.php is: <?php function foo{ global $bar; echo "$bar from foo"; //this does not work!!! } foo(); ?>
for some reason the $bar in function foo() doesn't have a value... :( calling page.php only returns the $bar from page.php
thanks in advance! jaxon
attached mail follows:
oh, this still happens when I fix the missing () in the foo declaration :)
cheers, jaxon
> -----Original Message-----
> From: Jaxon [mailto:jaxon
salamander.net]
> Sent: Thursday, August 09, 2001 12:34 PM
> To: php-general
lists.php.net
> Subject: help, weird include problem with functions
>
>
>
> can anyone tell me why this doesn't work??
> assuming I have these three files:
>
> settings.php is:
> <?php $bar="someval"; ?>
>
> page.php is:
> <?php
> require("settings.php");
> echo "$bar from page.php"; //this works!!!
> include "function.php";
> ?>
>
>
> function.php is:
> <?php
> function foo{
> global $bar;
> echo "$bar from foo"; //this does not work!!!
> }
> foo();
> ?>
>
> for some reason the $bar in function foo() doesn't have a value... :(
> calling page.php only returns the $bar from page.php
>
> thanks in advance!
> jaxon
>
attached mail follows:
You need to include settings.php in functions.php.
----- Original Message -----
From: "Jaxon" <jaxon
salamander.net>
To: <php-general
lists.php.net>
Sent: Thursday, August 09, 2001 12:48 PM
Subject: [PHP] RE: help, weird include problem with functions
> oh, this still happens when I fix the missing () in the foo declaration :)
>
> cheers,
> jaxon
>
> > -----Original Message-----
> > From: Jaxon [mailto:jaxon
salamander.net]
> > Sent: Thursday, August 09, 2001 12:34 PM
> > To: php-general
lists.php.net
> > Subject: help, weird include problem with functions
> >
> >
> >
> > can anyone tell me why this doesn't work??
> > assuming I have these three files:
> >
> > settings.php is:
> > <?php $bar="someval"; ?>
> >
> > page.php is:
> > <?php
> > require("settings.php");
> > echo "$bar from page.php"; //this works!!!
> > include "function.php";
> > ?>
> >
> >
> > function.php is:
> > <?php
> > function foo{
> > global $bar;
> > echo "$bar from foo"; //this does not work!!!
> > }
> > foo();
> > ?>
> >
> > for some reason the $bar in function foo() doesn't have a value... :(
> > calling page.php only returns the $bar from page.php
> >
> > thanks in advance!
> > jaxon
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
On Thu, Aug 09, 2001 at 12:48:38PM -0400, Jaxon wrote: > oh, this still happens when I fix the missing () in the foo declaration :) > > cheers, > jaxon >
Works fine, no problems at all!
Are you sure function.php is included at all? Because if the only problem would be $bar, the output would at least be:
someval from page.php from foo
Like I said... I don't have any problems with it. The output is:
someval from page.php someval from foo
(and all this without any errors or warnings!)
Pretty much what you'd expected...
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
hmm...yes, it does work, I jumped the gun on the simple example, cuz I thought it was an echo problem.. my un-simplified example has an opendir() in function foo() file.
function.php is: <?php function foo{ global $bar; echo "$bar from foo"; //this is working $handle=opendir("$bar/common/"); // I get a "OpenDir - no such file or directory" //some more stuff here to handle directory maniuplaion } foo(); ?>
so the simple example does indeed work, but the opendir() is choking trying to deal with the variable.
hmmm...
jaxon
> -----Original Message-----
> From: Renze Munnik [mailto:renze
datalink.nl]
> Sent: Thursday, August 09, 2001 1:06 PM
> To: jaxon
salamander.net; php-general
lists.php.net
> Subject: Re: [PHP] RE: help, weird include problem with functions
>
>
> On Thu, Aug 09, 2001 at 12:48:38PM -0400, Jaxon wrote:
> > oh, this still happens when I fix the missing () in the foo
> declaration :)
> >
> > cheers,
> > jaxon
> >
>
>
> Works fine, no problems at all!
>
> >
attached mail follows:
On Thu, Aug 09, 2001 at 01:15:41PM -0400, Jaxon wrote: > hmm...yes, it does work, I jumped the gun on the simple example, cuz I > thought it was an echo problem.. > my un-simplified example has an opendir() in function foo() file. > > > function.php is: > <?php > function foo{ > global $bar; > echo "$bar from foo"; //this is working > $handle=opendir("$bar/common/"); // I get a "OpenDir - no such file or > directory" > //some more stuff here to handle directory maniuplaion > } > foo(); > ?> > > so the simple example does indeed work, but the opendir() is choking trying > to deal with the variable. > > hmmm... > > jaxon >
Are you sure the directory you try to open actualy exists?
Btw... for things like this you better use:
if (!($handle = opendir ("$bar/common/"))) { // Some error here, and don't try to use $handle after this! }
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
yes, I'm sure the directory exists :)
here is the actual code, I suppose this would have been more helpful to start:
<?php function incl_common() { global $modroot; //modroot is defined as http://localhost/modules in a settings file
echo "<br>$modroot from included"; //this echos "http://localhost/modules" properly
//the below throws the error, OpenDir: No such file or directory (error 2) in (this function file name) //but I can replce the $modroot/common with a hard-coded path and it works fine.
$handle=opendir("$modroot/common"); while ($file = readdir($handle)) { //load files in $directory into array if ($file != ".." && $file != ".") { $files_to_include[count($files_to_include)] = $file; } }
//clean up and sort closedir($handle); if (is_array($files_to_include)) { while (list ($key, $val) = each ($files_to_include)) { include "$modroot/common/$val"; } } } incl_common(); ?>
attached mail follows:
I am making a site where people get 3 free months from when they register. In a table I have 2 different fields; 1 for when they register, and another I want exactly 3 months later. I have this code:
attached mail follows:
Message-ID: <20010809190835.A26828
pro-pain.telemediair.nl>
Date: Thu, 9 Aug 2001 19:08:35 +0200
From: Renze Munnik <renze
datalink.nl>
To: DrWebPat
aol.com, php-general
lists.php.net
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: Re: [PHP] correct date
On Thu, Aug 09, 2001 at 01:05:14PM -0400, DrWebPat
aol.com wrote:
> I am making a site where people get 3 free months from when they register.
> In a table I have 2 different fields; 1 for when they register, and another I
> want exactly 3 months later. I have this code:
>
I don't think that works :-)
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Oops..(Hit send prematurely.)
$currentmonth = date("m"); $currentday = date("d"); $year = date("Y"); $newmonth = $currentmonth + 3; if ($newmonth > 12){ $newmonth = $newmonth % 12; $year = $currentyear + 1; } $3months = date("Y-m-d",mktime(0,0,0,$newmonth,$currentday,$year));
This should get me exactly 3 months later and also checks for if its a later month (oct, nov, or dec) then it goes to the next year. How could I check to see if the new date doesn't fall on Feb. 30th or whatever? If someone signs up on the 31st of a month it'll never end on a month with 31 days.
Thanks, Pat
attached mail follows:
Message-ID: <20010809192604.B26828
pro-pain.telemediair.nl>
Date: Thu, 9 Aug 2001 19:26:04 +0200
From: Renze Munnik <renze
datalink.nl>
To: DrWebPat
aol.com, php-general
lists.php.net
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Subject: Re: [PHP] correct date (cont.)
On Thu, Aug 09, 2001 at 01:08:33PM -0400, DrWebPat
aol.com wrote:
> Oops..(Hit send prematurely.)
>
> $currentmonth = date("m");
> $currentday = date("d");
> $year = date("Y");
> $newmonth = $currentmonth + 3;
> if ($newmonth > 12){
> $newmonth = $newmonth % 12;
> $year = $currentyear + 1;
> }
> $3months = date("Y-m-d",mktime(0,0,0,$newmonth,$currentday,$year));
>
> This should get me exactly 3 months later and also checks for if its a later
> month (oct, nov, or dec) then it goes to the next year. How could I check to
> see if the new date doesn't fall on Feb. 30th or whatever? If someone signs
> up on the 31st of a month it'll never end on a month with 31 days.
>
> Thanks,
> Pat
>
Nothing to worry about... PHP does it for you. You can try it you know... Just use:
$currentmonth = 2; /* feb */ $currentday = 31; $year = 2001; /* eg */
The output will then be:
2001-03-03
Ain't that most excellent?!?!
I should tell you though... that:
$3months = date("Y-m-d",mktime(0,0,0,$newmonth,$currentday,$year));
doesn't work. Obv. you haven't tried it. It produces an error (and no date). Your variable name cannot begin with a number.
===== PHP Manual ===== A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' ===== =====
So I'd say: $threeMonths.
--* R&zE:
-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze
datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««
attached mail follows:
Hello,
I'm running RedHat 7.1 and have installed PHP 4 from the RedHat installation disk. It is a normal RPM file for the PHP install (prebuilt). PHP does not seem to work. Looking at the INSTALL file as if I were to build PHP from scratch it mentions some shared libraries that are not to be found. Any Ideas?
Thanks for any help Scott
attached mail follows:
Hello,
I'm running RedHat 7.1 and have installed PHP 4 from the RedHat installation disk. It is a normal RPM file for the PHP install (prebuilt). PHP does not seem to work. Looking at the INSTALL file as if I were to build PHP from scratch it mentions some shared libraries that are not to be found. Any Ideas?
Thanks for any help Scott
attached mail follows:
On 09 Aug 2001 12:31:18 -0500, Scott Pathel wrote: > Hello, > > I'm running RedHat 7.1 and have installed PHP 4 from the RedHat > installation disk. It is a normal RPM file for the PHP install (prebuilt). > PHP does not seem to work. Looking at the INSTALL file as if I were to > build PHP from scratch it mentions some shared libraries that are not to be > found. Any Ideas?
Define "does not seem to work". In the meantime check out your httpd.conf if your using Apache, may need to uncomment something is all.
-- ----------------------------------------------------------------------- destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common internet addict, 3. lover of late 80's heavy metal music, 4. Activist for the terminally un-elite; see also - cool guy, des, mr. php...It's 4:00am, your web site is still up, why are you? http://phplinks.org/ http://phptopsites.com/ http://destiney.com/ -----------------------------------------------------------------------
attached mail follows:
Hey, Scott:
I'm running RH7.1 myself. PHP sort-of "came out the box" when I installed the default server installation, as an Apache module. All's I had to do was make a PHP page (a timid "echo 'hello';"), throw it in the right directory, and *poof* it served.
Astonished me, too.
Seems as if when you install Apache from RH7.1, you get PHP as a module. Someone please correct me if this is a misunderstanding. But if you look, the httpd.conf for RH7.1 has "index.php" as one of its default index documents.
Best regards, Bill
-----Original Message-----
From: Scott Pathel [mailto:spsp
niia.net]
Sent: Thursday, August 09, 2001 1:31 PM
To: php-general
lists.php.net
Subject: [PHP] RedHat 7.1
Hello,
I'm running RedHat 7.1 and have installed PHP 4 from the RedHat installation disk. It is a normal RPM file for the PHP install (prebuilt). PHP does not seem to work. Looking at the INSTALL file as if I were to build PHP from scratch it mentions some shared libraries that are not to be found. Any Ideas?
Thanks for any help Scott
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
From: "BRACK" <brak
nettaxi.com>
To: php-general
lists.php.net
Date: Thu, 9 Aug 2001 20:19:46 +0200
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Reply-to: brak
nettaxi.com
Message-ID: <3B72F062.13598.33B57D
localhost>
Subject: charset win1251
I'm tired...
I finished English version of my site and wanted to start Russian part but realized that MySQL server returnes all data in koi-8r charset which is not very comfortable for some of the users, specially I know that A LOT of russians using Opera brawser older versions of which do not support koi-8 Any one knows how to convert koi-8 results of MySQL to win1251?
Thank you, you alredy helped me a lot,
Youri
attached mail follows:
I know CVS exists, and, I know there are some projects out there to make use of CVS/RCS using a web front end (I helped write one). I am however curious if anyone knows of any projects out there to create an ISO 900x angled document control systems out there?
Most of the commercial software packages seem fairly lame and ridiculously expensive.
The alternative of course is to build one myself, but, I figured I would avoid reinventing the wheel if at all possible.
Just curious, Seth
attached mail follows:
Hi friend!
Want to be a bulk email expert? Here is the best bulk mailer, period.
Ultra fast! Super reliable! No software to download! http://www.u-bulk.com
*******************Disclaimer********************
You are receiving email as php-general
lists.php.net
This email is a one time mailing. ADV appeared in
subject and vaild return address is provided.
There is no need to reply and you'll never receive
this email again. By law it cannot be considered
spam. But we still sincerely applogize should it
disturbed you.
************************************************
attached mail follows:
Hi folks,
I have a site on my laptop, works fine.
When I tar it up and move to my ISP for a production environment, certain things stop working.
The two environments are pretty much the same, except my laptop is php_mod and the ISP is a cgi.
Basic pages still work fine, but I'm using URL parsing to get variables and build pages on the fly. When I try to call one of these pages, e.g.
http://hostname/page.php/foo/bar
I get an "Internal Server Error" (bla bla bla internal error or misconfurguration bla bla bla)
Any idea how to troubleshoot what is going on here?
tia, suri
attached mail follows:
thanks, but it's not a csoft issue - it's webaxxs
i guess i'm trying to figure out if this could be a php configuration issue, and how i would track it down...
cheers, s
attached mail follows:
Okay...some valid info!
the error logs are showing:
[Thu Aug 9 15:23:20 2001] [error] [client my_ip_address] Premature end of script headers: /www/docued/cgi-bin/php
any ideas, oh gurus?
cheers, a
> -----Original Message-----
> From: duirfire
leary.csoft.net [mailto:duirfire
leary.csoft.net]
> Sent: Thursday, August 09, 2001 4:09 PM
> To: tyler
captainjack.com
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] development to ISP migration headache
>
>
> thanks, but it's not a csoft issue - it's webaxxs
>
> i guess i'm trying to figure out if this could be a php
> configuration issue, and how i would track it down...
>
> cheers,
> s
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]