php-general Digest 4 May 2009 18:57:15 -0000 Issue 6103
Topics (messages 292240 through 292243):
Re: compiling a test php from latest csv snapshot on os-x
292240 by: Tom Worster
Re: ImageMagick
292241 by: haliphax
Re: Static and/or Dynamic site scraping using PHP
292242 by: haliphax
elseif statements
292243 by: Gary
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 5/4/09 2:52 AM, "Michael A. Peters" <[email protected]> wrote:
> Tom Worster wrote:
>> i've an outstanding verification to do for a php bug fix. can anyone point
>> me at instructions for compiling the latest csv snapshot for testing on os-x
>> without installing over my current installed php?
>
> I assume you can compile as a non privileged and set a prefix during
> configure that make install will respect.
>
> One word of caution - make test will sometimes fail (linux systems) if
> an existing php installation exists, it's probably because it finds the
> installed php first in it's path, if you can set up a chroot build
> environment that's probably best, as you can then run make test after
> make without version conflicts causing test failures.
>
> But to avoid over writing your existing php - log in as an unprivileged
> user, give write permission to /opt/testphp (or something similar) and
> use that as a prefix when configuring php - then you can run configure,
> make, make install as an unprivileged user and make install won't have
> permission to over write your existing php.
>
> I'm not familiar with OS X but that should work.
thanks, mike.
i'm getting a compile error that i'm confused about. can anyone help me get
my configure options right?
here's what i'm using:
export WITHOUT_X11=yes
export MACOSX_DEPLOYMENT_TARGET=10.5
CFLAGS="-arch x86_64" \
CXXFLAGS="-arch x86_64" \
./configure --prefix=/test/php \
--sysconfdir=/private/etc \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--enable-cli \
--with-config-file-path=/test/php/etc \
--with-pcre-regex=yes \
--disable-cgi \
--disable-ipv6 \
--with-apxs2=/usr/sbin/apxs
here's the error:
Undefined symbols:
"_libiconv", referenced from:
__php_iconv_appendl in iconv.o
__php_iconv_appendl in iconv.o
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
adding --with-iconv-dir=/usr/lib to the configuration doesn't help. in
/usr/lob i have
lrwxr-xr-x 1 root wheel 16 Nov 22 2007
/usr/lib/libiconv.2.4.0.dylib -> libiconv.2.dylib
-rw-r--r-- 1 root wheel 4147008 Sep 23 2007 /usr/lib/libiconv.2.dylib
lrwxr-xr-x 1 root wheel 20 Nov 22 2007 /usr/lib/libiconv.dylib ->
libiconv.2.4.0.dylib
-rw-r--r-- 1 root wheel 795 Feb 19 2008 /usr/lib/libiconv.la
--- End Message ---
--- Begin Message ---
On Fri, May 1, 2009 at 7:11 AM, Kevin Waterson <[email protected]> wrote:
> This one time, at band camp, Michael A. Peters wrote:
>> Here's the scenario -
>>
>> Website has some demonstrative images.
>>
>> I create these images with the gimp - starting with a jpeg, adding a few
>> text layers and straight lines.
>>
>> I then save as xcf in case I ever need to edit.
>>
>> Then I export to jpeg, resize for thumb and export to jpeg again.
It seems that Imagick supports XCF internally:
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10431
I would imagine you can perform your Imagick export as you would with
any other image type.
--
// Todd
--- End Message ---
--- Begin Message ---
On Thu, Apr 30, 2009 at 8:03 AM, 9el <[email protected]> wrote:
> On Thu, Apr 30, 2009 at 3:33 AM, 9el <[email protected]> wrote:
>> I just got a project to do on PHP of scraping the body items from
>> static sites or just html sites.
>> Could you experts please suggest me some quick resources?
>>
>> I have to make an WP plugin with the data as well.
>
> Any expert there yet? Was looking for urgent advices on accomplishing the
> task.
http://www.regular-expressions.info and preg_match are your best friend(s).
--
// Todd
--- End Message ---
--- Begin Message ---
I am trying to get this to work, however it only reads the second if
statement. I get no error messages, but as I change counties, the % stays
the same.
Can someone enlighten me, or should I be looking at switch statements?
Thanks for your help.
Gary
<?php
$_SESSION['sale_session']=$_POST['sale'];
$_SESSION['assess_session']=$_POST['assess'];
$_SESSION['county_session']=$_POST['county'];
// checks if bot
if ($_POST['address'] != '' ){
exit("Changed field");
}
$sale_value=$_POST['sale'];
$assess_value=$_POST['assess'];
$county=$_POST['county'];
$chester_ratio=.51;
$montco_ratio=.53;
$delco_ratio=.58;
/*$ratio=.51;
/*$correct_assess=($sale_value)*($ratio); this is now the assessment should
be */
$chester_correct_assess=($sale_value)*($chester_ratio);
$montco_correct_assess=($sale_value)*($montco_ratio);
$delco_correct_assess=($sale_value)*($delco_ratio);
$chester_assess_difference=($assess_value)-($chester_correct_assess);
$montco_assess_difference=($assess_value)-($montco_correct_assess);
$delco_assess_difference=($assess_value)-($delco_correct_assess);
/* $assess_difference=($assess_value)-($sale_value * $ratio);
$percent_difference=($assess_difference)/($assess_value);*/
$chester_percent_difference=($chester_assess_difference)/($assess_value);
$delco_percent_difference=($delco_assess_difference)/($assess_value);
$montco_percent_difference=($montco_assess_difference)/($assess_value);
$chester_percent_savings=($chester_percent_difference)*100;
$delco_percent_savings=($delco_percent_difference)*100;
$montco_percent_savings=($montco_percent_difference)*100;
if(($_COOKIE['county_cookie'] ='Chester') && ($chester_assess_difference
>=50000))
{
echo '<h2 style="margin:0;color:#ff0000;">Yes, Your property appears to
qualify!</h2><br /><br />';
echo "You 1 believe your home would today sell for <b>
$".number_format($sale_value)." </b><br />";
echo "Your current tax assessment is<b>
$".number_format($assess_value)."</b><br />";
echo "You live in <b>$county </b><br />";
echo "Your potential savings could be<b> "
.number_format($chester_percent_savings,0)."%</b><br /><br />";
echo "According to preliminary calculations based on the information you
have entered, you may enjoy a savings of <b>
".number_format($chester_percent_savings,0)."% </b>off a combined total of
county, school and township real estate taxes. Actual dollar amount savings
will differ depending on the township that the property is located. Please
contact my office for a more precise estimate of savings.<br />";
}
elseif(($_COOKIE['county_cookie']='Delaware') && ($delco_assess_difference
>=30000)) {
echo '<h2 style="margin:0;color:#ff0000;">Yes, Your property appears to
qualify!</h2><br /><br />';
echo "You 2 believe your home would today sell for <b>
$".number_format($sale_value)." </b><br />";
echo "Your current tax assessment is<b>
$".number_format($assess_value)."</b><br />";
echo "You live in <b>$county </b><br />";
echo "Your potential savings could be<b> "
.number_format($delco_percent_savings,0)."%</b><br /><br />";
echo "According to preliminary calculations based on the information you
have entered, you may enjoy a savings of <b>
".number_format($delco_percent_savings,0)."% </b>off a combined total of
county, school and township real estate taxes. Actual dollar amount savings
will differ depending on the township that the property is located. Please
contact my office for a more precise estimate of savings.<br />";
}
elseif(($_COOKIE['county_cookie']='Montgomery') &&
($montco_assess_difference >=50000))
{
echo '<h2 style="margin:0;color:#ff0000;">Yes, Your property appears to
qualify!</h2><br /><br />';
echo "You 3 believe your home would today sell for <b>
$".number_format($sale_value)." </b><br />";
echo "Your current tax assessment is<b>
$".number_format($assess_value)."</b><br />";
echo "You live in <b>$county </b><br />";
echo "Your potential savings could be<b> "
.number_format($montco_percent_savings,0)."%</b><br /><br />";
echo "According to preliminary calculations based on the information you
have entered, you may enjoy a savings of <b>
".number_format($montco_percent_savings,0)."% </b>off a combined total of
county, school and township real estate taxes. Actual dollar amount savings
will differ depending on the township that the property is located. Please
contact my office for a more precise estimate of savings.<br />";
}
else if(($chester_assess_difference <=50000) &&
($chester_assess_difference>=1000)) {
echo '<h3 style="margin:0;">While it appears you may enjoy some savings, the
dollar amount may not reach the threshold required for action. If property
values in your area continue to decline, you may wish to revisit this issue
again next year.</h3><br /><br />';
}
else if(($delco_assess_difference <=30000) &&
($delco_assess_difference>=1000)) {
echo '<h3 style="margin:0;">While it appears you may enjoy some savings, the
dollar amount may not reach the threshold required for action. If property
values in your area continue to decline, you may wish to revisit this issue
again next year.</h3><br /><br />';
}
else if(($montco_assess_difference <=50000) &&
($montco_assess_difference>=1000)) {
echo '<h3 style="margin:0;">While it appears you may enjoy some savings, the
dollar amount may not reach the threshold required for action. If property
values in your area continue to decline, you may wish to revisit this issue
again next year.</h3><br /><br />';
}
else if(isset($chester_assess_difference) <=1000){
echo '<h3 style="margin:0;">NO, Your property does not appear to qualify. If
property values in your area continue to decline, you may wish to revisit
this issue again next year. </h3><br /><br />';
}
else if(isset($delco_assess_difference) <=1000){
echo '<h3 style="margin:0;">NO, Your property does not appear to qualify. If
property values in your area continue to decline, you may wish to revisit
this issue again next year. </h3><br /><br />';
}
else if(isset($montco_assess_difference) <=1000){
echo '<h3 style="margin:0;">NO, Your property does not appear to qualify. If
property values in your area continue to decline, you may wish to revisit
this issue again next year. </h3><br /><br />';
}
/*This is just a test to see which one is being displayed*/
echo "chester $chester_ratio .''. $chester_correct_assess .''.
$chester_percent_savings<br/>";
echo "montco $montco_ratio.''. $montco_correct_assess .''.
$montco_percent_savings<br />";
echo "delco $delco_ratio .''. $delco_correct_assess.''.
$delco_percent_savings";
?>
--- End Message ---