Re: [PHP] Re: RADICORE ramework released

2006-04-13 Thread Hans Juergen von Lengerke
 From: Tony Marston [EMAIL PROTECTED]
 
 Any problems with locale are cased by having the language
 code in your browser set to something which cannot be
 matched up with the contents of the server's locale file.
 If it cannot find a match my software is supposed to keep
 the current default setting, whatever that is.

supposed to, but it doesn't look like it does what you
say. I get this error too. My language prefs are (in that
order)

   de-de, de, en-gb, en

When I move en up to first place the demo works.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: RADICORE ramework released

2006-04-13 Thread Hans Juergen von Lengerke
 From: Tony Marston [EMAIL PROTECTED]
 Hans Juergen von Lengerke [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
  From: Tony Marston [EMAIL PROTECTED]
 
  Any problems with locale are cased by having the language
  code in your browser set to something which cannot be
  matched up with the contents of the server's locale file.
  If it cannot find a match my software is supposed to keep
  the current default setting, whatever that is.
 
  supposed to, but it doesn't look like it does what you
  say. I get this error too. My language prefs are (in that
  order)
 
de-de, de, en-gb, en
 
  When I move en up to first place the demo works.
 
 This is very strange. I have just tried setting my browser language to 
 de-de, de, en-gb, en and I can access my demo without any problem.

It is indeed very strange because it works for me now too.
But I swear that I saw the error earlier :)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] echo, print and is_callable()/function_exists()

2006-04-07 Thread Hans Juergen von Lengerke
Just wrap it, like Example 1 of the manual shows

function my_echo($array, $key) {
echo $array[$key];
}

array_walk_recursive($array, 'my_echo');


 Date: Fri, 7 Apr 2006 15:42:40 +0100
 From: Chris Boget [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Subject: [PHP] echo, print and is_callable()/function_exists()
 
 Because both echo and print are language constructs and not actual
 functions, you can't seem to use either is_callable() or
 function_exists() on either to determine if they are valid 'function'
 calls.  Is there any other way to determine to check to see if I can
 execute either or?  I'm writing a version of array_walk_recursive() (it
 doesn't exist in the version of PHP we are using) and if I try to pass
 in either echo or print as the function, nothing ever happens because
 neither resolves as an executable function...
  
 Any ideas as to how I can get around this?
  
 thnx,
 Chris
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FQDN of the server thru CLI

2006-04-04 Thread Hans Juergen von Lengerke
I usually do this by forcing the profile to be read before I 
run the script. Something like

  * * * * * . /etc/profile  /path/to/script


 Date: Tue, 04 Apr 2006 17:43:09 +0530
 From: Venkat Venkataraju [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Subject: [PHP] FQDN of the server thru CLI
 
 Hi All
 
 I'm writing a bunch of cron scripts that send reports periodically using 
 phpmailer.
 
 I'm having a hard time trying to find the FQDN of the server. I need 
 that information to construct the from address for the emails.
 
 The $_ENV['HOSTNAME'] works only if the script is executed manually. the 
 cron does not pass the HOSTNAME env variable to the scripts.
 
 When executed from the CLI, the $_SERVER['HOSTNAME'] does not have the 
 fqdn, but just the hostname part of the FQDN.
 
 Unless i hard code the corntab file with
 HOSTNAME=fqdn
 
 i do not want to hardcode the hostname anywhere as these script will be 
 copied onto many servers. is there a way i can find the fully qualified 
 domain name thru PHP?
 
 Thanks
 /V
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question about fsockopen

2005-04-11 Thread Hans Juergen von Lengerke
 Date: Sun, 10 Apr 2005 08:00:23 - (UTC)
 From: [EMAIL PROTECTED]
 
 I have several IP in one interface (eth0) in my server and I want make
 connection to another server (check email, etc) using different ip for
 every mail server. I was read the document, and there is no way how to
 make this happen. Any idea?

You can do this with the CURL Extension, but then that
limits you to the protocols supported by CURL. If that
doesn't matter, take a look at CURLOPT_INTERFACE in
curl_setopt()

I'm afraid, I don't know how to do this with fsockopen() and 
weather it is possible at all.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Variable Passing

2005-04-08 Thread Hans Juergen von Lengerke
 Brad Brevet:
 
 Hi, I am curious how to pass a variable without using something like id=321.
 
 I have seen sites that have something like
 http://www.website.com/something/321 and the variable is passed how exactly
 is that done? And is it called something specific so I know how to refer to
 it in the future?

You can do that with $_SERVER[PATH_INFO]. If your script
is /something, this variable will be set to /321

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get nice variables from POST

2004-03-12 Thread Hans Juergen von Lengerke
I know this isn't what you want, but nevertheless, this
does not look ugly:

pre

  # Get variables from the form
  #
  $username  = $_POST['username'];
  $password  = $_POST['password'];
  $password2 = $_POST['password2'];
  $email = $_POST['email'];
  $email2= $_POST['email2'];
  $nickname  = $_POST['name'];
  $city  = $POST['city'];
  $state = $_POST['state'];
  $country   = $_POST['country'];
  $misc  = $_POST['misc'];
  $country   = $_POST['country'];

/pre

and there you go, you can now easily spot a typo too :-)

Hans


PS: If you read this with variable-width font
you might think I am an idiot. never mind.


 Date: Thu, 11 Mar 2004 14:51:25 +
 From: Mike Mapsnac [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Get nice  variables from POST

 I have about 10 fields in the form. And I get the fields through POST:
 //Get Variable from the form
 $username = $_POST['username'];
 $password = $_POST['password'];
 $password2 = $_POST['password2'];
 $email = $_POST['email'];
 $email2 = $_POST['email2'];
 $nickname = $_POST['name'];
 $city = $POST['city'];
 $state = $_POST['state'];
 $country = $_POST['country'];
 $misc = $_POST['misc'];
 $country = $_POST['country'];

 It works but it looks ugly. For each variable I have statemet. Is there a
 way to get the variables in the loop?

 I'm looking for nice way to get variables from POST?

 Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Another preg question

2004-02-14 Thread Hans Juergen von Lengerke
 From: Al [EMAIL PROTECTED]

 $text= preg_replace(/\n\n+/, \n\n, $text);
 // remove excess This doesn't seem to do anything.


Strange, your code works for me:

[EMAIL PROTECTED]:~  cat foo.php
?php
  $text = foo\n\n\n\n\nbar;
  echo before:\n===\n$text\n===\n\n;
  $text = preg_replace(/\n\n+/, \n\n, $text);
  echo after:\n===\n$text\n===\n\n;
?
[EMAIL PROTECTED]:~  php ./foo.php
before:
===
foo




bar
===

after:
===
foo

bar
===

[EMAIL PROTECTED]:~  php -v
PHP 4.3.4 (cli) (built: Feb 12 2004 17:42:41)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend
Technologies
[EMAIL PROTECTED]:~ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php