php-general Digest 6 May 2006 04:33:49 -0000 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
----------------------------------------------------------------------
--- Begin Message ---
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 ---
--- Begin Message ---
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'=>'#ffffff','black'=>'#000000','blue'=>'#0000ff');
$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'=>'#ffffff','black'=>'#000000','blue'=>'#0000ff');
print_r($colors);
... and you will see:
Array ( [white] => #ffffff [black] => #000000 [blue] => #0000ff )
So you would call $colors['black'] to access #000000.
--- End Message ---
--- Begin Message ---
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 "<h1>Thank You!</h1>";
}
else {
?>
<form name="donation_eng" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<fieldset>
<legend>Fill in your details</legend>
<table cellspacing="0" cellpadding="0" class="form-container">
<tr>
<td colspan="2">
<label for="name">Name:
<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 ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
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!
--- End Message ---
--- Begin Message ---
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...
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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.
*****************************
--- End Message ---
--- Begin Message ---
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 "<h1>Thank You!</h1>";
}
else {
?>
<form name="donation_eng" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<fieldset>
<legend>Fill in your details</legend>
<table cellspacing="0" cellpadding="0" class="form-container">
<tr>
<td colspan="2">
<label for="name">Name:
<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
--- End Message ---
--- Begin Message ---
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!
--- End Message ---
--- Begin Message ---
-----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.
--- End Message ---
--- Begin Message ---
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.
--- End Message ---
--- Begin Message ---
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?
thanks,
jonathan
--- End Message ---
--- Begin Message ---
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/
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
>
> 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
--- End Message ---
--- Begin Message ---
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
--- End Message ---