Re: [PHP] Re: Programmers and developers needed

2012-09-19 Thread Doug Heimbecker
Not to say I'm all in for communism... but communism failed for the same 
reason capitalism is failing. Corruption!


Here might be a way to deal with this political issue, while keeping on 
topic with the world peace PHP project:


I've had this idea for years, but why not start a technocracy or ultra 
social-democracy that runs on a decentralized server, kind of like P2P 
(Kad, Bitcoins, etc.) -- only problem being the logic running the system 
(say, PHP scripts) would need to be programmed as a whole (so anyone could 
re-program the structure of such a social system, so it functioned the way 
everyone wanted). Think Wikipedia, but completely decentralized -- nobody 
could corrupt the system unless they were a majority. This seems to be the 
direction we're heading in -- what with hidden corruption, and most 
governments being slow processing laws, reforms, etc.


May seem like a far-fetched idea, but I see it being one of the final things 
to come in a rapidly evolving technological society, replacing most 
republics with a social system more run by the people. Nobody would ever 
again complain about stuff not getting done, when mobs of people could 
actually change the system the way they wanted -- and quicker. 
Socialism/communism/Marxism in the past has never worked, because a 
minority-elite would eventually take over and convert it into a totalitarian 
state with only the mere façade of socialism we see in countries today (not 
exactly the idea Karl Marx had in mind).


--
Doug Heimbecker
d...@tac.us 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Memory

2006-10-12 Thread Doug Fulton
I'm running out of memory even though I upped it to 
memory_limit = 500M in php.ini.
Error messages and script are below.  Thanks in advance for any tips.

$ php -c /usr/local/php5/lib/php.ini createPseudoIDs.php  crosswalk.txt
php(780) malloc: *** vm_allocate(size=1069056) failed (error code=3)
php(780) malloc: *** error: can't allocate region
php(780) malloc: *** set a breakpoint in szone_error to debug
FATAL:  emalloc():  Unable to allocate 37 bytes



?php

// Create a complete mapping of SSNs to random Pseudo Keys


// Create array with all potential Pseudo Keys
$pseudoKeys = array();
for ($i=1;$i=9;$i++) {
$pseudoKeys[] = padToNine($i);
}

// Loop through all possible SSNs
$numLeft = 9;
for ($i=1;$i=9;$i++) {
$ssn = padToNine($i);
// Get random index into remaining pseudo keys
$maxRand = $numLeft-- - 1;
$randIndex = rand(0, $maxRand);
$pseudoKey = $pseudoKeys[$randIndex];
array_splice($pseudoKeys,$randIndex,1);
// Output it.
print $ssn.:.$pseudoKey.\n;
}

function padToNine($num) {

$final = '';

$cnt = strlen(strval($num));
$padding = 9 - $cnt;
for ($i=1; $i=$padding; $i++) {
$final .= '0';
}
$final .= strval($num);

return $final;
}
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] gd for php5 under RH ES4

2006-10-11 Thread Doug Fulton
I am trying to use the php gd library (for imagecreate, etc) with php5 
under Red Hat ES4.  I tried installing php-gd via webmin (which in turn, 
I see, uses up2date), but get the following error in the apache error 
log when restarting:
PHP Warning:  PHP Startup: Unable to load dynamic library 
'/usr/lib/php4/gd.so' - /usr/lib/php4/gd.so: undefined symbol: 
empty_string in Unknown on line 0

I don't know if the problem is that php-gd is a php4 library or there is 
something else that I need to install or do.  I saw something about 
php5-gd, but webmin/up2date can't find anything by this name.

I have searched for a bit on this without joy; any guidance is 
appreciated.  I am not a system administrator by training, but am a 
longtime Unix programmer, so I can handle reasonably low level 
instructions, if necessary.  I did post this to a Red Hat list without 
any reply so far.

Thanks in advance,
Doug

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Basic PHP knowledge test

2006-07-20 Thread Finner, Doug
My advice, give the candidates problems and see how they solve them.
Even if they don't finish, you get an idea of how they think.
tedd

I like this idea! 

Do you expect them to be able to work with code written by others?  If
so, hand them some of your existing code (good examples and not so good)
and ask them to figure out what it does and recommend changes.

I really really like the 'give them a problem and have them solve it'
idea...

Doug
___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Using php4 to manage Apache 1.3 access database

2006-06-09 Thread Doug Carter

I'm trying to make a web page to maintain my Apache authorization
file with instead of dbmmanage.

Since I have to have php loaded for other reasons I started
there.  Problem seems to be that the OpenBSD package and port
systems only seem to gdbm for php-4 and gdbm is not
supported by Apache 1.3 (gdbm does seem to be supported for
Apache 2 but that is not an option for me). Sort of a catch 22.

Is this correct or am I more likely
malforming the gdbm database or something else?

Context is:
 OpenBSD 3.9 with default chrooted Apache 1.3
 db-4.2.52p8
 gdbm-1.8.3p0
 php4-core-4.4.1p0
 php4-dba-4.4.1p0

Ruby 1.8 supports DB files but I don't really want to move all
the Ruby stuff to /var/www/ (required for the chrooted Apache
install).

Any suggestions?

Thanks,
--
Doug Carter

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: When is z != z ?

2006-06-06 Thread Finner, Doug
I love this thread.  Who'da thunk alphabets could be so much fun?

FWIW:
Different language, different rules - to do 'letter math', letters must
be converted to their ASCII number value, add one, convert back to a
letter.  The set of allowed ASCII numbers is limited to (I think) 256
and 'real' letters are a subset of that collection.
Going from a-z was easy.  Once you hit z, you reverted character 1 to a,
then looped a-z for character 2, repeat as required.

There were only a couple of ways to evaluate a string's 'size';
alphabetical and length.  Each comparison generated different results
and one had to choose the comparison method based on the particular
requirements.  In order to convert a string to some numeric value, I
believe I had to do it letter-by-letter and derive my own 'value' for
the string which would be mostly useless.  

While the specific language methods differ from PHP (the language did
not allow anything like 'a'++ so this particular discussion couldn't
happen), it doesn't seem to me that the philosophical underpinnings are
all that different - letters are special.  They look and behave
differently depending on the particular microscope you happen to be
using.

Anybody want to talk about rounding?  ;-)

Doug

___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] RE: Can php convert doc to HTML?

2006-05-24 Thread Finner, Doug
On 5/23/06, Martin Alterisio [EMAIL PROTECTED] wrote:

 If that's the case, why don't you just use the export as web page or

 save as web page tools of MS Word (if you don't have it anymore you 
 can as someone who still has it, or I think OpenOffice also has a
similar tool).


 Because there are 200 of them.

 Dotan Cohen

Unless you want to do them one at a time, you'll need to write code.
Unless this is something that you need to do a lot, why not write the
code using OOo's programming language?  Seems like all the appropriate
hooks should be there to pull in each Word doc, push it off as HTML, and
repeat for all the docs.  I haven't worked with OOo for programming, but
it might be worth a look.  Hit the OOo site and see what their forums
have to offer.

Doug
___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP !== Hypertext Pre-Processor

2006-02-16 Thread Finner, Doug

 In the end it is not worth worrying about. If someone asks you what 
 PHP stands for tell them it stands for the best darned programming 
 language you ever saw.

Not disagreeing, just wondering if people here see PHP as a programming
language, or a scripting language? Just curious what the general
consensus is, as someone decided to challenge me over it recently and I
was left in two minds over it.

Cheers,

Rich

How 'bout this - 'PHP is an application development framework'.  I come
from a Lotus Notes background and get into the same kind of inane
religious discussions about 'you are/are not a programmer because fill
in deeply felt belief/reason here' in much of the same way I see for
other 'scripting/programming' languages.  I don't program, I create
applications and try and use the right tool for the right function.


___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Reverse Engineering of Smarty

2006-02-06 Thread Finner, Doug
 -Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 05, 2006 2:47 PM
To: [EMAIL PROTECTED]
Cc: PHP-General
Subject: Re: [PHP] Reverse Engineering of Smarty

On Sun, 2006-02-05 at 01:12, Sumeet wrote:
 Rory Browne wrote:
  If you don't have backups, then:
  
   1: Why do you not have backups?
   2: Are you insane?
 
 hmm. totally uncalled for 

I don't know that it's uncalled for. I think Rory was drawing to
attention that not having some kind of backup of important code is
tantamount to incompetence. I would have to agree with Rory that if the
code was important enough to seek a method of reverse engineering to
retrieve the original, then some kind of system should have been in
place long ago. Might I suggest CVS? I would have to say that are you
insane is a bit softer on the ego than are you a complete moron.

Cheers,
Rob.
--
=
Interesting thread.  I'd suggest that what this thread really gets to an
important issue - how to _ask_ a question.  The orignal poster asked a
question but didn't provide enough information for the list to really
respond properly.  If you have backups and know you can restore from
backup and want to learn if you can reverse engineer something for
grins, well then say so and help the group provide you useful
information rather than whack you about the head and shoulders for
failing to properly backup your system.

Great resource here --
http://www.catb.org/~esr/faqs/smart-questions.html

OK, I'm off to tilt at other windmills.

Doug Quixote...

___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: No forums?

2005-11-07 Thread Finner, Doug
Wow, go away for a few days and holy war breaks out...cool!

Why not one system that supports both without extra work?  The model I'm
thinking of is Google or Yahoo groups(*).  You can access any 'forum'
via a web browser, search, post, reply, etc AND/OR you can subscribe to
any forum and get messages sent to you via email (individual or digest
format).

At work, I sit behind a firewall and web access involves a multi-stop
PITA process so listerservers work well for me there.  At home, forum
access is easier since I can go to the forum site, decide what I want to
read and/or respond to without cluttering up my email client.

Doug

(*) - I am NOT suggesting this forum be configured like Yahoo, the
search function absolutely sucks and I'm not a real fan of the layout,
but the concept of a forum that's a list that's a forum...is what I
like.  For what it's worth, Yahoo has not PHP groups I can find but
there are 33 over at Google with 100 - 1000 members.
___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PDF printing under windows.

2005-10-25 Thread Finner, Doug
Not sure how this might work in PHP, but there is something called WSH
(go to MS and poke around) that gives you access to a ton of really
interesting Windows bits and pieces.  The following is a script I run in
Lotus Notes (LotusScript is rather like VBA) and it allows you to set
the default printer to something which you then just print to and reset
the default to whatever it was.  PDFCreator is a 'printer' that
generates PDF files (you probably don't want this since use of
PDFCreator includes it's own set of user interactions but the WSH
concept may still work).

Warning - I'm not a WSH expert and I never figured out how to properly
reset the printer to the user's default so I don't actually use this
script.  Still, someone smarter than me may have the magic touch - give
it a whirl.


Sub Initialize
 Dim net
 pName$ = PDFCreator
 Set net = CreateObject(WScript.Network)
 net.SetDefaultPrinter pName$
 
End Sub 

Doug

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 25, 2005 10:50 AM
To: php-general@lists.php.net; php-windows@lists.php.net
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PDF printing under windows.

Two (and a half) things:

1. Even though DOS/Windows machines don't have, specifically,
/dev/printer or /dev/lpr or whatever the *nix specific is, it does have
a LPTx: device

According to the page listed below, it may be possible to do:
copy /b filename LPTx

The /b indicates it's a binary file.  How it'd handle PDF fonts and
such, I'm not sure, but I know that some printers can decode PDF's
internally so that'd work out great.

2. Second point... If all you need is a simple print function and you
have exec() privs, why not try to find a DOS based printing solution.
The copy command above was mentioned on this page:
http://www.lerup.com/printfile/

It says it works with Windows 3.1 to XP.  And it even works with command
line options:

PrintFile also works well with command line (DOS) programs. It has
several command line options and can read data from command line
standard input, e.g. a command line pipe. A command like:
dir | prfile32

So I guess it sets up it's own print device that you can pipe to.

