|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 10 Oct 2004 05:54:46 -0000 Issue 3044
php-general-digest-help
lists.php.net
Date: Sun Oct 10 2004 - 00:54:46 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 10 Oct 2004 05:54:46 -0000 Issue 3044
Topics (messages 199077 through 199095):
Simply open an URL
199077 by: Armands Pucs
199079 by: Gareth Williams
Re: Securing Servers
199078 by: Chris Shiflett
http 411 error with cURL
199080 by: Nick Wilson
199081 by: Marek Kilimajer
199082 by: Nick Wilson
199083 by: Nick Wilson
199084 by: Marek Kilimajer
199085 by: Nick Wilson
199087 by: Marek Kilimajer
199088 by: Nick Wilson
199089 by: Marek Kilimajer
199090 by: Nick Wilson
199091 by: Nick Wilson
199093 by: Manuel Lemos
Re: Question about error_reporting()
199086 by: Jason Wong
(null)
199092 by: php-list.xenonsolutions.com
TTF Text not displaying correctly
199094 by: Brent Clements
Re: GD
199095 by: GH
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi everyone!
Sorry for the probably stupid question. But I can`t find a way to make a php
script to open an url in a browser!
Like "<script> location = "example.html"; </script>" does.
Armand from Latvia
attached mail follows:
header("Location: <<url>>");
On 9 Oct 2004, at 20:21, Armands Pucs wrote:
> Hi everyone!
>
> Sorry for the probably stupid question. But I can`t find a way to make
> a php
> script to open an url in a browser!
> Like "<script> location = "example.html"; </script>" does.
>
>
> Armand from Latvia
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
--- Stephen Craton <webmaster
melchior.us> wrote:
> I'm in the process of hooking up my own personal web server for
> use by certain clients to view the progress on work I'm doing
> for them. However, I'm on a shared network that is behind a
> firewall and some computers on the network need to stay secure
> as possible. I've heard that if you gain access to one computer,
> the whole thing is vulnerable.
That has some truth to it. My advice would be to establish a DMZ
(demilitarized zone). One way to do this would require the user of an
extra firewall. I assume that your current setup is a single firewall
between you and the Internet. When you relax your firewall rules to allow
HTTP traffic, your entire local network becomes a DMZ. Some users on the
local network might be running Windows with IIS and not even realize it,
and relaxed firewall rules can expose this weakness.
If you want to only open up additional ports for your server, you would
place an additional firewall between it and the local network, so HTTP
traffic can reach you, but the second firewall prevents it from reaching
the local network.
> I've going to be running Apache with PHP on my Windows box that
> has antivirus all set up and whatnot. My question comes in terms
> of port security. Since I'll be having the port open for Apache,
> I want to make sure nothing naughty gets through the port.
Apache should not be your concern. Windows is your security weakness, but
your firewall can help protect you. If you only want to be serving HTTP
(I'm assuming no SSL), only allow outside connections to be initiated on
port 80 and nowhere else. With this setup, you are relying on the security
of Apache for the most part (the OS does handle TCP/IP and such).
It is also very important that you do not actually use this computer for
other purposes, such as browsing the Web (e.g., if it's your personal
workstation). If you do, you are likely to get infected with something,
and then the firewall doesn't help you.
> How should I configure Apache and PHP in order to keep it as
> secure as possible but still functional?
This reminds me of another concern, which is your code. Even in the
theoretical case that your environment is 100% secure (a fiction that we
can only strive to achieve), weaknesses in your applications can still
exist.
> I have considered using Linux, but until I can get myself a
> separate computer box to dedicate to the server, I'm stuck with
> using my personal computer as the server as well and all my
> programs/games need Windows.
You cannot provide reasonable security with this approach, in my opinion.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming December 2004 http://httphandbook.org/
attached mail follows:
hi all,
Im getting an http 411 error when trying to post data with php's cURL
functions. The spec says
***The message for this error code is "Length Required."
The server refuses to accept the request without a defined Content-
Length.***
Im confused on 2 points:
* Is it the server i am posting *from* causing the error or is it the
server im posting *to*?
* How to resolve this?
Much thx for any guidance here, this was not happening yesterday doing
the same job.. weird!
--
Nick W
attached mail follows:
Nick Wilson wrote:
> hi all,
>
> Im getting an http 411 error when trying to post data with php's cURL
> functions. The spec says
>
> ***The message for this error code is "Length Required."
> The server refuses to accept the request without a defined Content-
> Length.***
>
> Im confused on 2 points:
>
> * Is it the server i am posting *from* causing the error or is it the
> server im posting *to*?
B is correct
>
> * How to resolve this?
header('Content-Length: ' . strlen($data_you_are_posting));
>
> Much thx for any guidance here, this was not happening yesterday doing
> the same job.. weird!
attached mail follows:
* and then Marek Kilimajer declared....
> >* How to resolve this?
>
> header('Content-Length: ' . strlen($data_you_are_posting));
Ok, im with you Marek but how/where do i put it in my curl function?
Not with CURL_POSTFIELDS for sure.. i've been looking through the
options in the manual and dont see anything obivious...?
thanks mate..
--
Nick W
attached mail follows:
* and then Nick Wilson declared....
>
> * and then Marek Kilimajer declared....
> > >* How to resolve this?
> >
> > header('Content-Length: ' . strlen($data_you_are_posting));
>
> Ok, im with you Marek but how/where do i put it in my curl function?
> Not with CURL_POSTFIELDS for sure.. i've been looking through the
> options in the manual and dont see anything obivious...?
Opps!
CURLOPT_HTTPHEADER
I go play with it now ;-)
--
Nick W
attached mail follows:
Nick Wilson wrote:
> * and then Nick Wilson declared....
>
>>* and then Marek Kilimajer declared....
>>
>>>>* How to resolve this?
>>>
>>>header('Content-Length: ' . strlen($data_you_are_posting));
>>
>>Ok, im with you Marek but how/where do i put it in my curl function?
>>Not with CURL_POSTFIELDS for sure.. i've been looking through the
>>options in the manual and dont see anything obivious...?
>
>
> Opps!
>
> CURLOPT_HTTPHEADER
>
> I go play with it now ;-)
>
Sorry, I got it mixed :) But you figured it out.
attached mail follows:
* and then Marek Kilimajer declared....
> >Opps!
> >
> >CURLOPT_HTTPHEADER
> >
> >I go play with it now ;-)
> >
>
> Sorry, I got it mixed :) But you figured it out.
do you know if the lenght includes the args? like this
strlen("val=$var&val2=$var2");
or
strlen($var . $var2=;
?
cheers marek
--
Nick W
attached mail follows:
Nick Wilson wrote:
> * and then Marek Kilimajer declared....
>
>>>Opps!
>>>
>>>CURLOPT_HTTPHEADER
>>>
>>>I go play with it now ;-)
>>>
>>
>>Sorry, I got it mixed :) But you figured it out.
>
>
> do you know if the lenght includes the args? like this
>
> strlen("val=$var&val2=$var2");
This one. Don't forget to urlencode where necessary
attached mail follows:
* and then Marek Kilimajer declared....
> Nick Wilson wrote:
> >* and then Marek Kilimajer declared....
> >
> >>>Opps!
> >>>
> >>>CURLOPT_HTTPHEADER
> >>>
> >>>I go play with it now ;-)
> >>>
> >>
> >>Sorry, I got it mixed :) But you figured it out.
> >
> >
> >do you know if the lenght includes the args? like this
> >
> >strlen("val=$var&val2=$var2");
>
> This one. Don't forget to urlencode where necessary
hmmm.. well, this is giving me the same curl_errno(22) http 411
$postF="s=$s&e=$e&a=" . urlencode($a) . "&em=" . urlencode($em) ."&x=" .
$x . "&b=$b&t=" . urlencode($t) . "&p=$p";
$postL=strlen($postF);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postF);
curl_setopt($ch, CURLOPT_HTTPHEADERS, "Content-Length: $postL");
$result=curl_exec($ch);
--
Nick W
attached mail follows:
Nick Wilson wrote:
> * and then Marek Kilimajer declared....
>
>>Nick Wilson wrote:
>>
>>>* and then Marek Kilimajer declared....
>>>
>>>
>>>>>Opps!
>>>>>
>>>>>CURLOPT_HTTPHEADER
>>>>>
>>>>>I go play with it now ;-)
>>>>>
>>>>
>>>>Sorry, I got it mixed :) But you figured it out.
>>>
>>>
>>>do you know if the lenght includes the args? like this
>>>
>>>strlen("val=$var&val2=$var2");
>>
>>This one. Don't forget to urlencode where necessary
>
>
>
> hmmm.. well, this is giving me the same curl_errno(22) http 411
>
> $postF="s=$s&e=$e&a=" . urlencode($a) . "&em=" . urlencode($em) ."&x=" .
> $x . "&b=$b&t=" . urlencode($t) . "&p=$p";
>
> $postL=strlen($postF);
>
> curl_setopt($ch, CURLOPT_POSTFIELDS,$postF);
> curl_setopt($ch, CURLOPT_HTTPHEADERS, "Content-Length: $postL");
CURLOPT_HTTPHEADER - An array of HTTP header fields to set.
curl_setopt($ch, CURLOPT_HTTPHEADERS, array('Content-Length' => $postL));
>
> $result=curl_exec($ch);
>
attached mail follows:
* and then Marek Kilimajer declared....
> CURLOPT_HTTPHEADER - An array of HTTP header fields to set.
Marek, im sure you dont need to know this, but i think it's funny so
maybe you will, i just went to bed, im now sitting here er.. without
much on at the PC cos i just realized the same thing! - sorry, im
tired....
thanks so much!
--
Nick W
attached mail follows:
* and then Nick Wilson declared....
>
> * and then Marek Kilimajer declared....
> > CURLOPT_HTTPHEADER - An array of HTTP header fields to set.
ahhh !
$# it!
that dont work and niether does this:
curl_setopt($ch, CURLOPT_HTTPHEADERS, array("Content-Length: $postL"));
im off to bed.. back in the am.
--
Nick W
attached mail follows:
Hello,
On 10/09/2004 07:49 PM, Nick Wilson wrote:
> Im getting an http 411 error when trying to post data with php's cURL
> functions. The spec says
>
> ***The message for this error code is "Length Required."
> The server refuses to accept the request without a defined Content-
> Length.***
>
> Im confused on 2 points:
>
> * Is it the server i am posting *from* causing the error or is it the
> server im posting *to*?
>
> * How to resolve this?
It seems cURL is sending a malformed HTTP request. When I used Curl I
don't let it compose the request. Instead I use this HTTP client class
that lets me use cUrl or fsockopen to establish HTTP connection and it
takes care of sending the HTTP request correctly regardless of the way
the request is sent.
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
On Saturday 02 October 2004 00:34, Greg Donald wrote:
> > The manual is not clear on this point.
> >
> > Also, must I have a an existing error file for the errors to append to?
>
> No, the web server error log is where they shoudl appear.
No, PHP errors DO NOT appear in the apache logs[1], they are logged to a
separate file which can be specified in php.ini.
[1] Some PHP induced errors do appear in the apache error log, notably
segfaults.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I have an existential map. It has "You are here" written all over it.
-- Steven Wright
*/
attached mail follows:
Hello everyone,
I'm hoping you guys can help me with this error. Here's what I'm getting:
Notice: Undefined variable: children in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
58
This error occurs only when the class's method outputs $children as having a
value of zero. Below is the class. I want it to return zero but I don't want
this error. Do I need to change my error settings in my php.ini file? The
error level is currently set to E_ALL and I'm using PHP 5.0.1. If at all
possible, I want to keep this error setting at high because I want
everything to be coded strictly. What did I do wrong in my class and how can
I fix it to where it doesn't output an error when a class's method returns a
value of zero? Here's the class:
function get_children($parent) {
$parent_coord = tree::get_item_coord($parent);
$descendants = $this->get_descendants($parent);
for ($i = 0; $i < count($descendants); $i++) {
if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
$descendants[$i]['lft'])) {
$children[] = $descendants[$i]; // found first child
}
elseif (($children[count($children)-1]['rgt'] + 1 ==
$descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
$parent_coord['0']['rgt']) {
$children[] = $descendants[$i]; // find next children
}
}
return $children;
}
Thanks in advance to anyone that can explain this error to me.
Nilaab
attached mail follows:
Does anybody know off the top of their head why truetype font text would look greyed out?
This is my code:
<?php
$im =
imagecreatefromgif("testimage.gif");
$myfont = "inc/arial.ttf";
$mycolor = imagecolorallocate($im,0,0,0);
imagettftext($im, 8, 0, 580, 118, $mycolor, $myfont, "test string");
imagejpeg($im);
imagedestroy($im);
?>
The text looks greyed out and it's a bit distorted.
Thanks,
Brent
attached mail follows:
phpinfo() also does the trick... atleast on my host
On Sat, 09 Oct 2004 20:25:27 +0300, Simas Toleikis <simast
projektas.lt> wrote:
> Gerben wrote:
>
> >how can i find out in PHP which version of GD is installed. I tried checking
> >for function-existence of imagecreatetruecolor and imagecopyresampled, but
> >these functions exist in older GD versions, but aren't implemented.
> >I want to know if I can use the functions imagecreatetruecolor() and
> >imagecopyresampled() ?
> >
>
> gd_info()
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]