php-general Digest 7 Feb 2005 11:05:48 -0000 Issue 3272
Topics (messages 208148 through 208161):
Re: Problems with PHP and MySQL
208148 by: Curt Zirzow
Re: Where's xml in PHP5?
208149 by: Curt Zirzow
Re: wait function
208150 by: Curt Zirzow
Re: Php Problem Parsing or so I think
208151 by: Curt Zirzow
Control Structures
208152 by: Wil
208153 by: John Holmes
208154 by: Marek Kilimajer
Public/Private Key Encryption
208155 by: Daniel Bowett
208156 by: Dan Trainor
208157 by: Stig Venaas
Remote Procedure Call Failed
208158 by: Alex Gemmell
Checking directory existance
208159 by: Ashley M. Kirchner
208160 by: Dan Trainor
Re: PHP Memory limit exceeded
208161 by: Ben-Nes Yonatan
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 ---
* Thus wrote Sarah:
> Fixed. It was a combination of the commandline version of PHP 503 not
> building by default, *and* my having to use the 'mysqli' interface as
> you suggested. The object interface to mysql works quite nicely.
Just a note: if you do use the mysqli interface, it isn't
compatible to php4, just in case that may be an issue.
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
* Thus wrote Brian V Bonini:
> Just compiled PHP5 usign --enable-xml (though I see it is supposed to be
> enabled by defaut however I'm getting 'call to undefined function'
> errors now.
The problem exists in your configure line.
'./configure'
'--enable-versioning' # most likely dont need this
'--enable-memory-limit'
'--with-layout=GNU' # most likley dont need this
'--with-zlib-dir=/usr'
'--with-imap=/usr/local'
'--disable-all' # disables the default install php will use
'--with-regex=php'
'--disable-cli'
'--enable-ctype' # enabled by default
'--with-gd'
'--enable-gd-native-ttf'
'--with-freetype-dir=/usr/local'
'--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr/local'
'--with-mysql=/usr/local'
'--enable-overload' # shouldn't be used
'--with-pcre-regex=yes' # enabled by default
'--enable-posix' # enabled by default
'--enable-session' # enabled by default
'--enable-tokenizer'
'--with-expat-dir=/usr/local' #shouldn't be used
'--enable-xml' # enabled by default
'--with-zlib=yes'
'--with-apxs2=/usr/local/www/bin/apxs'
'--prefix=/usr/local' # default installation path
The key entry is your --disable-all entry, Bypassing the default
installation that php uses. Thus, it will disable your
libxml2 installation which is what php uses for xml. The
--with-expat path is not needed because that is the old xml parser,
php 5 uses libxml2 for the XML functions.
the --enable-overload really isn't necessary unless you have old
php4 scripts that rely on this extension.
The --with-layout, just decides where to put the extension's
libdir = $prefix/php
GNU: $libdir/(no-)debug-(non-)zts/
PHP: $libdir/extenstions/(no-)debug-(non-)zts/
I'd only mabey recommend using GNU for linux like OS installations.
If this is being installed from a port from freebsd, i would
strongly suggest in contacting the maintainer and letting them know
that it is broken, although, iirc, this is a known issue.
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
* Thus wrote Alessandro Rosa:
> Yes, guys, SLEEP was what I was looking for.
> I took up the code I showed before from such a
> php site, but it did work on a linux server anyway.
btw, both sleep and usleep will work accross different Operating
Systems.
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
* Thus wrote Carinus Carelse:
> variables I get an error message in the browser Illegitimate format. I
> am including a copy of the link I click on to call the page below. I
> wonder if someone on the list can may be help me. Have I compiled PHP
> wrong or is the code itself wrong. Or is there a better way to do the
> below.
>
>
> http://localhost.domain.com/mailrelease/Release.php?id=1CwdBD-0002z8-1K&date=20050203&[EMAIL
> PROTECTED]
>
> <html>
> <head>
> <title> Releasing <?php echo($_GET['id']); ?> to all recipients </title>
>
> <body>
> <p> Releasing email message <b> <?php echo($_GET['id']); ?> </b> to <b>
> <?php echo ($HTTP_GET_VARS['name']); ?> </b>
> </p>
> <?php
>
> $file = $_GET['id'];
> $date = $_GET['date'];
> $name = $_GET['name'];
> if(preg_match("/^[a-zA-Z0-9]+$/",$file)
> && preg_match("/^[0-9]+$/",$date)
> && preg_match("/[EMAIL PROTECTED]/",$name))
>
> {
The $file expression is ignoring -'s, use:
if(preg_match("/^[a-zA-Z0-9-]+$/",$file)
Curt
--
Quoth the Raven, "Nevermore."
--- End Message ---
--- Begin Message ---
To PHP list:
The following code is attempting to compare the salary to the four other
pre-defined variables with if and else statements. So the final output
should result in 4 different statements. What is the best way to do this?
Following is the code...
<?php
$currentmax = 1049;
$maximum1 = 1420;
$maximum2 = 1692;
$maximum3 = 1901;
if ($salary < $currentmax) {
echo "Currently, you pay approximately $ ", round ($salary * .0055 * 52 /
12, 2), " per month in dues.<br>";}
else
{
echo "You currently pay the maximum monthly dues of $25";
}
if ($salary < maximum1); {
echo "After phase 1 of the proposed increase, your monthly dues amount will
be $ ", round ($salary *.0065 * 52 / 12,2);
}
else
{
echo ("You pay the maximum monthly dues of $40";)
}
if ($salary < $maximum2); {
echo ("<br>After phase 2 of the proposed increase, your monthly dues amount
will be $ ",round ($salary *.0075 * 52 / 12,2);
else
echo ("You pay the maximum monthly dues of $55");
}
if ($salary < $maximum3); {
echo ("<br>After phase 3 of the proposed increase, your monthly dues amount
will be $ ", round ($salary *.0085 * 52 / 12,2);
else
echo ("You pay the maximum monthly dues of $70");
}
?>
I am still a newbie so any help with this code will be great...
Thanks,
Wil
--- End Message ---
--- Begin Message ---
Wil wrote:
The following code is attempting to compare the salary to the four other
pre-defined variables with if and else statements. So the final output
should result in 4 different statements.
[snip]
if ($salary < maximum1); {
Take out the semi-colon in the above line and others like it.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Wil wrote:
To PHP list:
The following code is attempting to compare the salary to the four other
pre-defined variables with if and else statements. So the final output
should result in 4 different statements. What is the best way to do this?
Following is the code...
<?php
$currentmax = 1049;
$maximum1 = 1420;
$maximum2 = 1692;
$maximum3 = 1901;
if ($salary < $currentmax) {
echo "Currently, you pay approximately $ ", round ($salary * .0055 * 52 /
12, 2), " per month in dues.<br>";}
else
{
echo "You currently pay the maximum monthly dues of $25";
}
if ($salary < maximum1); {
echo "After phase 1 of the proposed increase, your monthly dues amount will
be $ ", round ($salary *.0065 * 52 / 12,2);
}
else
{
echo ("You pay the maximum monthly dues of $40";)
}
if ($salary < $maximum2); {
echo ("<br>After phase 2 of the proposed increase, your monthly dues amount
will be $ ",round ($salary *.0075 * 52 / 12,2);
else
echo ("You pay the maximum monthly dues of $55");
}
if ($salary < $maximum3); {
echo ("<br>After phase 3 of the proposed increase, your monthly dues amount
will be $ ", round ($salary *.0085 * 52 / 12,2);
else
echo ("You pay the maximum monthly dues of $70");
}
?>
I am still a newbie so any help with this code will be great...
You did not say what your output should look like, but as a start you
can fix your code of parse errors and see if the output is what you need.
--- End Message ---
--- Begin Message ---
Is there any way I can use public/private key encryption in php in a
similar way to mcrypt.
I have got php encrypting the data using gnugp but need to automate the
decrytping element which is proving difficult because of the way the
password is passed.
--- End Message ---
--- Begin Message ---
Daniel Bowett wrote:
Is there any way I can use public/private key encryption in php in a
similar way to mcrypt.
I have got php encrypting the data using gnugp but need to automate the
decrytping element which is proving difficult because of the way the
password is passed.
While Daniel has brang up the subject of encryption, and I know that the
other day we were talking about storing CC numbers in a database - i
don't think we touched on storing CCs encrypted with a gpg-stype
encryption. Is this generally acceptable at all, or do you developers
still not store CC numbers in any way, shape or form in a database?
THanks
-dant
--- End Message ---
--- Begin Message ---
On Sun, Feb 06, 2005 at 09:23:30PM +0000, Daniel Bowett wrote:
> Is there any way I can use public/private key encryption in php in a
> similar way to mcrypt.
>
> I have got php encrypting the data using gnugp but need to automate the
> decrytping element which is proving difficult because of the way the
> password is passed.
Don't know exactly what mcrypt does, but you can find an example of
public key crypto with PHP at http://www.venaas.no/php/
Stig
--- End Message ---
--- Begin Message ---
Hello,
I am building a login system for my website but I keep experiencing an
error on a specific PHP page that I have never encountered before and it
seems worryingly low-level! It says:
"The remote procedure call failed."
And that's it! Nothing else is on the page. Sometimes I get a slightly
different (but equally scary) error:
"PHP has encountered a Stack overflow"
I've googled these errors and some people have posted them but I found
no solution. I've searched the PHP bug database but found nothing. Has
anyone else encountered this and is there a solution?
FYI:
Other (more simple) PHP scripts work fine (so my PHP installation seems
to be ok) and this error only started happening last week.
I haven't changed this PHP/MySQL installation in months.
I'm testing my script on a (Windows) server in my office on which this
error occurs. When I upload it to a second remote (Linux) test server
it works fine!
Office Server: Windows 2000 Server + IIS 5.1, PHP Version 4.3.9 (Zend
Engine v1.3.0), MySQL 3.23.49. *CGI Version - I am considering changing
to ISAPI. Would this help do you think?
Remote Server: Linux + Apache, PHP Version 4.1.2 (Zend Engine v1.1.1),
MySQL 3.23.39.
Any ideas gratefully received! Thanks,
Alex
--- End Message ---
--- Begin Message ---
Through ftp commands, how can I check whether a directory already
exists before executing ftp_mkdir() ?
Thanks!
--- End Message ---
--- Begin Message ---
Ashley M. Kirchner wrote:
Through ftp commands, how can I check whether a directory already
exists before executing ftp_mkdir() ?
Thanks!
Ashley -
Try using:
if (!ftp_chdir($ftpc,$ftproot.$srcrela))
Thanks
-dant
--- End Message ---
--- Begin Message ---
> Richard Lynch wrote:
>>>At the other hand i did find some huge mistake at my side... only the
>>>download of the file require 28MB (god knows why! but i wont start to
>>>bother
>>>u folks about it now) the upload need 16MB so clearly u were correct but
>>>im
>>>sorry to admit that i didnt understand y its getting tripled... after all
>>>the result $res is a result of an INSERT not a SELECT therfore it doesnt
>>>return all the data but just an identification if the action went
>>>succesful
>>>or not... or maybe im wrong here also?
>>
>>
>> PHP probably has to create an extra big chunk of text somewhere in the
>> process of sending the data to PostgreSQL.
>
> or it was simpler to write :)
>
>>
>>
>>>About the mysql's function... well its mysql and im using postgresql... i
>>>tried to search for something that could help uploading files data to the
>>>server but didnt find anything useful.
>>
>>
>> Sorry. I suspect they operate the same internally anyway, in terms of
>> transferring data to/from the database, and buffering the query.
>
> no, load_file() is mysql internal function. the file is read by mysql
> server, so it completely bypass php and also client libraries. you need to
> have file priviledge.
>
Hi and thanks again Richard and Marek,
Finally I found the solution that I craved for which is large objects at
postgresql, I can upload and d/l files with memory consuming of just alittle
bit more of the file size itself.
Actually I have to admit that I saw that option before but I thought that
its quite useless for my needs because they wrote there that after version
7.1 of postgresql the large objects interface is partially obsolete and
they also wrote that one of the remaining beneifits of using it is that it
can hold up to 2GB!! instead of the new TOAST of 1GB!! so I thought that I
dont need it at all if anyway I can get to 1GB.... but apprantly they didnt
wrote anywhere about the memory consumption diffrence... or maybe I dont
control the english language as I wish to :)
The large objects manual -
http://www.postgresql.org/docs/7.4/interactive/largeobjects.html (for ver
7.4)
Thanks alot again,
Ben-Nes Yonatan
--- End Message ---