php-general Digest 13 Feb 2006 16:02:34 -0000 Issue 3961
Topics (messages 230292 through 230317):
Re: Smart anti-aliasing
230292 by: Curt Zirzow
Re: Asynchronous Processing
230293 by: Curt Zirzow
Where is Zend
230294 by: Roger Thomas
230295 by: Chris
230296 by: Roger Thomas
230297 by: antispo
limit on the mail function
230298 by: spamdetect.natrium.datanet.hu
230299 by: Barry
230300 by: Paul Scott
doubt in mail function
230301 by: suresh kumar
230302 by: Paul Scott
230303 by: Barry
Re: PHP Session
230304 by: Jochem Maas
Re: scope of classes in PHP
230305 by: Jochem Maas
Re: Clone of the concurrent users limit of Zend Encoder 4.0 ?
230306 by: HoWang Wang
phpinfo returns a permission error
230307 by: Dave M G
230308 by: Jay Blanchard
230309 by: Kevin Kinsey
safe_mode + move_upload_file
230310 by: fjug
230311 by: Jay Blanchard
230313 by: fjug
Converting piped data from stdin to phpcgi
230312 by: zedleon
230315 by: Jay Blanchard
GPG on Safe Mode - Other Options
230314 by: Mike Pogue
Converting piped data to values from html to phpcgi
230316 by: zedleon
230317 by: Dan Parry
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:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Sun, Feb 12, 2006 at 03:33:39PM -0500, tedd wrote:
> >Create the image you are going to watermark with as a PNG, png
> >doesn't suffer the issues of the antialiasing issues like GIF.
> >
> ...
>
> First, thanks for helping.
No problem
>
> Second, I wasn't using a GIF -- my copyright was a png and my image was a
> jpg.
>
> Third, the following is my code, I think I'm following what you said
> -- but something is wrong -- the problem remains as shown here:
I'm not an expert on all this, but it seems that it is because your
anti-alias method is against white, you really want it against
transparent.
I think it might be a bit off topic for discussion here but what
does your copyight.png look like?
Oh, one thing that might be important is what version of gd is php
compiled with?
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
On Sun, Feb 12, 2006 at 12:51:34AM -0200, Gustavo Rios wrote:
> Hey folks,
>
> i am writing a small program in C that does mysql queries. The problem
> i am facing is that it is done in synchronous fashion. I wonder how
> php does mysql queries in asynchronous fashion?
How do you mean synchronous/asynchronous fashion?
PHP programming with mysql is different monster than using the
mysql C API.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
I have had difficulty going to zend.com to download Zend Optimizer for
php-4.4.2 since last week. Anybody that have a copy of Zend Optimizer, I would
appreciate if you could provide me with a link to your server that I can
download a copy. TIA.
--roger
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
--- End Message ---
--- Begin Message ---
Roger Thomas wrote:
I have had difficulty going to zend.com to download Zend Optimizer for
php-4.4.2 since last week.
Have you contacted zend and told them you were having a problem ?
I'm sure they have an easy to fill in contact form on their site.
--- End Message ---
--- Begin Message ---
Quoting Chris <[EMAIL PROTECTED]>:
> Roger Thomas wrote:
> > I have had difficulty going to zend.com to download Zend Optimizer
> for php-4.4.2 since last week.
>
> Have you contacted zend and told them you were having a problem ?
>
> I'm sure they have an easy to fill in contact form on their site.
>
I can't even access the site.
--roger
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
--- End Message ---
--- Begin Message ---
last night i've dowloaded zend studio....
...zend.com... it's up an runnin'....
--- End Message ---
--- Begin Message ---
Hello!
I would like to know whether some limits on the mail function
could be set.
We host a lot of virtual hosts and some of our users send a lot
of messages by the mail() function. However I would like to
implement a limit such as max. 512 emails per virtualhost per hour.
Is it possible with PHP mail()?
Thanks for any help.
Janos Suto
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
Hello!
I would like to know whether some limits on the mail function
could be set.
We host a lot of virtual hosts and some of our users send a lot
of messages by the mail() function. However I would like to
implement a limit such as max. 512 emails per virtualhost per hour.
Is it possible with PHP mail()?
Thanks for any help.
Janos Suto
No, but you can configure the virtual hosts that PHP uses POP3 logins to
send mail.
Then you can configure your mail server like that.
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
On Mon, 2006-02-13 at 10:07 +0100, Barry wrote:
> No, but you can configure the virtual hosts that PHP uses POP3 logins to
> send mail.
> Then you can configure your mail server like that.
>
Or you could update and increment a file/dbtable or something every mail
sent. That way you could disable the function when it reaches a limit.
--Paul
--- End Message ---
--- Begin Message ---
hello everybody,
i am having one doubt in sending mail
in php.in my company our mail server is in windows,but
my php code for mail function in linux,i set the code
as
if(@mail('[EMAIL PROTECTED]','hi suresh','this is
test','From:[EMAIL PROTECTED]')):
both from and to address are valid but mail
is not receiving to [EMAIL PROTECTED],
whether i have 2 configure any settings in php.ini,i
am looking for reply from any one.
A.suresh
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
--- End Message ---
--- Begin Message ---
On Mon, 2006-02-13 at 10:05 +0000, suresh kumar wrote:
> both from and to address are valid but mail
> is not receiving to [EMAIL PROTECTED],
>
The PHP mail() function will use sendmail/postfix/etc (your hosts MTA),
if you plan on using a mail relay i.e. an SMTP server to send mail, you
will have to use a SMTP class/script. I know that the PHPMailer script
has a SMTP section, although I have never used it. Check out that
project (I think its http://phpmailer.sourceforge.net) for some help.
--Paul
--- End Message ---
--- Begin Message ---
suresh kumar wrote:
hello everybody,
i am having one doubt in sending mail
in php.in my company our mail server is in windows,but
my php code for mail function in linux,i set the code
as
if(@mail('[EMAIL PROTECTED]','hi suresh','this is
test','From:[EMAIL PROTECTED]')):
both from and to address are valid but mail
is not receiving to [EMAIL PROTECTED],
whether i have 2 configure any settings in php.ini,i
am looking for reply from any one.
A.suresh
Is on the windows machine a mail server installed?
Does this code work on your linux machine?
Be sure mail sending is allowed on your windows machine.
sendmail_from NULL PHP_INI_ALL
sendmail_path NULL PHP_INI_SYSTEM
Those ini variables must be set correctly in order to send mail on windows.
Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
he Kurt,
Given the question you ask is very much a beginners question I assume that you
are not working for LCMG as a programmer? nothing wrong with that, per se
... BUT working for a large IT company you are expected to
realise that the whole internet community is not just there to answer you
your personal questions and fix your problems. so please address your questions
to
an appropriate forum [php-generals mailing list in this case] - i.e. not to
some
random stranger who email address you plucked from the internet because you
decided
you want them to help you. [that means replying to the list address and not me
if you want to response to my post]
(I'm pretty sure that LCMG wouldn't answer my IT questions if I just started
'cold-emailing' their techsupport - rather I first need a 200euro/hour support
contract before anyone will help me; <-- not to far from the truth?)
Vandevelde, Kurt wrote:
Hello,
I saw in the PHP newsgroup that you were having problems with the PHP Session.
I just started using PHP a few days ago and I have the following problem :
unless you found a 3 year old post I suspect you saw me (trying to) help
someone else who
was having Session related problems.
It seems that $_SESSION is not recognized. I read that I must use
session_start(); before I can save data. Is there anything else that has to be
done? I used the following code. Do you know what my be wrong?
seems? wht does is 'seem' - state the problem you actually experience,
verbalizing a gut instinct that something
'seems' to be 'not recognized' is rather vAgue and therefore pointless.
likely you are not yet familiar with the way php autocasts variables. e.g. look
what happens here:
echo ""; // echo an empty string
echo null; // echo a 'null'
echo false; // echo a boolean false
as opposed to:
var_dump($a = "");
var_dump($b = null);
var_dump($c = false);
<?php
session_start();
echo '<pre>';
var_dump(isset($_SESSION['LoggedIn']));
var_dump($_SESSION);
if (!isset($_SESSION['LoggedIn'])) {
$_SESSION['LoggedIn'] = false;
$UserLoggedIn = false;
} else {
$UserLoggedIn = $_SESSION['LoggedIn'];
}
echo $_SESSION['LoggedIn'];
echo '.';
echo $UserLoggedIn;
?>
learn to debug your code, start with the these functions:
print_r();
var_dump();
they will help you to figure out what your variable contain
while your script runs and thereby (usually) figure out why your
script is not doing what you expect.
unless you are using a an old version of PHP $_SESSION will exist in your
script after you call session_start().
Thanks,
Kurt Vandevelde
Belgium.
<removed legalese mindrot>
--- End Message ---
--- Begin Message ---
Stuart Bailey wrote:
Hi
I'm developing an app to administer LDAP (phpLdapAdmin is too complex for the
customer).
I have created an LDAP class, in a file class_ldap.php. It include methods for
connecting to the server, binding a DN (effectively login), and adding posix
groups.
I have an index.php with include_once 'class_ldap.php', which allows me to
login using the HTTP authentication mechanism.
The connect method stores the resulting connection resource in a global
variable (included in a config.php file).
When I then go to add the posix group (from add_group.php, that also includes
class_ldap.php), I find that the global connection variable is not valid.
My question is, do I need to connect and authenticate with the LDAP server
every time I want to perform an action, or is there a way to establish a
you need to establish a connection at the start of every request php handles,
typically you perform one [major] 'action' per request so the short answer is:
'yes'.
the connection to the LDAP server is a 'resource' type variable - php
'resources'
are only valid for the duration of the script.
connection for the user's session, that is cleared when the user logs out.
Many thanks,
Stuart.
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
On Sun, Feb 12, 2006 at 10:32:27AM -0500, Mark Charette wrote:
Let me give an example:
on fileplanet.com, they have something so called "download slot"
and "lines". They limit the number of concurrent downloads. If
there are too many users, they will disallow new user to
download their files. As I know, they do it with custom HTTP
server.
Not so custom ... Apache has quite a few bandwidth limiting
modules. I use mod_bandwidth to accomplish this.
I would suggest going this method instead of trying to chisel a
round wheel from a square granite rock.
Curt.
:( really can't do this with PHP?
--- End Message ---
--- Begin Message ---
PHP list,
I wanted to adjust my register global settings in my php.ini file. I
found instructions on this page:
http://www.dmcinsights.com/phpmysql/phpini.php
The first thing it says to do is take a look at the results of
phpinfo(); to see where the php.ini file actually is.
So I created a phpinfo.php file, put in the following code:
<?php
phpinfo();
?>
... and then accessed it through FireFox at localhost.
To my surprise, I got the following error message:
Warning: Unknown(/home/dave/web_sites/phpinfo.php): failed to open
stream: Permission denied in Unknown on line 0
Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php' for
inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown
on line 0
It looks to be a permissions issue. But who has permission if not
me, and how is permission an issue when I'm just looking at the file
through a browser?
By the way, I'm using PHP 4.4.0-3 on Ubuntu 5.10.
Any advice or help would be much appreciated.
Thank you.
--
Dave M G
--- End Message ---
--- Begin Message ---
[snip]
I wanted to adjust my register global settings in my php.ini file. I
found instructions on this page:
http://www.dmcinsights.com/phpmysql/phpini.php
The first thing it says to do is take a look at the results of
phpinfo(); to see where the php.ini file actually is.
So I created a phpinfo.php file, put in the following code:
<?php
phpinfo();
?>
... and then accessed it through FireFox at localhost.
To my surprise, I got the following error message:
Warning: Unknown(/home/dave/web_sites/phpinfo.php): failed to open
stream: Permission denied in Unknown on line 0
Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php' for
inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown
on line 0
[/snip]
Where did you put the phpinfo.php file after you created it? Did you try
accessing like this; http://127.0.0.1/phpinfo.php ?
--- End Message ---
--- Begin Message ---
Dave M G wrote:
PHP list,
I wanted to adjust my register global settings in my
php.ini file. I found instructions on this page:
http://www.dmcinsights.com/phpmysql/phpini.php
The first thing it says to do is take a look at the
results of phpinfo(); to see where the php.ini file actually is.
So I created a phpinfo.php file, put in the following code:
<?php
phpinfo();
?>
... and then accessed it through FireFox at localhost.
To my surprise, I got the following error message:
Warning: Unknown(/home/dave/web_sites/phpinfo.php):
failed to open stream: Permission denied in Unknown on line 0
Warning: (null)(): Failed opening '/home/dave/web_sites/phpinfo.php'
for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in
Unknown on line 0
It looks to be a permissions issue. But who has permission if not me,
and how is permission an issue when I'm just looking at the file
through a browser?
By the way, I'm using PHP 4.4.0-3 on Ubuntu 5.10.
Any advice or help would be much appreciated.
Thank you.
--
Dave M G
So, what does this say:
$umask
and this:
$ ls -l /home/dave/web_sites/phpinfo.php
and are you using the browser to view the file via
a server (e.g., the browser address bar says "http://"),
or via the filesystem (you've opened it from an "explorer"
type window and the address bar says "file:///")....
Is PHP running as mod_php in apache, or CGI?
Finally, can you view other files in the same directory
via similar means?
Kevin Kinsey
--
Stult's Report:
Our problems are mostly behind us.
What we have to do now is fight the solutions.
--- End Message ---
--- Begin Message ---
Hi,
I try to use move_upload_file function with safe_mode (with PHP 4.3.10).
When I turn the safe_mode off, the function works fine, but when I turn it
back to on, the function doesn't work (with no error message).
When I read the documentation about safe_mode, I do not see any
restriction concerning the usage of move_upload_file function in this mode.
Does someone experienced this problem ?
Thank you.
F. Jugla
--- End Message ---
--- Begin Message ---
[snip]
I try to use move_upload_file function with safe_mode (with PHP 4.3.10).
When I turn the safe_mode off, the function works fine, but when I turn it
back to on, the function doesn't work (with no error message).
When I read the documentation about safe_mode, I do not see any
restriction concerning the usage of move_upload_file function in this mode.
Does someone experienced this problem ?
[/snip]
>From TFM
http://us2.php.net/manual/en/function.move-uploaded-file.php
"Note: move_uploaded_file() is both safe mode and open_basedir aware.
However, restrictions are placed only on the destination path as to allow
the moving of uploaded files in which filename may conflict with such
restrictions. move_uploaded_file() ensures the safety of this operation by
allowing only those files uploaded through PHP to be moved."
--- End Message ---
--- Begin Message ---
Le Mon, 13 Feb 2006 09:09:54 -0600, Jay Blanchard a écrit :
> From TFM
>
> http://us2.php.net/manual/en/function.move-uploaded-file.php
>
> "Note: move_uploaded_file() is both safe mode and open_basedir aware.
> However, restrictions are placed only on the destination path as to allow
> the moving of uploaded files in which filename may conflict with such
> restrictions. move_uploaded_file() ensures the safety of this operation by
> allowing only those files uploaded through PHP to be moved."
Thanks for your answer. I had seen this note before, but I don't
understand it (I also looked at the french translation but I also don't
understand it).
--- End Message ---
--- Begin Message ---
I am using php as a cgi. The data from my html is piped through stdin using
this code:
<?
$fp=popen("cat","r");
$str=fgets($fp);
print $str;
?>
The result I am getting looks like this: (which is correct)
sender_name=zedleon&[EMAIL PROTECTED]&sender_msg=This+is+a
+test&Submit=Submit
What I need to do now is to convert the piped string into the individual
values $sender_name, $sender_email, $sender_msg.
Does anybody know a way to do this...any help is appreciated.
Zed
--- End Message ---
--- Begin Message ---
[snip]
I am using php as a cgi. The data from my html is piped through stdin using
this code:
<?
$fp=popen("cat","r");
$str=fgets($fp);
print $str;
?>
The result I am getting looks like this: (which is correct)
sender_name=zedleon&[EMAIL PROTECTED]&sender_msg=This+is+a
+test&Submit=Submit
What I need to do now is to convert the piped string into the individual
values $sender_name, $sender_email, $sender_msg.
Does anybody know a way to do this...any help is appreciated.
[/snip]
http://us2.php.net/explode
http://us2.php.net/foreach
$string =
"sender_name=zedleon&[EMAIL PROTECTED]&sender_msg=This+is+
a+test&Submit=Submit";
$stringArray = explode("&", $string);
foreach($stringArray as $key => $value){
$partArray = explode("=", $value);
echo $partArray[0] . " is equal to " . $partArray[1] . "\n";
}
--- End Message ---
--- Begin Message ---
Hi all,
I'm trying to use GPG encryption on a server with Safe Mode on so exec,
system ... do not work. Also I can not load any pecl modules.
Is any other way I can encrypt/decrypt from PHP using the public/secret key
model?
Many Thanks,
Mike
--- End Message ---
--- Begin Message ---
I am using php as a cgi. The data from my html is piped through stdin using
this code:
<?
$fp=popen("cat","r");
$str=fgets($fp);
print $str;
?>
The result I am getting looks like this: (which is correct)
sender_name=zedleon&[EMAIL PROTECTED]&sender_msg=This+is+a
+test&Submit=Submit
What I need to do now is to convert the piped string into the individual
values $sender_name, $sender_email, $sender_msg.
Does anybody know a way to do this...any help is appreciated.
--- End Message ---
--- Begin Message ---
This works for me:
<?
$temp = 'sender_name=zedleon&[EMAIL PROTECTED]&
sender_msg=This+is+a+test&Submit=Submit';
$arr = array();
foreach (explode('&', $temp) as $v) {
$split = explode('=', $v);
// urldecode content for readability
$arr[$split[0]] = urldecode($split[1]); // create assoc. array
${$split[0]} = urldecode($split[1]); // form the variables
}
echo $sender_name . '<br/>' . $arr['sender_name']; ?>
That routine should create variables with the names of the arguments as well
as an associative array of the string
HTH
Dan
-----Original Message-----
From: zedleon [mailto:[EMAIL PROTECTED]
Sent: 13 February 2006 14:38
To: [email protected]
Subject: [PHP] Converting piped data to values from html to phpcgi
I am using php as a cgi. The data from my html is piped through stdin using
this code:
<?
$fp=popen("cat","r");
$str=fgets($fp);
print $str;
?>
The result I am getting looks like this: (which is correct)
sender_name=zedleon&[EMAIL PROTECTED]&sender_msg=This+is+a
+test&Submit=Submit
What I need to do now is to convert the piped string into the individual
values $sender_name, $sender_email, $sender_msg.
Does anybody know a way to do this...any help is appreciated.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---