And finally... the half a point.  All of this may not be necessary
because you can configure Windows printers to support DOS (although I
havn't done this in ages, I assume you still can in XP) so in theory the
normal DOS print command would pipe through Windows drivers and print
handling to the printer of choice.


So in general, there's probably zero need to use COM to print.  One of
these options should pipe the file through Windows which in turn, could
possibly send it through the proper printing method.   If not, you might
be able to look in your registry and find the right-click Print...
option and see if it's something you can execute from command line.

Ok, I know this email's too long already, but I know someone's going to
say How do you do that?  So here's the 50 cent tour:

1. Pull up regedit
2. Search for the file extension .pdf
3. Make note of the (Default) value, in this case AcroExch.Document
(I think this is specific to having the full Acrobat installed) 3. Below
the area where all the file extensions are in HKEY_CLASSES_ROOT there
are the actual named app section (that way, .gif and .jpg can both
point to Photoshop.document or something.. get it?)  So search for
AcroExch.Document in this case 4. Expand that tree and look for
shell. These are all the things that show up on your right-click menu.
In this case, we have a print section. Under each of these entries,
there should be (but sometimes not) a command branch.  This is what's
run when you select that option from the right-click menu.  And voila!
We find that the command to use Acrobat to print (which can be executed
from command line on a Windows machine) is:
C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe /p /h %1

Substituting the %1 for the filename.


Using that command line in a php exec() call should exactly simulate
selecting right-click PRINT on a PDF file.


Crossposting this to PHP-Win for their benefit too since this is more
Windows related than PHP General.

I see lots of ways to potentially solve this problem without using COM.

I loved messing with COM (with or without PHP) for a while, but it's not
a great general solution to things unless you absolutely HAVE to control
the app (which is very cool and slick sometimes, but not for something
as simple as printing).

Hope this gives you some new avenues to persue.  Best of luck!

-TG

= = = Original message = = =

Richard Lynch wrote:

On Mon, October 24, 2005 1:48 pm, Dave Lists wrote:
  

I'm generating PDFs under windows using PDFlib and all is easy. What I

am wondering though, and google reveals nothing usefull, can I print 
the PDF to a network printer from windows? I'm presuming to print the 
file I would ahve to use COM and open it under Acrobat? Anyone done 
this before and have

[PHP] RE: PHP wiki recommendations

2005-09-08 Thread Finner, Doug
 I'm not a Wiki expert, but have been using TikiWiki for a while and
very much like it.  It does everything you say with the possible
exception of CSS.  It may very well support CSS, I just don't need it so
haven't investigated.  It also allows for the use of templates that can
be applied globally or by each user (these may be the CSS bit, again, I
just haven't played).

User logins can be pre-assigned or user driven so you can control who
does what.

I think you can turn on/off the CamelCase feature.

Doug


-Original Message-
From: Murray @ PlanetThoughtful [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 2:03 AM
To: php-general@lists.php.net
Subject: PHP wiki recommendations

Hi All,

I want to add a wiki to my blog site to help create a knowledgebase of
the characters, localities, stories I write to make it easier for new
visitors to delve into the areas that interest them.

I've been experimenting with a couple of different wiki packages, but am
always interested in others' thoughts and recommendations.

In particular, I've looked at MediaWiki and PmWiki. Of the two, I like
MediaWiki's 'completeness', but it's also quite slow and doesn't strike
me as being particularly (or easily?) customizable. PmWiki is probably
my current candidate, but again I'd like to make sure I'm not missing a
more obvious choice.

My shopping list for the ideal wiki application is:

- wiki entries preferably stored in MySQL tables. I'm not adamant about
this (eg PmWiki uses files rather than a db backend), but it would suit
my purposes better to be able to draw from the wiki tables from the
front page of my blog to show lists of recently added and recently
updated wiki entries

- non-reliance on CamelCase wiki links. Many of my characters etc use
joined CamelCase names (eg KillFork and DangerSpoon), and to avoid
confusion I'd rather explicitly define links to wiki content

- ability to categorize wiki entries

- ability to compare history of wiki edits and easily reinstate older
edits if wiki pages get 'graffiti'd' 

- ability to allow others to edit / create wiki entries, thru a user id
/ password system, so that regulars who would like to participate can do
so

- ability to customize presentation of wiki pages, presumably through
CSS etc, so that I can maintain the 'look and feel' of my blog thru the
wiki content

- PHP based, though my host does run Perl, so if the killer wiki app is
a Perl-based one, I'm sure I can muddle thru implementing it

If anyone has any recommendations for other wiki applications I should
look at before making a decision, I'd love to hear from you!

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org
___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Web functional testing tools?

2004-09-07 Thread Doug Kearns
On Thu, Aug 26, 2004 at 04:19:51PM +0100, Geoff Caplan wrote:
 Doug,

snip
 
 I'm fairly new to this field, so I'm still feeling my way, but I guess
 my requirements are similar to anyone else building a fairly complex
 ecommerce application: fill and submit forms using the full range of
 HTML widgets, submit and check cookies, gets and posts, check changes
 to data (in Postgres), check for patterns in pages, organise groups of
 related tests, follow redirects etc etc. The requirement to run checks
 on the database suggests that a server-side solution would be the way
 to go.

SimpleTest provides all of this functionality with the exception of a
specific database testing API, although you can certainly use it for
this purpose.
 
 Obviously, a key issue is keeping the tests robust in the face of
 changes to the application. I need to be able to change a link label,
 for example, without breaking the test-suite.

Link assertions can be specified using the 'id' attribute.
 
 I am trying to avoid anything that requires a complex Java setup or
 Eclipse: I don't have the relevant skills. The best options I have
 found so far, in addition to SimpleTest, are:
 
 **Puffin** Pure Python framework, so easy to extend (I know a bit of
 Python). Looks very powerful, but not much current activity and
 documentation is minimal:
 
 http://www.puffinhome.org/what.htm
 
 **Canoo** Which you obviously know.
 
 http://webtest.canoo.com/webtest/manual/WebTestHome.html
 
 **TestCase**, which looks powerful - but requires that you model the
 whole site in UML, which is not the way I prefer to work:
 
 http://www5f.biglobe.ne.jp/~webtest/testcasetool/index.html
 
 Is there anything I have overlooked?

You might like to have a quick look at http://www.fitnesse.org/, but I
would think that SimpleTest meets most of your requirements.
 
 The problem I am facing is that it will take a few days to do a full
 evaluation of the options and I am pressed for time. Any advice that
 you could offer that would help accelerate the process would be most
 welcome...

Sorry, this might be a little late...

Regards,
Doug

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Web functional testing tools?

2004-08-26 Thread Doug Kearns
On Thu, Aug 26, 2004 at 10:58:43AM +0100, Geoff Caplan wrote:
 Hi folks,
 
 Just setting out on a major new project, and this time I want to set
 up a comprehensive regression testing from the start: I've learned the
 hard way that manual testing is not the way to go!
 
 But looking at open-source web application frameworks, most of them
 are very Java specific, or at least require Java to write the tests.
 
 What do people recommend for the functional testing of PHP data-driven
 apps? (By functional testing I mean testing the application as a
 whole, as opposed to unit testing.)

http://www.lastcraft.com/simple_test.php#web

Regards,
Doug

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Web functional testing tools?

2004-08-26 Thread Doug Kearns
On Thu, Aug 26, 2004 at 01:35:00PM +0100, Geoff Caplan wrote:
 Doug,
 
  What do people recommend for the functional testing of PHP data-driven
  apps? (By functional testing I mean testing the application as a
  whole, as opposed to unit testing.)
 
 DK http://www.lastcraft.com/simple_test.php#web
 
 I'm aware of SimpleTest, but it's very much a unit testing framework.
 As I say, my interest in this thread is with functional testing: the
 testing of the application as a whole...

SimpleTest's WebTester package is definitely an acceptance/functional
testing framework. If you'd prefer not to specify your test's in PHP you
could look at something like Canoo WebTest which uses XML.

If you can elaborate on what SimpleTest is lacking I might be able to
point you in another direction.

Regards,
Doug

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] writing source code to file

2004-08-16 Thread Doug Parker
I was wondering if there was a block of code I could place at the bottom of
the file that would write the page's source code to an html file.  I need
this because I'm posting pages to a server sans a PHP compiler.  Basically,
I'd like for every time I run a page its source code to be saved in the
filename of my choice, instead of me having to run the page, copy the
source, and paste it into the file of my choice. I know how to use fopen,
but I'm not sure what to tell it to write to file, since the source I want
to write is being generated simultaneously.

Any help would be greatly appreciated...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Inserting string - need to trim comma

2004-04-01 Thread Doug Parker
Hi -
I'm trying to create a very basic function that add the results of a form to
my database.  I have this code so far, with $table being the table name and
the $data is an exact copy of the $_POST array.

 function insert($table, $data) {
 $sql = INSERT INTO .$table. SET ;
 foreach ($data as $k=$v) {
 $sql.= $k. = '.$v.', ;
 }
 $sql.=;;
 $result = mysql_query($sql);

}

The only problem with the statement is the appended comma to each
iteration - the statement generates a mysql error with the extra comma at
the end of the statement.  This seems like an easy fix -any ideas?

Any help would be greatly appreciated...




http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Inserting string - need to trim comma

2004-04-01 Thread Doug Parker
implode() worked perfectly.  

thanks -
doug
- Original Message - 
From: Chris Shiflett [EMAIL PROTECTED]
To: Doug Parker [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 2:19 PM
Subject: Re: [PHP] Inserting string - need to trim comma


 --- Doug Parker [EMAIL PROTECTED] wrote:
  function insert($table, $data)
  {
  $sql = INSERT INTO .$table. SET ;
  foreach ($data as $k=$v)
  {
  $sql.= $k. = '.$v.', ;
  }
  $sql.=;;
  $result = mysql_query($sql);
  }
  
  The only problem with the statement is the appended comma to each
  iteration - the statement generates a mysql error with the extra comma
  at the end of the statement.
 
 You can usually avoid this type of problem in the first place with
 implode(). Something like this (untested):
 
 sql = insert into $table set ;
 $pairs = array();
 foreach ($data as $key = $value)
 {
 $pairs[] = $key = '$value';
 }
 $sql .= implode(',' $pairs);
 
 --- Matt Matijevich [EMAIL PROTECTED] wrote:
  http://www.php.net/rtrim
 
 rtrim() trims whitespace, not commas.
 
 Hope that helps.
 
 Chris
 
 =
 Chris Shiflett - http://shiflett.org/
 
 PHP Security - O'Reilly
  Coming Fall 2004
 HTTP Developer's Handbook - Sams
  http://httphandbook.org/
 PHP Community Site
  http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Segment fault

2004-03-19 Thread Doug Dalton
I am writting a php script that will be used in production,  it connects 
to a imap server gets all the headers and stores them in a db:

Here is where it is crashing

0x28258ede in mm_cache () from /usr/local/lib/libc-client4.so.8

(gdb) bt
#0  0x28258ede in mm_cache () from /usr/local/lib/libc-client4.so.8
#1  0x2825b9a2 in mail_elt () from /usr/local/lib/libc-client4.so.8
#2  0x0809af8e in zif_imap_headers (ht=1, return_value=0x113196a4,
   this_ptr=0x0, return_value_used=1)
   at /usr/home/ddalton/src/php-4.3.4/ext/imap/php_imap.c:1048
#3  0x081c2b06 in execute (op_array=0x82acb24)
   at /usr/home/ddalton/src/php-4.3.4/Zend/zend_execute.c:1616
#4  0x081b13a9 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
   at /usr/home/ddalton/src/php-4.3.4/Zend/zend.c:884
#5  0x08179f5b in php_execute_script (primary_file=0xbfbff6fc)
   at /usr/home/ddalton/src/php-4.3.4/main/main.c:1729
#6  0x081c8fa9 in main (argc=2, argv=0xbfbff76c)
   at /usr/home/ddalton/src/php-4.3.4/sapi/cli/php_cli.c:819
#7  0x0806af85 in _start ()
it appears to run out of memory in the c-client, increasing the memory 
limit does not resolve the issue here are the key elements of the code:

include '../config.php';

while($row = $results-fetchRow(DB_FETCHMODE_ASSOC))
{
$cnt=0;
$successful=false;
extract ($row);
$connectstr=connectstr($bmserver,$bmssl,$bmtype);
$mbox = imap_open(\{$connectstr}, $bmusername, $bmpassword, 
OP_READONLY );
$list = imap_list($mbox, \{$server}, *);

 if (is_array($list)) {
  reset($list);
   while (list($key, $val) = each($list))
   {
@imap_reopen($mbox,  $val, OP_READONLY );
 if ( $mbox === false )
  {
 $mbox = imap_open(\{$connectstr}$val, $bmusername, 
$bmpassword,  OP_READONLY );
  }
   $headers = @imap_headers($mbox);

   $numEmails = sizeof($headers);
if ($numEmails!=0  is_array($headers))
{
 for($i = 0; $i  $numEmails; $i++)
 {
 $mailHeader = @imap_headerinfo($mbox, $i);
 $from = $mailHeader-fromaddress;
 $fromar=split(,,$from);
 $xfrom=sizeof($fromar);
for ($y=0; $y  $xfrom; $y++)
 {
 $emails=parseEmailString($fromar[$y]);
 if (insertemail ($emails))
   $successful=true;
 }
 }
}
   }
  }

}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php debug

2004-03-08 Thread Doug Dalton
I am getting an error in php that is causing a core dump :
(gdb) core php.core
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
#0  0x00686264 in ?? ()
The program is a script and is working fine until,  my assumption is 
that it exhausts resources and crashes,  does anyone have a suggestion 
on how to debug a problem of this sort?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Error redirect function

2004-01-08 Thread Doug Parker
I have a message board script that requires certain parameters like
message_id, thread_id, etc.  The whole thing works fine, I'd like to have a
generic error page to default to in the case that someone fools with the
parameters above - for example, setting the thread id to 400 when there are
only 300 threads.  Right now, it just generates the mysql error message,
which doesn't look nice.  I know you can use the die() function after the
mysql_query function to display some text in the case of an error, but I
want to go a little further by redirecting to an error page.  How would I go
about doing this?

Any help would be greatly appreciated.

- Doug



http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Selecting between using letters

2003-12-29 Thread Doug Parker
How would I create a select statement in MySQL that would return a range of
records from the LastName field where the value starts with a designated
letter - for example, returning the range where the first letter of LastName
is between A and E...

Any help would be greatly appreciated.




http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Creating a line break between letter groupings

2003-11-19 Thread Doug Parker
I'm reading a list of stores from a database and ordering them
alphabetically.   How would I place a line break in between each letter
grouping?   For example,

Applebee's
Aaron's Place
Aardvark Store

Bumblebee's
Bears R' Us
Big Bad Johnny's

Caterpillar central
Coffee time!!

etc.- with the line break occuring in between each letter grouping.

Any help would be greatly appreciated.


--




http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] Creating a line break between letter groupings

2003-11-19 Thread Doug Parker
Worked great.

Thanks!!


Tom Rogers [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 Thursday, November 20, 2003, 11:12:55 AM, you wrote:
 TR Hi,

 TR Keep track of the first letter and if it changes echo a br

 TR $key = ''

 TR //loop through results

 TR while($result = mysql..){
 TR   $char =  strtoupper(substr($row['name'],0,1));
 TR   if(empty($key){
 TR $key = $char;//first result set key
 TR   else{
 TR if($key != $chat){
 TR   echo 'br';
 TR   $key = $char;
 TR }
 TR   }
 TR   //rest of loop
 TR }

 TR --
 TR regards,
 TR Tom

 Stupid keyboard :)

 $key = ''

 //loop through results

 while($result = mysql..){
   $char =  strtoupper(substr($row['name'],0,1));
   if(empty($key){
 $key = $char;//first result set key
   else{
 if($key != $char){
   echo 'br';
   $key = $char;
 }
   }
   //rest of loop
 }


 --
 regards,
 Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Test Links...

2003-09-26 Thread Doug Coning
Greetings All,

I am creating a 'links' page and was wondering if there was a way in PHP
to test the response of an outside link?  I'm sure everyone here has
clicked on a links page link and have a No Page Found error because no
one is keeping the links uptodate.  I was wondering if there was a way
when a link was clicked to test the link first to see if it is still
active.  If it isn't active, I would like to remove the link from my
database.

Is there a command that tests the results of link?

Thanks,

Doug Coning
American Web Studio
http://www.americanwebstudio.com
HTML / FLASH / PHP / MYSQL / FILEMAKER



[PHP] storing quotes into a variable

2003-09-11 Thread Doug Parker
isn't there a function that allows me to store a string with a bunch of
quotes in it (like an html tag) into a variable?

for example, i need something like:  $perf_mod = a href=#
onclick=popWindow('popup.php')

thanks...

--




http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] upload problems

2003-09-08 Thread Doug Parker
I'm trying to do some uploading on my server, and I'm not getting any value
for my tmp upload setting - meaning this code:

$source = $_FILES['cat1_thumb']['tmp_name'];
echo $source;

returns nothing.   The form is fine - meaning that the text input name is
correct and I am indeed selecting a file.  I realized that our
upload_tmp_dir setting was not set, so I had the admin set it, but it still
returns nothing.  Is there another setting I should check?

Thanks

--




http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Controlling Access

2003-08-26 Thread Doug Wolfgram
I have an application that consists of some 30 php modules.  Each one links 
to another, as you can imagine. How can I create a security mechanism that 
only allows the modules in my system to be called from one-another? I do 
nto want any of the modules to be called by typing them on the address bar. 
Of course, sessions takes care of folks who have not logged into the 
system, btu I don;t want registered users hacking around either.

I though of using HTTP_REFERER as a handshake restrictor, but it seems to 
be unstable and unreliable. Any suggestions?

D




'Marketing that Listens

Doug Wolfgram
CEO - GRAFX Group, Inc.
www.gfx.com
www.aimprojects.com
949.433.3641
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] File upload restrictive permissions

2003-08-22 Thread Doug Parker
Recently I had a problem with file uploading on a server I use, and the
problem was that the tmp/ directory was not set.  Now that it has been set,
the images do upload, but the file permissions end up being very
restrictive - something like (-rw---) - so the images obviously do not
show up on the web.  I know I could login and chmod tihs, but since we have
clients upload their own images, it goes without saying that this would be a
major inconvenience.  Our sysadmin, who is relatively clueless, suggested
that I add a php chmod function to my scripts.  I suppose this would work,
but I don't understand why my scripts once worked without this function -
the files uploaded and were web-viewable.  I checked both the target
directory and tmp/ directory, and both are fit for web viewing.

Any ideas as to how I could fix this?

Thanks...



http://www.phreshdesign.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Form Retain Info on Back?

2003-07-31 Thread Doug Coning
Hi All,

I have a php form that I run a test to see if they have entered in all
required fields before inserting into a MySQL db.  The PHP script simply
reports what is missing and exits the rest of the page.  However, when
you click the back button, all the information that was entered, is
gone.  Is there a simple way of retaining this information so the user
doesn't has to retype all the information in?

Doug 


[PHP] regexp help...

2003-07-21 Thread Doug La Farge
Hi all,

I have a string that for all practical purposes should probably be a 
list (array).  I need one line from the string and need to send the 
rest to /dev/null.

The string starts:
HTTP/1.1 200 OK
Date: Tue, 22 Jul 2003 01:34:12 GMT
Server: Apache/1.3.27 (Unix) mod_jk/1.1.0 mod_ssl/2.8.12 OpenSSL/0.9.6g
Set-Cookie: JSESSIONID=mngtpma6i1;Path=/Interface
Connection: close
Content-Type: text/html;charset=ISO-8859-1








?xml version=1.0? blah blah blah  /shipment



The String ends on the line above (white space line).

If I'm not mistaken the blank lines are actually a combo of unix and 
dos line returns.

any help is much appreciated.

thanks,

Re: [PHP] regexp help...

2003-07-21 Thread Doug La Farge
I guess I should point out that the line i want is the XML line 
'?xml..'

On Monday, July 21, 2003, at 11:44 AM, Doug La Farge wrote:

Hi all,

I have a string that for all practical purposes should probably be a 
list (array).  I need one line from the string and need to send the 
rest to /dev/null.

The string starts:
HTTP/1.1 200 OK
Date: Tue, 22 Jul 2003 01:34:12 GMT
Server: Apache/1.3.27 (Unix) mod_jk/1.1.0 mod_ssl/2.8.12 OpenSSL/0.9.6g
Set-Cookie: JSESSIONID=mngtpma6i1;Path=/Interface
Connection: close
Content-Type: text/html;charset=ISO-8859-1








?xml version=1.0? blah blah blah  /shipment



The String ends on the line above (white space line).

If I'm not mistaken the blank lines are actually a combo of unix and 
dos line returns.

any help is much appreciated.

thanks,


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] POSIX seteuid and similar

2003-07-21 Thread Doug La Farge
You guys can correct me if I'm wrong but I believe what is referred to 
here is SUEXEC.

This allows a virtual domain instance to run as any specified username 
and group.

You are not setting the UID of the script but rather any script fun for 
that domain.  This way you don't have to chmod 777 or chgrp apache 
files.  The virtual server instance is set to run as you (usually) and 
thus has the same permissions you do.

You may have to compile or recompile apache to get this to work for 
your set up (requires you specify a path where SUEXEC files exist) 
among other things.

hope this helps...

now... any regexp's response out there? :-)

On Monday, July 21, 2003, at 12:56 PM, David Goodchild wrote:

Curt, thanks for that, I didnt see that in the notes.

A question that I havent been able to work out since reading this is...

When both you and the person in the contributed notes say: make your 
php
cgi setuid and that is ran in cgi mode that is setuid'd ...

How do I setuid a CGI script? ...surely if i access it through the 
browser
it will still execute as apache?

Cheers

- Original Message -
From: Curt Zirzow [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Monday, July 21, 2003 5:08 AM
Subject: Re: [PHP] POSIX seteuid and similar

* Thus wrote David Goodchild ([EMAIL PROTECTED]):
Hi,

I am trying to create a small php program where I can control users
processes.  As far as I see I require Apache to run as root in order 
to
do
this (Note: I wish to access it via a webpage run through a 
browser). At
the moment all pages are executed as user 'apache' (UID #48 in this
case).
Other than giving apache root access which i hear is a very bad 
thing to
do,
what other ways can i use the posix_seteuid() functions and the like.

Any help at all will be really appreciated.
There is an example in the contributed notes on the site under the
posix_setuid. Baically it is a perl script that is ran in cgi mode 
that
is setuid'd. then opens a php script that runs the setuid script.

I dont see why, if you choose this method is to just bypass the perl 
cgi
and just make your php cgi setuid.

I'm not sure of any security issues in doing that but it seems better
than running your whole apache server as root.
Curt
--
I used to think I was indecisive, but now I'm not so sure.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: How to..

2003-07-21 Thread Doug La Farge
[EMAIL PROTECTED]
Haseeb:
hi,
i have heard a lot of people commenting about the coding style of
other programmers. i think everyone has his own style.


but i also say
that there should be a standard that should be followed by everyone.
A nice idea that can never fly.  It might work for basic programming 
but you have to realize there are many ways and styles that people 
develop - often times based on their idea of proper coding 
philosophy.  OO code is a perfect case in point.  Pure OO coders (the 
ones that realize Small Talk is the ideal OO model *shrug*) will have a 
different style and implementation.  This thread talks about using 
include files (and thus classes) as a good way to split up code.  The 
problem is, the code i've seen, the reason for using the classes isn't 
to write any object code at all (where is the inheritance?) but rather 
to keep thing organized.  PHP suffers from the fact that there is a 
huge difference between the most basic of programming skills (it's an 
easy language to pick up) and the folks that have been writing OO code 
all their life (C++, Perl, Java, etc.).  I've seen it in Perl - I 
cannot code in the same style as a friend of mine (Randal Schwartz).  
He simply thinks on a much higher level than I ever will and thus his 
coding style will always be more sophisticated.

Just my two cents...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] fsockopen

2003-07-21 Thread Doug La Farge
Is there a way to get fsockopen to suppress the header information it 
returns.  I have no use for the crap, have no idea how to use a regexp 
to get it out of there (nor does anyone on this list it would seem 
either).

I'd like to be able to grab a web page as it is presented to the 
browsers (as seen in view source).

HTTP/1.1 200 OK
Date: Tue, 22 Jul 2003 05:14:41 GMT
Server: Apache/1.3.27 (Unix) mod_jk/1.1.0 mod_ssl/2.8.12 OpenSSL/0.9.6g
Set-Cookie: JSESSIONID=jwjesefa81;Path=/Interface
Connection: close
Content-Type: text/html;charset=ISO-8859-1
The above crap needs to not be returned.

Any ideas?

[PHP] XML Parsing

2003-07-17 Thread Doug La Farge
Hello,

I'm new to PHP but have been coding in Perl for over six years.  I've  
had a steep learning curve in the last few days. My task has been to  
use fsockopen to pull in an XML stream, parse that XML stream, and  
package up that data into a complex, but usable data structure.  We've  
been able to accomplish this in Perl but now I'm attempting to port the  
Perl code to PHP. The Perl code was written by Randal Schwartz (for me)  
but he's not interested in helping me solve the PHP problems I'm  
running into.  I'm hoping to find someone on this list savvy in Perl  
and PHP, and understands complex data structures (in perl the hash  
refs/pointers go about four levels deep). I've included below the PHP  
code with three functions in question. Below each function is the Perl  
code I'm attempting to port.

Here are some URL's that might help:

http://shop.sprocketdata.com/test.php - url for the code below (which  
works if you copy paste)
ignore the feof error- i left out the fsockopen because I know that's  
not where the problem is nor does this error effect the output.

http://stage.holdit.com/cgi-bin/is/shipping.cgi - url for equivalent  
code in perl (ignore the drop-down)

http://stage.holdit.com/cgi-bin/is/fetch.cgi - the data structure I'm  
trying to achieve in PHP

http://stage.holdit.com/cgi-bin/is/is.cgi - the raw XML data structure  
- almost useless until parsed and probably useless to look at :-).

