[PHP] "report" generation with PHP

2001-07-16 Thread Matthew Garman


Hello:

I wrote an small web application that interfaces a Microsoft Access
database.  The database is fairly small and simple: it is a listing of
employees, their phone number(s) and their department.  My interface
allows folks to view the phone list, search for a name, list by
department, etc., and allows certain users to update the phone book (add
employees, change phone numbers, etc).  It's a fairly "typical" phonebook
application.

The Access database has a macro in it that allows for the generation of a
report.  The report is a nicely formatted listing of all the employees and
their phone numbers, grouped by department.  Everybody fits on one page.
The whole purpose of this report is to be printable, and so that the one
page phone list can be distributed throughout the factory.

Now I want to be able to generate this report from the web.  It doesn't
have to use Access (and I would prefer that it didn't, so I can convert to
MySQL).  But I don't know of a nice (and easy!) way to generate such a
report.  Using HTML tables isn't acceptable---when you print, you still
get the header and footer that the browser adds (and it's unacceptable to
have everyone modify their browser's setup).  Furthermore, the printable
list has to look as close as possible to the original, because if I start
changing formats, people will get upset.

So I'm not really too sure where to start on this one.  If anyone could
offer some suggestions, and point me in the right direction, it would be
sincerely appreciated!

Thanks,
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"




-- 
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] php file extensions with IIS

2001-07-16 Thread Matthew Garman


I installed PHP 4.0 on an MS Windows 2000 server (running IIS 5.0).  It
processes files whose extension is ".php" but displays files with ".php3"
and ".php4" extensions as text.

I might have specified such behavior in the original installation.  But
now I can't find out where to associate other extensions with the PHP
engine.  Mainly I want to install the phpMyAdmin package to get started
with MySQL (and get rid of MS Access :), but all the PHP files in that
package are named with ".php3" or ".php4" extensions.

By the way, I've been using Linux exclusively for the last few years, so
I'm not too Windows savvy.  But I'm working at an internship where
everything is Windows-based, so I'm a bit lost (but feeling more at home
by using great open source packages like PHP and MySQL :)

Thanks!
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"




-- 
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] "report" generation with PHP

2001-07-16 Thread Matthew Garman

On Mon, Jul 16, 2001 at 05:19:41PM +0300, Marius Andreiana wrote:
> În 16 Jul 2001 09:07:17 -0500 garman a scris:
> > I forgot to mention that I already looked into the PDF extensions.
> > Although 
> > it looks like it would do exactly what I want, the PDFLib isn't free for 
> You can generate xml in php, write xsl to convert xml in xml-fo
> and then use fop to generate pdf, it really works :)
> http://xml.apache.org/fop/index.html

Does all that work under Windows?  Fop looked like it was part of the
Apache project, and we're running IIS 5.0 on Windows 2000 Pro (not my
decision!).

Thanks again!
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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] image "forwarding" through a proxy?

2001-07-16 Thread Matthew Garman


At the organization I'm interning at this summer, we have an intranet web.
My job is to update, maintain and enhance it.

On the main intranet web page, there's a weather channel "magnet" that
displays the local weather conditions.  Now, since not everyone has
inTERnet access, some people simply can't see the magnet.

I'd like to write a little PHP script that gets the magnet from the
weatherchannel.com site and "forwards" it to the inTRAnet web page.  This
way, everyone will be able to see the weather info (and not just an ugly
broken link).

Making the problem slightly more complicated is that all inTERnet traffic
has to go through a proxy.

I already wrote something similar to allow anyone (regardless of 'net
access) to use an external paging site.  I opened a socket to the proxy,
and sent an HTTP POST query, then read from the socket until eof to get
the reponse.

I modified this to pull data from the weatherchannel.com site (using an
HTTP GET request with via a socket to the proxy).  Now I know I can
actually pull the data, because I had the script echo everything the
socket returned, which (as expected) was the HTTP headers
(Content-type..., etc) then a bunch of nonsense (i.e., the binary image
data).

So I tried to write this script so that it accepted a GET parameter which
is the URL of an image to retrieve.  Then on the main webpage of the
intranet site, I used an HTML tag that looked like this:

img src="myscript.php?url=http://host.com/path/to/image.jpg";

(obviously surrouned in greater than/less than signs), but the image
doesn't display.  My php script looked at the variable $url for the
location of the image file.

