php-general Digest 6 May 2006 04:33:49 -0000 Issue 4112

2006-05-05 Thread php-general-digest-help

php-general Digest 6 May 2006 04:33:49 - Issue 4112

Topics (messages 235652 through 235672):

Re: Showing an image outside of the web folder
235652 by: Rabin Vincent

Re: Echo a value from an arrays position
235653 by: Eric Butera

Re: php and ssl
235654 by: Eric Butera

Re: Rhumb Lines
235655 by: Paul Scott
235663 by: Paul Scott

Re: heredoc question
235656 by: Robert Cummings
235657 by: Dave Goodchild
235660 by: Al

Re: User confirmation questions?
235658 by: tedd
235659 by: Rabin Vincent
235662 by: tedd
235666 by: Chuck Anderson

Re: php and ssl [SOLVED]
235661 by: Schalk

Re: PHP Upgrade Question
235664 by: Tom Ray

Re: What editor do you use?
235665 by: Nicolas Verhaeghe
235671 by: Ólafur Waage

adding objects to spl.php because it doesn't appear to be there
235667 by: jonathan
235668 by: chris smith
235669 by: jonathan

Re: Test URL  length please (Pretty much 0T)
235670 by: Ryan A

hosting reselling
235672 by: John Taylor-Johnston

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---

On 5/5/06, James Nunnerley [EMAIL PROTECTED] wrote:

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?


Drop the appropriate content-type header:

header('Content-type: image/png');
readfile('/home/foo/bar.png');

Rabin
---End Message---
---BeginMessage---

On 5/4/06, Brad Bonkoski [EMAIL PROTECTED] wrote:


Will this also work with an associative array?  If this is what he is
talking about, I tried it and it does not work

I put this together though and it works, not sure if it is the *best*
way though...

?php
$colors =
array('white'='#ff','black'='#00','blue'='#ff');

$count = 0;
foreach( $colors as $k = $v) {
$count++;
if( $count == 2 )
echo \$colors[$k] = $v.\n;
}
?

-Brad



One thing that might help you guys... now and in in the future are the
functions var_dump() and print_r().  You can wrap these with pre/pre
tags to make it all pretty and formatted for reading too.

If you're unsure of what exactly is happening with your data try this:

$colors = array('white'='#ff','black'='#00','blue'='#ff');
print_r($colors);

... and you will see:

Array ( [white] = #ff [black] = #00 [blue] = #ff )

So you would call $colors['black'] to access #00.
---End Message---
---BeginMessage---

On 5/4/06, Schalk [EMAIL PROTECTED] wrote:


Greetings All,

I am currently implementing a form for a client that will run over
https. Now, all is good and well except, for some reason when the form
loads in IE the lock in the status bar displays for a short while and
then goes away, it is fine in Firefox though. The way I have the form
coded is something like this:

?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$street_address = $_POST['street_address'];

$to = 'address';
$subject = subject;
$headers = MIME-Version: 1.0\r\n.
   Content-type: text/html; charset=iso-8859-1\r\n.
   From: .$name.\r\n.
   Reply-to: .$email.\r\n.

   Date: .date(r).\r\n;

// Compose message:
$message = message;

// Send message
mail($to, $subject, $message, $headers);

// Thank the generous user
echo h1Thank You!/h1;
}
else {

?
form name=donation_eng action=?php echo $_SERVER['PHP_SELF']; ?
method=post
fieldset
legendFill in your details/legend
table cellspacing=0 cellpadding=0 class=form-container
tr
td colspan=2
label for=nameName:
input name=name type=text id=name tabindex=1 size=35
maxlength=150 /
/label
/td
/tr
/table
/fieldset
/form
?php
   }
?

The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to think
that the form is not secure and not loaded over https? Thank you in
advance!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

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



I bet your problem is this:
http://www.epda.cc/images/horz_master_120pixels.gif

One thing I do at work here when I'm having issues with SSL is to check any
links you have to stylesheets, javascript, etc for http:// in them.  Then
after that use firefox's View Page Info and goto the tab Media.  Check
for any http:// images.

Hope that helps.
---End Message---
---BeginMessage---
On Fri, 2006-05-05 at 11:44 -0300, Miles Thompson wrote:
 What an interesting problem. You might have better luck on a 

Re: [PHP] User confirmation questions?

2006-05-05 Thread Rabin Vincent

On 5/5/06, William Stokes [EMAIL PROTECTED] wrote:

In PHP is it possible to generate windows style question boxes and get the
users choice back? Or do I need javascript or something else for that?

For example if a user hits a button in form I could ask for his confirmation
for the action. Like Do you Really wan't to drop the whole database? Yes
or No. And perform or cancel the action by user's decision.


You'll need to use Javascript for this kind of dialog box. PHP
runs on the server-side, so you can't do this with PHP.

Rabin

--
http://rab.in

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



Re: [PHP] User confirmation questions?

2006-05-05 Thread William Stokes
OK

Rabin Vincent [EMAIL PROTECTED] kirjoitti 
viestissä:[EMAIL PROTECTED]
On 5/5/06, William Stokes [EMAIL PROTECTED] wrote:
 In PHP is it possible to generate windows style question boxes and get 
 the
 users choice back? Or do I need javascript or something else for that?

 For example if a user hits a button in form I could ask for his 
 confirmation
 for the action. Like Do you Really wan't to drop the whole database? Yes
 or No. And perform or cancel the action by user's decision.

You'll need to use Javascript for this kind of dialog box. PHP
runs on the server-side, so you can't do this with PHP.

Rabin

--
http://rab.in 

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



Re: [PHP] Mail and hotmail

2006-05-05 Thread Angelo Zanetti


Peter Lauri wrote:

I do set the headers now, but still the email is not delivered to Hotmail.
This is the headers that I set:

X-Sender: [EMAIL PROTECTED]
From: DWS Asia [EMAIL PROTECTED]
Date: Thu, 04 May 2006 22:04:23 +0700
Subject: What is this? 2


the subject of your email!

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



RE: [PHP] Mail and hotmail

2006-05-05 Thread Peter Lauri
:) And that was my subject for the test mail I sent :) It was just a
coincidence.

What values can Importance have?

$headers  = X-Sender: .$this-myFrom. .$this-myFromEmail..$eol;
$headers .= From: .$this-myFrom. .$this-myFromEmail..$eol; 
$headers .= Date: .date(r).$eol; 
$headers .= Subject: .$this-mySubject.$eol; 
$headers .= Delivered-to: .$this-myTo. .$this-myToEmail..$eol; 
$headers .= MIME-Version: 1.0.$eol; 
$headers .= Reply-To: .$this-myFrom. .$this-myFromEmail..$eol; 
$headers .= Content-type: text/html; charset=utf-8.$eol; 
$headers .= X-Priority: 3.$eol; 
$headers .= Importance: 3.$eol; 
$headers .= Return-Path: .$this-myFrom. .$this-myFromEmail..$eol; 
$headers .= X-Mailer: PHP v.phpversion().$eol;