You'll also notice at the bottom of the code I've included how the PHP  
XML parsed the data.  It's very similar to the fetch.cgi - maybe it's  
different and thus causing the problem but I don't see it.

?php

$state = array();
global $state;
// these two associatative arrays will hold the data structure (I hope  
:-)
$quote = array();
global $quote;
$quotes = array();
global $quotes;

//XML start element
function startElement($Parser, $Elem, $Attr) {
	global $state;   //this works
	array_push ($state, $Elem);//this works
	$states = join (' ',$state);//can't interpolate the list so must  
join - works
	if ($states = SHIPMENT PACKAGE) {  //we make it this far
		echo $states\n;   //for testing should on print once!
//		$package_id = $Attr-{id};   // how to write this in PHP?
	}
	//This conditional is never met - QUOTE gets popped off before it  
returns
	elseif ($states = SHIPMENT PACKAGE QUOTE) {   //why does perl see  
QUOTE?
		echo $states\n;   // testing
//		%quote = ( package_id = $package_id, id = $attr-{id} );  //Perl
//		$quote = array ( package_id = $package_id, id = $attr-{id}  );   
//PHP version of above line?
	}
}

/*Perl
start_h = [ sub {
my ($tagname, $attr) = @_;
push @state, $tagname;
if (@state eq shipment package) {
print @statebr;#testing
$package_id = $attr-{id};
}
elsif (@state eq shipment package quote) {
%quote = ( package_id = $package_id, id = $attr-{id} );
print @statebr;#testing
}
}, tagname, attr],
*/
// XML data
//This function might work but I don't know yet as QUOTE never stays in  
the $state stack
function characterData($Parser, $Line) {  			
	global $state;
	$states = join (' ',$state);	
	if ($states = SHIPPMENT ERROR) {
		$error = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE BOXID) {
		$boxID = $Line;
  	}
  	elseif ($states = SHIPMENT PACKAGE QUOTE CARRIER NAME) {
		$quote{carrier_name} = $Line;  // Doubting this will work - need to  
fix this too
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE CARRIER CODE) {
		$quote{carrier_code} = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE CLASS NAME) {
		$quote{class_name} = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE CLASS CODE) {
		$quote{class_code} = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE SERVICE NAME) {
		$quote{service_name} = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE SERVICE CODE) {
		$quote{service_code} = $Line;
	}
	elseif ($states = SHIPMENT PACKAGE QUOTE RATE AMOUNT) {
		$quote{amount} = $Line;
	}
}