I'm not sure if I need to put some extra code in somewhere, or what.
Furthermore, the url to the weather channel magnet is actually script, so
it has it's own GET parameters :)

Anyone have any suggestions on how to tackle this?

Thanks!

Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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] learning PHP from scratch

2001-07-17 Thread Matthew Garman

On Tue, Jul 17, 2001 at 04:55:11PM +1000, Jason Rennie wrote:
> > > This approach worked pretty well with previous people i teached 
> > > PHP, but they already had some sort of programming background. 
> > > This guy hasn't. I find that he has some difficulties picking 
> > > it up. And I have some difficulties to further help him. 
> > 
> > Is he having problems with PHP, or database interaction with PHP?
> 
> It sounds like he might be having problems with the basic programming
> concepts.
> 
> Are you teaching him and then getting the guy to actaully try some for
> himself ?
> 
> Start with something really basic, (hello world) and get him to do a
> couple of dynamic things that dont use the database, then introduce the db
> slowly. 

After the "hello world," I would have him print it 10 times.  First let
him hardcode 10 echoes, then show him how a for loop works.  Since the
concept is almost the same, once he understands the for loop, have him do
it on his own with a while loop.

To expand on that, you might have each iteration of the loop print in
different formatting, e.g. , , .

Then have him build an array of strings, and use a for loop to create an
(un)ordered list from the array .  Then have him build a 2D array
and create a table from it.

The next step might be to have him create an HTML form that accepts a
number from a user in a text box.  The user enters a number, and
submitting calls a PHP script that prints "hello world" as many times as
the input specified.

Just some suggestions, hope they help,
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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] Re: a good PHP editor

2001-07-18 Thread Matthew Garman

On Wed, Jul 18, 2001 at 06:43:55PM -0400, Tom Malone wrote:
> I think that both TextPad and NoteTab are excellent editors, with TextPad
> being the better of the two.

If it hasn't been mentioned already, check out vim (www.vim.org).  I got
hooked on it using by using Linux.  This summer I'm interning at a place
where there is no alternative to Windows.  Fortunately, vim has been
ported to win32...

Of course non-Unix folks might find vi-like editor kind of goofy... but
it's worth a try, you might like it :)

MG

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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] inserting free-form text with quotes to mysql

2001-07-21 Thread Matthew Garman


Ahh yes, that was exactly what I needed.  (I knew it was simple!)

But that brings up another question: whenever I have POST information
propagate over more than one page, is it generally a good idea to *always*
use htmlspecialchars () on my data?

I.e., even if the data shouldn't need htmlspecialchars () (numbers for
example), it seems like it wouldn't hurt to use that function just to make
sure nothing is lost.

Thanks again!
Matt

On Fri, Jul 20, 2001 at 02:18:09PM -0500, Brad S. Jackson wrote:
> And when you print the value back on the verification page, call
> htmlspecialchars() on the value.
> 
> echo " "\">";
> 
>> Whenever I try to submit text that contains a double quote character ("), the
>> submission gets truncated at the first occurance of a double quote and beyond.
>>  Single quotes don't seem to be problematic.

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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] PHP.... i suck at it

2001-07-22 Thread Matthew Garman


Well, there are a few ways to do it.  The secret is to know a little bit
of HTML.  Another poster suggested using the  (line break) tag.  The
paragraph tag would also work nicely:

IP ADDRESS";
echo "$remote_admin";
?>

Or you could start to get fancy by doing it with a table:

";
echo "IP ADDRESS";
echo "$remote_admin";
echo "";
?>

When I'm writing code such as the above, though, I usually do something
more like this:


IP ADDRESS



Hope that helps!
Matt

On Sun, Jul 22, 2001 at 05:46:30PM -0700, Kyle Smith wrote:
> Ok this may sound really pathetic but how do i add a new line (like a space) to a 
>code like this
> 
>  echo "IP ADDRESS";
> 
> echo $remote_admin;
> ?>
> 
> cause when i try the code out it looks like 
> 
> IPADDRESS127.0.0.1
> 
> and i want it to look like
> 
> IP ADDRESS
> 127.0.0.1
> 
> or 
> 
> IP ADDRESS
> 
> 127.0.0.1
> 
> so what do i put in?
> 
> Thanks for your time :)

-- 
Matt Garman, [EMAIL PROTECTED]
"I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray..."
-- Pete Townshend/The Who, "Won't Get Fooled Again"


-- 
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]