X-Sender: [EMAIL PROTECTED]
From: DWS Asia [EMAIL PROTECTED]
Date: Thu, 04 May 2006 22:04:23 +0700
Subject: What is this? 2
Delivered-to: Markus Karlsson [EMAIL PROTECTED]
MIME-Version: 1.0
Reply-To: DWS Asia [EMAIL PROTECTED]
Content-type: text/html; charset=utf-8
X-Priority: 3
Importance: 3
Return-Path: DWS Asia [EMAIL PROTECTED]
X-Mailer: PHP v4.3.11

Best regards,
Peter Lauri



-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 05, 2006 1:31 PM
To: Peter Lauri
Cc: php-general@lists.php.net
Subject: Re: [PHP] Mail and hotmail


Peter Lauri wrote:
 I do set the headers now, but still the email is not delivered to Hotmail.
 This is the headers that I set:
 
 X-Sender: [EMAIL PROTECTED]
 From: DWS Asia [EMAIL PROTECTED]
 Date: Thu, 04 May 2006 22:04:23 +0700
 Subject: What is this? 2

the subject of your email!

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



[PHP] Smarty error

2006-05-05 Thread Nirmalya Lahiri
Dear all,
  I wrote this script using Smarty template,which gives a syntax error ..
 
 syntax error: unrecognized tag:  (Smarty_Compiler.class.php, line 436)
 
 
 I wrote a javascript block in template file,where I use '{'. This '{' 
acctually shows the problem. How can I solve this problem?
 
 --Nirmalya Lahiri
 

-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.

Re: [PHP] Avoiding user refresh of pages with forms

2006-05-05 Thread Satyam


- Original Message - 
From: Richard Lynch [EMAIL PROTECTED]

To: John Wells [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Friday, May 05, 2006 3:27 AM
Subject: Re: [PHP] Avoiding user refresh of pages with forms



On Thu, May 4, 2006 6:37 am, John Wells wrote:

On 5/3/06, Satyam [EMAIL PROTECTED] wrote:

I used that method initially, some months ago, but finally dropped
it.  It
looked nice at first, but then I started getting into problems and
required
too many special cases to make it work.   In the end, it wasn't a
clean nor
elegant solution.


Satyam,

Would you care to give some more details as to those edge cases that
swayed you to drop the unique id approach?  I've just recently added


I'd be interested as well, as I've got an application that's been
running for most of a decade that does this, with no complaints...
[shrug]

Maybe all the indie musicians using it are so web-savvy that none of
them double-click on buttons, hit re-load, or use their back buttons
and re-submit...  Yeah.  That's it.
[that was sarcasm, in case you missed it :-)]

--


Then, I had my version wrong from the start and because of that I never 
managed to get it right so, in the end, it is not worth it.  I would have to 
dig into the CVS to pick it up but it is nothing to be proud of anyway, 
nothing to be learned from it except what not to do.   Redirecting, though, 
works fine and never cared to look back.


Satyam

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



Re: [PHP] Smarty error

2006-05-05 Thread Nirmalya Lahiri
Dear all,
  I solved the problem using {literal}{/literal} tag. Thanks every one, who 
gives me tips to solve the error.
 
 --Nirmalya
 

Nirmalya Lahiri [EMAIL PROTECTED] wrote: Dear all,
  I wrote this script using Smarty template,which gives a syntax error ..
 
 syntax error: unrecognized tag:  (Smarty_Compiler.class.php, line 436)
 
 
 I wrote a javascript block in template file,where I use '{'. This '{' 
acctually shows the problem. How can I solve this problem?
 
 --Nirmalya Lahiri
 
  
-
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ 
countries) for 2¢/min or less.


-
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: [PHP] Polymorphism [was] [Fwd: Re: [PHP] Parents constructor]

2006-05-05 Thread Tony Marston

Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Wed, May 3, 2006 9:17 am, Jochem Maas wrote:
 BUT there is a fourth form of polymorphism - one I would argue if the
 most common form when speaking about polymorphism with respect to
 programming,
 namely the ability to derive a subclass from more than one base class
 (simutaneously),
 this is something that php cannot do (thank deity).

 In my CS classes we always called that multiple inheritence

 I ain't saying multiple inheritence isn't a subclass* of
 polymorhism or anything, just that that's what we called it.

 This was 20 years ago, and I've sat through WAY too many arguments
 about what is or isn't polymorphism to count.

 I think anybody would agree that PHP's support for polymorphism is
 minimal, at best :-)

 I disagree. PHP's support for polymorphism is all that it need be. The 
problem is that what some people call polymorphism is nothing of the sort. 
The simplest definition of polymorphism is same interface, different 
implementation which means that different objects can have identical 
interfaces which produce different results. It has nothing to do with 
multiple inheritance or overloading.

No wonder so many people are confused about OOP if they cannot even 
understand what the basic concepts mean.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 

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



Re: [PHP] Quotation marks considered harmful

2006-05-05 Thread Anthony Ettinger

doesn't php have something like qq// and q// in perl?

qq = double quote interpolation
q = single quote (no interpolation)

the delimiteer / can be any character you'd like.

or, like stated previously, use a heredoc. or smarty-template engine.

On 5/4/06, Richard Lynch [EMAIL PROTECTED] wrote:

On Thu, May 4, 2006 1:53 pm, John Hicks wrote:
 Why not develop a language syntax that has distinct open and close
 string delimiters?

Because then you need to escape the closing character anyway, to have
it as data, so what did you just gain, really?

Not to mention that all the good matching possible delimiters are
already taken for Arrays, code blocks, tag start/end, and order of
operations.

--
Like Music?
http://l-i-e.com/artists.htm

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] causing HTTP error status

2006-05-05 Thread Nic
Richard Lynch [EMAIL PROTECTED] writes:

 On Thu, May 4, 2006 8:50 am, Nic wrote:
 I'm having trouble with setting HTTP error status from PHP4.

 The PHP docs say that if I have this :

   Directory /mydir

 WILD GUESS!!!

 Try it with full pathname to /mydir, or perhaps without the leading
 '/' or some combination of more/fewer directories and/or slashes.

No. /mydir is the directory I want the error page served for.

It does actually work outside the PHP environment, eg:

  Directory /mydir
ErrorDocument 404 hello!!!
  /Directory

and requesting /mydir/not_there returns a 404 with hello!!! in the
page.

But /mydir/some.php doing: 

   header(HTTP/1.1 404 Rubbish!!!) 

_never_ causes the error document to be picked up.

It's strange because the docs say this can be done; I can't find an
example that is purported to work outside of the docs though.


Nic

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



Re: [PHP] causing HTTP error status

2006-05-05 Thread Rabin Vincent

On 5/5/06, Nic [EMAIL PROTECTED] wrote:

But /mydir/some.php doing:

   header(HTTP/1.1 404 Rubbish!!!)

_never_ causes the error document to be picked up.


That's right. Apache's not going to take action based
on the headers you generate in your PHP script. These
headers are just going to go to the browser. If you
want to display the error page, you'll have to make your
PHP script include/readfile() it.


It's strange because the docs say this can be done; I can't find an
example that is purported to work outside of the docs though.


Where do the docs say this? I can't find it in http://php.net/header.

Rabin

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



Re: [PHP] causing HTTP error status

2006-05-05 Thread Nic
Hi Rabin


Rabin Vincent [EMAIL PROTECTED] writes:

 On 5/5/06, Nic [EMAIL PROTECTED] wrote:
 But /mydir/some.php doing:

header(HTTP/1.1 404 Rubbish!!!)

 _never_ causes the error document to be picked up.

 That's right. Apache's not going to take action based
 on the headers you generate in your PHP script. These
 headers are just going to go to the browser. If you
 want to display the error page, you'll have to make your
 PHP script include/readfile() it.

mod_perl and mod_python can both do this. As can CGIs. So I'll be
really surprised if this isn't possible with PHP.



 It's strange because the docs say this can be done; I can't find an
 example that is purported to work outside of the docs though.

 Where do the docs say this? I can't find it in http://php.net/header.

The url is: 

  http://www.php.net/manual/en/function.header.php

The relevant bit is where it says:

   There are two special-case header calls. The first is a header that
   starts with the string HTTP/ (case is not significant), which
   will be used to figure out the HTTP status code to send. For
   example, if you have configured Apache to use a PHP script to
   handle requests for missing files (using the ErrorDocument
   directive), you may want to make sure that your script generates
   the proper status code.

?php
 header(HTTP/1.0 404 Not Found);
?

   Note: The HTTP status header line will always be the first sent to
   the client, regardless of the actual header() call being the first
   or not. The status may be overridden by calling header() with a
   new status line at any time unless the HTTP headers have already
   been sent.

The only other meaning I can attribute to the first paragraph is that
it is suggesting that a PHP script acting as an error document will
have to do this to set the error code... but I'm not sure that's right
because Apache will already have set the error code.



Nic

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



Re: [PHP] causing HTTP error status

2006-05-05 Thread M. Sokolewicz

Nic wrote:

Hi Rabin


Rabin Vincent [EMAIL PROTECTED] writes:



On 5/5/06, Nic [EMAIL PROTECTED] wrote:


But /mydir/some.php doing:

  header(HTTP/1.1 404 Rubbish!!!)

_never_ causes the error document to be picked up.


That's right. Apache's not going to take action based
on the headers you generate in your PHP script. These
headers are just going to go to the browser. If you
want to display the error page, you'll have to make your
PHP script include/readfile() it.



mod_perl and mod_python can both do this. As can CGIs. So I'll be
really surprised if this isn't possible with PHP.





It's strange because the docs say this can be done; I can't find an
example that is purported to work outside of the docs though.


Where do the docs say this? I can't find it in http://php.net/header.



The url is: 


  http://www.php.net/manual/en/function.header.php

The relevant bit is where it says:

   There are two special-case header calls. The first is a header that
   starts with the string HTTP/ (case is not significant), which
   will be used to figure out the HTTP status code to send. For
   example, if you have configured Apache to use a PHP script to
   handle requests for missing files (using the ErrorDocument
   directive), you may want to make sure that your script generates
   the proper status code.

?php
 header(HTTP/1.0 404 Not Found);
?

   Note: The HTTP status header line will always be the first sent to
   the client, regardless of the actual header() call being the first
   or not. The status may be overridden by calling header() with a
   new status line at any time unless the HTTP headers have already
   been sent.

The only other meaning I can attribute to the first paragraph is that
it is suggesting that a PHP script acting as an error document will
have to do this to set the error code... but I'm not sure that's right
because Apache will already have set the error code.



Nic


The meaning of the paragraph is indeed your only other meaning I can 
attribute to it. And no, Apache does not automatically set it (ok, not 
*always*... there's a lot of magic going on behind the screens).


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



Re: [PHP] Quotation marks considered harmful

2006-05-05 Thread M. Sokolewicz
thank god PHP doesn't have qq// and q//, it's one of the few things I 
can't stand in Perl (along with the 100 different ways of calling the 
same variable (@var, $var, %var, etc.). Just use a standard delimiter 
with standard, normal, quotes. It's really not that hard.



Anthony Ettinger wrote:


doesn't php have something like qq// and q// in perl?

qq = double quote interpolation
q = single quote (no interpolation)

the delimiteer / can be any character you'd like.

or, like stated previously, use a heredoc. or smarty-template engine.

On 5/4/06, Richard Lynch [EMAIL PROTECTED] wrote:


On Thu, May 4, 2006 1:53 pm, John Hicks wrote:
 Why not develop a language syntax that has distinct open and close
 string delimiters?

Because then you need to escape the closing character anyway, to have
it as data, so what did you just gain, really?

Not to mention that all the good matching possible delimiters are
already taken for Arrays, code blocks, tag start/end, and order of
operations.

--
Like Music?
http://l-i-e.com/artists.htm

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





--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html



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



Re: [PHP] set_error_handler() fails

2006-05-05 Thread icy

Richard Lynch wrote:

It's possible that you have mistaken whatever set_error_handler
returns for no previous error handler for NULL...

Are you using === NULL or is_null() to test?

If not, I suspect it's really returning FALSE or '' and what you think
is an error condition is, in fact, not an error condition at all.



I use === NULL, so it really returns NULL.
My own error handler is never called so this is another indication that 
it fails. PHP doesn't throw any error or exception. I also searched for 
an entry in php.ini which might turn own error handlers off but didn't 
find anything relevant. Maybe someone can reproduce the bug.

This issue is freaking me out.

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



Re: [PHP] What editor do you use?

2006-05-05 Thread David Robley
Miles Thompson wrote:

 At 03:35 PM 5/4/2006, John Nichel wrote:
 
Nicolas Verhaeghe wrote:
I am currently looking for a good PHP editor for Windows. I know, the
question must have been asked so many times, but I thought I could ask it
again now that a few editors have evolved, others have appeared.

It has been asked, and usually starts a flame war.

STFA
 
 And after scratching the bald spot a bit, enlightenment. No, that's not
 the name of an editor, but
 
 Search The Fine Archives - because yes, this has been done to death.
 
 Miles

It actually (enlightenment) seems to be a window manager.

This has been today's bit of useless information, brought to you by the
numbers 0xffcd and 0xa83e and the letter omega :-)




Cheers
-- 
David Robley

I hate pies with crumb bases, said Tom crustily.
Today is Setting Orange, the 52nd day of Discord in the YOLD 3172. 

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



Re: [PHP] set_error_handler() fails

