|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 24 May 2003 21:02:06 -0000 Issue 2076
php-general-digest-help
lists.php.net
Date: Sat May 24 2003 - 16:02:06 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 24 May 2003 21:02:06 -0000 Issue 2076
Topics (messages 148825 through 148878):
Re: Encrypt psw before sending?
148825 by: Jason Wong
148826 by: Catalin Trifu
Re: looking for function (pre 4.3.x)
148827 by: Justin French
148830 by: David Otton
148836 by: Jim Lucas
Re: [feature request] safe_mode_allowed_uids
148828 by: Adrian
148833 by: Philip Olson
Is there any function that sorts the contents of a string?
148829 by: DvDmanDT
148834 by: John W. Holmes
148875 by: Don Read
Need to get a site going in PHP
148831 by: The Doctor
148832 by: Manuel Lemos
Re: Finding out whether request was done via http or https
148835 by: Jim Lucas
Looking for code
148837 by: Sparky Kopetzky
148838 by: Jim Lucas
148864 by: Manuel Lemos
Re: PHP newbie: I love it, but...
148839 by: Steve Lane
Re: HTTP_REFERER <-> Norton firewall
148840 by: Merlin
148844 by: Martin Christian Koch
148845 by: Comex
148846 by: David Otton
148853 by: Martin Christian Koch
148854 by: Martin Christian Koch
148861 by: Martin Christian Koch
148871 by: Don Read
Re:Re: Re:Re: [PHP] Some problem with PHP install
148841 by: fongming
product catalog
148842 by: Chris Knipe
Re: CMS system
148843 by: Alexandru COSTIN
system calls to java not working
148847 by: goat
The || Operator
148848 by: zavaboy
148849 by: Rasmus Lerdorf
148850 by: zavaboy
148851 by: Tom Rogers
148852 by: zavaboy
148859 by: Ernest E Vogelsinger
148860 by: Rasmus Lerdorf
4.2.3 version of file_get_contents()
148855 by: MIKE YRABEDRA
mail() problem help.....
148856 by: fongming
148867 by: Manuel Lemos
148868 by: Manuel Lemos
148872 by: Ernest E Vogelsinger
faq's on the php site
148857 by: electroteque
Build
148858 by: Comex
148876 by: Comex
148877 by: Comex
PHP not working, giving "undefined variable"
148862 by: PHP Spooky
148863 by: PHP Spooky
148865 by: electroteque
148873 by: PHP Spooky
Apache 2
148866 by: bob parker
148870 by: Comex
New to classes
148869 by: Sparky Kopetzky
148874 by: Catalin Trifu
PHP Installation problem
148878 by: Jbbabalola.aol.com
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:
On Saturday 24 May 2003 16:48, Thomas Hochstetter wrote:
> is it possible to md5 encrypt + serialize a password from a form BEFORE
> sending off?
There is some (freely?) available javascript code to do md5 (google for it).
> Along the same line: can we call a php function from an
> onblur() js function?
Not without making another trip to the server. Refer to archives for previous
discussions on this.
> What is the best way of encrypting/ securing the password from a form? At
> this stage all i can come up with is POST call and then protect the vars
> thru a class.
google for that javascript md5 code.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Stenderup's Law:
The sooner you fall behind, the more time you will have to catch up.
*/
attached mail follows:
Hi,
If you use SSL, you don't have to worry
about encrypting the password, SSL does it for you.
If you want to use MD5 from JS, you can use the onSubmit event on the
form
or onClick event for the Submit button, and in a JS function encrypt the
password
and then send it to the server.
Cheers,
Catalin
"Thomas Hochstetter" <fisherofmen
gmx.net> wrote in message
news:23341.1053766113
www59.gmx.net...
> Hi guys,
>
> as promised, i am back with another question:
>
> is it possible to md5 encrypt + serialize a password from a form BEFORE
> sending off? Along the same line: can we call a php function from an
onblur() js
> function?
>
> What is the best way of encrypting/ securing the password from a form? At
> this stage all i can come up with is POST call and then protect the vars
thru a
> class.
>
> Any ideas?
>
> Thomas
>
> --
> +++ GMX - Mail, Messaging & more http://www.gmx.net +++
> Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!
>
attached mail follows:
not sure about the name of the calling function, but there is
$_SERVER['PHP_SELF'] for the called file (ie not the included file.
there are the constants __FILE__ and (i think) __LINE__ also
what are you trying to write? looks to me like some error handling type
stuff.
look at the example on the custom error handling page:
http://au.php.net/manual/en/ref.errorfunc.php
and trigger_error():
http://au.php.net/manual/en/function.trigger-error.php
on 24/05/03 5:21 PM, Carl P. Corliss (rabbitt
xaraya.com) wrote:
> Is there a known function that will give you the name of the calling function,
> something like this:
>
> $callee = who_the_heck_called_me();
>
> where $callee would then be an array with the following indices:
>
> calling_function
> calling_file
> calling_line
>
> or, if not, does anyone have any idea how to go about creating this?
>
> TIA :)
>
> cheers,
attached mail follows:
On Sat, 24 May 2003 00:21:29 -0600, you wrote:
>Is there a known function that will give you the name of the calling function,
>something like this:
>
>$callee = who_the_heck_called_me();
>
>where $callee would then be an array with the following indices:
>
>calling_function
>calling_file
>calling_line
>
>or, if not, does anyone have any idea how to go about creating this?
Hmm... error handling?
You could explore debug_backtrace(), I suppose. But that's 4.3 and above.
Anything else would probably require modifying PHP itself... while that's
possible, upgrading would be less work.
attached mail follows:
what I did was to use an array as my last argument on all my functions, this
will have something like this. And I will us your names
CallMyFunc("First arg", "second args", array(
'calling_function' =>
'ParentCall',
'calling_file' => __FILE__,
'calling_line' => __LINE__,
)
);
now, inside the CallMyFunc()
you will get this:
function CallMyFunc($ar1, $ar2, $args=array()) {
extract($args);
//now you have this
$calling_function == 'ParentCall';
$calling_file == '/home/www/path/to/my/file.php';
$calling_line == 200;
}
try out something like that.
Jim Lucas
----- Original Message -----
From: "Carl P. Corliss" <rabbitt
xaraya.com>
To: <php-general
lists.php.net>
Sent: Friday, May 23, 2003 11:21 PM
Subject: [PHP] looking for function (pre 4.3.x)
> Is there a known function that will give you the name of the calling
function,
> something like this:
>
> $callee = who_the_heck_called_me();
>
> where $callee would then be an array with the following indices:
>
> calling_function
> calling_file
> calling_line
>
> or, if not, does anyone have any idea how to go about creating this?
>
> TIA :)
>
> cheers,
>
> --
> Carl P. Corliss
> System Administrator / Developer
> Xaraya Web Application Framework Project
> www.xaraya.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
or am I in the wrong mailing list?
attached mail follows:
On Sat, 24 May 2003, Adrian wrote:
> or am I in the wrong mailing list?
Yes, you are :) Feature requests belong in the bug database
as it also has a feature request category.
http://bugs.php.net/
Regards,
Philip
attached mail follows:
Hello, is there any function that will change "acb" to "abc", "rys" to "rsy"
and so on? Otherwise, how would I sort them?
Thanks in advance... // DvDmanDT
attached mail follows:
> Hello, is there any function that will change "acb" to "abc", "rys" to
> "rsy"
> and so on? Otherwise, how would I sort them?
Convert your string into an array, sort the array, and then turn it back
into a string. Or use some sort of sorting algorithm and go letter by
letter.
$l = strlen($string);
for($x=0;$x<$l;$x++)
{ $ar[] = $string{$x}; }
sort($ar);
$sorted_string = implode('',$ar);
Check that sort() is the right function you want to use, but something
like that should work.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
On 24-May-2003 John W. Holmes wrote:
>> Hello, is there any function that will change "acb" to "abc", "rys" to
>> "rsy"
>> and so on? Otherwise, how would I sort them?
>
> Convert your string into an array, sort the array, and then turn it back
> into a string. Or use some sort of sorting algorithm and go letter by
> letter.
>
> $l = strlen($string);
> for($x=0;$x<$l;$x++)
> { $ar[] = $string{$x}; }
$ ar=preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
...
Regards,
--
Don Read dread
texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
I got a request from a customer to
sharpen his HTML based site.
UNFORTUNATELY, the site he wants it based on
http://www.advantage-financial.com based on asp.
What can I do to base it on PHP and a top nav to go.
converting http://www.abg.ca to said format.
attached mail follows:
Hello,
On 05/24/2003 10:36 AM, The Doctor wrote:
> I got a request from a customer to
> sharpen his HTML based site.
>
> UNFORTUNATELY, the site he wants it based on
> http://www.advantage-financial.com based on asp.
>
> What can I do to base it on PHP and a top nav to go.
>
> converting http://www.abg.ca to said format.
Rename all php scripts to have .asp extension? PHP won't mind! :-)
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
if https is being used, you will find this.
$_SERVER["HTTPS"] == 'on';
all you need to do is test for this and you're done.
now, on the regular server, it won't be set!
Jim Lucas
----- Original Message -----
From: "Lauri Vain" <lauri_lists
tharapita.com>
To: <php-general
lists.php.net>
Sent: Friday, May 23, 2003 2:18 AM
Subject: [PHP] Finding out whether request was done via http or https
> Hello,
>
> Is there a way to find out in the code whether the request was made via
> http or https?
>
> Thanks,
> Lauri
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Good morning!!
Does anyone know of any PHP ad rotator type code that exists and where I may find a copy thereof??
Thanks in advance!!
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
attached mail follows:
Check out www.phpclasses.org
they have many different scripts there.
Jim Lucas
----- Original Message -----
From: "Sparky Kopetzky" <sparkyk
blackmesa-isp.net>
To: "PHP General" <php-general
lists.php.net>
Sent: Saturday, May 24, 2003 8:51 AM
Subject: [PHP] Looking for code
Good morning!!
Does anyone know of any PHP ad rotator type code that exists and where I may
find a copy thereof??
Thanks in advance!!
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
attached mail follows:
Hello,
On 05/24/2003 12:51 PM, Sparky Kopetzky wrote:
> Does anyone know of any PHP ad rotator type code that exists and where I may find a copy thereof??
http://www.phpadsnew.com/
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
On 6/8/03 1:26 AM, "Jean" <jean
dpc.com> wrote:
> PHP is a very nice language. Been about a week reading O'Reilly & writing
> my first program. Making some fast progress. But, as I embellish my
> program, I am beginning to run into trouble. I am finding PHP to be
> extremely difficult to debug. There's a limit to embedding echo to check
> the program flow. Then, there are times when the browser shows absolutely
> nothing. Browser's Show Source Code lists next to nothing; I assume this is
> because the interpreter hung on a missing brace or something and outputted
> nothing! Until I become good at spotting my errors, I've got to find a
> debugging tool. Any words of wisdom would be appreciated.
>
> Jean
>
>
Hi Jean:
I usually log my debuggin output to a file. Look at the error_log function,
for example. I write a custom wrapper to send my errors there. In general
look at the error handling section in the online PHP docs.
You might also want to look into Zend Studio (www.zend.com) -- graphical IDE
with integrated debugger for PHP.
-- sgl
=======================================================
Steve Lane
Vice President
The Moyer Group
14 North Peoria St Suite 2H
Chicago, IL 60607
Voice: (312) 433-2421 Email: slane
moyergroup.com
Fax: (312) 850-3930 Web: http://www.moyergroup.com
=======================================================
attached mail follows:
HTTP_REFERER is set by the browser, so you can not rely on that!
cheers,
Merlin
"Martin Christian Koch" <martin
koch.dk> schrieb im Newsbeitrag
news:000801c32162$8f90d0d0$0100a8c0
koch...
> Due to the fact that Norton firewall takes control of the value of
> HTTP_REFERER, I want to find another way to secure data.
>
> This is the setup :
>
> picserver = apache server with PHP4 - acts as upload / output of jpeg
> server
> www = apache server with PHP4 - this is where the website runs from
>
> Now - on www I'm posting through a form a file upload directly to
> picserver.
> The receiving PHP-script checks the HTTP_REFERER - if it's NOT www, you
> will
> not be able to upload the picture. Now - under normal circumstances this
> is
> working fine, but NOT for users using Norton firewall, since
> HTTP_REFERER is
> altered.
>
> Outputting pictures is done like this :
>
> <a href=http://picserver/output.php?c=code> running on www.
> output.php contains a script which checks 'c' and outputs like this :
>
> if ($HTTP_REFERER == "www") {
> header("Content-type: image/jpeg");
> readline("picture.jpg");
> exit;
> }
>
> Now - under normal circumstances this works fine - but again -
> HTTP_REFERER
> is altered so Norton users are not able to view the pictures.
>
> How do I set security so that only www has access to picserver - so that
> noone else are able to misuse the server.
>
> Thanks for any advice,
> Martin
>
>
attached mail follows:
Gee - thanks mate - that really helped ... or maybe not.
Anybody knows a solution to the problem ?
Martin
-----Oprindelig meddelelse-----
Fra: Merlin [mailto:news.groups
web.de]
Sendt: 24. maj 2003 18:02
Til: php-general
lists.php.net
Emne: [PHP] Re: HTTP_REFERER <-> Norton firewall
HTTP_REFERER is set by the browser, so you can not rely on that!
cheers,
Merlin
"Martin Christian Koch" <martin
koch.dk> schrieb im Newsbeitrag
news:000801c32162$8f90d0d0$0100a8c0
koch...
> Due to the fact that Norton firewall takes control of the value of
> HTTP_REFERER, I want to find another way to secure data.
>
> This is the setup :
>
> picserver = apache server with PHP4 - acts as upload / output of jpeg
> server
> www = apache server with PHP4 - this is where the website runs from
>
> Now - on www I'm posting through a form a file upload directly to
> picserver.
> The receiving PHP-script checks the HTTP_REFERER - if it's NOT www,
you
> will
> not be able to upload the picture. Now - under normal circumstances
this
> is
> working fine, but NOT for users using Norton firewall, since
> HTTP_REFERER is
> altered.
>
> Outputting pictures is done like this :
>
> <a href=http://picserver/output.php?c=code> running on www.
> output.php contains a script which checks 'c' and outputs like this :
>
> if ($HTTP_REFERER == "www") {
> header("Content-type: image/jpeg");
> readline("picture.jpg");
> exit;
> }
>
> Now - under normal circumstances this works fine - but again -
> HTTP_REFERER
> is altered so Norton users are not able to view the pictures.
>
> How do I set security so that only www has access to picserver - so
that
> noone else are able to misuse the server.
>
> Thanks for any advice,
> Martin
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Martin Christian Koch wrote:
> Gee - thanks mate - that really helped ... or maybe not.
>
> Anybody knows a solution to the problem ?
>
> Martin
Do it a different way. This would put a load on the pic-server *AND* the
www one, but it's the only way to make sure.
1. Only accept requests from your www-server on your pic-server.
2. Do a readfile from your www-server to your pic-server.
1.41421356237309504880168872420969807856967187537694
Comex
The search is more profitable than the find.
Never, ever back down.
..==// Why not? \\==..
attached mail follows:
On Sat, 24 May 2003 18:43:05 +0200, "Martin Christian Koch" wrote:
[quoting fixed]
>>> Due to the fact that Norton firewall takes control of the value of
>>> HTTP_REFERER, I want to find another way to secure data.
>>HTTP_REFERER is set by the browser, so you can not rely on that!
>Gee - thanks mate - that really helped ... or maybe not.
>
>Anybody knows a solution to the problem ?
He told you exactly what you need to know - the REFERER line is set by the
client, and should not be used as a security mechanism.
It's not just NPF in paranoid mode that rewrites the referrer... pretty much
every Junkbuster-like proxy does. Opera and other browsers have security
settings to disable it, too.
Use sessions.
attached mail follows:
>>>> Due to the fact that Norton firewall takes control of the value of
>>>> HTTP_REFERER, I want to find another way to secure data.
>>>HTTP_REFERER is set by the browser, so you can not rely on that!
>>Gee - thanks mate - that really helped ... or maybe not.
>>
>>Anybody knows a solution to the problem ?
>He told you exactly what you need to know - the REFERER line is set by
the
>client, and should not be used as a security mechanism.
So - he told me exactly what I need to know, huh ?
If you read the first 2 lines (written by me), I already THERE state
that I want to find ANOTHER way than using HTTP_REFERER, and the guy
tells me not to use HTTP_REFERER. Big help.
And the "use sessions" statement I can't use at all. As I said this is 2
http-servers interacting.
Martin
attached mail follows:
> 1. Only accept requests from your www-server on your pic-server.
That is exactly what I requested. A method for the pic-server to be sure
it's the www-server which is doing the requesting. Be advised that the
pic-server has other purposes, acting as www-server for other sites and
therefore I can't just let apache only accept requests from the
www-server.
> 2. Do a readfile from your www-server to your pic-server.
Thanks.
Martin
attached mail follows:
> encode() and decode() are functions you have to make. If you need any
> help with them, you can contact me.
Thanks - good idea :)
This helped!
Martin
attached mail follows:
On 23-May-2003 Martin Christian Koch wrote:
> Due to the fact that Norton firewall takes control of the value of
> HTTP_REFERER, I want to find another way to secure data.
>
> This is the setup :
>
> picserver = apache server with PHP4 - acts as upload / output of jpeg
> server
> www = apache server with PHP4 - this is where the website runs from
>
> Now - on www I'm posting through a form a file upload directly to
> picserver.
> The receiving PHP-script checks the HTTP_REFERER - if it's NOT www, you
> will
> not be able to upload the picture. Now - under normal circumstances this
> is
> working fine, but NOT for users using Norton firewall, since
> HTTP_REFERER is
> altered.
>
> Outputting pictures is done like this :
>
> <a href=http://picserver/output.php?c=code> running on www.
> output.php contains a script which checks 'c' and outputs like this :
>
> if ($HTTP_REFERER == "www") {
> header("Content-type: image/jpeg");
> readline("picture.jpg");
> exit;
> }
>
> Now - under normal circumstances this works fine - but again -
> HTTP_REFERER
> is altered so Norton users are not able to view the pictures.
>
> How do I set security so that only www has access to picserver - so that
> noone else are able to misuse the server.
>
add a secret (password) code:
output.php?c=code&s=secret
<?php
function mksecret($salt) {
$d=date('DdM'); // change once a day
return(crypt($d, md5($salt)));
}
function cksecret($sec, $salt) {
$calc=mksecret($salt);
return ($sec == $calc);
}
$code='pic227.jpg';
$sec= mksecret($code);
echo "$code =$sec= : ", (cksecret($sec, $code) ? 'ok' : 'nope'), '<P>';
$code='pic228.jpg';
echo "$code =$sec= : ", (cksecret($sec, $code) ? 'ok' : 'nope'), '<P>';
?>
------
pic227.jpg =fbETv42yuurxQ= : ok
pic228.jpg =fbETv42yuurxQ= : nope
Regards,
--
Don Read dread
texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
attached mail follows:
I've solved the problem after I reinstall the
imap-2001a
I put --with-mm=/usr/local
before
--with-imap=../imap-2001a
and I succeeded in compiling the Apache.
thanks a lot.........
Fongming from Taiwan...
------------------------------------------
attached mail follows:
Yeah, I know this should be p!ss to code, but humans are lazy ok :)
I'm not looking for a entire shopping cart, but is there anything out there
that is like a product catalog??? (categories, products, images, price,
etc)?
I had a look, but I can't seem to find anything really... (not in PHP in
anycase)
--
me
attached mail follows:
Hello,
You might start by looking at our free KompleteLite product (based on
Krysalis 2.4) http://www.interakt.ro/products/KompleteLite/
> 1) i want to allow customer make something like "personal templates".
> when he will add a new article, news or somethink like it, he can use
> some prebuilt template (this template will be used to make the
> uniform layout for all web or for PDA etc).
We have this in the commercial version of Komplete - check
http://komplete.interakt.ro/
> 2) security, how to allow for some users make some action in system? a
> plan to make system based on plugins, eg. customer need FAQ so we will
> make it and add it to others plugins. it is simple to work with one
> plugin, but how to check all actions from all installed plugins?
We have support for modules in our KompleteLite open source CMS, and we
welcome any developer that could join us to imrpove it.
Alexandru
>
> jiri nemec, ICQ: 114651500
>
attached mail follows:
Hello all,
I am making system calls to a java class
like so
$res = system("java javaclass");
print $res;
the class is executable
but I get no result
thanks,
jcphp
goatstone.com
attached mail follows:
$you = "some";
if ($you == ("few" || "some" || "one")) {
echo "yes";
}else{
echo "no";
}
How can I make it print out "yes" if $you is equal to "few", "some", or
"one"?
attached mail follows:
if($you=="few" || $you=="some" || $you=="one")
On Sat, 24 May 2003, zavaboy wrote:
> $you = "some";
> if ($you == ("few" || "some" || "one")) {
> echo "yes";
> }else{
> echo "no";
> }
>
> How can I make it print out "yes" if $you is equal to "few", "some", or
> "one"?
>
>
>
>
attached mail follows:
*Sigh*
I thought there would be a better way...
Thanks anyway!
"Rasmus Lerdorf" <rasmus
lerdorf.com> wrote in message
news:Pine.LNX.4.44.0305241022420.1237-100000
thinkpad.lerdorf.com...
> if($you=="few" || $you=="some" || $you=="one")
>
> On Sat, 24 May 2003, zavaboy wrote:
> > $you = "some";
> > if ($you == ("few" || "some" || "one")) {
> > echo "yes";
> > }else{
> > echo "no";
> > }
> >
> > How can I make it print out "yes" if $you is equal to "few", "some", or
> > "one"?
> >
> >
> >
> >
>
attached mail follows:
Hi,
Sunday, May 25, 2003, 3:18:37 AM, you wrote:
z> $you = "some";
z> if ($you == ("few" || "some" || "one")) {
z> echo "yes";
z> }else{
z> echo "no";
z> }
z> How can I make it print out "yes" if $you is equal to "few", "some", or
z> "one"?
you can use a switch statement
switch($you){
case 'few':
case 'some':
case 'one':
echo 'yes';
break;
default:
echo 'no';
break;
}
--
regards,
Tom
attached mail follows:
Ok,
Thanks!
"Tom Rogers" <trogers
kwikin.com> wrote in message
news:457731279.20030525032546
kwikin.com...
> Hi,
>
> Sunday, May 25, 2003, 3:18:37 AM, you wrote:
> z> $you = "some";
> z> if ($you == ("few" || "some" || "one")) {
> z> echo "yes";
> z> }else{
> z> echo "no";
> z> }
>
> z> How can I make it print out "yes" if $you is equal to "few", "some", or
> z> "one"?
>
> you can use a switch statement
>
> switch($you){
> case 'few':
> case 'some':
> case 'one':
> echo 'yes';
> break;
> default:
> echo 'no';
> break;
> }
>
> --
> regards,
> Tom
>
attached mail follows:
At 19:18 24.05.2003, zavaboy said:
--------------------[snip]--------------------
>$you = "some";
>if ($you == ("few" || "some" || "one")) {
>echo "yes";
>}else{
>echo "no";
--------------------[snip]--------------------
if (in_array($you, array('few','some','one')))
echo 'yes';
else
echo 'no';
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Well, you could put your words into an array and use in_array() or use a
switch like someone suggested. The way you wrote your if, you are or'ing
together 3 strings. ("few"||"some"||"one") is going to evaluate to true
and then what you have left is ($you==true) which is not what you wanted.
-Rasmus
On Sat, 24 May 2003, zavaboy wrote:
> *Sigh*
> I thought there would be a better way...
> Thanks anyway!
>
> "Rasmus Lerdorf" <rasmus
lerdorf.com> wrote in message
> news:Pine.LNX.4.44.0305241022420.1237-100000
thinkpad.lerdorf.com...
> > if($you=="few" || $you=="some" || $you=="one")
> >
> > On Sat, 24 May 2003, zavaboy wrote:
> > > $you = "some";
> > > if ($you == ("few" || "some" || "one")) {
> > > echo "yes";
> > > }else{
> > > echo "no";
> > > }
> > >
> > > How can I make it print out "yes" if $you is equal to "few", "some", or
> > > "one"?
> > >
> > >
> > >
> > >
> >
>
>
>
>
attached mail follows:
Is there anyway to do this...
$string.=file_get_contents($file);
But, in a way that can be done in PHP 4.2.3?
I need the php syntax in the $file to remain intact for writing to a staic
file.
+--------------------------------------------+
Mike Yrabedra (President)
323 Incorporated
Home of MacDock, MacAgent and MacSurfshop
+--------------------------------------------+
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: mike
323inc.com
I: ichatmacdock
+--------------------------------------------+
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
+--------------------------------------------+
attached mail follows:
Hi, Sir:
I develop my own webmail on my website .
A few days ago, I join this php mailling list.
After that,
I found I could not send any mail to this mailling list.
I guess....
Because I sent mail with PHP's mail() function,
It seems like every mail's header shows "nobody "
on the first line of Return-path :
------------------------------------------------------------------
Return-Path: <nobody
fonn.fongming.idv.tw>
^^^^^^^^^^
and...
Received: (from nobody
localhost)
^^^^^^^^^^^^^^
------------------------------------------------------------------
I guess this is the reason why my mail was always rejected
by php mailling list.
How Can I replace the "nobody " to a normal user name ?
Thanks for any helps.....
Fongming from Taiwan.
attached mail follows:
Hello,
On 05/24/2003 10:53 PM, Fongming wrote:
> I develop my own webmail on my website .
> A few days ago, I join this php mailling list.
> After that,
> I found I could not send any mail to this mailling list.
> I guess....
> Because I sent mail with PHP's mail() function,
> It seems like every mail's header shows "nobody "
> on the first line of Return-path :
> ------------------------------------------------------------------
> Return-Path: <nobody
fonn.fongming.idv.tw>
> ^^^^^^^^^^
> and...
> Received: (from nobody
localhost)
> ^^^^^^^^^^^^^^
> ------------------------------------------------------------------
> I guess this is the reason why my mail was always rejected
> by php mailling list.
>
> How Can I replace the "nobody " to a normal user name ?
Return-Path: is a virtual header. It does not mean anything to MTAs.
Some MTAs: add it to the messages but it is ignored by any receiving server.
To set the return address, you may want to try this class that looks at
the Return-Path: header that you specify in the messages and passes it
to the MTA in a way that it is not ignored.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Hello,
On 05/24/2003 10:53 PM, Fongming wrote:
> I develop my own webmail on my website .
> A few days ago, I join this php mailling list.
> After that,
> I found I could not send any mail to this mailling list.
> I guess....
> Because I sent mail with PHP's mail() function,
> It seems like every mail's header shows "nobody "
> on the first line of Return-path :
> ------------------------------------------------------------------
> Return-Path: <nobody
fonn.fongming.idv.tw>
> ^^^^^^^^^^
> and...
> Received: (from nobody
localhost)
> ^^^^^^^^^^^^^^
> ------------------------------------------------------------------
> I guess this is the reason why my mail was always rejected
> by php mailling list.
>
> How Can I replace the "nobody " to a normal user name ?
Return-Path: is a virtual header. It does not mean anything to MTAs.
Some MTAs: add it to the messages but it is ignored by any receiving server.
To set the return address, you may want to try this class that looks at
the Return-Path: header that you specify in the messages and passes it
to the MTA in a way that it is not ignored.
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
At 20:46 24.05.2003, Manuel Lemos said:
--------------------[snip]--------------------
>Return-Path: is a virtual header. It does not mean anything to MTAs.
>Some MTAs: add it to the messages but it is ignored by any receiving server.
--------------------[snip]--------------------
Usually MTSs use the Return-Path to direct bounces and errors to, if it
exists. If it doesn't they use the "From" address.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
just curious and an idea is there an faq section on the php site ? if not
maybe it would be an idea
attached mail follows:
I'm trying to build PHP5 from source on WinXP & Apache2. I get the
following:
wddx.obj : error LNK2001: unresolved external symbol _XML_ParserFree
xml.obj : error LNK2001: unresolved external symbol _XML_ParserFree
wddx.obj : error LNK2001: unresolved external symbol _XML_Parse
xml.obj : error LNK2001: unresolved external symbol _XML_Parse
wddx.obj : error LNK2001: unresolved external symbol
_XML_SetCharacterDataHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetCharacterDataHandler
wddx.obj : error LNK2001: unresolved external symbol _XML_SetElementHandler
xml.obj : error LNK2001: unresolved external symbol _XML_SetElementHandler
wddx.obj : error LNK2001: unresolved external symbol _XML_SetUserData
xml.obj : error LNK2001: unresolved external symbol _XML_SetUserData
wddx.obj : error LNK2001: unresolved external symbol _XML_ParserCreate
xml.obj : error LNK2001: unresolved external symbol _XML_ExpatVersion
xml.obj : error LNK2001: unresolved external symbol _XML_GetUserData
xml.obj : error LNK2001: unresolved external symbol _XML_ParserCreate_MM
xml.obj : error LNK2001: unresolved external symbol
_XML_SetProcessingInstructionHandler
xml.obj : error LNK2001: unresolved external symbol _XML_SetDefaultHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetUnparsedEntityDeclHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetNotationDeclHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetExternalEntityRefHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetStartNamespaceDeclHandler
xml.obj : error LNK2001: unresolved external symbol
_XML_SetEndNamespaceDeclHandler
xml.obj : error LNK2001: unresolved external symbol _XML_GetErrorCode
xml.obj : error LNK2001: unresolved external symbol _XML_ErrorString
xml.obj : error LNK2001: unresolved external symbol
_XML_GetCurrentLineNumber
xml.obj : error LNK2001: unresolved external symbol
_XML_GetCurrentColumnNumber
xml.obj : error LNK2001: unresolved external symbol _XML_GetCurrentByteIndex
..\Debug_TS\php4ts_debug.dll : fatal error LNK1120: 21 unresolved externals
Error executing link.exe.
php4apache2.dll - 27 error(s), 49 warning(s)
What is the problem?
--
1.41421356237309504880168872420969807856967187537694
Will you answer "no" or an equivalent of it to this question?
The search is more profitable than the find.
Never, ever back down.
..==// Why not? \\==..
attached mail follows:
<008001c3221f$b878c940$0a01a8c0
BigBeastie>
Comex:
> I'm trying to build PHP5 from source on WinXP & Apache2. I get the
> following:
>
> wddx.obj : error LNK2001: unresolved external symbol _XML_ParserFree
> xml.obj : error LNK2001: unresolved external symbol _XML_ParserFree
> wddx.obj : error LNK2001: unresolved external symbol _XML_Parse
> xml.obj : error LNK2001: unresolved external symbol _XML_Parse
> wddx.obj : error LNK2001: unresolved external symbol
> _XML_SetCharacterDataHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetCharacterDataHandler
> wddx.obj : error LNK2001: unresolved external symbol
> _XML_SetElementHandler xml.obj : error LNK2001: unresolved external
> symbol _XML_SetElementHandler wddx.obj : error LNK2001: unresolved
> external symbol _XML_SetUserData xml.obj : error LNK2001: unresolved
> external symbol _XML_SetUserData wddx.obj : error LNK2001: unresolved
> external symbol _XML_ParserCreate xml.obj : error LNK2001: unresolved
> external symbol _XML_ExpatVersion xml.obj : error LNK2001: unresolved
> external symbol _XML_GetUserData xml.obj : error LNK2001: unresolved
> external symbol _XML_ParserCreate_MM xml.obj : error LNK2001:
> unresolved external symbol _XML_SetProcessingInstructionHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetDefaultHandler xml.obj : error LNK2001: unresolved external
> symbol _XML_SetUnparsedEntityDeclHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetNotationDeclHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetExternalEntityRefHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetStartNamespaceDeclHandler
> xml.obj : error LNK2001: unresolved external symbol
> _XML_SetEndNamespaceDeclHandler
> xml.obj : error LNK2001: unresolved external symbol _XML_GetErrorCode
> xml.obj : error LNK2001: unresolved external symbol _XML_ErrorString
> xml.obj : error LNK2001: unresolved external symbol
> _XML_GetCurrentLineNumber
> xml.obj : error LNK2001: unresolved external symbol
> _XML_GetCurrentColumnNumber
> xml.obj : error LNK2001: unresolved external symbol
> _XML_GetCurrentByteIndex ..\Debug_TS\php4ts_debug.dll : fatal error
> LNK1120: 21 unresolved externals Error executing link.exe.
>
> php4apache2.dll - 27 error(s), 49 warning(s)
>
> What is the problem?
I downloaded a LibXML binary from
http://www.zlatkovic.com/projects/libxml/binaries.html because it was
looking for some related files. I didn't have to do this before.
--
1.41421356237309504880168872420969807856967187537694
Yes, it's true that the above isn't not false, unless it isn't.
The search is more profitable than the find.
Never, ever back down.
..==// Why not? \\==..
attached mail follows:
Whoops. I get my mistake.
--
1.41421356237309504880168872420969807856967187537694
No, it's true that the above isn't not true, unless it is.
The search is more profitable than the find.
Never, ever back down.
..==// Why not? \\==..
attached mail follows:
Glory!
I recently installed Apache2 on my WindowsXP system. And I'm running the
latest PHP version.
Everything was working fine but today I noticed something, an error. Now
I don't know, I cant recall, if it's since I installed Apache2 or if it
just started today. But anyway, here's the deal..
In any script that I provide where I'm using the
if(!$submit)
to check if the form has been submitted or not, I get the following
error :
Notice: Undefined variable: submit in D:\Program Files\Apache
Group\Apache2\htdocs\mjs\dir\install.php on line 6
Basically it's giving me a "Notice : Undefined variable" error. Why? I
have the Register_Globals turned On. And I never had this problem. I
have been using this $submit variable from a long time. How do I rectify
this problem? What has happened?
Thanks,
PHPSpooky
______________________________________
"If God had wanted me otherwise, He would have created me otherwise."
- Johann Wolfgang von Goethe
attached mail follows:
Glory!
I recently installed Apache2 on my WindowsXP system. And I'm running the
latest PHP version.
Everything was working fine but today I noticed something, an error. Now
I don't know, I cant recall, if it's since I installed Apache2 or if it
just started today. But anyway, here's the deal..
In any script that I provide where I'm using the
if(!$submit)
to check if the form has been submitted or not, I get the following
error :
Notice: Undefined variable: submit in D:\Program Files\Apache
Group\Apache2\htdocs\mjs\dir\install.php on line 6
Basically it's giving me a "Notice : Undefined variable" error. Why? I
have the Register_Globals turned On. And I never had this problem. I
have been using this $submit variable from a long time. How do I rectify
this problem? What has happened?
Thanks,
PHPSpooky
______________________________________
"If God had wanted me otherwise, He would have created me otherwise."
- Johann Wolfgang von Goethe
attached mail follows:
default the E_NOTICE is on , turn that one off in php.ini check out the
error_reporting section of php.net, i know its annoying , but seriously how
do u not get those errors to show up , is the var supposed to be set like
var $submit ?
-----Original Message-----
From: PHP Spooky [mailto:phpspooky
mjimm.com]
Sent: Sunday, May 25, 2003 4:31 AM
To: php-general
lists.php.net
Subject: [PHP] PHP not working, giving "undefined variable"
Glory!
I recently installed Apache2 on my WindowsXP system. And I'm running the
latest PHP version.
Everything was working fine but today I noticed something, an error. Now
I don't know, I cant recall, if it's since I installed Apache2 or if it
just started today. But anyway, here's the deal..
In any script that I provide where I'm using the
if(!$submit)
to check if the form has been submitted or not, I get the following
error :
Notice: Undefined variable: submit in D:\Program Files\Apache
Group\Apache2\htdocs\mjs\dir\install.php on line 6
Basically it's giving me a "Notice : Undefined variable" error. Why? I
have the Register_Globals turned On. And I never had this problem. I
have been using this $submit variable from a long time. How do I rectify
this problem? What has happened?
Thanks,
PHPSpooky
______________________________________
"If God had wanted me otherwise, He would have created me otherwise."
- Johann Wolfgang von Goethe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Thanks so much. That worked.. putting up the "E_ALL & ~E_NOTICE" for the
error_reporting.
And that was actually very stupid. You're right, do we give var $submit?
I mean there was actually no error.. and if you have the reporting on,
it makes it an error.
Thanks,
PHPSpooky
______________________________________
"If God had wanted me otherwise, He would have created me otherwise."
- Johann Wolfgang von Goethe
default the E_NOTICE is on , turn that one off in php.ini check out the
error_reporting section of php.net, i know its annoying , but seriously
how
do u not get those errors to show up , is the var supposed to be set
like
?
-----Original Message-----
From: PHP Spooky [mailto:phpspooky
mjimm.com]
Sent: Sunday, May 25, 2003 4:31 AM
To: php-general
lists.php.net
Subject: [PHP] PHP not working, giving "undefined variable"
Glory!
I recently installed Apache2 on my WindowsXP system. And I'm running the
latest PHP version.
Everything was working fine but today I noticed something, an error. Now
I don't know, I cant recall, if it's since I installed Apache2 or if it
just started today. But anyway, here's the deal..
In any script that I provide where I'm using the
if(!$submit)
to check if the form has been submitted or not, I get the following
error :
Notice: Undefined variable: submit in D:\Program Files\Apache
Group\Apache2\htdocs\mjs\dir\install.php on line 6
Basically it's giving me a "Notice : Undefined variable" error. Why? I
have the Register_Globals turned On. And I never had this problem. I
have been using this $submit variable from a long time. How do I rectify
this problem? What has happened?
Thanks,
PHPSpooky
______________________________________
"If God had wanted me otherwise, He would have created me otherwise."
- Johann Wolfgang von Goethe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Have the issues between Apache 2 and PHP been resolved?
Thanks
Bob Parker
attached mail follows:
<bob_parker
dodo.com.au>
bob parker:
> Have the issues between Apache 2 and PHP been resolved?
>
> Thanks
> Bob Parker
In a word, no.
1.41421356237309504880168872420969807856967187537694
It's true that it's not true, not taking into consideration the fact
that could not be not true, or perhaps the opposite, or perhaps not.
The search is more profitable than the find.
Never, ever back down.
..==// Why not? \\==..
attached mail follows:
Hi, again!!
I'm building a class that has an associative array the I want to reveal to the outside called $lot. Code that uses the class should be able to put data into the array. When the user has finished filling the array, they should be able to send the array back to the class for further processing. Can I get away with this:
var $lot;
// $lot initialized by constructor
function GetEmptyLot()
{
return $this->lot;
}
function UseLot($lot)
{
// processing goes here
}
or do I use this instead
$mylot = new lot;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
mylot->UseLot(); // where $lot is still inside $mylot
Looked throught the php manual and could not find a instance of this type of code.
Help!!
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
attached mail follows:
Hi,
First things first; classes in PHP version 4.x are nothing more than
syntactic sugar for arrays, so basically you can't hide anything from
a class to the outside world; so
$myot->lot['something'] = $value;
is perfectly legal and does what you wanted too.
One piece of advice though; it's pointless to use classes
like that. It breaks the idea of encapsulation.
if you want to add something to your class, use
accessor methods (get and set).
Cheers,
Catalin
"Sparky Kopetzky" <sparkyk
blackmesa-isp.net> wrote in message
news:000a01c32227$a7408c00$82dbfcd0
blackmesaisp.net...
Hi, again!!
I'm building a class that has an associative array the I want to reveal to
the outside called $lot. Code that uses the class should be able to put data
into the array. When the user has finished filling the array, they should be
able to send the array back to the class for further processing. Can I get
away with this:
var $lot;
// $lot initialized by constructor
function GetEmptyLot()
{
return $this->lot;
}
function UseLot($lot)
{
// processing goes here
}
or do I use this instead
$mylot = new lot;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
$mylot->lot['something'] = value;
mylot->UseLot(); // where $lot is still inside $mylot
Looked throught the php manual and could not find a instance of this type of
code.
Help!!
Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net
attached mail follows:
Hey,
I am having problem in disabling the "security alert" even after I've
configured the force_redirect to off (0) and removed the semicolon. I
installed the PHP
Window Installer on win98 using PWS.
Any help suggested most appreciated.
Regards
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]