php-general Digest 24 Nov 2008 19:45:08 -0000 Issue 5808
Topics (messages 283758 through 283774):
Re: It's Sunday, and I'm bored...
283758 by: ANR Daemon
Re: how can I make an email bounce
283759 by: Ashley Sheridan
283760 by: japruim.raoset.com
283761 by: Richard Heyes
283762 by: Ashley Sheridan
283763 by: Michael Kubler
Re: file_Exists() and case
283764 by: Stan
283765 by: Stut
Re: PHP causing Script: '/usr/www/...' in httpd-error.log?
283766 by: Jochem Maas
283767 by: robert arnesson
Help with understanding an error
283768 by: Terion Miller
283769 by: Wolf
283770 by: Terion Miller
283771 by: Stut
283772 by: Terion Miller
283773 by: Wolf
PostTrack Reminder
283774 by: Daniel Brown
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 ---
Greetings, "Richard Heyes".
In reply to Your message dated Tuesday, November 18, 2008, 18:34:27,
> In looking at the manual regarding tagging, it seems an awful chore
> compared to CVS.
It only seems.
In fact, the "copy" command only creating a reference to the specific
revision. So, nothing, at all, being duplicated in reality.
I too was disoriented a bit in the same place, but, to make it clear, SVN
based mostly on structure organisation, than on added features.
In this situation, CVS's "tagging" is a feature, while SVN "tagging" by
referencing your revision in /tags/ branch is a way to organise your work.
> Is this the generally held belief or do I need to go
> back and re-read?
Just read further while you keeping confusing moments in mind.
At some point, they will become clearer... eventually.
--
Sincerely Yours, ANR Daemon <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
On Sun, 2008-11-23 at 16:01 -0800, Richard Kurth wrote:
> I need to make a bunch of emails bounce in different ways so I can check
> to see if my script to read a mail box full of bounced emails will work
> properly.
> Does any body know how I can do this.
>
Send some flubber as an attachment and...
Nah, you'll need to make changes to your email server (the server
receiving the emails) to recognise certain things in an email and bounce
in the ways you want.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Nov 23, 2008, at 7:01 PM, Richard Kurth wrote:
I need to make a bunch of emails bounce in different ways so I can
check to see if my script to read a mail box full of bounced emails
will work properly.
Does any body know how I can do this.
If you have access to a Mac, in Apples Mail.app there is a feature
for bouncing messages that show up like a real bounce. All you need
are the donor e-mails to bounce from.
Just keep in mind that when you "bounce" a message in mail.app it
removes the e-mail... So I wouldn't go bouncing lvoe letters from
your girl! ;)
If you don't have such access, let me know, and I can probably help
out with it.
--
Jason Pruim
[EMAIL PROTECTED]
616.399.2355
--- End Message ---
--- Begin Message ---
Hi,
> I need to make a bunch of emails bounce in different ways
Carve them into some rubber and throw them at the flloor at different
angles... :-)
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 15th)
--- End Message ---
--- Begin Message ---
On Mon, 2008-11-24 at 12:53 +0000, Richard Heyes wrote:
> Hi,
>
> > I need to make a bunch of emails bounce in different ways
>
> Carve them into some rubber and throw them at the flloor at different
> angles... :-)
>
> --
> Richard Heyes
>
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org (Updated November 15th)
>
exactly... flubbber!
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
If you have a previous bounce message then something like Mail Redirect
<https://addons.mozilla.org/en-US/thunderbird/addon/550> extension in
thunderbird might work. You simply bounce the email to yourself, or from
one account to another.
I've used it quite often to test procmail rules, and the like.
Although, as I use gmail for my email I don't have to worry about my
inbox being full.
Also, if you can give us more details about the actual email server then
maybe there could be a way to induce the required bounce messages,
somewhat like the eicar <http://www.eicar.org/anti_virus_test_file.htm>
file is a semi-standardised anti-virus test. Then again, I run exim4,
and haven't bothered looking at trying to force certain bounce messages
without reconfiguring the server.
Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>
[EMAIL PROTECTED] wrote:
On Nov 23, 2008, at 7:01 PM, Richard Kurth wrote:
I need to make a bunch of emails bounce in different ways so I can
check to see if my script to read a mail box full of bounced emails
will work properly.
Does any body know how I can do this.
If you have access to a Mac, in Apples Mail.app there is a feature for
bouncing messages that show up like a real bounce. All you need are
the donor e-mails to bounce from.
Just keep in mind that when you "bounce" a message in mail.app it
removes the e-mail... So I wouldn't go bouncing lvoe letters from your
girl! ;)
If you don't have such access, let me know, and I can probably help
out with it.
--- End Message ---
--- Begin Message ---
Stut,
Shouting is something that happens when people are actually speaking and
listening. In a medium where there is no other way to emphasize salient
points in a message, capitalization is all that works. I'm sorry it
offended your sensabilities.
realpath() fails, just like file_exists() fails, to report the file as
non-existant.
echo "realpath(\$basePicture) returns '" . realpath($basePicture) .
"'<br>\n";
echo "when \$basePicture is '" . $basePicture . "'<br>\n";
-------------------------------------------------------------------
generates
-------------------------------------------------------------------
realpath($basePicture) returns '/Stan-and-Jeanne.com/pictures/2008 west
coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg'
when $basePicture is '../pictures/2008 west coast trip/2008-06-10 first week
at Chris'/DSC_0011.jpg'
-------------------------------------------------------------------
but ls DSC_0011.* in ../pictures/2008 west coast trip/2008-06-10 first week
at Chris' returns only
-------------------------------------------------------------------
DSC_0011.JPG
-------------------------------------------------------------------
and
-------------------------------------------------------------------
try {$image = new IMagick($basePicture);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
-------------------------------------------------------------------
results in
-------------------------------------------------------------------
Caught exception: unable to open image `/Stan-and-Jeanne.com/pictures/2008
west coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg': No such file
or directory
-------------------------------------------------------------------
so ... the following takes care of the extension problem in a very time
expensive way
-------------------------------------------------------------------
try
{
$image = new IMagick($basePicture);
}
catch (Exception $e)
{
$basePicture =
substr($basePicture, 0, strrpos($basePicture, ".")) .
"." .
strtoupper(substr($basePicture, strrpos($basePicture, ".") + 1));
}
unset($image);
-------------------------------------------------------------------
I don't actually consider this solved and I'll return to it after everything
else at least works.
Now I can proceed to my next problem.
Thanks to all,
Stan
--- End Message ---
--- Begin Message ---
On 24 Nov 2008, at 14:41, Stan wrote:
Shouting is something that happens when people are actually speaking
and
listening. In a medium where there is no other way to emphasize
salient
points in a message, capitalization is all that works. I'm sorry it
offended your sensabilities.
It's actually well-established that capital letters indicate shouting.
To emphasise words or phrases you should surround them with _ or *.
The is also common practice.
realpath() fails, just like file_exists() fails, to report the file as
non-existant.
echo "realpath(\$basePicture) returns '" . realpath($basePicture) .
"'<br>\n";
echo "when \$basePicture is '" . $basePicture . "'<br>\n";
-------------------------------------------------------------------
generates
-------------------------------------------------------------------
realpath($basePicture) returns '/Stan-and-Jeanne.com/pictures/2008
west
coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg'
when $basePicture is '../pictures/2008 west coast trip/2008-06-10
first week
at Chris'/DSC_0011.jpg'
-------------------------------------------------------------------
but ls DSC_0011.* in ../pictures/2008 west coast trip/2008-06-10
first week
at Chris' returns only
-------------------------------------------------------------------
DSC_0011.JPG
-------------------------------------------------------------------
and
-------------------------------------------------------------------
try {$image = new IMagick($basePicture);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
-------------------------------------------------------------------
results in
-------------------------------------------------------------------
Caught exception: unable to open image `/Stan-and-Jeanne.com/
pictures/2008
west coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg': No
such file
or directory
-------------------------------------------------------------------
so ... the following takes care of the extension problem in a very
time
expensive way
-------------------------------------------------------------------
try
{
$image = new IMagick($basePicture);
}
catch (Exception $e)
{
$basePicture =
substr($basePicture, 0, strrpos($basePicture, ".")) .
"." .
strtoupper(substr($basePicture, strrpos($basePicture, ".") + 1));
}
unset($image);
-------------------------------------------------------------------
I don't actually consider this solved and I'll return to it after
everything
else at least works.
Now I can proceed to my next problem.
You never answered one of my questions. Where are you getting
$basePicture from? Why does it differ in case from the actual file on
disk. If you ask me you'd be better off trying to resolve this problem
further upstream at the point where the case gets changed but your
workflow doesn't appear to notice it.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
robert arnesson schreef:
> A. There is no more to the log
> B. There are no calls to error_log()
>
> PHP is installed as CGI, I will check the ScriptLog dir (good tip!).
>
> I forgot to mention that this occurres on a few php-files only.. the rest is
> working fine. And there are no major differences between the files that show
> up in the log compared to the ones that don't. I have checked the files them
> selfs over and over.. they are working as expected.
check the contents of those few scripts for a line that looks something like:
error_log(__FILE__);
ie the log messages are done on purpose for tracing purposes... mostly likely
just some debug cruft left in the code by mistake.
hth
>
> /Robert
>
> On Sun, Nov 23, 2008 at 7:07 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote:
>
>> robert arnesson wrote:
>>
>>> What is causing these errors?
>>>
>> further thought.. is PHP installed as CGI or SAPI? if CGI have you checked
>> the apache settings to see if the ScriptLog directive is on any where?
>>
>>
>
--- End Message ---
--- Begin Message ---
There are no calls to error_log in the files, however, I took care of some
notices in the code (with error_reporting to E_ALL - there where only
notices - no errors or warnings) and suddenly the number of entries in the
error log dropped. Getting rid of all notices will probably solve the
problem. But i still dont get how this can be happening. error_reporting is
set to 0 in php.ini, and no changes or calls to error functions are made in
the code. It's also kind of strange that other files in the same framework,
files that uses the same functions, includes the same files, etc, dont
generate these kind of errors in the log at all.
/Robert
On Mon, Nov 24, 2008 at 4:08 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> robert arnesson schreef:
> > A. There is no more to the log
> > B. There are no calls to error_log()
> >
> > PHP is installed as CGI, I will check the ScriptLog dir (good tip!).
> >
> > I forgot to mention that this occurres on a few php-files only.. the rest
> is
> > working fine. And there are no major differences between the files that
> show
> > up in the log compared to the ones that don't. I have checked the files
> them
> > selfs over and over.. they are working as expected.
>
> check the contents of those few scripts for a line that looks something
> like:
>
> error_log(__FILE__);
>
> ie the log messages are done on purpose for tracing purposes... mostly
> likely
> just some debug cruft left in the code by mistake.
>
> hth
>
> >
> > /Robert
> >
> > On Sun, Nov 23, 2008 at 7:07 PM, Nathan Rixham <[EMAIL PROTECTED]>
> wrote:
> >
> >> robert arnesson wrote:
> >>
> >>> What is causing these errors?
> >>>
> >> further thought.. is PHP installed as CGI or SAPI? if CGI have you
> checked
> >> the apache settings to see if the ScriptLog directive is on any where?
> >>
> >>
> >
>
>
--
Vänliga hälsningar/Best regards
Robert Arnesson
Ventio AB
E-mail: [EMAIL PROTECTED]
Phone: +46(0)736 41 61 14
Web: www.ventio.se
Address: Holländargatan 27
SE-113 59 Stockholm
Sweden
--- End Message ---
--- Begin Message ---
Can anyone help explain what I need to do to fix this:
Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid
MySQL result resource in *
C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
*Warning*: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *
65
Code:
line 57: $row = mysql_fetch_object ($result);
line 65: if (mysql_num_rows($result) == 0) {
?>
*
--- End Message ---
--- Begin Message ---
---- Terion Miller <[EMAIL PROTECTED]> wrote:
> Can anyone help explain what I need to do to fix this:
>
> Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid
> MySQL result resource in *
> C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
>
> *Warning*: mysql_num_rows(): supplied argument is not a valid MySQL result
> resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *
> 65
>
>
> Code:
> line 57: $row = mysql_fetch_object ($result);
> line 65: if (mysql_num_rows($result) == 0) {
> ?>
> *
STFW as Google has the answer..
But... you need to actually provide MORE of the code, since the error pretty
much tells you that you don't have a connection to your database. Not a PHP
issue really.
Wolf
--- End Message ---
--- Begin Message ---
I added an echo and got this:
Query failed: Unknown column 'WorkOrderNumber' in 'field list' Actual
query: but the actual query is blank
and as I have stated before when I have had questions on this list, I am NOT
a php programmer, just learning and inherited a job with tons of php already
in place, so please save all the snarky comments about how stupid I am, I
don't need them, lists are supposed to be helpful not hurtful.
On Mon, Nov 24, 2008 at 11:32 AM, Wolf <[EMAIL PROTECTED]> wrote:
>
> ---- Terion Miller <[EMAIL PROTECTED]> wrote:
> > Can anyone help explain what I need to do to fix this:
> >
> > Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid
> > MySQL result resource in *
> > C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
> >
> > *Warning*: mysql_num_rows(): supplied argument is not a valid MySQL
> result
> > resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on
> line *
> > 65
> >
> >
> > Code:
> > line 57: $row = mysql_fetch_object ($result);
> > line 65: if (mysql_num_rows($result) == 0) {
> > ?>
> > *
>
> STFW as Google has the answer..
>
> But... you need to actually provide MORE of the code, since the error
> pretty much tells you that you don't have a connection to your database.
> Not a PHP issue really.
>
> Wolf
>
--- End Message ---
--- Begin Message ---
On 24 Nov 2008, at 17:28, Terion Miller wrote:
Can anyone help explain what I need to do to fix this:
Error: *Warning*: mysql_fetch_object(): supplied argument is not a
valid
MySQL result resource in *
C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
*Warning*: mysql_num_rows(): supplied argument is not a valid MySQL
result
resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php*
on line *
65
Code:
line 57: $row = mysql_fetch_object ($result);
line 65: if (mysql_num_rows($result) == 0) {
?>
*
This means exactly what it says... $result is not a valid MySQL result
resource. This is usually caused by an error in the SQL query. Check
that.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
this was the code I posted that accidentally only went to Wolf:
what does STFW mean?
<?php
include("inc/dbconn_open.php");
if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] <> 'OK' ){
?>
<script language="javascript">
window.close();
</script>
<?php
exit();
}
if (isset($_POST['AdminID'])){
$AdminID = $_POST['AdminID'];
} elseif (isset($_GET['AdminID'])){
$AdminID = $_GET['AdminID'];
} else {
?>
<script language="javascript">
window.close();
</script>
<?php
exit();
}
if (isset($_POST['WorkOrderID'])){
$WorkOrderID = $_POST['WorkOrderID'];
} elseif (isset($_GET['WorkOrderID'])){
$WorkOrderID = $_GET['WorkOrderID'];
} else {
?>
<script language="javascript">
window.close();
</script>
<?php
exit();
}
if (isset($_POST['ReturnPage'])){
$ReturnPage = $_POST['ReturnPage'];
} elseif (isset($_GET['ReturnPage'])){
$ReturnPage = $_GET['ReturnPage'];
} else {
$ReturnPage = "Welcome.php";
}
$sql = "SELECT WorkOrderID, CreatedDate, IONumber, OrderType,
WorkOrderNumber, Advertiser, AccountNum, Address, City, ";
$sql .= "State, Zip, Phone, Fax, ContactName, URL, AdvertisingAgency,
ClickThru, Impressions, AdSize, ";
$sql .= "DATE_FORMAT(StartDate, '%m/%e/%Y') AS StartDates,
DATE_FORMAT(EndDate, '%m/%e/%Y') AS EndDates, CPM, FlatRate, ";
$sql .= "IncludeSites, Package, Matrix, DATE_FORMAT(MatrixDate, '%m/%e/%Y')
AS MatrixDates, Salesperson, SalespersonID, ";
$sql .= "SalespersonEmail, SalespersonExt, NameCampaign,
SpecialInstructions, AdContactName, AdContactPhone, AdContactEmail, ";
$sql .= "Artwork, DATE_FORMAT(PrintDate, '%m/%e/%Y') AS PrintDates,
ElectronicAd, EmailProof, ";
$sql .= "DATE_FORMAT(ProofDate, '%m/%e/%Y') AS ProofDates, ArtInstructions,
Focus, BannerSize, BannerSizeOther, BannerType, ";
$sql .= "BannerTypeOther, ExtraImage1, ExtraImage1Desc, ExtraImage2,
ExtraImage2Desc, ExtraImage3, ExtraImage3Desc, ";
$sql .= "ExtraImage4, ExtraImage4Desc, ExtraImage5, ExtraImage5Desc FROM
workorderform WHERE WorkOrderID='$WorkOrderID'";
$result = mysql_query ($sql);
$row = mysql_fetch_object ($result);
$sql2 = "SELECT Date_FORMAT(CreatedDate,'%m/%e/%Y %h:%i %p') AS OrderDate,
Location, WorkOrderName, Status FROM workorders ";
$sql2 .= "WHERE WorkOrderID='$WorkOrderID'";
$result2 = mysql_query ($sql2);
$row2 = mysql_fetch_object ($result2);
if (mysql_num_rows($result) == 0) {
?>
<script language="javascript">
window.close();
</script>
<?php
exit();
}
?>
On Mon, Nov 24, 2008 at 11:32 AM, Wolf <[EMAIL PROTECTED]> wrote:
>
> ---- Terion Miller <[EMAIL PROTECTED]> wrote:
> > Can anyone help explain what I need to do to fix this:
> >
> > Error: *Warning*: mysql_fetch_object(): supplied argument is not a valid
> > MySQL result resource in *
> > C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on line *57*
> >
> > *Warning*: mysql_num_rows(): supplied argument is not a valid MySQL
> result
> > resource in *C:\Inetpub\wwwroot\WorkOrderSystem\ViewWorkOrder.php* on
> line *
> > 65
> >
> >
> > Code:
> > line 57: $row = mysql_fetch_object ($result);
> > line 65: if (mysql_num_rows($result) == 0) {
> > ?>
> > *
>
> STFW as Google has the answer..
>
> But... you need to actually provide MORE of the code, since the error
> pretty much tells you that you don't have a connection to your database.
> Not a PHP issue really.
>
> Wolf
>
--- End Message ---
--- Begin Message ---
Bottom POST when mailing the list.
My responses inline and at the bottom
---- Terion Miller <[EMAIL PROTECTED]> wrote:
> this was the code I posted that accidentally only went to Wolf:
>
> what does STFW mean?
http://www.google.com/search?q=STFW&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
> <?php
> include("inc/dbconn_open.php");
Change the include to require (should barf faster)
<!-- SNIP -->
> $result = mysql_query ($sql);
change this to:
$result = mysql_query ($sql) or die(mysql_error());
> $row = mysql_fetch_object ($result);
>
> $sql2 = "SELECT Date_FORMAT(CreatedDate,'%m/%e/%Y %h:%i %p') AS OrderDate,
> Location, WorkOrderName, Status FROM workorders ";
> $sql2 .= "WHERE WorkOrderID='$WorkOrderID'";
> $result2 = mysql_query ($sql2);
Change this one as well to add the die statement
> $row2 = mysql_fetch_object ($result2);
>
<!-- SNIP -->
And as I said before, your error code tells you that the connection to the
database is invalid. Making the changes to the code I wrote above should point
you in the right direction to get it figured out.
Wolf
--- End Message ---
--- Begin Message ---
Folks;
Just as a reminder, the PostTrack/ListWatch system is back to
recording and reporting data on the list for the Friday summary
reports and list metrics. If you do not want your email address to
show up in the reports and have not already told me, please let me
know ASAP and I will permanently remove you from the reports. Note
that this will *NOT* unsubscribe you from the list, just keep you from
showing metrics in the weekly reports.
Thanks, all. And a happy upcoming holiday to my fellow US Americans.
Everyone stay safe.
--
</Daniel P. Brown>
http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
1 LEFT: $149/mo. $0 Setup - Dual-Core/320GB HDD/1GB RAM/3TB
100Mbps/cPanel - SAME-DAY SETUP! Contact me to buy.
--- End Message ---