/* Perl
text_h = [ sub {
my ($text) = @_;
if (@state eq shipment error) {
$error = $text;
}
elsif (@state eq shipment package boxID) {
$boxID = $text;
}
elsif (@state eq shipment package quote carrier name) {
$quote{carrier_name} = $text;
}
elsif (@state eq shipment package quote carrier code) {
$quote{carrier_code} = $text;
}
elsif (@state eq shipment package quote class name) {
$quote{class_name} = $text;
}
elsif (@state eq shipment package quote class code) {
$quote{class_code} = $text;
}
elsif (@state eq shipment package quote service name) {
$quote{service_name} = $text;
}
elsif (@state eq shipment package quote service code) {
$quote{service_code} = $text;
}
elsif (@state eq 

[PHP] Perl to PHP (Was XML Parsing)

2003-07-17 Thread Doug La Farge
First let me thank Tyler Lane for pointing out my XML issue. I'm an 
idiot (= vs. ==) was holding me up. D'uh!

Now allow me to ask a Perl to PHP conversion question or three.  As any 
Perl and PHP programmer is aware PHP does not have the cool reference 
thing going that Perl does (yeah, I hear the newest release of PHP is 
going there). It's not as bad as C++ (so I hear) but regardless it 
doesn't work like it does in Perl. Not complaining, just stuck (again).

Perl code:
sub {
my ($tagname, $attr) = @_;
push @state, $tagname;
if (@state eq shipment package) {
$package_id = $attr-{id};# need to convert this
#$attr is a ref to a hash where id is the key.
}
elsif (@state eq shipment package quote) {
print @state\n;
%quote = ( package_id = $package_id, id = $attr-{id} );
#need to convert the above line.
}
}, tagname, attr],
PHP code:
function startElement($Parser, $Elem, $Attr) {
global $state;
array_push ($state, $Elem);
$states = join (' ',$state);
if ($states == SHIPMENT PACKAGE) {
$package_id = $Attr-{id};//How to get the pointer to the data?
// The value of this should be '1'
}
elseif ($states == SHIPMENT PACKAGE QUOTE) {
echo $states\n;
//  %quote = ( package_id = $package_id, id = $attr-{id} );
$quote = array ( package_id = $package_id, id = $attr-{id}  );
}
}
After that, how would this convert:

$quote{class_name} = $text;
quote is a hash where class_name is the key.
Thanks again!

RE: [PHP] Get Rid of this Crook

2003-07-03 Thread Doug Essinger-Hileman
On 3 Jul 2003 at 9:06, Adam Voigt wrote:

 Well spamming doesn't get them any money. I believe
 I read they use this info to transfer money from your bank
 account, after convincing you to scan your passport for
 them, or something like that.

Actually, the scam is fairly sophisticated. They ask for money 
upfront in order to begin the process of getting access to the loot 
that is stored whereever. Usually, they ask for one or two more 
payments, since it is costing them more than they thought. They then 
inform you that the money you sent them has been used to bribe 
officials, including those in the government. If you don't send them 
even more money, they will report you to the authorities on suspicion 
of bribery and have you arrested.

At this point, the scam becomes simple blackmail. Most interesting to 
me is that this scam is so widespread (a sign that it is successful) 
that the FBI has stationed some agents in Nigeria solely for the 
purpose of dealing with this scam. Apparently, there are some folk so 
greedy that gullibility wins the day.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Authentication system

2003-07-02 Thread Doug Essinger-Hileman
I am in the process of scripting a site which requires 
authentication. I've no problems with the scripts allowing folk to 
register, login, logout, change password, etc. However, this morning 
I've begun to work on providing some security in the form of 
preventing someone from registering as another person.

This site will be limited to those who are members of a particular 
electronic (religious) community. I want to be able to verify that 
the person registering as George Fox, for instance, is George Fox. 
At the point where they fill out the registration form, I am sending 
them an email, informing them that they have been registered. On many 
sites I've gone to, the process then includes a requirement that the 
person reply to the message.

Now I need to learn how to take the incoming message and process it. 
I am assuming that the processing can be done by php. Any 
suggestions, either on how to do this, or where I might learn how to 
do this?

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Authentication system

2003-07-02 Thread Doug Essinger-Hileman
On 2 Jul 2003 at 13:00, Mike Migurski wrote:

 You may find it easier to include, in the e-mail, a
 uniquely-generated, limited-time URL that the person can visit to
 verify that they have received the e-mail. This will remove the burden
 of having to set up a system that responds to e-mail commands.

Thanks, Mike. I think my brain is working undertime at the moment. 
Can you give me an example? (Or point me in the direction of one?)

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php-general as REPLY TO

2003-06-30 Thread Doug Essinger-Hileman
On 30 Jun 2003 at 21:23, Derick Rethans wrote:

  I'm wondering why the listed Reply To address is not 
  [EMAIL PROTECTED] 
  Thing would be so much easier to just reply than cut-n-paste when
  reply to the entire list on a subject (which is the norm).
 
 That's an evil thing, and misusing e-mail. E-mail clients have the
 reply-all function for this.

I disagree with you Derick. In many (most? all?) programs, the reply-
all function will send an email back to the list **and** one to the 
author. This wastes bandwidth needlessly, in my opinion. I receive 
the messages to the list and do not need to receive a message sent 
directly to me. 

I am the owner and one of four admins of a mailing list, and we have 
set the default such that the reply is to the list. I have always 
thought that any other default setting is antithetical to the idea of 
a mailing list. A mailing list is a vehicle where conversations about 
the particular topic are shared with everyone on the list, even those 
who are not actively engaged in that particular thread of 
conversation. To set the default reply to go to the author of a 
particular post is to have the default to break the public nature of 
the conversation and shift it to a private conversation. Of course, 
this default can be overridden by an action of the replier. But if 
the default model is public conversation, why should the default be 
private reply?

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php-general as REPLY TO

2003-06-30 Thread Doug Essinger-Hileman
On 30 Jun 2003 at 22:34, Derick Rethans wrote:

  I disagree with you Derick. In many (most? all?) programs, the
  reply- all function will send an email back to the list **and** one
  to the author. This wastes bandwidth needlessly, in my opinion. I
  receive the messages to the list and do not need to receive a
  message sent directly to me. 
 
 You have procmail for that. There is some very good explanation for
 this, see
 http://www.math.fu-berlin.de/~guckes/faq/maillist.html#munge_reply-to

First, Derick, not everyone has access to procmail. In fact, most 
folk **do not** have access to procmail.

Second, I still think it antithetical to the whole idea of a public 
mailing list to set the reply-to default to anything other than the 
mailing list. Since I see no evil coming out of this, nor any misuse, 
I fail to see the problem. As the owner of a mailing list, I am quite 
familiar with the webpage you referenced; to my mind, it doesn't make 
any valid arguments. 

Having said this, I suspect that you and I will continue to disagree, 
which is perfectly okay. If this list changes the default I will be 
happy. If it doesn't, I will learn to adjust. One request I make is 
that folk, including you, Derick, refrain from sending replies to my 
email to both the list *and* my personal inbox. There's no need to 
waste the bandwidth.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Securing PHP code

2003-06-29 Thread Doug Essinger-Hileman
On 25 Jun 2003 at 16:42, Dan Joseph wrote:

  Store that file outside the docroot.  That way there is no chance
  they can
 get it from the web site.  I myself use an ini file that is no where
 near the docroot, and use parse_ini_file() to load the DB
 information in, and then I connect to it.  This method passed our
 security audit with flying colors.
 
  A sample of what my ini file resembles is:
 
 [mysql_info]
 host = 192.168.1.1
 uid = username
 pwd = password
 dbn = database
 
  They end up in a $INI array, and the fields are $INI['host'],
  $INI['uid'],
 etc..  You can read more about that function @ www.php.net.

I am just beginning to use php and mysql together (I'm new to both). 
I am having trouble getting this to work in what I think is a very
simple test.

I have created mysql.ini, and put it outside the docroot: 
/myhome/mysql.ini. This file, in its entirety, is:

[mysql_info}
host=spore.org
uid=myuserid
passwd=mypassword

Then I created a webpage with nothing more than the following:

?php 
parse_ini_file(/home/revref/mysql.ini);
echo $INI;
?

When I point my browser to that page, I am getting the following 
error message:

Warning: Error parsing /home/revref/mysql.ini on line 4 in Unknown on
line 0

Help is greatly needed.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Securing PHP code

2003-06-29 Thread Doug Essinger-Hileman
On 30 Jun 2003 at 10:25, - Edwin - wrote:

  [mysql_info}
 
 I think you meant [mysql_info]? (Check the closing bracket.)

It is correct on the server. My fingers didn't type what my brain 
told
them to for this email.

 Notice that you need to do something like this: (based on your
 example)
 
 ?php
 
   $INI = parse_ini_file(/home/revref/mysql.ini);
   print_r($INI);
 
 ?

This leads to the following output:

Warning: Error parsing /mydirectory/mysql.ini on line 4 in Unknown on
line 0 Array ( [host] = spore.org [uid] = myuserid [passwd] =
mypassword) 

The error message still remains, though now the test confirms that
mysql.ini is being parsed.

 PS
 Please check the difference between print_r() and echo() as well...

Thanks for the tip. I have read the manual for both of these.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Securing PHP code

2003-06-29 Thread Doug Essinger-Hileman
On 30 Jun 2003 at 11:20, - Edwin - wrote:

  Warning: Error parsing /mydirectory/mysql.ini on line 4 in Unknown
  on line 0 Array ( [host] = spore.org [uid] = myuserid [passwd] =
  mypassword) 
  
  The error message still remains, though now the test confirms that
  mysql.ini is being parsed.
  
 [/snip]
 
 Hmm... it could be that the (real) passwords you're using contains
 non-alphanumeric characters. Try using double-quotes like:
 
   passwd=mypassword

Bingo. Thanks.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ?xml version=1.0 encoding=UTF-8

2003-06-24 Thread Doug Essinger-Hileman

On 24 Jun 2003 at 4:33, Philip Olson wrote:

 No.  (btw, be sure to quote your strings). In reading 
 the table found here:

Thanks. That is a mistake I make frequently. The good thing about 
that is that if there is an error the first thing I look for is 
whether I have quoted my strings.  ;-}

   http://www.php.net/ini_set
 
 You will notice short_open_tag has this level:
 
   PHP_INI_SYSTEM|PHP_INI_PERDIR
 
 And according to the documentation, most namely the
 documenation found here:
 
   http://www.php.net/configuration.changes
 
 It can be set in the following (in Apache) or similar
 depending your web server:
 
   .htaccess
   php.ini
   httpd.conf
 
 Closest you have is .htaccess  But, if you don't want
 to worry about it, just use echo as someone already
 suggested, instead of embedding it.  Something like:
 
   echo '?xml version=1.0 encoding=UTF-8';
 
 Btw, the question proposed in this thread is also a
 documented FAQ here:
 
   http://www.php.net/manual/en/faq.using.php#faq.using.mixml

Thanks, again. As someone just starting to learn php, I'm also just 
starting to learn where answers to my questions can be found.

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] ?xml version=1.0 encoding=UTF-8

2003-06-23 Thread Doug Essinger-Hileman

When I include ?xml version=1.0 encoding=UTF-8? in my html 
code, I get a parse error. The version is 4.1.2; phpinfo() reports 
that XML support is turned on. Can anyone help with this?

Doug



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ?xml version=1.0 encoding=UTF-8

2003-06-23 Thread Doug Essinger-Hileman

On 23 Jun 2003 at 13:22, CPT John W. Holmes wrote:

 The first two characters are opening up a PHP block of code, so you
 get a parse error. Either disable short open tags in php.ini, 

I don't have access to php.ini. Can I do this on a script by script
basis with

ini_set(short_open_tag, off)

Doug


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] imagettftext - font size randomly changes

2003-06-06 Thread Doug Dossett
Hello all,

I'm using the following code to create images on the fly on a web site for page 
headers.  This works great for the most part, but a couple times now the text has 
started resizing for no apparent reason.  The first time it was just slightly wider 
than 
normal.  Most recently the text was giant.  I'm running PHP 4.3.1 on Win2k Server.   

Code:

header(Content-type: image/jpeg);
$im = imagecreate(200,14);
$white = imagecolorallocate($im, 255,255,255);
$green = imagecolorallocate($im, 51,102,0);
$shadow = imagecolorallocate($im, 204,204,153);
imagettftext($im, 12, 0, 1, 14, $shadow, arialbd.ttf, $imgText);
imagettftext($im, 12, 0, 0, 13, $green, arialbd.ttf, $imgText);
imagejpeg($im);
imagedestroy($im);

If I restart IIS, the problem goes away.  Has anyone else seen this problem, know 
why this might be happening and/or have a fix?   

Thanks much,

Doug Dossett, LLC
www.dougdossett.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] need a reliable PHP host

2003-03-27 Thread Doug Parker
Hi everyone - I need suggestions for a reliable PHP/mySQL host that has 
cURL support WITH https capability.  The site is e-commerce, but is 
mainly a statistics site that relies on frequent mysql requests, rather 
than numerous transactions.  The only transaction is the site 
subscription fee.  I could also use suggestions for a reliable Credit 
Card processor.  If anyone has experience with this and can point me in 
the right direction, I would REALLY appreciate it.  I'm having alot of 
trouble with shoddy hosting and a terrible cc processor right now, I 
really need to know which direction to take.

Thanks - Doug

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] looking for advice on PHP server

2003-03-24 Thread Doug Parker
My server has cURL built into its php module, but it doesn't support 
SSL, and thus doesn't support requests to secure servers, i.e. https. It 
was an effort in itself to get them incorporate cURL, and I was just 
wondering if I should move immediately to a new host - if this were just 
ridiculous.  I needed cURL badly in order to process credit card 
transactions, now I don't even have the option.  I supposed I could use 
the PHP wrapper with the API, but it looks difficult and the processing 
company (Linkpoint) really doesn't seem to have their stuff together as 
far as support goes, or anything for that matter.  What should I do?  If 
I should move, could anyone suggest a decent host that could handle the 
aforementioned?

any help would be greatly appreciated...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Encoding /'s

2003-03-15 Thread Doug Coning
Hi All,

When my PHP page sends text that is being passed in, it places an / in
front of the apostrophe.  How do I encode or decode this when I am outputing
the variable?

Thanks,

Doug Coning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] imagejpeg and downloading images

2003-03-11 Thread Doug Coning
Hi All,

I'm using the following code to try to download images automatically from a
directory:

header('Content-Type: image/jpeg');
$im = imagecreatefromjpeg(001_SM77GR.jpg);
imagejpeg($im,'',85);
imagedestroy($im);

I copied this code from PHP.net.  However, when I run the above code, it
doesn't download the image, it just shows the image in the browser.  I'm
using IE 6 for my browser.

How I get PHP to download this image?

Thanks!

Doug Coning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] imagejpeg and downloading images

2003-03-11 Thread Doug Coning
Thanks to everyone for their help.

The code below worked great!  Thanks,

Doug Coning
- Original Message -
From: adrian [EMAIL PROTECTED] [EMAIL PROTECTED]
To: Doug Coning [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 11:57 AM
Subject: Re: [PHP] imagejpeg and downloading images


 try changing headers sent e.g

 header(Content-type: application/octet-stream);
 header(Content-Disposition: attachment; filename=001_SM77GR.jpg);

 $im = imagecreatefromjpeg(001_SM77GR.jpg);
 imagejpeg($im,'',85);
 imagedestroy($im);

 - Original Message -
 From: Doug Coning [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, March 11, 2003 4:40 PM
 Subject: [PHP] imagejpeg and downloading images


  Hi All,
 
  I'm using the following code to try to download images automatically
from
 a
  directory:
 
  header('Content-Type: image/jpeg');
  $im = imagecreatefromjpeg(001_SM77GR.jpg);
  imagejpeg($im,'',85);
  imagedestroy($im);
 
  I copied this code from PHP.net.  However, when I run the above code, it
  doesn't download the image, it just shows the image in the browser.  I'm
  using IE 6 for my browser.
 
  How I get PHP to download this image?
 
  Thanks!
 
  Doug Coning
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] quick question

2003-03-10 Thread Doug Parker
I'm sending credit card info to a 3rd party credit card processing site. 
 I would like to keep the inputted values and, after the approval, have 
them appear in the value part of the form so that they don't have to 
re-input the same values they had just put in for the credit card.  how 
can i do this?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] form submission and storing variables

2003-03-10 Thread Doug Parker
I'm sending information to be processed by a third party site.  I need 
to store the inputted information in my site, via session or whatever, 
at some point.  However, the 3rd part site only accepts the information 
via a POST form submission, so I can't record the variables, then 
redirect them to the 3rd party site via a header function.  What should 
I do?

any help would be greatly appreciated.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] quick question

2003-03-10 Thread Doug Parker
Right - but the problem is, the form is submitting to another site, so i 
don't have a way to store the variables.   I could put them in session 
variables, but I would have to create another script and then forward 
the form submission to the outside side.  This isn't working because the 
 outside site requires the variables to be submitted via a form, or 
POST i guess.  I don't even know if I'm going about this the right way - 
I just need to somehow store variables on my site that are submitted for 
processing to another site, so that when the user is sent back from that 
other site, i can put the values in the form fields of a new page.

Cpt John W. Holmes wrote:

I'm sending credit card info to a 3rd party credit card processing site.
 I would like to keep the inputted values and, after the approval, have
them appear in the value part of the form so that they don't have to
re-input the same values they had just put in for the credit card.  how
can i do this?
So put the value in the value attribute of your text box.

input type=text name=cc_number value=?=$_POST['cc_number']?

substitute $_POST['cc_number'] with whatever you send to the processing
site.
---John Holmes...




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Redirect...

2003-03-10 Thread Doug Coning
Hi all,

I'm running the below code to download a text file.  After the save as
window comes up, I can correctly save the document.  However, the browser
goes to a Action Cancelled error page.

Here's my code:

?
header(Content-type: application/text);
header('Content-Disposition: attachment; filename=variables.txt');
header('Content-Length: ' . strlen($send));
?

Am I suppose to redirect the page after it saves the file, and if so how
would I do that?

Thanks,

Doug Coning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP removing data...

2003-03-08 Thread Doug Coning
Hi all,

I'm trying to save a text file from my server to a client machine through
PHP and am using the following headers:

header(Content-type: application/text);
header(Content-Disposition: attachment; filename=variables.txt);

The header does save a text file from the server to my desktop alright, but
it strips everything in the text file.  I have a file named variables.txt
with nothing in it.  I have uploaded a text file that does have test data in
it.  Furthermore, I set all the user rights in Unix to Read / Write/Execute
but everytime PHP opens or saves it, it does so without any of the variables
I've entered.

Does anyone have a suggestion as to what I'm doing wrong?

Thanks

Doug Coning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Automatically Save Image?

2003-03-04 Thread Doug Coning
Hi,

I'm developing a flash site that uses PHP and MySQL to pull in images.  My
client would like to have a button in flash underneath the images he has
shown that would enable the viewer to download the images to their own
harddrive.

I know I could set it up to open the picture in a new window and have the
viewer 'right' click on it and select Save.  But is there anyway to automate
this so that Flash would open the URL that would automatically open the
Save Picture window for saving to the person's harddrive?

Thanks,

Doug Coning




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [PHP-DB] Random not working?

2003-03-01 Thread Doug Thompson
This recent thread from the mysql list explains a lot about the
problem.
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:15034


hth,
Doug

On Sat, 1 Mar 2003 12:24:57 +0100, Frank Keessen wrote:

Hi All,

I'm trying to get a random record each time this script runs; Only it's giving me 
everytime the first record back.. No random at all..

// generate and execute query
$query = SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 
1;
$result = mysql_query($query) or die (Error in query: $query.  . mysql_error());
$row = mysql_fetch_object($result);
echo $row-naamstad;


Version info;

PHP 4.3.1
Mysql 3.23.54 

When i'm trying to excute the SELECT statement in phpmyadmin; i'm only getting the 
first record back and when i'm taking off the LIMIT 1 it will display all the records 
in ascending order so also not in random..


Regards,

Frank









-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] refreshing scripts a problem

2003-02-18 Thread Doug Parker
I'm having trouble with my php scripts running on my local machine.  I'm 
running winXP, apache, and for the most part, everything runs ok.  But 
sometimes the scripts will refresh rapidly for a few seconds, and then 
give up - This page cannot be displayed.  It seems to happen more 
often when I'm sorting a query that i had run in phpMyAdmin, and 
sometimes in normal scripts as well.  Everything works fine on a remote 
server.  Is there a setting I can change here?  this is getting really 
annoying.

any help would be greatly appreciated.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] need apostrophe solution

2003-02-15 Thread Doug Parker
OK - thanks.  I saw that the magic_quotes_gpc is turned off by default, 
so I did a ini_set(magic_quotes_gpc, 1) to turn it on temporarily.  I 
ran a get_magic_quotes_gpc() and saw that the ini_set did work, but for 
some reason the query still won't accept the quotes.  What am i doing wrong?

thanks again, doug

Chris Shiflett wrote:

--- drparker [EMAIL PROTECTED] wrote:


i need to escape all my apostrophes in values submitted to a mySQL
database.



http://www.php.net/manual/en/function.addslashes.php



is there a way i can loop thru all the post variables and replace the
apostrophes?



Read about the magic_quotes setting in your php.ini.

Chris






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] need apostrophe solution

2003-02-15 Thread Doug Parker
So you're saying that I have to turn on magic_quotes_gpc in php.ini in 
order for it to work?  the ini_set won't work?

Leif K-Brooks wrote:

Magic_quotes has already done (or not done) its job by the time your 
script runs.

Doug Parker wrote:

OK - thanks.  I saw that the magic_quotes_gpc is turned off by 
default, so I did a ini_set(magic_quotes_gpc, 1) to turn it on 
temporarily.  I ran a get_magic_quotes_gpc() and saw that the ini_set 
did work, but for some reason the query still won't accept the 
quotes.  What am i doing wrong?

thanks again, doug

Chris Shiflett wrote:

--- drparker [EMAIL PROTECTED] wrote:


i need to escape all my apostrophes in values submitted to a mySQL
database.



http://www.php.net/manual/en/function.addslashes.php



is there a way i can loop thru all the post variables and replace the
apostrophes?



Read about the magic_quotes setting in your php.ini.

Chris











--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Save Image?

2003-01-06 Thread Doug Coning
Hi all,

I have a PHP page that returns products.  My client wants to have a button
beside each product that says Download.  When you click download, he wants
the Save Picture Window box to automatically open and allow the viewer to
select the location to save the image that he clicked DownLoad on.

Is this possible with PHP?

Thanks,

Doug




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Warning?

2002-12-30 Thread Doug Coning
Hi everyone,

I'm using Dreamweaver to create an insert page and after the record is
inserted I receive this error:

Warning: Cannot add header information - headers already sent by (output
started at
/home/virtual/site8/fst/var/www/html/admin_gs/products_insert.php:2) in
/home/virtual/site8/fst/var/www/html/admin_gs/products_insert.php on line 62

Line 58 - 62 is as follows:

  if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ?  : ?;
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
  }
  header(sprintf(Location: %s, $insertGoTo));

This same code works in my update page without an error.

If you can help, thank you

Doug




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Warning?

2002-12-30 Thread Doug Coning
Never mind.

http://www.agner.org/messageboards/docs/read-me.txt says that if there is a
space before the ?php that this error will return.  Sure enough.
Dreamweaver MX placed a space between an include tag and the next ?php tag.
Once I removed the space, it worked without error.

Doug




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Multiple forms

2002-12-30 Thread Doug Coning
Hi all,

I have an update page that has a form in it.

However, I want to add another form in the same page.  My current form acts
upon itself (i.e. Action = the same page).  If I set up another form to do
the same, how would my PHP determine with action submit button was acted
upon?

Currently, for the single form here is how it knows a form was submitted:

if ((isset($HTTP_POST_VARS[MM_update]))  ($HTTP_POST_VARS[MM_update]
== form1)) {

How would I test which form submitted the action?

Thanks and if I didn't make myself clear, I apologize.

Doug




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] approaching a relational database

2002-12-12 Thread Doug Parker
I'm about to embark on a project where I have to enter many, many fields 
into a MySQL database, and I don't know how to approach the database 
structure.  The data is statistics for a golf course.  There are 18 
holes, and each hole has a Red Tee Par, White Tee Par, and Blue Tee Par, 
which is 54 inputs already (18 x 3).  Then, there are about 5 more 
statistics I have to keep for each hole, making the total amount of 
inputs 144 (18 x 8).  There's about 7 more fields pertaining to the 
Course name, location, etc.  How the heck do I approach this?  I've 
successfully done relational databases before, but not to this scale. 
Does anyone have any suggestions as to how I should approach this?
I attached a .jpg of the form I'm using to input, just to clarify things.

Any suggestions would be greatly appreciated...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Beginner question : Removing spaces in forms

2002-12-12 Thread Doug Parker
I've solved similar things, i.e. removing commas from a number of text 
fields, by looping through the input boxes and doing a search/replace - 
all using Javascript via the onSubmit event.  This chunk of code removes 
commas from input boxes:

script
	for (var i = 0; i  form.elements.length; i++)
	{
		var pattern = /,/ig;
		var newString =  form.elements[i].value.replace(pattern,);
		form.elements[i].value = newString;
	}
/script

In your case, you'd just replace the , with a  .  I don't know of an 
easier way, though if one exists I'd would like to know about it.

Andrew Wilson wrote:

Hay guys i was wondering if there was a form parameter of something
equivalent for input text boxes that when a user enters a number or series
of numbers that it removes the spaces.
If there is no alternative how would you go about solving this issue.

Your help is appreciated. 
Thanks.


Netway Networks Pty Ltd 
(T) 8920 8877 
(F) 8920 8866 





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Select drop-down box overflow?

2002-12-10 Thread Doug Parker
I've got sort of an odd one here.  I'm populating a select drop down box 
 with a substantial number of options - actually every county in the 
U.S.- which is about 3000 results from a query.  The problem is that 
when I load the page, there are all kinds of weird problems, characters, 
you name it.  I'm wondering if theres's a limit to how many options I 
can have in a select drop down box?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Integer to decimal value.

2002-12-09 Thread Doug Parker
I know this seems easy, but I can't get it to work for the freaking life 
of me.  I have number that is an integer, lets say 15, and I need it to 
be 15.00, for a monetary value.  I've casted every which way to no avail.

Any help would be greatly appreciated.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Integer to decimal value.

2002-12-09 Thread Doug Parker
excellent.  thanks.

John W. Holmes wrote:


I know this seems easy, but I can't get it to work for the freaking


life


of me.  I have number that is an integer, lets say 15, and I need it


to


be 15.00, for a monetary value.  I've casted every which way to no


avail.

www.php.net/number_format

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] passing form variables with the same name

2002-12-05 Thread Doug Parker
I'm passing form variables from a script that is meant to display 
information to be updated in a mysql database, and it sends these to a 
script that updates the changed values.  The problem is, I have a number 
of the same field being passed.  For example, I have two fields in an 
html form - Resource and Task, that need to be updated in a specific 
table, let's call it Projects.  However, I need to update every Resource 
and Task in table Projects.   So if there were 5 rows in Projects, the 
script would display the values for Task and Resource for all 5 rows, so 
that would total 10 input boxes.  Obviously, I loop the display of these 
variables in input boxes as to get all 5 rows.  So in order to send the 
variables to the script that will update them, they need to be unique - 
right?  I can't have the input name=Resource  for each one, so in the 
loop on the form I resolved this by appending a number to each one - 
e.g. input name=Resource1, input name=Task1, input name=Resource2, 
... etc.  So now I have the unique variables I need, the problem is that 
I have no idea how to loop through them in the update script and update 
each one accordingly.   Can someone give me an idea how to do this?  I'd 
love to use an array, but I don't think you can pass an array value from 
a form and have it work on the update script - e.g. input 
name=Resource[0]...

any help would be greatly appreciated.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Is there a way to test for a file?

2002-10-08 Thread Doug Coning

Hi everyone,

I'm a PHP newbie and wanted to know if there is a way to test for a file.
The reason I'd like to do this is because I'm writing a query to return
items from a catalog.  However, if the client hasn't uploaded a picture or
if the picture is misteriously missing from the image folder, instead of
returning the product with the infamous missing jpeg picture, I would rather
the product be skipped altogether.

I'd like PHP to check to see if the image/picture.jpg exists before
returning the picture.  Is this possible?

Thanks!

Doug Coning
American Web Studio
www.americanwebstudio.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] quick mysql question

2002-09-27 Thread Doug Parker

where can i find info on setting up a mysql database on a remote server? 
  i know how to set them up on a local machine, but i can't figure out 
how to get to the command line setting on a remote server...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] quick mysql question

2002-09-27 Thread Doug Parker

jon - thanks for the reply.
i tried this:

prompt ssh server.net

i got an open failed: no such file or directoy

does that mean that ssh is not enabled on the server?  i pinged the 
server and it said it was alive...

Jon Haworth wrote:

 Hi Doug,
 
 
where can i find info on setting up a mysql 
database on a remote server? i know how to 
set them up on a local machine, but i can't 
figure out how to get to the command line 
setting on a remote server...

 
 me@mybox:~$ ssh my.remote.server
 
 Or am I missing something?
 
 Cheers
 Jon
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MySQL vs. basic text file

2002-09-23 Thread Doug Parker

often i use text files at my data sources, delimted by the | symbol. 
i simply delimit the fields of each line, then when i need to open them, 
i open the text file, populate an array with each line, then explode the 
fields for each to get the corresponding values.   i use this method for 
catalogs - and even backend interfaces, for which the client can 
add/edit/delete products.  everything seems to be working fine, and 
there doesn't seem to be a need for MySQL or anything.  i was wondering 
if there is anything i'm not thinking of that perhaps would push me to 
favor using php and mysql instead of the plain old text file.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP User Permissions

2002-09-13 Thread Doug Kozar

Does anyone know how to define a PHP script (within itself) to run as a
certain user. Currently my PHP scirpt runs as nobody and I need to change
the user it runs as temporarily to get certain permissions to update a file.
Thank you.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP EXEC();

2002-09-12 Thread Doug Kozar

Does anyone know why the following script will not rebuild one of my
sendmail databases?

?
exec('/usr/sbin/makemap hash /etc/mail/virtusertable.db 
/etc/mail/virtusertable');
exit;
?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-12 Thread Doug Smith

Dan,

thank you for asking, i can actually connect to db2 via command line no
problem, i can even connect to the database via TCP/IP using the IBM DB2
Run-Time Client on a Win32 machine. Just having a problem with PHP
seemingly.

it's possible that i can't connect because it doesn't seem that i have
the DB2 Connect software installed according to ./db2setup could
that be possible?


__ connecting via CLP
[auser@ndn auser]$ su db2inst1
Password:
[db2inst1@ndn auser]$ db2 connect to thedb
   Database Connection Information

 Database server= DB2/LINUX 7.2.0
 SQL authorization ID   = DB2INST1
 Local database alias   = THEDB

thanks again,

-Doug



Dan Vande More [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Doug, can you log in via plain db2 in linux (sorry if you said you could, I
didnt read that far back).

Heres what I do:


*
[root@somelinuxbox /root]# su - db2inst1
[db2inst1@somelinuxbox db2inst1]$ /usr/IBMdb2/V7.1/bin/db2
(c) Copyright IBM Corporation 1993,2001
Command Line Processor for DB2 SDK 7.2.0

You can issue database manager commands and SQL statements from the command
prompt. For example:
db2 = connect to sample
db2 = bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG  for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 = CONNECT TO MYDB2DB user MICHAEL
Enter current password for MICHAEL:

   Database Connection Information

 Database server= OS/400 4.4.0
 SQL authorization ID   = MICHAEL
 Local database alias   = CMSFIL

db2 =

**

Names changed to protect my network!:)

Can you do that?


Thanks

Dan
-Original Message-
From: Doug Smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 7:02 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?


Matt,

I wish you were my boss :) I love MySQL and would want to use it instead
of db2 (seeing i could probably have had it working with php last week ;) )
but Somehow my boss loves to waste money on IBM products... and then
hires on people who don't know how to use them well (i.e. me!). My
philosophy is: don't waste money on it, if you can use some open source --
for example he wanted to use IBM WAS (websphere application server) but, PHP
will do everything we need to do, and is a lot easier to deal with than the
bulky WAS.

Anyways.

I had seen the IBM document that you referenced about connecting DB2 to
PHP, in fact, it's the main document i used to start attempting to get PHP
to work with DB2. The second doc you referenced from phpbuilder.net was
definately a good find -- had a couple ideas that i hadn't tried (i.e.
catalogging the db, running apache as db2inst1 [still trying to get that to
work, db2inst1 doesn't have the priviledges that root has, and henceforth
can't access all the files needed by apache])

Matt, thanks again for all your help!

    -Doug

Matt [EMAIL PROTECTED] wrote in message
047001c23f46$f7707c40$[EMAIL PROTECTED]">news:047001c23f46$f7707c40$[EMAIL PROTECTED]...
 It seems way too difficult to configure db2 on linux. Let alone trying to
do
 it on freebsd, which I hope to tackle that next week.

 I tell you though, I really love mysql, it's so easy to use, and
configure.
 mysql just works. mysql's performance on a table I have that has roughly
 250,000 rows of address entries, beats our as/400 with db2 by orders of
 magnitude  and  mytest box is a  Celeron 300.

 Anyway, this is where I found the solution to the gibberish line that I
put
 in my doc (see step 3) :

http://www7b.boulder.ibm.com/dmdd/library/techarticle/scott/0614_scott.html

 You may find this of help:
 http://www.phpbuilder.com/mail/php-db/2001011/0076.php

 Oh, did you call your instance db2inst1?





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-12 Thread Doug Smith

I fixed my DB2 + PHP problem. Turns out I didn't have DB2 Connect EE
installed -- which is required to work with PHP. ooops.

Thanks for all your help,

-Doug

Matt [EMAIL PROTECTED] wrote in message
047001c23f46$f7707c40$[EMAIL PROTECTED]">news:047001c23f46$f7707c40$[EMAIL PROTECTED]...
 It seems way too difficult to configure db2 on linux. Let alone trying to
do
 it on freebsd, which I hope to tackle that next week.

 I tell you though, I really love mysql, it's so easy to use, and
configure.
 mysql just works. mysql's performance on a table I have that has roughly
 250,000 rows of address entries, beats our as/400 with db2 by orders of
 magnitude  and  mytest box is a  Celeron 300.

 Anyway, this is where I found the solution to the gibberish line that I
put
 in my doc (see step 3) :

http://www7b.boulder.ibm.com/dmdd/library/techarticle/scott/0614_scott.html

 You may find this of help:
 http://www.phpbuilder.com/mail/php-db/2001011/0076.php

 Oh, did you call your instance db2inst1?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-09 Thread Doug Smith

Matt,

I wish you were my boss :) I love MySQL and would want to use it instead
of db2 (seeing i could probably have had it working with php last week ;) )
but Somehow my boss loves to waste money on IBM products... and then
hires on people who don't know how to use them well (i.e. me!). My
philosophy is: don't waste money on it, if you can use some open source --
for example he wanted to use IBM WAS (websphere application server) but, PHP
will do everything we need to do, and is a lot easier to deal with than the
bulky WAS.

Anyways.

I had seen the IBM document that you referenced about connecting DB2 to
PHP, in fact, it's the main document i used to start attempting to get PHP
to work with DB2. The second doc you referenced from phpbuilder.net was
definately a good find -- had a couple ideas that i hadn't tried (i.e.
catalogging the db, running apache as db2inst1 [still trying to get that to
work, db2inst1 doesn't have the priviledges that root has, and henceforth
can't access all the files needed by apache])

Matt, thanks again for all your help!

-Doug

Matt [EMAIL PROTECTED] wrote in message
047001c23f46$f7707c40$[EMAIL PROTECTED]">news:047001c23f46$f7707c40$[EMAIL PROTECTED]...
 It seems way too difficult to configure db2 on linux. Let alone trying to
do
 it on freebsd, which I hope to tackle that next week.

 I tell you though, I really love mysql, it's so easy to use, and
configure.
 mysql just works. mysql's performance on a table I have that has roughly
 250,000 rows of address entries, beats our as/400 with db2 by orders of
 magnitude  and  mytest box is a  Celeron 300.

 Anyway, this is where I found the solution to the gibberish line that I
put
 in my doc (see step 3) :

http://www7b.boulder.ibm.com/dmdd/library/techarticle/scott/0614_scott.html

 You may find this of help:
 http://www.phpbuilder.com/mail/php-db/2001011/0076.php

 Oh, did you call your instance db2inst1?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-08 Thread Doug Smith

Andrew,

I tried adding these lines to my php script...

putenv(LD_LIBRARY_PATH=/home/db2inst1/sqqlib/lib);
putenv(DB2INSTANCE=db2inst1);
// i assume that's the right way to create those statements

But... I didn't have any luck with that either :/ ..same error.

Thanks again,
-Doug


Andrew Hill [EMAIL PROTECTED] wrote in message
044701c23f14$d1f1b650$[EMAIL PROTECTED]">news:044701c23f14$d1f1b650$[EMAIL PROTECTED]...
Doug,

Have you tried setting the variables with putenv() ?

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Virtuoso Universal Server


-Original Message-
From: Doug Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 08, 2002 2:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

 I just checked my config, and I *actually* have that line in
apachectl.
Try
 that, and if it fixes it, I'll correct the doc.

although my apache is built via rpm, i put the line (.
/home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/
apachectl, bt...

unfortunately i'm still getting the

Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in
/var/www/html/db2php/db2lib.php on line 8

error...

i also tried to add export DB2INSTANCE=db2inst1 in the same script and
that didn't help either.

could the problem be that i'm starting httpd (or apachectl) as root? i
know
the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl
inherit the db2 environment variables, but.. somehow it's not
working :/

matt, thank you again :)

    -doug


p.s. for the record__
./configure
i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbind
ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--includedir=/usr/includ
e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs
--with-ibm-
db2








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-08 Thread Doug Smith

does this look like the ODBC SDK of unixODBC (not that i expect you to know
unixODBC)

/usr/lib/libboundparam.so.1
/usr/lib/libboundparam.so.1.0.0
/usr/lib/libesoobS.so.1
/usr/lib/libesoobS.so.1.0.0
/usr/lib/libgtrtst.so.1
/usr/lib/libgtrtst.so.1.0.0
/usr/lib/libnn.so.1
/usr/lib/libnn.so.1.0.0
/usr/lib/libodbc.so.1
/usr/lib/libodbc.so.1.0.0
/usr/lib/libodbccr.so.1
/usr/lib/libodbccr.so.1.0.0
/usr/lib/libodbcdrvcfg1S.so.1
/usr/lib/libodbcdrvcfg1S.so.1.0.0
/usr/lib/libodbcdrvcfg2S.so.1
/usr/lib/libodbcdrvcfg2S.so.1.0.0
/usr/lib/libodbcextras.so.1
/usr/lib/libodbcextras.so.1.0.0
/usr/lib/libodbcinst.so.1
(...it continues)

I found this from $rpm -q --list unixODBC ... somehow I was under the
assumption that IBM DB2 UDB came with a ODBC SDK -- i.e. this stuff...
/usr/IBMdb2/V7.1/lib/libdb2ccai.so.1
/usr/IBMdb2/V7.1/lib/libdb2ar.so
/usr/IBMdb2/V7.1/lib/libdb2.so
/usr/IBMdb2/V7.1/lib/libdb2qp.so
/usr/IBMdb2/V7.1/lib/libdb2apie.so
/usr/IBMdb2/V7.1/lib/libdb2jdbc.so
(which continues as well...)

or am i still missing something?

thanks again, and thanks for your patience too, i really appreciate it.

-doug

Andrew Hill [EMAIL PROTECTED] wrote in message
news:043601c23f0c$0d74efc0$[EMAIL PROTECTED]...
 Doug,

 You need an ODBC SDK - you should be able to find the libs in UnixODBC
 or simply use iODBC from www.iodbc.org

 Best regards,
 Andrew Hill
 Director of Technology Evangelism
 OpenLink Software  http://www.openlinksw.com
 Universal Data Access  Virtuoso Universal Server

 -Original Message-
 From: Doug Smith [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 08, 2002 10:11 AM
 To: Andrew Hill
 Subject: Re: [PHP] Re: can i use --with-unixODBC instead of
 --with-ibm-db2?

 Thanks for the suggestion.

 I tried issuing the command
 # export LD_LIBRARY_PATH=/usr/IBMdb2/V7.1/include/
  (which is where i found sql.h and sqlext.h to be living)

 Before I ran make install but, unfortunately it came up with the
 same
 errors.

 Well... Maybe it is time I head back to the drawing board and
 checkout iodbc -- thank you very much, I appreciate it.

 -Doug Smith

 Andrew Hill [EMAIL PROTECTED] wrote in message
 news:03f101c23eea$986d8960$[EMAIL PROTECTED]...
  Doug,
 
  You can try --with-iodbc if you like, there is a howto at
 www.iodbc.org.
  That being said, I think that you simply need to set LD_LIBRARY_PATH
 to
  the location of your ODBC SDK, so the .h files can be found.
 
  Best regards,
  Andrew Hill
  Director of Technology Evangelism
  OpenLink Software  http://www.openlinksw.com
  Universal Data Access  Virtuoso Universal Server
 
  -Original Message-
  From: Doug Smith [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, August 08, 2002 9:38 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Re: can i use --with-unixODBC instead of
 --with-ibm-db2?
 
  well i figured i'd try it...
 
  i run
  $ ./configure
  i386-redhat-linux --sysconfdir=/etc --with-unixODBC=shared
  --with-apxs=/usr/
  sbin/apxs
 
  $ make clean
 
  $ make install
 
  which returns this aweful mess :/
 
  Making install in odbc
  make[2]: Entering directory `/home/doug/php-4.2.2/ext/odbc'
  make[3]: Entering directory `/home/doug/php-4.2.2/ext/odbc'
  /bin/sh /home/doug/php-4.2.2/libtool --silent --mode=compile
  gcc -I. -I/home/dou
  g/php-4.2.2/ext/odbc -I/home/doug/php-4.2.2/main
 -I/home/doug/php-4.2.2
  -I/u
  sr/i
  nclude/apache -I/home/doug/php-4.2.2/Zend
  -I/home/doug/php-4.2.2/ext/mysql/l
  ibmy
  sql -I/usr/local/include -I/home/doug/php-4.2.2/ext/xml/expat
  -DLINUX=22 -D
  EAPI
   -DEAPI_MM -DEAPI_MM_CORE_PATH=/var/run/httpd.mm
  -I/home/doug/php-4.2.2/TSRM
   -g
  -O2 -prefer-pic  -c php_odbc.c  touch php_odbc.slo
  In file included from php_odbc.c:37:
  php_odbc.h:120:17: sql.h: No such file or directory
  php_odbc.h:121:20: sqlext.h: No such file or directory
  make[3]: *** [php_odbc.slo] Error 1
  make[3]: Leaving directory `/home/doug/php-4.2.2/ext/odbc'
  make[2]: *** [install-recursive] Error 1
  make[2]: Leaving directory `/home/doug/php-4.2.2/ext/odbc'
  make[1]: *** [install-recursive] Error 1
  make[1]: Leaving directory `/home/doug/php-4.2.2/ext'
  make: *** [install-recursive] Error 1
 
 
 
  how do i let php know where the sql.h / sqlext.h files are?
 
  TIA -- any ideas are appreciated.
 
 
 
  ___
  Doug Smith [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]...
   can i use --with-unixODBC instead of --with-ibm-db2?
  
   I've had a lot of trouble getting php to talk to IBM DB2 (see
   comp.databases.ibm-db2 for more info [if you want], ref DB2 / PHP /
   Redhat -- Tried Many Suggestions)
  
   But, I can get unixODBC to work with DB2, no problem (via the isql
  command,
   so i've got the .odbc.ini and odbcinst.ini all set)
  
   So, if I compile php --with-unixODBC and _not_ --with-ibm-db2 ---
 will
  i
  be
   able to make requests to the database using the unified ODBC
 commands
  in
   php -- i.e

Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?

2002-08-08 Thread Doug Smith

Dan,

Thank you for the link unfortunately, even after initally logging in
as db2inst1 and then su to root (w/o the dash) and stopping/starting
apachectl -- i still had no luck :/

same old error:
Warning: SQL error: , SQL state ËtøO@ÈØÿ¿6#A@ in SQLConnect
in /var/www/html/db2php/db2lib.php on line 11

Thank you very much though still, i appreciate the ideas :)

-Doug



Dan Vande More [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I used this:

Some of his info is wrong, or I had problems with, but hey, this worked:


*
Now we know DB2 works now to test it with PHP and Apache, first login as
user db2inst1 then su to the user root, dont use su - , cause this will make
the shell use the settings of root instead of db2inst1 and we need those
settings so Apache can find the DB2 Instances. Now first stop apache (if
started ofcourse) /usr/local/apache/bin/apachectl stop and start apache
/usr/local/apache/bin/apachectl start . Now create a file in de apache
docroot ( on my machine thats /usr/local/apache/htdocs/ ) called test.php
for example and fill it with the following example:


*

http://people.a2000.nl/nlvanrey/docs/install-db2-php-apache-linux.html


-Original Message-
From: Doug Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 08, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can i use --with-unixODBC instead of --with-ibm-db2?


 I just checked my config, and I *actually* have that line in apachectl.
Try
 that, and if it fixes it, I'll correct the doc.

although my apache is built via rpm, i put the line (.
/home/db2inst1/sqllib/db2profile) in apachectl and started httpd w/
apachectl, bt...

unfortunately i'm still getting the

Warning: SQL error: , SQL state ËtøO@Ùÿ¿6#A@ in SQLConnect in
/var/www/html/db2php/db2lib.php on line 8

error...

i also tried to add export DB2INSTANCE=db2inst1 in the same script and
that didn't help either.

could the problem be that i'm starting httpd (or apachectl) as root? i know
the . /home/db2inst1/sqllib/db2profile is supposed to make apachectl
inherit the db2 environment variables, but.. somehow it's not working :/

matt, thank you again :)

    -doug


p.s. for the record__
./configure
i386-redhat-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbind
ir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/includ
e --libdir=/usr/lib --sysconfdir=/etc --with-apxs=/usr/sbin/apxs --with-ibm-
db2








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Java Pop UP...

2002-06-26 Thread Doug Coning

Hi everyone...

I have a php page that return rows from a database.  I then have an href
link to the individual thread as such:

a href='73things_thread.php?threadID=.$row-postid.' target='_blank'.


This works, it opens a new window which has the detailed information needed.
However, how would I write java code into this to force it to open the
window at 300 by 255?  I know the java code for this is as follows:

onclick=MM_openBrWindow('73things_thread.php','Thread','scrollbars=yes,widt
h=300,height=255')

How do I merge the java code into PHP?

Thanks!

Doug Coning
Coning Consulting


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Another Pop-Up problem..

2002-06-26 Thread Doug Coning

Thanks all who have helped with my Javascript / PHP pop-up.

I've got it to work now where it will pop up a window.  However, now it
returns the same record each time.  So which ever record you click first, it
will bring that window up for each item.

How do I reset or clear out the value so that when you click a different
link it brings up the proper record.  You can see what I mean by visiting
the code at: http://www.coning.com/phptest/73things_view5.php.

Thanks!

Doug Coning


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Easy Date MySQL Question...

2002-06-25 Thread Doug Coning

Hi everyone,

I have searched the php.net and don't know where to look for the code I
need.  I have a MySQL date column that reads this way: 2002-06-25.  However,
in PHP I want to show it this way 06/25/2002.

Any assistance is greatly appreciated!!!

Thanks in advance.

Doug Coning
Coning Consulting
www.coning.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include statement errors -- something missing

2002-06-18 Thread Doug DeVries

I've tried a hundred different things -- YOURS WORKED! Thank you very much!

-Doug

- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Monday, June 17, 2002 10:45 PM
Subject: RE: [PHP] include statement errors -- something missing


So far so good. $myfile is now a pointer to this file, so you can't
print it like that. Use fgets() or something else to read your file.


Niklas


-Original Message-
From: Doug DeVries [mailto:[EMAIL PROTECTED]]
Sent: 18. kesäkuuta 2002 8:34
To: Chris Knipe; Doug DeVries; Php-General (E-mail)
Subject: Re: [PHP] include statement errors -- something missing


here is what I tried:

?php
$myfile=fopen(http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li
=yes
limit=4, r);
?
?php echo $myfile;?

-- but basically it returns me Resource ID#1 which makes me feel like
I am close.

Thanks again for your time and input. I've been learning a lot as I've
been researching for this issue.

-Doug

- Original Message -
From: Chris Knipe [EMAIL PROTECTED]
To: Doug DeVries [EMAIL PROTECTED]; Php-General (E-mail)
[EMAIL PROTECTED]
Sent: Monday, June 17, 2002 3:49 PM
Subject: Re: [PHP] include statement errors -- something missing


 Yes, you will.

 You've only opened the file, you need to read it, and process it and
extract
 the data that you want.

 i.e.. $blah = fopen(http://a/a.html, r);

 while ($blah) {
   do something with it
 }

 and so forth Try php.net / google.com there's lost of examples of
sites
 and pages using fopen to include data from other web sites...


 Kind Regards,

 Chris Knipe
 MegaLAN Corporate Networking Services
 Tel: +27 21 854 7064
 Cell: +27 72 434 7582

 - Original Message -
 From: Doug DeVries [EMAIL PROTECTED]
 To: Chris Knipe [EMAIL PROTECTED]; Doug DeVries
 [EMAIL PROTECTED]; Php-General (E-mail)
 [EMAIL PROTECTED]
 Sent: Tuesday, June 18, 2002 12:32 AM
 Subject: Re: [PHP] include statement errors -- something missing


  Thank you, but it is not quite working yet. I get no errors, but
  rather blank.
 
  http://www.solomonsporch.org/test.php
 
  - Original Message -
  From: Chris Knipe [EMAIL PROTECTED]
  To: Doug DeVries [EMAIL PROTECTED]; Php-General (E-mail)
  [EMAIL PROTECTED]
  Sent: Monday, June 17, 2002 12:55 PM
  Subject: Re: [PHP] include statement errors -- something missing
 
 
   RTFM
  
   http://www.php.net/manual/en/function.fopen.php
  
  
 

fopen(http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslim
it=4
   , r);
  
   Would give read-only access to the file, which is what you want.
  
  
   - Original Message -
   From: Doug DeVries [EMAIL PROTECTED]
   To: Chris Knipe [EMAIL PROTECTED]; Doug DeVries
   [EMAIL PROTECTED]; Php-General (E-mail)
 [EMAIL PROTECTED]
   Sent: Monday, June 17, 2002 9:36 PM
   Subject: Re: [PHP] include statement errors -- something missing
  
  
I tried fopen in the following way, but with no success.
   
?php
   
  
 

fopen(http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslim
it=4
);
?
   
   
- Original Message -
From: Chris Knipe [EMAIL PROTECTED]
To: Doug DeVries [EMAIL PROTECTED]; Php-General
(E-mail) [EMAIL PROTECTED]
Sent: Monday, June 17, 2002 12:33 PM
Subject: Re: [PHP] include statement errors -- something missing
   
   
 I don't think you can use include like that

 Have a look at fopen though, I'm not 100% sure that is going
 to
 help,
   but
I
 know fopen opens files on remote sites, include only does
 local.


 - Original Message -
 From: Doug DeVries [EMAIL PROTECTED]
 To: Php-General (E-mail) [EMAIL PROTECTED]
 Sent: Monday, June 17, 2002 9:27 PM
 Subject: [PHP] include statement errors -- something missing


  Help ... please. ...
 
  From the page www.solomonsporch.org/test.php I get the
  following
   error.
 
  Warning: Failed opening
 
 'http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit
   =4'
 for
  inclusion (include_path='c:\php4\pear') in
   e:\solomonsporch.org\test.php
 on
  line 10
 
  The page HTML is as follows:
 
  html
  head
  /head
  body
  test area should show 4 lines of news
 
 
  ?php
 

   
  
 

include(http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yesl
imit
  =4);
  ?
 
 
  /body
 
  /html
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
  
  
   --
   PHP General Mailing List (http

[PHP] subscription problem

2002-06-11 Thread Doug DeVries

Why am I getting all the messages from this newsgroup delivered to my
mailbox?

I subscribed to the newsgroup -- or at least that is all I wanted.

Thanks.

-Doug

- Original Message -
From: Jason Soza [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 11, 2002 9:36 AM
Subject: Re: [PHP] Different Problem [Re: Passing a Variable to PHP Via the
URL]


 Rather than just setting globals on in php.ini, try this:

 Your printf() line is:
 printf(Variables:  %s\nbr, $HTTP_GET_VARS[id]);

 And your if() statement is:
 if($id) {}

 Where is $id set? It's probably not. $HTTP_GET_VARS[id] doesn't set
 $id. If you want the id variable in your if(), you need:
 if($HTTP_GET_VARS[id]) {}

 Or alternately do:
 $id = $HTTP_GET_VARS[id]
 if($id) {}

 Although that's not necessary. Also, try using $_GET[id], as
 $HTTP_GET_VARS[] has been deprecated in newer versions.

 HTH,

 Jason Soza

 - Original Message -
 From: [EMAIL PROTECTED]
 Date: Tuesday, June 11, 2002 8:16 am
 Subject: [PHP] Different Problem [Re: Passing a Variable to PHP Via the
 URL]

  I found out that in fact PHP is creating a variable with the name
  and value I'm passing through a URL from the querystring.  But
  it's still not working as planned.
 
  The url server/test.php?id=1 creates the following results in my code:
 
  printf(Variables:  %s\nbr, $HTTP_GET_VARS[id]);
 
  This line works - there IS a variable named 'id' in my page and it
  has the correct value, 1.
 
  if ($id) {}
 
  This fails.  If I test 'id' instead of '$id' then it works but my
  page doesn't seem to equate 'id=1' with the presence of $id.
 
  $result = mysql_query(SELECT * FROM employees WHERE id=$id,$db);
 
  This doesn't work - again it seems $id isn't being treated
  properly.  I get this error:
 
  Warning: mysql_fetch_array(): supplied argument is not a valid
  MySQL result resource
 
  If I hardwire my page with the line '$id=1;' before the if
  statement and the query everything works.
 
  So why isn't the variable from my URL being treated properly?
 
  Jesse
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Fw: include() statement goofing me up - help

2002-06-11 Thread Doug DeVries

Subject: include() statement goofing me up - help


 Can anyone let me know what I am doing incorrectly on the following page:

 http://www.solomonsporch.org/test.php

 The news clips that should appear are a service from another site and I
 simply want to include them on my page, but I am getting an error.

 The include() statement or link
 http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4
works
 when typed as a regular URL so I figure it must be my issue.

 Thanks.

 -Doug





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Fw: include() statement goofing me up - help

2002-06-11 Thread Doug DeVries

I've changed the source file on this issue. Slightly different error, but
still no joy. Thanks for taking the time with this.

html
head
/head
body
test area should show 4 lines of news


?php
include
(http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4;)
?


/body

/html

- Original Message -
From: Leotta, Natalie (NCI/IMS) [EMAIL PROTECTED]
To: 'Jay Blanchard' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, June 11, 2002 10:30 AM
Subject: RE: [PHP] Fw: include() statement goofing me up - help


 That may be the case, but I had assumed the show() was a function in the
 file that should be included.

 When I include files and it doesn't work (I've only started trying today
and
 discovered the beauties of the include_path) it says:
 Fatal error: Failed opening required 'includeFile.inc'
 (include_path='.:/opt/net/utils/lib/php') in /prj/web/.../file.php on line
4

 So I would guess that his include() is working and there either is no
show()
 in the file or he isn't actually including it, which goes back to your
idea.
 Hopefully he'll give us more info :-)

 -Natalie

 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 11, 2002 1:27 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Fw: include() statement goofing me up - help


 you are getting the error

 Fatal error: Call to undefined function: show() in
 e:\solomonsporch.org\test.php on line 9

 show() is not a function, try include()


 Jay

 Wouldn't it be great if lists were like the Magic 8 Ball or a Quija
board?



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] dumb guy needs smart answer

2002-06-06 Thread Doug

I get the following error statement from a PHP insert I am trying at
http://www.solomonsporch.org/test.php

Warning: Failed opening
'http://www.gospelcom.net/mnn/includes/pubNewsTease.php?li=yeslimit=4' for
inclusion (include_path='c:\php4\pear') in e:\solomonsporch.org\test.php on
line 12

I really don't know what I am doing -- but would sure appreciate getting
this working. My host seems to be all set up.

Thanks for your time!

-Doug



[PHP] Looking for a PHP/MySQL Developer for short project

2001-10-01 Thread Doug Daulton

Folks,

I am relatively new to PHP  MySQL.  I took on a side project some months
ago which I now realize is over my head.  The project is a real estate
catalog.  I adapted the catalog system from Welling and Thomson's PHP 
MySQL Web Development from SAMS.

I really need to wrap this project up.  So, I am looking for someone whose
skills are strong and has time to connect all of the dots in the
modifications I've made.  The Database is built and I've not strayed to far
from the original PHP, so I think this should be relatively simple for
someone with lots of dev experience in this environment.

If you are interested in working on this, please email me at
[EMAIL PROTECTED]  Please include your number of years experience in
this environment, hourly rate, current availability, links to some sample
sites and two professional references.

Regards,

Doug Daulton
Ursa Studios





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] scoping: can someone explain to me if this should/should not work?

2001-09-26 Thread Doug Farmer

The following code seems to work in general but everyone once in a while I'm
getting a segmentation fault.  Can someone explain to me why this would be
intermittent and/or whether or not it should work?

function getDomain($serverName)
{
 $result = $serverName;
 // some processing to result occurs here
 echo here 3: $resultbr;
 return $result;
}

function test()
{
global $SERVER_NAME;
echo here 1br;
$domain = getDomain($SERVER_NAME);
echo here 2br;

}

When I get a segv, I get the output:

here 1
here 3: appropriate value here

The here 2 is not displayed.  I thought that this would a return by copy
and not have an issue.

- doug



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: corrupted definitions

2001-09-13 Thread Doug Farmer

Further info:

I'm on Redhat Linux 6.2.  The uname output is Linux web2 2.2.13-0.13smp #1
SMP Tue Jan 11 13:26:01 EST 2000 i686 unknown.

Also, the problem goes away if I set display_errors in php.ini to Off.   Can
someone explain?  I'm guessing a memory overrun somewhere.

Note that on another machine running Redhat Linux 6.1 with a uname output of
Linux web3 2.2.16-3smp #1 SMP Mon Jun 19 19:00:35 EDT 2000 i686 unknown,
the problem does NOT occur even if display_errors in php.ini is set to On.

- doug


Doug Farmer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have definitions (i.e. define (a, b);) that are being corrupted in
 php-4.0.6 in apache 1.3.20 on Redhat linux from Jan. 11.

 Anyone seen this?  Any solutions?







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Call to undefined function problem

2001-09-12 Thread Doug Farmer


Typo in my explanation.  I had defined in my code.  Nice catch though.


However, I'm running into more define issues.  When I get to a file through
a redirect via header(Location: /newfile.php), my defines are existing as
tested by defined but the values are all corrupt.  However, if I then
refresh the page, the value is good.   Anyone else seen this in php-4.0.6?
Can someone explain to me what is fixed for defines in the 4.0.7 candidate?



Andrey Hristov [EMAIL PROTECTED] wrote in message
01ce01c13a93$a4fd6d00$0b01a8c0@ANDreY">news:01ce01c13a93$a4fd6d00$0b01a8c0@ANDreY...
 if (!define(__FUNCTIONS__) )
 must be:
  if (!defined(__FUNCTIONS__) )



 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 BALANCED SOLUTIONS


 - Original Message -
 From: Doug Farmer [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, September 11, 2001 6:50 AM
 Subject: [PHP] Call to undefined function problem


 
  I'm doing the following:
 
   test.php -
  ?php
  require(functions.php);
  require();  // several other requires here
 
  setNoCacheHeaders();   // this is line 16
 
  // other stuff here
  ?
 
  -- functions.php -
  ?php
 
  if (!define(__FUNCTIONS__) )
  {
  define( __FUNCTIONS__, 1, 1 );
 
  // a bunch of other defines here
  echo here 1br;
  function setNoCacheHeaders( ) {
  static $headersNotSet = TRUE;
 
  if ( $headersNotSet ) {
  header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in
the
  past
  header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
//
  always modified
  header(Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
  header(Pragma: no-cache);  // HTTP/1.0
  $headersNotSet = FALSE;
  }
  }
  echo here 2br;
 
  // a few more functions here
 
  }
 
  
 
  My output is
  here 1
  here 2
 
  Fatal error: Call to undefined function: setnocacheheaders() in
  $DOCUMENT_ROOT/test.php on line 16
 
  Can someone explain?  I found something similar in the archives but no
  answer was given.  This exact code worked under php3.  The only changes
in
  the files were files ending in php3 were changed to end php.  I also had
2
  classes that I was using that had initializers in the variable
declaration.
  I moved the initialization to constructors.
 
  Note that on some clients the request goes through w/o errors.  This is
  intermittent but consistent on a per client basis.
 
  - doug
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] corrupted definitions

2001-09-12 Thread Doug Farmer

I have definitions (i.e. define (a, b);) that are being corrupted in
php-4.0.6 in apache 1.3.20 on Redhat linux from Jan. 11.

Anyone seen this?  Any solutions?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Call to undefined function problem

2001-09-10 Thread Doug Farmer


I'm doing the following:

 test.php -
?php
require(functions.php);
require();  // several other requires here

setNoCacheHeaders();   // this is line 16

// other stuff here
?

-- functions.php -
?php

if (!define(__FUNCTIONS__) )
{
define( __FUNCTIONS__, 1, 1 );

// a bunch of other defines here
echo here 1br;
function setNoCacheHeaders( ) {
static $headersNotSet = TRUE;

if ( $headersNotSet ) {
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);// Date in the
past
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); //
always modified
header(Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header(Pragma: no-cache);  // HTTP/1.0
$headersNotSet = FALSE;
}
}
echo here 2br;

// a few more functions here

}



My output is
here 1
here 2

Fatal error: Call to undefined function: setnocacheheaders() in
$DOCUMENT_ROOT/test.php on line 16

Can someone explain?  I found something similar in the archives but no
answer was given.  This exact code worked under php3.  The only changes in
the files were files ending in php3 were changed to end php.  I also had 2
classes that I was using that had initializers in the variable declaration.
I moved the initialization to constructors.

Note that on some clients the request goes through w/o errors.  This is
intermittent but consistent on a per client basis.

- doug





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >