php-general Digest 5 Jun 2004 03:07:41 -0000 Issue 2803
Topics (messages 187622 through 187659):
Re: php as CGI and $_POST
187622 by: Curt Zirzow
187627 by: David T-G
187631 by: Peter Risdon
187632 by: Curt Zirzow
187635 by: David T-G
187639 by: Curt Zirzow
187641 by: David T-G
Re: Compiling PHP with mnoGoSearch fails
187623 by: Curt Zirzow
187625 by: Aaron Gould
187636 by: Aaron Gould
187642 by: John Nichel
187644 by: Aaron Gould
187658 by: raditha dissanayake
script location
187624 by: Gabe
187626 by: Matt Matijevich
187628 by: James Harrell
187629 by: David T-G
187633 by: Gabe
187634 by: Gabe
187638 by: Curt Zirzow
187640 by: John W. Holmes
187643 by: Ben Ramsey
187647 by: Daniel Clark
Re: Current URL
187630 by: Stephen Craton
Re: Best way to sort?
187637 by: Ra�l Castro
Mapping solutions
187645 by: Ren� Fournier
Re: Asuming query without the ?
187646 by: Robert Winter
HTTP_REFERER
187648 by: Steve Douville
187649 by: John Nichel
187650 by: Stephen Lake
187651 by: Steve Douville
PHP and Apache Authentication
187652 by: Glenn MacGregor
187653 by: Matt Matijevich
Error Downloading files using FOpen
187654 by: Gerald Winkler
187655 by: Matt Matijevich
187656 by: Gerald Winkler
187657 by: John W. Holmes
table formatting
187659 by: BigMark
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
* Thus wrote David T-G ([EMAIL PROTECTED]):
>
> and know that it works as intended, but now I seem completely unable to
> get any $_POST (or even $_GET) data into the script. I suspect, from
> reading the manual and noting the warnings, that any GET data will be
> ignored, and that's fine, but I know that I can provide that without even
> messing about with a form that I might somehow be screwing up, so I
> thought I'd try it...
>
> My code is as simple as
>
> #!/usr/local/bin/php
What does '/usr/local/bin/php -v' show?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Curt, et al --
...and then Curt Zirzow said...
%
% * Thus wrote David T-G ([EMAIL PROTECTED]):
% >
% > My code is as simple as
% >
% > #!/usr/local/bin/php
%
% What does '/usr/local/bin/php -v' show?
Doesn't seem to scary to me:
bash-2.05a$ /usr/local/bin/php -v
PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
%
%
% Curt
TIA & HAND
:-D
--
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgpoz20kNpoYY.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
David T-G wrote:
Curt, et al --
...and then Curt Zirzow said...
%
% * Thus wrote David T-G ([EMAIL PROTECTED]):
% >
% > My code is as simple as
% >
% > #!/usr/local/bin/php
%
% What does '/usr/local/bin/php -v' show?
Doesn't seem to scary to me:
bash-2.05a$ /usr/local/bin/php -v
PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
You probably need the cgi version - not the command line one you
actually have.
Peter.
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
%
%
% Curt
TIA & HAND
:-D
--- End Message ---
--- Begin Message ---
* Thus wrote David T-G ([EMAIL PROTECTED]):
> Curt, et al --
>
> ...and then Curt Zirzow said...
> %
> % * Thus wrote David T-G ([EMAIL PROTECTED]):
> % >
> % > My code is as simple as
> % >
> % > #!/usr/local/bin/php
> %
> % What does '/usr/local/bin/php -v' show?
>
> Doesn't seem to scary to me:
>
> bash-2.05a$ /usr/local/bin/php -v
> PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
that cli should be cgi.
I'm assuming you compiled php with something like:
configure --with-apxs=/yada/apxs [other options]
What you need to do is recompile php with configure like:
configure --[other options]
Then make will build a cgi binary in sapi/cgi/php, relative to your build
directory. If you want both versions (cgi and cli) you'll have to
manually place the cgi version of php somewhere else than
/usr/local/bin or name it something php_cgi. And then reference
that file in you php script.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Peter --
...and then Peter Risdon said...
%
% David T-G wrote:
%
% > bash-2.05a$ /usr/local/bin/php -v
% > PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
%
% You probably need the cgi version - not the command line one you
% actually have.
Ooohhhhhhhhhhh... Ouch. So there are *three* possible PHP compiles:
module, CGI, and CLI?
OK. To save us the cost of rebuilding at this host, is there any way to
pass args to the CLI version of the script running as a CGI?
Thanks & HAND
:-D
--
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgpm9z9RdgviJ.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
* Thus wrote David T-G ([EMAIL PROTECTED]):
> Peter --
>
> ...and then Peter Risdon said...
> %
> % David T-G wrote:
> %
> % > bash-2.05a$ /usr/local/bin/php -v
> % > PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
> %
> % You probably need the cgi version - not the command line one you
> % actually have.
>
> Ooohhhhhhhhhhh... Ouch. So there are *three* possible PHP compiles:
> module, CGI, and CLI?
>
> OK. To save us the cost of rebuilding at this host, is there any way to
> pass args to the CLI version of the script running as a CGI?
You might have getenv('QUERY_STRING') for GET data and *possibly* to
get the POST data you can do something like:
$fp = fopen('php://stdin', 'r');
while (!feof($fp) ) $buf .= fgets($fp, 1024);
fclose($fp);
Then of course you're going to have to parse the query_string and
post data in order to get the variable names and values..
parse_str(getenv('QUERY_STRING'), $_GET);
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Curt, et al --
...and then Curt Zirzow said...
%
% * Thus wrote David T-G ([EMAIL PROTECTED]):
% >
% > bash-2.05a$ /usr/local/bin/php -v
% > PHP 4.3.4 (cli) (built: Jan 6 2004 15:27:52)
%
% that cli should be cgi.
%
% I'm assuming you compiled php with something like:
% configure --with-apxs=/yada/apxs [other options]
Yep. And with CLI enabled, too.
%
% What you need to do is recompile php with configure like:
% configure --[other options]
Gotcha. Thanks for the pointers.
%
% Then make will build a cgi binary in sapi/cgi/php, relative to your build
% directory. If you want both versions (cgi and cli) you'll have to
% manually place the cgi version of php somewhere else than
% /usr/local/bin or name it something php_cgi. And then reference
% that file in you php script.
I found where our support crew had built the current version not quite
six months ago, and that a lovely buildme file with our approximately 8
billion --with* params in it, so I just copied the tree, pulled apxs out,
rebuilt, and copied the CGI php somewhere as you suggest. And now I have
post data; yippee :-)
Thanks also for your other response. Finding the build tree was
definitely the easier route :-)
HAND
:-D
--
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgpUhVYR6Kxwi.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
* Thus wrote Aaron Gould ([EMAIL PROTECTED]):
> "/usr/local/mnogosearch"), and PHP configures fine. But during PHP's
> make, I get all sorts of errors at the end of the compilation:
>
> /usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
> definition of `mysql_port'
Just a guess but mnogosearch have mysql compiled staticly in its
library?
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
* Thus wrote Aaron Gould ([EMAIL PROTECTED]):
"/usr/local/mnogosearch"), and PHP configures fine. But during PHP's
make, I get all sorts of errors at the end of the compilation:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
definition of `mysql_port'
Just a guess but mnogosearch have mysql compiled staticly in its
library?
Curt
That just occurred to me as well, although it's just a guess for me as
well. Upon checking mnoGoSearch's configuration help, it appears the
default is static. I'll see if I can get it working as shared...
--
Aaron Gould
Parts Canada - Web Developer
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
* Thus wrote Aaron Gould ([EMAIL PROTECTED]):
"/usr/local/mnogosearch"), and PHP configures fine. But during PHP's
make, I get all sorts of errors at the end of the compilation:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
definition of `mysql_port'
Just a guess but mnogosearch have mysql compiled staticly in its
library?
I tried configuring both mnoGoSearch and PHP with shared libs and it
still did not work together (same errors).
I just tried mnoGoSearch withouth the MySQL support and it did work. I
suppose at least that will work well enough to let me know what
mnoGoSearch is all about.
I wonder if mnoGoSearch does not truly support MySQL 4.x (I'm on
4.0.18). They've only tested with 3.21, 3.22 and 3.23.
--
Aaron Gould
Parts Canada - Web Developer
--- End Message ---
--- Begin Message ---
Aaron Gould wrote:
Curt Zirzow wrote:
* Thus wrote Aaron Gould ([EMAIL PROTECTED]):
"/usr/local/mnogosearch"), and PHP configures fine. But during PHP's
make, I get all sorts of errors at the end of the compilation:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
definition of `mysql_port'
Just a guess but mnogosearch have mysql compiled staticly in its
library?
I tried configuring both mnoGoSearch and PHP with shared libs and it
still did not work together (same errors).
I just tried mnoGoSearch withouth the MySQL support and it did work. I
suppose at least that will work well enough to let me know what
mnoGoSearch is all about.
I wonder if mnoGoSearch does not truly support MySQL 4.x (I'm on
4.0.18). They've only tested with 3.21, 3.22 and 3.23.
I had the same problem. We're running mnoGoSearch just fine on our
production box using MySQL 3.x, but on one of our development machines,
we're running MySQL 4.x. mnoGoSearch configured/compiled/installed fine
on that box, but php barfed on compile. We then reinstalled
mnoGoSearch, configuring it with --with-built-in, and then PHP built fine.
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
John Nichel wrote:
Aaron Gould wrote:
Curt Zirzow wrote:
* Thus wrote Aaron Gould ([EMAIL PROTECTED]):
"/usr/local/mnogosearch"), and PHP configures fine. But during
PHP's make, I get all sorts of errors at the end of the compilation:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
definition of `mysql_port'
Just a guess but mnogosearch have mysql compiled staticly in its
library?
I tried configuring both mnoGoSearch and PHP with shared libs and it
still did not work together (same errors).
I just tried mnoGoSearch withouth the MySQL support and it did work.
I suppose at least that will work well enough to let me know what
mnoGoSearch is all about.
I wonder if mnoGoSearch does not truly support MySQL 4.x (I'm on
4.0.18). They've only tested with 3.21, 3.22 and 3.23.
I had the same problem. We're running mnoGoSearch just fine on our
production box using MySQL 3.x, but on one of our development machines,
we're running MySQL 4.x. mnoGoSearch configured/compiled/installed fine
on that box, but php barfed on compile. We then reinstalled
mnoGoSearch, configuring it with --with-built-in, and then PHP built fine.
Good to know it's not just my machine, thanks! I've just run a few
tests and it seems mnoGoSearch will fill our need. Hopefully they'll
soon have MySQL 4.x supported though!
--
Aaron Gould
Parts Canada - Web Developer
--- End Message ---
--- Begin Message ---
Aaron Gould wrote:
Has anyone here had recent success compiling PHP with mnoGoSearch?
Consider ASPSeek. It's a spin off from mnogo. It does have a lot of
other benefits including faster speeds.
--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--- End Message ---
--- Begin Message ---
Does anyone know of a simple/efficient way to determine the path to a
script on the URL?
For instance:
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
I didn't see an element in one of the super global variables that would
provide me this information. Any ideas?
Thanks!
--- End Message ---
--- Begin Message ---
[snip]
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
[/snip]
http://php.net/dirname
I think that will do it
--- End Message ---
--- Begin Message ---
See the parse_url() function.
>-----Original Message-----
>From: Matt Matijevich [mailto:[EMAIL PROTECTED]
>Sent: Friday, June 04, 2004 9:57 AM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: Re: [PHP] script location
>
>
>[snip]
>http://www.nowhere.com/test/whatever/testing.php
>
>All I want out of that URL is this:
>
>/test/whatever/
>[/snip]
>
>http://php.net/dirname
>
>I think that will do it
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Gabe --
...and then Gabe said...
%
% Does anyone know of a simple/efficient way to determine the path to a
% script on the URL?
Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
the right track :-)
HTH & HAND
:-D
--
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
pgpOf1k6VPFZ2.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
Thanks Matt and James... very helpful!
James Harrell wrote:
See the parse_url() function.
-----Original Message-----
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 9:57 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] script location
[snip]
http://www.nowhere.com/test/whatever/testing.php
All I want out of that URL is this:
/test/whatever/
[/snip]
http://php.net/dirname
I think that will do it
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Knowing the functions is half the battle. :-)
David T-G wrote:
Gabe --
...and then Gabe said...
%
% Does anyone know of a simple/efficient way to determine the path to a
% script on the URL?
Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
the right track :-)
HTH & HAND
:-D
--- End Message ---
--- Begin Message ---
* Thus wrote David T-G ([EMAIL PROTECTED]):
> Gabe --
>
> ...and then Gabe said...
> %
> % Does anyone know of a simple/efficient way to determine the path to a
> % script on the URL?
>
> Gee, it sounds like you want the dirname() of the SCRIPT_URL. You're on
> the right track :-)
Or dirname() of $_SERVER['REQUEST_URI'] in case SCRIPT_URL isn't
available.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--- End Message ---
--- Begin Message ---
From: "Gabe" <[EMAIL PROTECTED]>
> Knowing the functions is half the battle. :-)
GI JOE!!!
---John Holmes
http://www.ebaumsworld.com/gijoe.html
--- End Message ---
--- Begin Message ---
Well, then... let me win the whole battle for you:
$path = $_SERVER['REQUEST_URI'];
$path = dirname($path);
echo $path;
You can use REQUEST_URI, SCRIPT_NAME, or PHP_SELF.
Now you know, and knowing is . . . ;-)
John W. Holmes wrote:
From: "Gabe" <[EMAIL PROTECTED]>
Knowing the functions is half the battle. :-)
GI JOE!!!
---John Holmes
http://www.ebaumsworld.com/gijoe.html
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
--- End Message ---
--- Begin Message ---
I use of realpath()
> Does anyone know of a simple/efficient way to determine the path to a
> script on the URL?
>
> For instance:
>
> http://www.nowhere.com/test/whatever/testing.php
>
> All I want out of that URL is this:
>
> /test/whatever/
>
> I didn't see an element in one of the super global variables that would
> provide me this information. Any ideas?
--- End Message ---
--- Begin Message ---
Also, on a Windows machiene, it returns something like c:\htdocs\subsite.
Already tried it, but thanks. :-)
I'll be going with your GLOBAL variable suggestion, it seems so obvious now.
Thanks for the help! :-)
Thanks,
Stephen Craton
http://www.melchior.us
-----Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 12:59 AM
To: Aidan Lister
Cc: PHP-General
Subject: Re: [PHP] Current URL
On Fri, 2004-06-04 at 01:38, Aidan Lister wrote:
> Hi,
>
> You could use $_SERVER['DOCUMENT_ROOT']
>
That doesn't work... as the OP mentioned, the URLs might need to refer
locally within a subsite built as a subdirectory within the document root.
Cheers,
Rob.
>
> "Robert Cummings" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > > I've wondered for quite some time, and search just as long it
> > > seems
> like,
> > > for a way to get the current URL directory. For example, let's say
> > > you
> were
> > > at www.example.com/files. The script is executing in this
> > > directory, and it's calling an include script from the base
> > > (www.example.com or maybe
> even
> > > www.example.com/includes). In this included file are some links
> > > and
> maybe
> > > some images. These images and links are set up to be called from
> > > the
> base
> > > directory, so basically all the links inside the file say
> > > something like "images/bob.gif" or something of that nature.
> > >
> > > How could you dynamicaly change this in relation to where the
> > > included script is? If I were to include it in that files in
> > > /files, it would
> look
> > > for the images in /files/images/bob.gif which would not be there.
> > > One solution I have thought of is just putting the / at the
> > > beginning
> (/images/)
> > > but that wouldn't be the safest solution if the script were
> > > running in a subfolder to begind with (like the entire site is in
> www.example.com/site1).
> > >
> > > I hope you understand what I'm trying to say. Any ideas?
> >
> > In a configuration file shared by the project's scripts have a
> > constant or global variable like follows:
> >
> > $GLOBALS['imageBase'] = '/site1/';
> >
> > Now wherever in your site you use an image you can use this value to
> > prepend the image path.
> >
> > Cheers,
> > Blobbie.
> > --
> > .------------------------------------------------------------.
> > | InterJinn Application Framework - http://www.interjinn.com |
> > :------------------------------------------------------------:
> > | An application and templating framework for PHP. Boasting | a
> > | powerful, scalable system for accessing system services | such as
> > | forms, properties, sessions, and caches. InterJinn |
> > | also provides an extremely flexible architecture for |
> > | creating re-usable components quickly and easily. |
> > `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting | a
| powerful, scalable system for accessing system services | such as
| forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
yes, Is the column number on select statement. You could use alias too:
SELECT person_name, count(*) count
FROM table_name
GROUP BY person_name
ORDER BY count DESC
----- Original Message -----
From: "Angelo Zanetti" <[EMAIL PROTECTED]>
To: "Ra�l Castro" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 04, 2004 2:20 AM
Subject: RE: [PHP] Best way to sort?
> what is the 2? in the order by statement mean?
> thanks
>
> -----Original Message-----
> From: Ra�l Castro [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 03, 2004 6:20 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Best way to sort?
>
>
> The best way is:
>
> SELECT person_name, count(*)
> FROM table_name
> GROUP BY person_name
> ORDER BY 2 DESC
>
>
> ----- Original Message -----
> From: "Daniel Clark" <[EMAIL PROTECTED]>
> To: "Brian Dunning" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, June 03, 2004 10:30 AM
> Subject: Re: [PHP] Best way to sort?
>
>
> > SELECT DISTINCT person_name, count(*)
> > FROM table_name
> > GROUP BY person_name
> > ORDER BY 2 DESC
> >
> > > I'm not sure if this is a complex SQL query or a PHP array sorting
> > > thing, but what's the best way to take this data:
> > >
> > > Tom
> > > Greg
> > > Brian
> > > Tom
> > > Brian
> > > Tom
> > >
> > > And return the following results, sorted by number of records:
> > >
> > > Tom - 3
> > > Brian - 2
> > > Greg - 1
> > >
> > > Any thoughts?
> > >
> > > --
> > > 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
>
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
I'm looking for a good mapping solution for a PHP project I'm working
on, and wondered if any of you would be able to recommend one.
Basically, I would like to be able to pass this "Map Module" several
values: Latitude, longitude, map scale (e.g., 5KM x 5KM), and map
resolution (500 pixels x 500 pixels), and have it return a GIF or JPEG
which I can then send to the user's browser. (Additionally, it would be
useful if I could pass more than one set of latitude/longitude values
and have the map software display multiple points on the same map.)
It seems unlikely that I could get my Host Provider to let me run
third-party software like this on their servers, so I would probably
have to install it on my own—which would likely end up being a Mac OS X
box.
Any suggestions?
...Rene
--- End Message ---
--- Begin Message ---
I can't make it work. Because I'm new to .htaccess I tried some examples
from apache.org:
1) Contents of .htaccess in http://mysite.com/path
RewriteEngine On
RewriteRule ^oldstuff\.html$ newstuff.html
THIS EXAMPLE WORK, but the next one doesn't, nor the rule you told me:
2)
RewriteEngine On
RewriteRule ^localpath(.*)$ http://www.google.com$1
Thanks again!
"Marek Kilimajer" <[EMAIL PROTECTED]> escribi� en el mensaje
news:[EMAIL PROTECTED]
> Robert Winter wrote:
> > Where and how do I set this? I'm to Unix and PHP.
> >
>
> in .htaccess file
>
> >>
> >>RewriteRule ^/path/([0-9]+)$ /path/index.php?code=$1
> >
> >
--- End Message ---
--- Begin Message ---
I think I'm having a major brain fart here. Is there a $HTTP_REFERER
anymore? It doesn't show up as a server variable or anything at all in
phpinfo()... using php 4.3.4
Ideas?
TIA,
Steve
--- End Message ---
--- Begin Message ---
Steve Douville wrote:
I think I'm having a major brain fart here. Is there a $HTTP_REFERER
anymore? It doesn't show up as a server variable or anything at all in
phpinfo()... using php 4.3.4
Ideas?
TIA,
Steve
It has to be set to show up.
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
No...it shows up in the auto global varaible $_SERVER['HTTP_REFERER']
"Steve Douville" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I think I'm having a major brain fart here. Is there a $HTTP_REFERER
> anymore? It doesn't show up as a server variable or anything at all in
> phpinfo()... using php 4.3.4
>
> Ideas?
>
> TIA,
> Steve
>
--- End Message ---
--- Begin Message ---
lmao -- uh huh
Problem was that I was using a javascript redirect and of course, that
doesn't send any value. Found that out just a minute ago. New the stupid
variable existed...
Think I'll grab the info in js and then redirect it to the php page as part
of the query string.
Thanks,
Steve
----- Original Message -----
From: "John Nichel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 04, 2004 2:51 PM
Subject: Re: [PHP] HTTP_REFERER
> Steve Douville wrote:
> > I think I'm having a major brain fart here. Is there a $HTTP_REFERER
> > anymore? It doesn't show up as a server variable or anything at all in
> > phpinfo()... using php 4.3.4
> >
> > Ideas?
> >
> > TIA,
> > Steve
> >
>
> It has to be set to show up.
>
> --
> John C. Nichel
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
--- End Message ---
--- Begin Message ---
Hi All,
I am trying to protect portions of my website. I am using pache 2.x and
php4.X. I don't want to use apache authentication within the Directory
directive because I can't utilize sessions if I do that. So I want to
use PHP to authenticate from a postgresql database.
This works fine on the pages I have put it on, the problem is I want it
on all pages in a given directory but I don't want to edit every page in
that directory. Is there a way to configure apache to include something
in every response?
Example:
http://test/v1/v1.php
v1.php:
...
include(../auth.inc)
...
This file is protected.
http://test/v1/v1-test.php
v1-test.php doesn't contain the include above, but I still want to
protect it.
Thanks
Glenn
--- End Message ---
--- Begin Message ---
[snip]
Is there a way to configure apache to include something
in every response?
[/snip]
I think you could use a autoprepend in your php.ini file
http://www.php.net/reserved.variables
there is a mention of it on the user comments on this page
--- End Message ---
--- Begin Message ---
I have a weird problem, maybe one of you can help me figure it out. I have
a server (that is a test box..but that's a different issue) running PHP
4.3.1 RC (I believe. I didn't install it and they laid off the guy who
did..) and it's giving me a weird error.
When you go to download a file off a page it corrupts the download. The code
for the fopen is specifying a binary d/l and not ASCII so it shouldn't be
doing this. However, it is and I can't figure out why.
I've run it through two browsers and even took the php pages off the
production site and literally replaced the files on the test box. Same
errors. When I directly link to the file, it of course works.
I thought I had ruled out the code (and it still seems to be ruled out)
because the exact same procedure works on the production box. One of the
guys who worked here before he quit two weeks ago mentioned something about
having to change the max upload size in the php.ini file becaue of issues
with large .zip files. However this is not an upload issue so I don't think
it's the problem. I changed it anyways (to varying levels) and it still
didn't work.
Oh, the original files are good. I know becase you can go across the network
and open them and they look fine.
Anyone have any ideas? I'm getting nowhere fast.
Oh, it was originally tested using some .xls files, but a few .txt files I
created as a test were altered in the d/l as well...
It's a local file, it has permission to open it, the size is 20,480 bytes
and the size of the dowloaded file comes out at 20,480 bytes, so they match.
The Apache server is 2.0.43.
Code:
// Verify current user and their permissions
//
$skip = FALSE;
if( $_SESSION['userid'] == "" ) {
$errormsg = "You must be logged in to download files.";
$skip = TRUE;
}
if( $_SESSION['providerid'] == "" ) {
$errormsg = "You must be logged in to download files.";
$skip = TRUE;
}
// Build path
if ( @$HTTP_GET_VARS['rfile']) {
$filepath = $_SESSION['Settings']['datapath'] .
$HTTP_GET_VARS['rfile'];
} else {
$filepath = $_SESSION['Settings']['datapath'] .
$_SESSION['providerid'] . $HTTP_GET_VARS['file'];
}
if(!$skip) {
if(file_exists($filepath)) {
// Save an audit log entry of this download
// Output headers
header("Cache-Control: private, must-revalidate");
header("Pragma: private");
header("Content-type: application/octet-stream\n");
header("Content-Disposition: attachment;
filename=\"".substr(strrchr($filepath,"/"),1)."\"\n");
header("Content-length:
".(string)(filesize($filepath))."\n");
$fd = fopen($filepath,'rb');
while(!feof($fd)) {
print fread($fd, 4096);
flush();
}
fclose($fd);
--- End Message ---
--- Begin Message ---
[snip]
When you go to download a file off a page it corrupts the download.
[/snip]
not sure what the exact problem is, but have you tried other functions,
like readfile
http://www.php.net/manual/en/function.readfile.php
--- End Message ---
--- Begin Message ---
That gives me the same junk data problems.
-----Original Message-----
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Friday, June 04, 2004 2:29 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Error Downloading files using FOpen
[snip]
When you go to download a file off a page it corrupts the download.
[/snip]
not sure what the exact problem is, but have you tried other functions,
like readfile
http://www.php.net/manual/en/function.readfile.php
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender by email, delete and destroy this message and its
attachments.
**********************************************************************
--- End Message ---
--- Begin Message ---
Winkler, Gerald wrote:
That gives me the same junk data problems.
Define "junk data"? How is it corrupting the file? try downloading a
simple text file with a basic sentence in it. What does it look like
after it's corrupted?
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
This script by Rob Sossomon works great --Thanks!
however could anyone tell me if its possible to make it run horizontally. at
the moment the output is like this---
----------------------------------------------
Round Game Winning team Wins
1 1 Collingwood
1 2 Melbourne 4
1 3 Fremantle 4
1 4 Brisbane 4
1 5 St Kilda
1 6 Port Adelaide 4
1 7 Kangaroos 4
1 8 West Coast 4
2 1 Richmond
2 2 Collingwood 4
2 3 Brisbane 4
2 4 West Coast
2 5 Essendon
2 6 Fremantle
2 7 Carlton 4
2 8 Hawthorn
----------------------------------------------------------I would like it
like this
Round game1 win game2 win game3 etc
1 Collingwood 4 Melbourne 4 Fremantle 4
<?php
session_start();
include("connect.php");
$Name = $_SESSION['first_name'] . " " . $_SESSION['last_name'];
$sql = "SELECT * FROM Selections WHERE Name = '$Name'";
$result = mysql_query($sql);
/* Determine the number of records returned */
while ($row = MYSQL_FETCH_array($result))
$number = mysql_numrows($result);
/* Start printing to make it look good */
print "<table width=\"30%\" cellspacing=\"0\" cellpadding=\"0\"
border=\"0\">";
print
"<tr><th>Round....</th><th>Game....</th><th>Winning
Team....</th><th>Wins</th></tr>";
$total_points=0;
/* Iterate through to make it clean */
while ($i < $number)
{
$item_1 = mysql_result($result, $i,"Round");
$item_2 = mysql_result($result, $i,"Game");
$item_4 = mysql_result($result, $i,"Winner");
$item_5 = mysql_result($result, $i,"Points");
/* This makes it print out in 2 separate color, depending on rows. */
if ($i%8 == 0)
{
print "<tr
bgcolor=\"#999999\"><td><center>$item_1</center></td><td><center>$item_2</ce
nter></td><td><center>$item_4</center></td><td><center>$item_5</center></td>
</tr>\n";
}
else
{
print "<tr
bgcolor=\"#666666\"><td><center>$item_1</center></td><td><center>$item_2</ce
nter></td><td><center>$item_4</center></td><td><center>$item_5</center></td>
</tr>\n";
}
/* Increase record count and total_points to date */
$i++;
$total_points += $item_5;
}
/* close everything up */
print "<tr><th colspan=5>Total Points Earned: $total_points</th></tr>";
print "</table>";
?>
--- End Message ---