2006-05-05 Thread chris smith

On 5/5/06, icy [EMAIL PROTECTED] wrote:

Richard Lynch wrote:
 It's possible that you have mistaken whatever set_error_handler
 returns for no previous error handler for NULL...

 Are you using === NULL or is_null() to test?

 If not, I suspect it's really returning FALSE or '' and what you think
 is an error condition is, in fact, not an error condition at all.


I use === NULL, so it really returns NULL.
My own error handler is never called so this is another indication that
it fails. PHP doesn't throw any error or exception. I also searched for
an entry in php.ini which might turn own error handlers off but didn't
find anything relevant. Maybe someone can reproduce the bug.
This issue is freaking me out.


What does your code look like?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] set_error_handler() fails

2006-05-05 Thread icy

chris smith wrote:


What does your code look like?


I just realized that when called a second time, set_error_handler() 
returns my custom error handler but it is never triggered.

Code looks like this:

?php
if (set_error_handler('core_error_handler', E_ALL) === NULL)
echo 'could not set error handlerbr /';

trigger_error('test error');

var_dump(set_error_handler('core_error_handler', E_ALL));

function core_error_handler($errno, $errstr, $errfile, $errline)
{
echo 'error...';
}
?

This gives me the following output:

could not set error handler
Notice: test error in /var/www/.../core.inc.php on line 5
core_error_handler

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



[PHP] Re: causing HTTP error status

2006-05-05 Thread Nic
M. Sokolewicz [EMAIL PROTECTED] writes:

 The meaning of the paragraph is indeed your only other meaning I can
 attribute to it. And no, Apache does not automatically set it (ok,
 not *always*... there's a lot of magic going on behind the screens).

Oh. Ok. Thanks.


Nic

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



Re: [PHP] set_error_handler() fails

2006-05-05 Thread Martin Alterisio \El Hombre Gris\

icy escribió:

chris smith wrote:


What does your code look like?


I just realized that when called a second time, set_error_handler() 
returns my custom error handler but it is never triggered.

Code looks like this:

?php
if (set_error_handler('core_error_handler', E_ALL) === NULL)
echo 'could not set error handlerbr /';

trigger_error('test error');

var_dump(set_error_handler('core_error_handler', E_ALL));

function core_error_handler($errno, $errstr, $errfile, $errline)
{
echo 'error...';
}
?

This gives me the following output:

could not set error handler
Notice: test error in /var/www/.../core.inc.php on line 5
core_error_handler

Have you thought about the fact that you're pointing to a function 
that's not been defined yet when the error is triggered?


And set_error_handler() returns NULL because there isn't a previously 
defined error handler, not because it failed.


Hope this helps.

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



[PHP] Re: Quotation marks considered harmful

2006-05-05 Thread John Wells

On 5/4/06, John Hicks [EMAIL PROTECTED] wrote:

Why not develop a language syntax that has distinct open and close
string delimiters?


I consider HEREDOC to be the answer to that kind of prayer.  For quick
one-liners I find it overkill, but I felt so freed when I discovered
it for creating large string blocks, like HTML templates with PHP
intermixed.

The only thing I wish HEREDOC could do is evaluate functions within
the string blocks.  But at least it will evaluate object methods, so
if you're a staunch OOPer, you're set. (Yet another reason why I'm a
convert)

All other comments about having to escape alternative delimiters are valid.

-John W

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



Re: [PHP] Test URL length please (Pretty much 0T)

2006-05-05 Thread tedd

At 1:36 PM -0700 5/4/06, Ryan A wrote:

Hi again,
Kindly save the below code as t.php and run it in as
many browsers/servers you can, then click on each of
the links and tell me if you run into any problems.

(Basically, I am checking to see how many characters
we can have in a URL that the server will accept and
process, the script checks 200-1000 chars.. add more
if you want to)

Thanks!
Ryan


Ryan:

http://xn--ovg.com/t.php

In Safari 2.0.3, FireFox 1.5.0.2, IE 5.2, Mozilla 1.83a I could run 
8168 characters (f-click) without any problems. But, Opera 8.5 failed.


However, when I increased it to 8169 characters (g-click) they all failed.

HTH's

tedd

PS: Mac OS-X 10.4.6
Linux server1.ghettowebhosting.net Apache/1.3.34 (Unix) 
mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 
PHP/4.3.11 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a

--

http://sperling.com

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



Re: [PHP] What editor do you use?

2006-05-05 Thread Wolf
Editpad Classic 3.5.3

And it's postcardware...  :)

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



RE: [PHP] Maximum URL length (Pretty much 0T)

2006-05-05 Thread tedd

At 2:31 PM -0700 5/4/06, Chris W. Parker wrote:

Ryan A mailto:[EMAIL PROTECTED]
on Thursday, May 04, 2006 1:18 PM said:


 Thanks for replying, thats an idea, but was hoping
 people from this list could reply with their
 experiences because my local server might be different
 from production servers that you guys access everyday
 (as the article i read said that this setting varies
 from browser to browser and server to server)...


Are you sure you searched on this subject?

maximum url length in Google turns up a number of resources saying
2083 due to IE's limit.


Ryan:

Google can be wrong, as it is now.

IE 5.2 for the Mac running on Mac OS-X 10.4.2 will accept/pass 8168 
characteries.


tedd
--

http://sperling.com

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



Re: [PHP] Array Sorting

2006-05-05 Thread tedd

On Thu, May 4, 2006 10:20 am, James Nunnerley wrote:
  What I'm not sure about doing is sorting by say Size or Date?



There's several different examples of date sorts here:

http://www.weberdev.com/AdvancedSearch.php?searchtype=titlesearch=date+sortSubmit1.x=0Submit1.y=0

HTH's

tedd
--

http://sperling.com

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



Re: [PHP] Smarty error

2006-05-05 Thread John Nichel

Nirmalya Lahiri wrote:

Dear all,
  I wrote this script using Smarty template,which gives a syntax error ..
 
 syntax error: unrecognized tag:  (Smarty_Compiler.class.php, line 436)
 
 
 I wrote a javascript block in template file,where I use '{'. This '{' acctually shows the problem. How can I solve this problem?




http://smarty.php.net/resources.php?category=7

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] User confirmation questions?

2006-05-05 Thread tedd

At 8:58 AM +0300 5/5/06, William Stokes wrote:

Hello,

In PHP is it possible to generate windows style question boxes and get the
users choice back? Or do I need javascript or something else for that?

For example if a user hits a button in form I could ask for his confirmation
for the action. Like Do you Really wan't to drop the whole database? Yes
or No. And perform or cancel the action by user's decision.

-Will


-Will:

It depends. Typically no, but what you want can be done via a single 
click by switching style sheets through php (it need cookies though). 
See --


http://www.sperling.com/examples/styleswitch/

-- for an example and explanation.

tedd

--

http://sperling.com

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



[PHP] Rhumb Lines

2006-05-05 Thread Leonard Burton

HI All,

I need to calculate Rhumb Lines in an application and have not found a
good formula for doing such.

Does anyone know of an existing Class/Function that will calculate Rhumb Lines?

Thanks and Be Well,

--
Leonard Burton, N9URK
[EMAIL PROTECTED]

The prolonged evacuation would have dramatically affected the
survivability of the occupants.

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



Re: [PHP] Paged Results Set in MySQL DB with one result

2006-05-05 Thread Edward Vermillion


On May 4, 2006, at 11:16 PM, Jochem Maas wrote:


Richard Lynch wrote:

On Thu, May 4, 2006 10:15 am, Edward Vermillion wrote:

On May 4, 2006, at 4:16 AM, Richard Lynch wrote:



On Wed, May 3, 2006 6:57 pm, Jochem Maas wrote:



...


Yes.  Usually.
Mostly sometimes.
For something like a Forum or a CMS with minimal EZ tags for the  
admin

on a small-scale site, I'll confess to just tossing HTML into the db.
But not if my site is allegedly a professionally-written series of
articles.


lets assume that the author of the articles what some kind of  
stylistic
and/or semantic control over the content of the article - how would  
you

store this formatting information?

I'd hazard to say that XHTML is a rather better markup language  
definition

than any custom thing we could come up with on own own, no?



Your probably right, well at least defining a custom xml dtd set for  
your particular purposes, or not, maybe. I haven't gotten into the  
whole XML thing yet, so I could very well change my mind once I do  
(in other words, I know what I know so if I'm being a complete idiot  
slap me over the head).


The problem I have with using X/HTML in the body of the articles is  
that it's a lot more difficult, at least for me, to control what gets  
in and what doesn't. script... for example (or sc

ri
pt.. which apparently IE is more than happy to execute for you). I'd  
rather define a *small* set of custom tags that look nothing like X/ 
HTML that I do a replacement on after running htmlentities() on the  
text.


That way if for some unknown reason they want to have img or link  
or script or just ? in the body of the text, it shows up fine and  
it doesn't break anything. If the replacement tag gets borked then  
you see parts of the tag, and the page still isn't broken.




As a personal note, I prefer to read things that have been broken up
into logical chunks for me, as opposed to being fed some 2000 word
essay all at once. I *hate* scrolling. But then I didn't learn to
read on a computer screen either.

There's truly logical chunks, and there's we need you to break this
into 10 pages so we can sell more ads, okay? chunks.


lol - don't forget the chunk it so we sell more banners AND link  
random

words in the article to DHTML popup ads - I *really* hate those.


Blech.




I assumed logical chunks, hadn't even thought of marketing getting in  
on the action... *eww*

Ed

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



[PHP] Showing an image outside of the web folder

2006-05-05 Thread James Nunnerley
I'm creating a file manager application, from which I want the user to be
able to edit/view files.

On the text side of things, it's pretty easy, however from the image side of
things, I'm not sure how to allow the user to view files outside of the web
folder.

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?

Cheers
Nunners

 



[PHP] heredoc question

2006-05-05 Thread Al
How can I include place holders for variables in a heredoc such that after the heredoc is declared, I can assign the 
variables?


I have a config file with a heredoc string declared.  I'd like to keep the 
include config.inc at the top of my page.

Down in the page, when I call the heredoc variable, I'd like to replace the place holders with a values assigned in 
the page, below the include statement.


I know I can break up the heredoc into several segments and put the variables 
between them; but, I rather not.

Seems like there should be an obvious way to do this.

Thanks...

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



Re: [PHP] Showing an image outside of the web folder

2006-05-05 Thread John Nichel

James Nunnerley wrote:

I'm creating a file manager application, from which I want the user to be
able to edit/view files.

On the text side of things, it's pretty easy, however from the image side of
things, I'm not sure how to allow the user to view files outside of the web
folder.

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?

Cheers
Nunners



PHP Manual - Function Reference - Image Functions

Google - php display image

IMO
It's easier to say RTFM and/or STFW
/IMO

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] heredoc question

2006-05-05 Thread John Nichel

Al wrote:
How can I include place holders for variables in a heredoc such that 
after the heredoc is declared, I can assign the variables?


I have a config file with a heredoc string declared.  I'd like to keep 
the include config.inc at the top of my page.


Down in the page, when I call the heredoc variable, I'd like to replace 
the place holders with a values assigned in the page, below the 
include statement.


I know I can break up the heredoc into several segments and put the 
variables between them; but, I rather not.


Seems like there should be an obvious way to do this.

Thanks...



printf()?

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Rhumb Lines

2006-05-05 Thread Miles Thompson

At 11:01 AM 5/5/2006, Leonard Burton wrote:


HI All,

I need to calculate Rhumb Lines in an application and have not found a
good formula for doing such.

Does anyone know of an existing Class/Function that will calculate Rhumb 
Lines?


Thanks and Be Well,

--
Leonard Burton, N9URK
[EMAIL PROTECTED]

The prolonged evacuation would have dramatically affected the
survivability of the occupants.


Leonard,

What an interesting problem. You might have better luck on a GIS or ocean 
racing list.


But a quick look revealed this link: 
http://www.geocities.com/capecanaveral/2265/msail.htm

and the JavaScript can be picked off with reveal source.

Let us know how it works out.

Miles 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.392 / Virus Database: 268.5.4/332 - Release Date: 5/4/2006

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



[PHP] Re: Showing an image outside of the web folder

2006-05-05 Thread Barry

James Nunnerley schrieb:

I'm creating a file manager application, from which I want the user to be
able to edit/view files.

On the text side of things, it's pretty easy, however from the image side of
things, I'm not sure how to allow the user to view files outside of the web
folder.

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?

Cheers
Nunners

 




img src=showimage.php?location=\path\to\image.gif

showimage.php :

readfile(location);

something like that

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] heredoc question

2006-05-05 Thread Paul Novitski

At 07:40 AM 5/5/2006, Al wrote:
How can I include place holders for variables in a heredoc such 
that after the heredoc is declared, I can assign the variables?



Al,

Escape the $'s in your heredoc expression so that the variable names 
remain and aren't evaluated, then eval() the whole expression later:


$sString =  hdBodyClass
body class=\$sBodyClass
hdBodyClass;

This sets $sString equal to:

body class=$sBodyClass

Then:
$sBodyClass = contact;
eval(\$sHTML = '$sString';);

Evaluates as:

$sHTML = 'body class=contact';

As always, be careful not to include any external data in an eval() 
statement without careful sponging.  Its presence in your script 
should be regarded as an Achilles heel and treated with special respect.


Paul 


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



Re: [PHP] User confirmation questions?

2006-05-05 Thread Rabin Vincent

On 5/5/06, tedd [EMAIL PROTECTED] wrote:

At 8:58 AM +0300 5/5/06, William Stokes wrote:
Hello,

In PHP is it possible to generate windows style question boxes and get the
users choice back? Or do I need javascript or something else for that?

For example if a user hits a button in form I could ask for his confirmation
for the action. Like Do you Really wan't to drop the whole database? Yes
or No. And perform or cancel the action by user's decision.

-Will

-Will:

It depends. Typically no, but what you want can be done via a single
click by switching style sheets through php (it need cookies though).
See --

http://www.sperling.com/examples/styleswitch/

-- for an example and explanation.


Could you elaborate as to how switching stylesheets can
provide a confirmation dialog box?

Rabin

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



Re: [PHP] Showing an image outside of the web folder

2006-05-05 Thread Rabin Vincent

On 5/5/06, James Nunnerley [EMAIL PROTECTED] wrote:

Doing a readfile ($file_location) outputs the binary... can someone point
me in the direction of being able to translate that binary into a viewable
image file?


Drop the appropriate content-type header:

header('Content-type: image/png');
readfile('/home/foo/bar.png');

Rabin

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



Re: [PHP] Echo a value from an arrays position

2006-05-05 Thread Eric Butera

On 5/4/06, Brad Bonkoski [EMAIL PROTECTED] wrote:


Will this also work with an associative array?  If this is what he is
talking about, I tried it and it does not work

I put this together though and it works, not sure if it is the *best*
way though...

?php
$colors =
array('white'='#ff','black'='#00','blue'='#ff');

$count = 0;
foreach( $colors as $k = $v) {
$count++;
if( $count == 2 )
echo \$colors[$k] = $v.\n;
}
?

-Brad



One thing that might help you guys... now and in in the future are the
functions var_dump() and print_r().  You can wrap these with pre/pre
tags to make it all pretty and formatted for reading too.

If you're unsure of what exactly is happening with your data try this:

$colors = array('white'='#ff','black'='#00','blue'='#ff');
print_r($colors);

... and you will see:

Array ( [white] = #ff [black] = #00 [blue] = #ff )

So you would call $colors['black'] to access #00.


Re: [PHP] php and ssl

2006-05-05 Thread Eric Butera

On 5/4/06, Schalk [EMAIL PROTECTED] wrote:


Greetings All,

I am currently implementing a form for a client that will run over
https. Now, all is good and well except, for some reason when the form
loads in IE the lock in the status bar displays for a short while and
then goes away, it is fine in Firefox though. The way I have the form
coded is something like this:

?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$street_address = $_POST['street_address'];

$to = 'address';
$subject = subject;
$headers = MIME-Version: 1.0\r\n.
   Content-type: text/html; charset=iso-8859-1\r\n.
   From: .$name.\r\n.
   Reply-to: .$email.\r\n.

   Date: .date(r).\r\n;

// Compose message:
$message = message;

// Send message
mail($to, $subject, $message, $headers);

// Thank the generous user
echo h1Thank You!/h1;
}
else {

?
form name=donation_eng action=?php echo $_SERVER['PHP_SELF']; ?
method=post
fieldset
legendFill in your details/legend
table cellspacing=0 cellpadding=0 class=form-container
tr
td colspan=2
label for=nameName:
input name=name type=text id=name tabindex=1 size=35
maxlength=150 /
/label
/td
/tr
/table
/fieldset
/form
?php
   }
?

The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to think
that the form is not secure and not loaded over https? Thank you in
advance!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

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



I bet your problem is this:
http://www.epda.cc/images/horz_master_120pixels.gif

One thing I do at work here when I'm having issues with SSL is to check any
links you have to stylesheets, javascript, etc for http:// in them.  Then
after that use firefox's View Page Info and goto the tab Media.  Check
for any http:// images.

Hope that helps.


Re: [PHP] Rhumb Lines

2006-05-05 Thread Paul Scott
On Fri, 2006-05-05 at 11:44 -0300, Miles Thompson wrote:
 What an interesting problem. You might have better luck on a GIS or ocean 
 racing list.
 

Have you tried this: http://en.wikipedia.org/wiki/Rhumb_line 

I could do something like this using PostGIS and PHP, but a pure PHP
solution is probably going to be a tad slow with real geometries.

I would love to help out on this, can we collaborate on it (I will
provide a CVS server etc if necessary)...

--Paul

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



Re: [PHP] heredoc question

2006-05-05 Thread Robert Cummings
On Fri, 2006-05-05 at 10:40, Al wrote:
 How can I include place holders for variables in a heredoc such that after 
 the heredoc is declared, I can assign the 
 variables?
 
 I have a config file with a heredoc string declared.  I'd like to keep the 
 include config.inc at the top of my page.
 
 Down in the page, when I call the heredoc variable, I'd like to replace the 
 place holders with a values assigned in 
 the page, below the include statement.
 
 I know I can break up the heredoc into several segments and put the variables 
 between them; but, I rather not.
 
 Seems like there should be an obvious way to do this.

str_replace() ??

Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] heredoc question

2006-05-05 Thread Dave Goodchild

Or just use str_replace

On 05/05/06, John Nichel [EMAIL PROTECTED] wrote:


Al wrote:
 How can I include place holders for variables in a heredoc such that
 after the heredoc is declared, I can assign the variables?

 I have a config file with a heredoc string declared.  I'd like to keep
 the include config.inc at the top of my page.

 Down in the page, when I call the heredoc variable, I'd like to replace
 the place holders with a values assigned in the page, below the
 include statement.

 I know I can break up the heredoc into several segments and put the
 variables between them; but, I rather not.

 Seems like there should be an obvious way to do this.

 Thanks...


printf()?

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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





--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] User confirmation questions?

2006-05-05 Thread tedd

At 9:38 PM +0530 5/5/06, Rabin Vincent wrote:

On 5/5/06, tedd [EMAIL PROTECTED] wrote:

At 8:58 AM +0300 5/5/06, William Stokes wrote:

Hello,

In PHP is it possible to generate windows style question boxes and get the
users choice back? Or do I need javascript or something else for that?

For example if a user hits a button in form I could ask for his confirmation
for the action. Like Do you Really wan't to drop the whole database? Yes
or No. And perform or cancel the action by user's decision.

-Will


-Will:

It depends. Typically no, but what you want can be done via a single
click by switching style sheets through php (it need cookies though).
See --

http://www.sperling.com/examples/styleswitch/

-- for an example and explanation.


Could you elaborate as to how switching stylesheets can
provide a confirmation dialog box?

Rabin



Perhaps I didn't fully understand the question. A confirmation dialog 
box, no -- but, a confirmation, yes.


If he wants a dialog box, then a simple js alert will do.

tedd
--

http://sperling.com

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



Re: [PHP] User confirmation questions?

2006-05-05 Thread Rabin Vincent

On 5/5/06, tedd [EMAIL PROTECTED] wrote:

At 9:38 PM +0530 5/5/06, Rabin Vincent wrote:
On 5/5/06, tedd [EMAIL PROTECTED] wrote:
At 8:58 AM +0300 5/5/06, William Stokes wrote:
Hello,

In PHP is it possible to generate windows style question boxes and get the
users choice back? Or do I need javascript or something else for that?

For example if a user hits a button in form I could ask for his confirmation
for the action. Like Do you Really wan't to drop the whole database? Yes
or No. And perform or cancel the action by user's decision.

-Will

-Will:

It depends. Typically no, but what you want can be done via a single
click by switching style sheets through php (it need cookies though).
See --

http://www.sperling.com/examples/styleswitch/

-- for an example and explanation.

Could you elaborate as to how switching stylesheets can
provide a confirmation dialog box?

Rabin


Perhaps I didn't fully understand the question. A confirmation dialog
box, no -- but, a confirmation, yes.

If he wants a dialog box, then a simple js alert will do.


OK, no dialog box, but how could we get a confirmation from
the user for something by switching stylesheets? Do you mean
something like showing a hidden div with the are you sure
text?

Rabin

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



Re: [PHP] heredoc question

2006-05-05 Thread Al

Robert Cummings wrote:

On Fri, 2006-05-05 at 10:40, Al wrote:
How can I include place holders for variables in a heredoc such that after the heredoc is declared, I can assign the 
variables?


I have a config file with a heredoc string declared.  I'd like to keep the 
include config.inc at the top of my page.

Down in the page, when I call the heredoc variable, I'd like to replace the place holders with a values assigned in 
the page, below the include statement.


I know I can break up the heredoc into several segments and put the variables 
between them; but, I rather not.

Seems like there should be an obvious way to do this.


str_replace() ??

Rob.


Yes, that is the simplest solution.  Now that you've refreshed my memory, I've 
done it that way in the past.

Thanks...

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



Re: [PHP] php and ssl [SOLVED]

2006-05-05 Thread Schalk

Eric Butera wrote:

On 5/4/06, Schalk [EMAIL PROTECTED] wrote:


Greetings All,

I am currently implementing a form for a client that will run over
https. Now, all is good and well except, for some reason when the form
loads in IE the lock in the status bar displays for a short while and
then goes away, it is fine in Firefox though. The way I have the form
coded is something like this:

?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$street_address = $_POST['street_address'];

$to = 'address';
$subject = subject;
$headers = MIME-Version: 1.0\r\n.
   Content-type: text/html; charset=iso-8859-1\r\n.
   From: .$name.\r\n.
   Reply-to: .$email.\r\n.

   Date: .date(r).\r\n;

// Compose message:
$message = message;

// Send message
mail($to, $subject, $message, $headers);

// Thank the generous user
echo h1Thank You!/h1;
}
else {

?
form name=donation_eng action=?php echo $_SERVER['PHP_SELF']; ?
method=post
fieldset
legendFill in your details/legend
table cellspacing=0 cellpadding=0 class=form-container
tr
td colspan=2
label for=nameName:
input name=name type=text id=name tabindex=1 size=35
maxlength=150 /
/label
/td
/tr
/table
/fieldset
/form
?php
   }
?

The page in question is here: https://www.epda.cc/donation_eng.php

Is there any reason why coding the form like this will cause IE to think
that the form is not secure and not loaded over https? Thank you in
advance!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

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



I bet your problem is this:
http://www.epda.cc/images/horz_master_120pixels.gif

One thing I do at work here when I'm having issues with SSL is to 
check any

links you have to stylesheets, javascript, etc for http:// in them.  Then
after that use firefox's View Page Info and goto the tab Media.  
Check

for any http:// images.

Hope that helps.

Perfect! Thanks a lot!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers

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



Re: [PHP] User confirmation questions?

2006-05-05 Thread tedd

Perhaps I didn't fully understand the question. A confirmation dialog
box, no -- but, a confirmation, yes.

If he wants a dialog box, then a simple js alert will do.


OK, no dialog box, but how could we get a confirmation from
the user for something by switching stylesheets? Do you mean
something like showing a hidden div with the are you sure
text?

Rabin



Rabin:

The confirmation is in the click itself. Like selecting the language 
you want. Click it once and you have confirmed that you what French, 
for example. Understand?


It doesn't have to be a choice between just two options either -- you 
can have several options.


In fact, it doesn't even have to be style sheets, you can run any php 
script from a href=


But, if you want feedback before changing, then I believe you must 
either use js or ajax.


tedd

--

http://sperling.com

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



Re: [PHP] Rhumb Lines

2006-05-05 Thread Paul Scott
On Fri, 2006-05-05 at 19:16 +0200, Paul Scott wrote:

 I could do something like this using PostGIS and PHP, but a pure PHP
 solution is probably going to be a tad slow with real geometries.
 

Sorry about replying to my own post, but here is a postgis solution
supplied off the PostGIS list (thanks David):

Reproject the start and end point to a mercator (not a transverse
mercator) projection, connect the points, fill in the gap with
additional points (the segmentize() function would do this) and then
reproject to the original projection.

The following should work where a and b are the two points in your
original projection. To make a rhumb between with a distance of 100m:

select transform(segmentize(transform(makeline(a,b),9804)),100),4326)

--Paul

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



Re: [PHP] PHP Upgrade Question

2006-05-05 Thread Tom Ray
On 05.03.2006 at 20:34:20, Eric Butera [EMAIL PROTECTED] wrote:

 
  Ok so I can't find apxs on the server at all, even though the
 4.3.4phpinfo
  claims to have been configured with
 --with-apxs2=/usr/sbin/apxs2-prefork.
  I did
  some search via google and I reconfigured using --enable-cli and
  --disable-cgi
  but I still had to use --with-apache2=/usr/sbin/httpd2 because I need to
  have
  that correct? Since all the builds I done with PHP call on a Apache
 source
  in
  some way. It still compiled with it's SAPI choice being cgi then I ran
  'make
  install-cli' and now when I do a /usr/bin/php -v I get:
 
  PHP 4.4.2 (cli) (built: May  3 2006 18:36:11)
  Copyright (c) 1997-2006 The PHP Group
  Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
 
  But when I restart apache I'm still seeing 4.3.4 in the phpinfo()
  information.
  I've even restarted the server with no luck.
 
  Can someone tell me what I missing? It seems SuSE compiled PHP with the
  --disable-session call in the configuration and we need Sessions enable
 to
  support Zencart and phpOpenChat for some clients.
 
 
   Another thing to consider is if you built it, you could easily have
   different versions installed on the machine.  Issuing a locate
 /bin/php
   might prove that or not.
  
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
  I run Ubuntu Dapper Drake at home (the only place I've dabbled with
 compiling php).  To get it to compile I had to install the packages
 apache2-mpm-prefork and apache2-prefork-dev to get the system setup
 correctly.  By default it had something else which did not give me apxs2.
 My apxs2 is in /usr/bin/apxs2.  So maybe if you could figure out how to
 get
 that package /usr/sbin/apxs2-prefork on your system that might do it.
 
 I'm really not the one who should be giving any advice on this since I
 just
 kept beating on mine till it worked. ;)  But then again, nobody else is
 replying so...

Well I finally got PHP 4.4.2 installed. I ended up having to install a fresh
version of Apache2 and then compiling PHP into that version. Now I have the fun
task of configuring the new install of Apache2 with all the current sites on
that server so they can run PHP 4.4.2

Thanks for the help!

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



RE: [PHP] What editor do you use?

2006-05-05 Thread Nicolas Verhaeghe

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 04, 2006 1:54 PM
To: Nicolas Verhaeghe
Cc: 'Jay Blanchard'; 'PHP-General'
Subject: RE: [PHP] What editor do you use?


On Thu, 2006-05-04 at 16:39, Nicolas Verhaeghe wrote:
  [snip]
  I am currently looking for a good PHP editor for Windows. I know, 
  the
  question must have been asked so many times, but I thought I could ask 
  it again now that a few editors have evolved, others have appeared.
  [/snip]
  
  Eclipse. You could also STFA
 
 Joe! It's better than ever now. It even has syntax highlighting.
 
 FWIW, anything that autocompletes is for wimps.
 
 ---
 
 Well, I like the autocomplete feature, allows me to work faster.
 
 How about that? More time to go do what you like to do better.

Direct memory access beats secondary helper memory every time. Autocomplete
is an incentive to have a lazy mind. When your brain has a larger overall
picture of available resources, it can formulate better strategies than when
it only has part of the picture. Additionally, when you are typing out a
flow of code, anything that interrupts that flow slows you down... ala
autocomplete.

---

Let's agree to disagree. When you have the experience, autocomplete does
save you a lot of time.

I realized I was working a lot faster with autocomplete on. Meaning more
time to concentrate on improving the apps or looking for new clients.

Easy as that.

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



[PHP] Re: User confirmation questions?

2006-05-05 Thread Chuck Anderson

William Stokes wrote:


Hello,

In PHP is it possible to generate windows style question boxes and get the 
users choice back? Or do I need javascript or something else for that?


For example if a user hits a button in form I could ask for his confirmation 
for the action. Like Do you Really wan't to drop the whole database? Yes 
or No. And perform or cancel the action by user's decision.


-Will
 

It's not what you want to do (popup window), but I do it in the 
following often.


I put the question right on the page - using a form. The form reloads 
the page on submit and my script checks for the submit value at the top 
of the page. If the form was submitted it either performs the action or 
not - based on the submitted values.


--
*
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*

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



Re: [PHP] adding objects to spl.php because it doesn't appear to be there

2006-05-05 Thread chris smith

On 5/6/06, jonathan [EMAIL PROTECTED] wrote:

I'm not really sure where to post this but when I run phpunit, it is
throwing an error because  Class 'InvalidArgumentException' not
found. It looks like this is supposed to be in spl.php but I'm not
sure how to add this. Is it possible to just updated spl.php with the
code for InvalidArgumentException or is this something where I will
need to have the sys-admin rebuild php?


When does this happen? You're running make test on a new php build?
Running tests against your own code ?

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] adding objects to spl.php because it doesn't appear to be there

2006-05-05 Thread jonathan
a sample phpunit. the issue is that this class doesn't seem to be in  
my spl (which I don't really use and am not sure how to upgrade).


thanks,

jonathan
On May 5, 2006, at 4:38 PM, chris smith wrote:


On 5/6/06, jonathan [EMAIL PROTECTED] wrote:

I'm not really sure where to post this but when I run phpunit, it is
throwing an error because  Class 'InvalidArgumentException' not
found. It looks like this is supposed to be in spl.php but I'm not
sure how to add this. Is it possible to just updated spl.php with the
code for InvalidArgumentException or is this something where I will
need to have the sys-admin rebuild php?


When does this happen? You're running make test on a new php build?
Running tests against your own code ?

--
Postgresql  php tutorials
http://www.designmagick.com/

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





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



Re: [PHP] Test URL length please (Pretty much 0T)

2006-05-05 Thread Ryan A


 
 Ryan:
 
 http://xn--ovg.com/t.php
 
 In Safari 2.0.3, FireFox 1.5.0.2, IE 5.2, Mozilla
 1.83a I could run 
 8168 characters (f-click) without any problems. But,
 Opera 8.5 failed.
 
 However, when I increased it to 8169 characters
 (g-click) they all failed.
 
 HTH's
 
 tedd
 
 PS: Mac OS-X 10.4.6
 Linux server1.ghettowebhosting.net Apache/1.3.34
 (Unix) 
 mod_auth_passthrough/1.8 mod_log_bytes/1.2
 mod_bwlimited/1.4 
 PHP/4.3.11 FrontPage/5.0.2.2635 mod_ssl/2.8.25
 OpenSSL/0.9.7a
 -- 


Thanks Tedd,
I appreciate it.

Cheers,
Ryan

--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] What editor do you use?

2006-05-05 Thread Ólafur Waage

Nicolas Verhaeghe wrote:


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 04, 2006 1:54 PM

To: Nicolas Verhaeghe
Cc: 'Jay Blanchard'; 'PHP-General'
Subject: RE: [PHP] What editor do you use?


On Thu, 2006-05-04 at 16:39, Nicolas Verhaeghe wrote:
 


[snip]
I am currently looking for a good PHP editor for Windows. I know, 
the
question must have been asked so many times, but I thought I could ask 
it again now that a few editors have evolved, others have appeared.

[/snip]

Eclipse. You could also STFA
 


Joe! It's better than ever now. It even has syntax highlighting.

FWIW, anything that autocompletes is for wimps.

---

Well, I like the autocomplete feature, allows me to work faster.

How about that? More time to go do what you like to do better.
   



Direct memory access beats secondary helper memory every time. Autocomplete
is an incentive to have a lazy mind. When your brain has a larger overall
picture of available resources, it can formulate better strategies than when
it only has part of the picture. Additionally, when you are typing out a
flow of code, anything that interrupts that flow slows you down... ala
autocomplete.

---

Let's agree to disagree. When you have the experience, autocomplete does
save you a lot of time.

I realized I was working a lot faster with autocomplete on. Meaning more
time to concentrate on improving the apps or looking for new clients.

Easy as that.

 


Ive been using PSPad for a while now, quite fond of it.

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



[PHP] hosting reselling

2006-05-05 Thread John Taylor-Johnston

Kind of off-topic.
My current ISP has problems with quality control: especially offering 
php 5  mysql.
Also rates keep going up per account. Reselling is beginning to look 
very interesting.
Anyone have any recommendations for a reseller where I can host 5 sites 
myself

with very low bandwidth and minimum harddrive space.
John

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