php-general Digest 25 Dec 2008 06:51:07 -0000 Issue 5864
Topics (messages 285037 through 285063):
Re: MERRY XMAS
285037 by: Dotan Cohen
285038 by: Jay Blanchard
285042 by: tedd
285048 by: Colin Guthrie
285049 by: Larry Garfield
285055 by: Robert Cummings
285056 by: Robert Cummings
ACL Framework / Library
285039 by: Feris
285040 by: Bastien Koert
285047 by: Colin Guthrie
Re: Chrome 1.0 released
285041 by: Bill Guion
285044 by: Ed Curtis
285045 by: tedd
Re: Assignment (Was Re: [PHP] More microptimisation (Was Re: [PHP] Variable as
an index)
285043 by: tedd
Trying to prevent large file attachments in Squirrelmail, on U8.10S, is this a
PHP issue?
285046 by: Xn Nooby
285057 by: Ashley Sheridan
285058 by: Xn Nooby
Zend framework
285050 by: Al
285051 by: Richard Heyes
285052 by: Al
285060 by: Colin Guthrie
Re: Segmentation fault in php5-imap
285053 by: Dan Osipov
Round to a given value?
285054 by: Anders Norrbring
285059 by: Ashley Sheridan
285063 by: Anders Norrbring
Re: Help with a Search Function
285061 by: Jim Lucas
Mail server that doesn't actually get installed
285062 by: Michael S. Dunsavage
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 ---
2008/12/24 Richard Heyes <[email protected]>:
>> word
>
> Which one?
>
Open Office 3.0, to be exact.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي
А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я
ä-ö-ü-ß-Ä-Ö-Ü
--- End Message ---
--- Begin Message ---
[snip]
...greetings from around the world....
[/snip]
Merry Chrismakwanzica! Happy Festivus!
--- End Message ---
--- Begin Message ---
At 3:29 AM -0500 12/24/08, Robert Cummings wrote:
On Wed, 2008-12-24 at 00:38 -0700, Nathan Nobbe wrote:
On Tue, Dec 23, 2008 at 8:59 PM, German Geek <[email protected]> wrote:
> Merry xmas to everyone! Thanks for the support and fun discussions.
As they say in my son's kindergarten so as to be all inclusive:
We wish you a happy holiday!
We wish you a happy holiday!
We wish you a happy holiday,
and a happy New Year!!
:)
Although, I guess that's a bit half baked if you're working through the
"holidays" :/
Cheers,
Rob.
Yes, for those poor soles who must work through the holidays -- I
feel sorry for them.
I used to work and program, but I gave up work and now do nothing but program.
As for the holidays, my wife tells me when to celebrate and what I
should to do for each one. You know, they all have their own special
requirements/demands (i.e., carve pumpkins, hide eggs, give/receive
gifts,, etc.). But they all include eating -- so me and my dogs are
happy.
My life is so much simpler now that I just program and do what my wife says.
Cheers and Merry Christmas (my wife told me to say that, but I was
going to anyway). :-)
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
'Twas brillig, and Jay Blanchard at 24/12/08 12:07 did gyre and gimble:
[snip]
...greetings from around the world....
[/snip]
Merry Chrismakwanzica! Happy Festivus!
Indeed. Happy Annual Gift Giving Day (when it comes!) to one and all.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
On Tuesday 23 December 2008 9:59:40 pm German Geek wrote:
> Merry xmas to everyone! Thanks for the support and fun discussions.
>
> Regards,
> Tim
foreach ($php_general->subscribers() as $subscriber) {
foreach ($subscriber->holidaysCelebrated() as $holiday) {
print 'Happy '. $holiday->name() .', '. $subscriber->name() .'!'. PHP_EOL;
}
}
--
Larry Garfield
[email protected]
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-24 at 11:08 +0000, Richard Heyes wrote:
> > word
>
> Which one?
>
> Happpy needless turkey murder day! To coin a phrase.
We eat ham usually instead... we prefer to needlessly kill bigger
animals >:)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-24 at 10:05 -0500, tedd wrote:
> At 3:29 AM -0500 12/24/08, Robert Cummings wrote:
> >On Wed, 2008-12-24 at 00:38 -0700, Nathan Nobbe wrote:
> >> On Tue, Dec 23, 2008 at 8:59 PM, German Geek <[email protected]> wrote:
> >>
> >> > Merry xmas to everyone! Thanks for the support and fun discussions.
> >
> >As they say in my son's kindergarten so as to be all inclusive:
> >
> > We wish you a happy holiday!
> > We wish you a happy holiday!
> > We wish you a happy holiday,
> > and a happy New Year!!
> >
> >:)
> >
> >Although, I guess that's a bit half baked if you're working through the
> >"holidays" :/
> >
> >Cheers,
> >Rob.
>
> Yes, for those poor soles who must work through the holidays -- I
> feel sorry for them.
People who wear shoes throughout the holidays should ask themselves if
they think it's fair that their soles have to work and they don't!!!
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
Hi All,
Is there any references for a good ACL framework / library ? I want to
develop one but if there is any available I didn't want to reinvent the
wheel.
Thanks,
Feris
--- End Message ---
--- Begin Message ---
On Wed, Dec 24, 2008 at 9:01 AM, Feris <[email protected]> wrote:
> Hi All,
> Is there any references for a good ACL framework / library ? I want to
> develop one but if there is any available I didn't want to reinvent the
> wheel.
>
> Thanks,
>
> Feris
>
Zend has their ACL as part of the framework
http://framework.zend.com/manual/en/zend.acl.html
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
'Twas brillig, and Bastien Koert at 24/12/08 14:22 did gyre and gimble:
On Wed, Dec 24, 2008 at 9:01 AM, Feris <[email protected]> wrote:
Hi All,
Is there any references for a good ACL framework / library ? I want to
develop one but if there is any available I didn't want to reinvent the
wheel.
Thanks,
Feris
Zend has their ACL as part of the framework
http://framework.zend.com/manual/en/zend.acl.html
+1 on that one. Remember that you don't need to use the whole
framework... you can just pick out the Zend_Acl stuff easily enough.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
At 9:30 AM -0500 12/14/08, tedd wrote:
At 3:08 PM -0800 12/13/08, Yeti wrote:
I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.
Even a blind pig finds an acorn every once in a while.
Cheers,
tedd
Tedd,
You should apologize to all pigs for that comparison.
-----===== Bill =====-----
--
A conclusion is the place where you get tired of thinking.
--- End Message ---
--- Begin Message ---
Bill Guion wrote:
At 9:30 AM -0500 12/14/08, tedd wrote:
At 3:08 PM -0800 12/13/08, Yeti wrote:
I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.
Even a blind pig finds an acorn every once in a while.
Cheers,
tedd
Tedd,
You should apologize to all pigs for that comparison.
-----===== Bill =====-----
Yeah, but javascript is still a PITA.
--- End Message ---
--- Begin Message ---
At 9:22 AM -0500 12/24/08, Bill Guion wrote:
At 9:30 AM -0500 12/14/08, tedd wrote:
At 3:08 PM -0800 12/13/08, Yeti wrote:
I have to defend poor little IE a little now. It supports XHTML and
CSS2 pretty well so far. And those standards came out a couple of
months ago.
Even a blind pig finds an acorn every once in a while.
Cheers,
tedd
Tedd,
You should apologize to all pigs for that comparison.
Bill:
It seems to be the season for me to apologize -- so I offer an
apology to all the pigs out there for remotely comparing them to IE
-- which truly degrades pigs.
I would like everyone to know that some of my best friends are pigs
-- I should have known better. Sorry pigs.
A conclusion is the place where you get tired of thinking.
Good point. Quite often, so is an apology -- you get tired of arguing.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 11:06 AM +1100 12/24/08, Clancy wrote:
On Tue, 23 Dec 2008 10:25:13 -0500, [email protected] (tedd) wrote:
>Two things:
1. One statement, one line.
2. The code between the two examples is different; produces different
results; and thus is rather pointless in making a definitive
>comparison.
Spoken like a true demagogue -- nitpicking about trivial points of
style, but displaying
total ignorance of elementary rules of programming.
Clancy:
A tag strong, but you're right. Apology offered.
Certainly, my comment about "One statement, one line" is a personal
choice. But it is founded on 40+ years of writing code. It's
something that makes debugging simpler for me and perhaps for others.
My second point was just plain wrong. In one of the previous post on
this thread, someone used the value of $i as an index and it produced
different results. So I jumped to the conclusion it was different,
but it's not. I should of examined it more closely. Sorry.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
I am using PHP5 on Ubuntu 8.10 Server, it is being used by Apache and
Squirrelmail. I have tried setting the upload_max_filesize in the
/etc/php5/apache2/php.ini file, but it only seems to apply after I
upload the file. My goal is to prevent remote Squirrelmail users from
attaching large files to the emails they are drafting. They have slow
connections, and uploading a large file would effectively hang them.
Here is my question originally posted to the Ubuntu Forum (before I
began understand it was possibly a PHP issue):
Is it possible to prevent Squirrelmail users from uploading large
files to a server running Squirrelmail? My testing seems to indicate
that the attachment size limits enforced by Squirrelmail take place
*after* the file has been uploaded - at which time Squirrelmail aborts
the entire message. I will have some remote users, and I do not want
them to be able to upload files that are over a limit (say 10MB).
If a remote user tries to attach a 500MB attachment to their email, I
don't want them to upload the entire 500MB file, only to then have SM
abort the message. I want it to fail immediately, or after the 10MB
limit has been reached.
I though there was a way to do this in Apache or PHP, but have been
unable to find it. I am running Ubuntu Server 8.10 with Apache,
Postfix, Dovecot, and Squirrelmail.
Any suggestions on how to get the file attaching process to abort
before it uploads the entire 500MB file?
thanks!
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-24 at 11:23 -0500, Xn Nooby wrote:
> I am using PHP5 on Ubuntu 8.10 Server, it is being used by Apache and
> Squirrelmail. I have tried setting the upload_max_filesize in the
> /etc/php5/apache2/php.ini file, but it only seems to apply after I
> upload the file. My goal is to prevent remote Squirrelmail users from
> attaching large files to the emails they are drafting. They have slow
> connections, and uploading a large file would effectively hang them.
>
>
> Here is my question originally posted to the Ubuntu Forum (before I
> began understand it was possibly a PHP issue):
>
>
> Is it possible to prevent Squirrelmail users from uploading large
> files to a server running Squirrelmail? My testing seems to indicate
> that the attachment size limits enforced by Squirrelmail take place
> *after* the file has been uploaded - at which time Squirrelmail aborts
> the entire message. I will have some remote users, and I do not want
> them to be able to upload files that are over a limit (say 10MB).
>
> If a remote user tries to attach a 500MB attachment to their email, I
> don't want them to upload the entire 500MB file, only to then have SM
> abort the message. I want it to fail immediately, or after the 10MB
> limit has been reached.
>
> I though there was a way to do this in Apache or PHP, but have been
> unable to find it. I am running Ubuntu Server 8.10 with Apache,
> Postfix, Dovecot, and Squirrelmail.
>
> Any suggestions on how to get the file attaching process to abort
> before it uploads the entire 500MB file?
>
> thanks!
>
You could look at amending the form that is shown on the client machines
browser, and set a size there, although the browser may only use it as a
suggestion rather than enforce it. Maybe Squirrelmail already has such a
feature?
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Wed, Dec 24, 2008 at 3:03 PM, Ashley Sheridan
<[email protected]> wrote:
> On Wed, 2008-12-24 at 11:23 -0500, Xn Nooby wrote:
>> I am using PHP5 on Ubuntu 8.10 Server, it is being used by Apache and
>> Squirrelmail. I have tried setting the upload_max_filesize in the
>> /etc/php5/apache2/php.ini file, but it only seems to apply after I
>> upload the file. My goal is to prevent remote Squirrelmail users from
>> attaching large files to the emails they are drafting. They have slow
>> connections, and uploading a large file would effectively hang them.
>>
>>
>> Here is my question originally posted to the Ubuntu Forum (before I
>> began understand it was possibly a PHP issue):
>>
>>
>> Is it possible to prevent Squirrelmail users from uploading large
>> files to a server running Squirrelmail? My testing seems to indicate
>> that the attachment size limits enforced by Squirrelmail take place
>> *after* the file has been uploaded - at which time Squirrelmail aborts
>> the entire message. I will have some remote users, and I do not want
>> them to be able to upload files that are over a limit (say 10MB).
>>
>> If a remote user tries to attach a 500MB attachment to their email, I
>> don't want them to upload the entire 500MB file, only to then have SM
>> abort the message. I want it to fail immediately, or after the 10MB
>> limit has been reached.
>>
>> I though there was a way to do this in Apache or PHP, but have been
>> unable to find it. I am running Ubuntu Server 8.10 with Apache,
>> Postfix, Dovecot, and Squirrelmail.
>>
>> Any suggestions on how to get the file attaching process to abort
>> before it uploads the entire 500MB file?
>>
>> thanks!
>>
> You could look at amending the form that is shown on the client machines
> browser, and set a size there, although the browser may only use it as a
> suggestion rather than enforce it. Maybe Squirrelmail already has such a
> feature?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
I was able to solve this by adding the value "LimitRequestBody" to an
Apache/PHP config file. Now it immediately aborts the upload after the
limit has been set. I set the limit to about 11MB with these commands:
sudo vi /etc/apache2/mods-enabled/php5.conf
LimitRequestBody 11222333
thanks!
--- End Message ---
--- Begin Message ---
I've not given it much thought, so far.
But, am curious about what you folks think about it.
Anyone with experience have a comment?
Al..........
--- End Message ---
--- Begin Message ---
2008/12/24 Al <[email protected]>:
> I've not given it much thought, so far.
>
> But, am curious about what you folks think about it.
>
> Anyone with experience have a comment?
On what? The Zend Framework?
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated December 20th)
--- End Message ---
--- Begin Message ---
Richard Heyes wrote:
2008/12/24 Al <[email protected]>:
I've not given it much thought, so far.
But, am curious about what you folks think about it.
Anyone with experience have a comment?
On what? The Zend Framework?
Sorry, I wasn't clear. Anyone with experience using the Zend framework, in
general or any particular components, have a comment?
Al.......
--- End Message ---
--- Begin Message ---
'Twas brillig, and Al at 24/12/08 17:51 did gyre and gimble:
Richard Heyes wrote:
2008/12/24 Al <[email protected]>:
I've not given it much thought, so far.
But, am curious about what you folks think about it.
Anyone with experience have a comment?
On what? The Zend Framework?
Sorry, I wasn't clear. Anyone with experience using the Zend framework,
in general or any particular components, have a comment?
Well I use it and like it very much. It takes a while to get your head
round, or rather the programming methodologies and the related "best
practices" do (especially when you are trying to retro fit it to an
existing project).
But if you just spend a few days reading through the manual you'll be
totally fine.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
--- End Message ---
--- Begin Message ---
I just tried closing the message box and reopeining it, ie using
imap_open & imap_close repeated, instead of imap_open, imap_reopen
repeated, imap_close. Unfortunately, the server has a limit on the
number of connections per minute, so I couldn't use that method...
I am implementing some conditions and exceptions, in order to avoid the
segfault, and at least finish the execution of a script even if the
connection is dropped.
I will let everyone know if I discover the source of the issue.
Nathan Nobbe wrote:
On Tue, Dec 23, 2008 at 5:30 PM, Dan Osipov <[email protected]> wrote:
Script takes about 5 minutes to run (average). On other servers I've seen
it run over 2 hours without segfaults... All depends on how many messages
are in the NNTP mailboxes.
ok, so this is def a long running script then.
After applying the mentioned patch to libc-client2002edebian the issue
persisted. No change...
ok, lets check that one off the list then.
I'm not running xdebug. The PHP memory limit is 512 Mb and server has 16Gb
of RAM, so it doesn't look like its exhausting all the memory, although one
of the libraries potentially could?
ok, i didnt think so, but just wanted to make sure so as not to waste time,
when it could be an easy fix like that.
If this helps: It looks like the script is dropping connection to
the NNTP server. If it then tries to open another mailbox, it segfaults.
Otherwise it continues to run successfully.
hmm, well, i dont see any sort of functions in the imap api that check the
integriy of the imap stream. its sounds lame, but have you considered
tearing down and rebuilding the connection after a fixed number of downloads
have completed.
But why does it drop the connection?
maybe php's client code just wasnt designed to hold imap connections open
for a long periods of time. not sure though.
-nathan
--- End Message ---
--- Begin Message ---
Rounding an integer to the closest divisor by ten is easy with round() and a
negative precision, but I turn out to be lost if I want to round to a given
number..
Example, round to the closest 5000, or closest 400? Any great ideas?
Thanks, and merry x-mas!
Anders.
--- End Message ---
--- Begin Message ---
On Wed, 2008-12-24 at 20:38 +0100, Anders Norrbring wrote:
> Rounding an integer to the closest divisor by ten is easy with round() and a
> negative precision, but I turn out to be lost if I want to round to a given
> number..
>
> Example, round to the closest 5000, or closest 400? Any great ideas?
>
> Thanks, and merry x-mas!
> Anders.
>
>
>
http://www.alixaxel.com/wordpress/wp-content/2008/05/Round.php
Someone was way ahead of you and found the answer and posted on the PHP
manual pages back in May. The manual pages are always useful, even if
only for the user-written functions!
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
> On Wed, 2008-12-24 at 20:38 +0100, Anders Norrbring wrote:
> > Rounding an integer to the closest divisor by ten is easy with
> round() and a
> > negative precision, but I turn out to be lost if I want to round to a
> given
> > number..
> >
> > Example, round to the closest 5000, or closest 400? Any great ideas?
> >
> > Thanks, and merry x-mas!
> > Anders.
> >
> >
> >
> http://www.alixaxel.com/wordpress/wp-content/2008/05/Round.php
>
> Someone was way ahead of you and found the answer and posted on the PHP
> manual pages back in May. The manual pages are always useful, even if
> only for the user-written functions!
>
>
> Ash
> www.ashleysheridan.co.uk
Thanks Ash.
I browse the pages frequently for ideas, and also did it yesterday..
However, I must have missed that post, maybe because it was so small in the
list.. ;-)
Thanks for the tip!
Anders.
--- End Message ---
--- Begin Message ---
Terion Miller wrote:
> Hey Everyone, been steaming right along for a couple days but now I'm stuck
> on writing a search function, could you all take a look at it and see what
> it could be, I will mark the line throwing the error in red, I did try just
> commenting out that line and searching for a record by OrderID that I know
> is there but it does not return anything , I am trying to search several
> tables in one db:
>
> Code:
First off, and I think I have told you this before, I highly recommend that you
escape your code with mysql_real_escape_string().
I am guessing that you are probably relying on magic_quote_gpc() to do it for
you, but is going to catch up with you some day.
> <?php
> session_start();
> include("inc/dbconn_open.php");
>
> if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] <> 'OK' ){
> header ("Location: LogOut.php");
> }
>
> if (isset($_GET['AdminID']) && !empty($_GET['AdminID'])){
> $AdminID = $_GET['AdminID'];
> } elseif (isset($_POST['AdminID']) && !empty($_POST['AdminID'])){
> $AdminID = $_POST['AdminID'];
> } else {
> header ("Location: LogOut.php");
> }
>
> $query = "SELECT SearchWorkOrder FROM admin WHERE AdminID='$AdminID'";
> $result = mysql_query ($query);
> $row = mysql_fetch_object ($result);
> if ($row->SearchWorkOrder == "NO") {
> header ("Location:
> Welcome.php?AdminID='.$_SESSION[AdminLogin]'&msg=Sorry, you do not have
> access to that page.");
> }
>
> if (isset($_POST['WorkOrderID'])) {$WorkOrderID = $_POST['WorkOrderID'];}
> else {$WorkOrderID = '';}
> if (isset($_POST['WorkOrderName'])) {$WorkOrderName =
> $_POST['WorkOrderName'];} else {$WorkOrderName = '';}
> if (isset($_POST['CustomerName'])) {$CustomerName = $_POST['CustomerName'];}
> else {$CustomerName = '';}
> if (isset($_POST['CustomerEmail'])) {$CustomerEmail =
> $_POST['CustomerEmail'];} else {$CustomerEmail = '';}
> if (isset($_POST['SalesRep'])) {$SalesRep = $_POST['SalesRep'];} else
> {$SalesRep = '';}
> if (isset($_POST['SalesRepEmail'])) {$SalesRepEmail =
> $_POST['SalesRepEmail'];} else {$SalesRepEmail = '';}
>
> if (isset($_POST['SortBy'])) {$SortBy = $_POST['SortBy'];} else {$SortBy =
> 'WorkOrderID DESC';}
> if (isset($_POST['Page'])) {$Page = $_POST['Page'];} else {$Page = 1;}
>
> $PerPage = 30;
> $StartPage = ($Page - 1) * $PerPage;
> $OrderID = '';
>
>
> // All Orders
> $sql = "SELECT WorkOrderID FROM workorders WHERE WorkOrderID <>'' ";
> if (!empty($WorkOrderName)) {
> $sql .= "AND Advertiser LIKE '%". $WorkOrderName ."%' ";
> }
> if (!empty($WorkOrderID)) {
> $sql .= "AND WorkOrderID LIKE '%". $WorkOrderID ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
>
>
>
> // Work Orders
> if (!empty($CustomerName) || !empty($CustomerEmail) || !empty($SalesRep)
> || !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM workorderform WHERE WorkOrderID<>''
> ";
> if (!empty($CustomerName)) {
> $sql .= "AND Advertiser LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($CustomerEmail)) {
> $sql .= "AND AdContactEmail LIKE '%". $CustomerEmail ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> // Homescape Builder Profile
> if (!empty($CustomerName) || !empty($CustomerEmail) || !empty($SalesRep)
> || !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM hs_builder_profile WHERE
> WorkOrderID<>'' ";
> if (!empty($CustomerName)) {
> $sql .= "AND OrganizationName LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($CustomerEmail)) {
> $sql .= "AND LeadEmail LIKE '%". $CustomerEmail ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> // Homescape Builder Spec Home
> if (!empty($CustomerName) || !empty($SalesRep) ||
> !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM hs_spec_home WHERE WorkOrderID<>''
> ";
> if (!empty($CustomerName)) {
> $sql .= "AND CommunityName LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> // Planet Discover Coupon
> if (!empty($CustomerName) || !empty($SalesRep) ||
> !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM pd_coupon WHERE WorkOrderID<>'' ";
> if (!empty($CustomerName)) {
> $sql .= "AND BusinessName LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> // Planet Discover Enhanced Listing
> if (!empty($CustomerName) || !empty($CustomerEmail) || !empty($SalesRep)
> || !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM pd_enhanced WHERE WorkOrderID<>'' ";
> if (!empty($CustomerName)) {
> $sql .= "AND BusinessName LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($CustomerEmail)) {
> $sql .= "AND Email LIKE '%". $CustomerEmail ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> // Planet Discover Right Side Text Ad
> if (!empty($CustomerName) || !empty($SalesRep) ||
> !empty($SalesRepEmail)) {
> $sql = "SELECT WorkOrderID FROM pd_textad WHERE WorkOrderID<>'' ";
> if (!empty($CustomerName)) {
> $sql .= "AND Customer LIKE '%". $CustomerName ."%' ";
> }
> if (!empty($SalesRep)) {
> $sql .= "AND Salesperson LIKE '%". $SalesRep ."%' ";
> }
> if (!empty($SalesRepEmail)) {
> $sql .= "AND SalespersonEmail LIKE '%". $SalesRepEmail ."%' ";
> }
> $result = mysql_query ($sql);
> while ($row = mysql_fetch_object ($result)) {
> $OrderID = $OrderID .", ". $row->WorkOrderID;
> }
> }
>
> if (substr($OrderID, -2) == ", ") {
> $OrderID = substr($OrderID, 0, -2);
> }
>
> if (substr($OrderID, 0, 2) == ", ") {
> $OrderID = substr($OrderID, 2);
> }
>
>
> $sql = "SELECT WorkOrderID FROM workorders WHERE WorkOrderID IN
> ($OrderID)";
Well, I was going to say this before, in all the other mysql_query() calls, but
you might want to look at having something like this for your
mysql_query() function...
Do the following for each mysql_query() call on this page. Other wise, you are
going to have the page die'ing and not have any clue where the problem is.
if ( ($result = mysql_query($sql) ) !== false ) {
$Total = ceil(mysql_num_rows($result)/$PerPage);
} else {
echo mysql_error();
}
> $result = mysql_query ($sql);
> * $Total = ceil(mysql_num_rows($result)/$PerPage);
> *
> $sql = "SELECT WorkOrderID, DATE_FORMAT(CreatedDate,'%m/%e/%y') AS
> SubmitDate, Location, AdminID, FormName, Status FROM ";
> $sql .= "workorders WHERE WorkOrderID IN ($OrderID) ORDER BY $SortBy
> LIMIT $StartPage, $PerPage";
> $result = mysql_query ($sql);
>
>
> If ($Page > 0) {$PagePrev = ($Page - 1);} else {$PagePrev = '';}
> If ($Page < $Total) {$PageNext = ($Page + 1);} else {$PageNext = '';}
> ?>
>
> the error is this one: *Warning*: mysql_num_rows(): supplied argument is not
> a valid MySQL result resource in *
> C:\Inetpub\Xampp\htdocs\SNLeader\WOSystemN\ViewOrders.php* on line *182
>
> Thanks in advance
> *
>
--
Jim Lucas
"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."
Twelfth Night, Act II, Scene V
by William Shakespeare
--- End Message ---
--- Begin Message ---
I downloaded server2go, and actually got it to work pretty well. However
some of my forms send emails, and this project I'm working on is for a
friend of mine, and I don't want to make him set up a mail server on his
laptop. So is there anything like server2go for mailservers for windows
that I can put on the CD for him so he can see what the site looks like?
--
Michael S. Dunsavage
--- End Message ---