php-general Digest 22 Jan 2001 05:54:20 -0000 Issue 469

Topics (messages 35909 through 35960):

Re: GetImageSize problem
        35909 by: Thies C. Arntzen
        35912 by: eschmid+sic.s.netic.de

W98se, PWS 4.0, IE 5.5 php wird nicht interpretiert
        35910 by: Philipp Althaus
        35914 by: Sterling Hughes
        35918 by: eschmid+sic.s.netic.de
        35919 by: Sterling Hughes

Re: CF vs PHP for Creating PDF's
        35911 by: Michael Kimsal
        35930 by: Michael Stearne

solutions to disadvantages when register_globals is off
        35913 by: Dale Robinson
        35915 by: Rasmus Lerdorf
        35920 by: Dale Robinson
        35922 by: Chris Lee
        35923 by: Alex Black
        35929 by: Carsten Gehling

Include statement problems
        35916 by: Si Wizard
        35925 by: Stephan Ahonen

Re: file selected in form changes in next php page?!
        35917 by: Andrew Sitnikov

Re: getting from PHP the vars that are in the memory during the execution of the 
script...
        35921 by: Chris Lee
        35924 by: Maciek Uhlig

XML Processing Instruction ( was " <? PHP vs. <?" )
        35926 by: Brian White
        35932 by: Romulo Roberto Pereira
        35933 by: Romulo Roberto Pereira

Re: Upgrading to 4.04 question, but won't stick
        35927 by: Rasmus Lerdorf

Re: Build with Apache on Linux
        35928 by: Markus Fischer
        35949 by: johnny p.

mysql_fetch_array strangeness
        35931 by: Jaxon
        35937 by: Richard Lynch
        35940 by: Kristi Russell
        35941 by: Kristi Russell

Re: Verifying against a file
        35934 by: Richard Lynch

Re: MySQL Access Denied
        35935 by: Richard Lynch

Re: Help With passthru, system, exec
        35936 by: Richard Lynch

cookie paths are really confusing me...please help!
        35938 by: Noah Spitzer-Williams
        35939 by: Jason Murray

Macromedia Generator PHP Library :: Beta :: Please evaluate
        35942 by: Mike Chambers

HTTP_USER_AGENT and preg_match
        35943 by: John Hinsley

- printing 2 dim. array
        35944 by: Ray Iftikhar

[php] - alphabetizing
        35945 by: Ray Iftikhar
        35946 by: Josh G
        35948 by: Sean Cazzell

PHP won't allow Apache to start
        35947 by: Chris Boothe

MySQL Query Error
        35950 by: Matt Stone
        35954 by: Matt Stone

writing a binary file to a browser
        35951 by: Mike Chambers
        35953 by: Toby Butzon

How to send the whole form content to database
        35952 by: hoo chong wei
        35959 by: Richard Lynch

file storage/downloader...
        35955 by: johnny p.
        35956 by: Jason Murray
        35957 by: Toby Butzon

Re: PHP Editors
        35958 by: Jeff Lacy

Re: Calendar program
        35960 by: Jeff Lacy

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]


----------------------------------------------------------------------


On Sun, Jan 21, 2001 at 03:05:31PM +0000, Sue Bailey wrote:
> I have a bunch of images living on one ISP's server which I want to use
> on another page on another ISP's server, with GetImageSize. I RTFM, and
> see "The filename needs to be either relative to the current document,
> or an absolute filesystem path. Thus absolute URL paths will not work."
> which is absolutely correct - I get an error msg "cannot open file".
> $DOCUMENT_ROOT  is obviously no use to me - does anyone know any way
> round this?

    try the latest snapshot of PHP 4 from snaps.php.net. it
    supports URLs in the getinagesize() function.

    tc




On Sun, Jan 21, 2001 at 07:02:07PM +0100, Thies C. Arntzen wrote:
> On Sun, Jan 21, 2001 at 03:05:31PM +0000, Sue Bailey wrote:
> > I have a bunch of images living on one ISP's server which I want to use
> > on another page on another ISP's server, with GetImageSize. I RTFM, and
> > see "The filename needs to be either relative to the current document,
> > or an absolute filesystem path. Thus absolute URL paths will not work."
> > which is absolutely correct - I get an error msg "cannot open file".
> > $DOCUMENT_ROOT  is obviously no use to me - does anyone know any way
> > round this?
> 
>     try the latest snapshot of PHP 4 from snaps.php.net. it
>     supports URLs in the getinagesize() function.

Hi Sue,

Thies Arntzen made a typo, it is the getimagesize() function. Look at page
497 and use "string imagefile" in newer versions as URL.

-Egon

-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
mailto:[EMAIL PROTECTED]




trotz viel Nachlesen und üben schaffe ich es nicht php zum Laufen zu bringen.
Bin neu in der PHP-Welt. 

ich möchte PHP ausprobieren und local installieren auf Notebook zum Testen. 
Leider wird der php-Code nicht interpretiert. Nachfolgend meine Daten:

Problem:  php-Code wird nicht interpretiert

<html>
    <head>
        <title>Beispiel</title>
    </head>
    <body>
    test 1
        <?php echo "Hallo, ich bin ein PHP-Skript!"; ?>
    </body>
</html>

es wird nur test 1 angezeigt



Windows 98 SE  mit  PWS 4.0  Explorer 5.5  ,  PWS funktioniert
PWS-Basis-Verzeichnis : d:\windows\wwwroot


php-4.0.4-win32.zip gemäss Anleitung installiert
d:\programme\php


php-4.0.4-installer.exe ausgeführt


php registriert:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="D:\Programme\php\sapi\php4isapi.dll"
".php3"="D:\Programme\php\sapi\php4isapi.dll"
".php4"="D:\Programme\php\sapi\php4isapi.dll"

HKEY_CLASSES_ROOT
.php    phpfile
.php3   "
.php4   "

phpfile shell open command  : d:\programme\php\sapi\php4isapi.dll

Explorer  5.5 erkennt php-Files als PHP-Script


php.ini angepasst:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
include_path =       d:\windows\wwwroot      
doc_root = d:\windows\wwwroot 
user_dir = d:\programme\php 
extension_dir = d:\programme\php\extensions 
enable_dl  = On 

[browscap]
;browscap = extra/browscap.ini
browscap = d:\windows\system\inetsrv\browscap.ini


wer weiss was falsch ist ?

Danke für eine kurze Nachricht.

freundlich grüsst Philipp




Hoi,
        Das hier ist eine rein-deutschsprachige Liste.  Bitte schicke deutsche
Mails an die deutsche PHP liste (php-center.de).

Danke,
Sterling


Philipp Althaus wrote:
> 
> trotz viel Nachlesen und üben schaffe ich es nicht php zum Laufen zu bringen.
> Bin neu in der PHP-Welt.
> 
> ich möchte PHP ausprobieren und local installieren auf Notebook zum Testen.
> Leider wird der php-Code nicht interpretiert. Nachfolgend meine Daten:
> 
> Problem:  php-Code wird nicht interpretiert
> 
> <html>
>     <head>
>         <title>Beispiel</title>
>     </head>
>     <body>
>     test 1
>         <?php echo "Hallo, ich bin ein PHP-Skript!"; ?>
>     </body>
> </html>
> 
> es wird nur test 1 angezeigt
> 
> Windows 98 SE  mit  PWS 4.0  Explorer 5.5  ,  PWS funktioniert
> PWS-Basis-Verzeichnis : d:\windows\wwwroot
> 
> php-4.0.4-win32.zip gemäss Anleitung installiert
> d:\programme\php
> 
> php-4.0.4-installer.exe ausgeführt
> 
> php registriert:
> 
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
> ".php"="D:\Programme\php\sapi\php4isapi.dll"
> ".php3"="D:\Programme\php\sapi\php4isapi.dll"
> ".php4"="D:\Programme\php\sapi\php4isapi.dll"
> 
> HKEY_CLASSES_ROOT
> .php    phpfile
> .php3   "
> .php4   "
> 
> phpfile shell open command  : d:\programme\php\sapi\php4isapi.dll
> 
> Explorer  5.5 erkennt php-Files als PHP-Script
> 
> php.ini angepasst:
> 
> ;;;;;;;;;;;;;;;;;;;;;;;;;
> ; Paths and Directories ;
> ;;;;;;;;;;;;;;;;;;;;;;;;;
> include_path =       d:\windows\wwwroot
> doc_root = d:\windows\wwwroot
> user_dir = d:\programme\php
> extension_dir = d:\programme\php\extensions
> enable_dl  = On
> 
> [browscap]
> ;browscap = extra/browscap.ini
> browscap = d:\windows\system\inetsrv\browscap.ini
> 
> wer weiss was falsch ist ?
> 
> Danke für eine kurze Nachricht.
> 
> freundlich grüsst Philipp





On Sun, Jan 21, 2001 at 09:40:01PM +0100, Sterling Hughes wrote:
> Hoi,
>       Das hier ist eine rein-deutschsprachige Liste.  Bitte schicke deutsche
> Mails an die deutsche PHP liste (php-center.de).

Hei Sterling, this is a English speaking list. I know in Südtirol our
language is also recogniced. Have you seen too much snow?

-Egon

> Philipp Althaus wrote:
> > 
> > trotz viel Nachlesen und üben schaffe ich es nicht php zum Laufen zu bringen.
> > Bin neu in der PHP-Welt.
> > 
> > ich möchte PHP ausprobieren und local installieren auf Notebook zum Testen.
> > Leider wird der php-Code nicht interpretiert. Nachfolgend meine Daten:
> > 
> > Problem:  php-Code wird nicht interpretiert
> > 
> > <html>
> >     <head>
> >         <title>Beispiel</title>
> >     </head>
> >     <body>
> >     test 1
> >         <?php echo "Hallo, ich bin ein PHP-Skript!"; ?>
> >     </body>
> > </html>
> > 
> > es wird nur test 1 angezeigt
> > 
> > Windows 98 SE  mit  PWS 4.0  Explorer 5.5  ,  PWS funktioniert
> > PWS-Basis-Verzeichnis : d:\windows\wwwroot
> > 
> > php-4.0.4-win32.zip gemäss Anleitung installiert
> > d:\programme\php
> > 
> > php-4.0.4-installer.exe ausgeführt
> > 
> > php registriert:
> > 
> > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
> > ".php"="D:\Programme\php\sapi\php4isapi.dll"
> > ".php3"="D:\Programme\php\sapi\php4isapi.dll"
> > ".php4"="D:\Programme\php\sapi\php4isapi.dll"
> > 
> > HKEY_CLASSES_ROOT
> > .php    phpfile
> > .php3   "
> > .php4   "
> > 
> > phpfile shell open command  : d:\programme\php\sapi\php4isapi.dll
> > 
> > Explorer  5.5 erkennt php-Files als PHP-Script
> > 
> > php.ini angepasst:
> > 
> > ;;;;;;;;;;;;;;;;;;;;;;;;;
> > ; Paths and Directories ;
> > ;;;;;;;;;;;;;;;;;;;;;;;;;
> > include_path =       d:\windows\wwwroot
> > doc_root = d:\windows\wwwroot
> > user_dir = d:\programme\php
> > extension_dir = d:\programme\php\extensions
> > enable_dl  = On
> > 
> > [browscap]
> > ;browscap = extra/browscap.ini
> > browscap = d:\windows\system\inetsrv\browscap.ini
> > 
> > wer weiss was falsch ist ?
> > 
> > Danke für eine kurze Nachricht.
> > 
> > freundlich grüsst Philipp
> 
> -- 
> 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]
> 

-- 
-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
mailto:[EMAIL PROTECTED]




[EMAIL PROTECTED] wrote:
> 
> On Sun, Jan 21, 2001 at 09:40:01PM +0100, Sterling Hughes wrote:
> > Hoi,
> >       Das hier ist eine rein-deutschsprachige Liste.  Bitte schicke deutsche
> > Mails an die deutsche PHP liste (php-center.de).
> 
> Hei Sterling, this is a English speaking list. I know in Südtirol our
> language is also recogniced. Have you seen too much snow?
> 

Typo, englishsprachige, duh!

Brain konfuse much :)

-Sterling




We are doing some PDF work for a client in PHP.  Not quite sure how many 'tags'
CF has, but, although there are many, it's not an easy thing.  Lots of 'exact
positioning' for everything, and we ended up writing some routines ourselves to
handle textboxes and such.  You'll need to invest a bit of time, but I'd
imagine you would under cold fusion as well.

The cpdf1 service from adobe looks neat, but it also looks like it takes a
while - doesn't look like it'd be a good 'realtime' service to integrate with
your site.  If you need 'real time' PDFs you'll need to roll your own I'd
think.

Good luck.

DPG Account wrote:

> Hi-
>
> I'm new to this list. I'll start out with hopefully a good question. I have
> a project coming up where I need to take some form input insert it into a
> premade template and create a custom pdf for a user. The pdf will then be
> e-mailed to the user or a link to download it e-mailed to them.
>
> My question is, which would be better for doing this? I see Cold Fusion has
> some tags for creating pdf's but it looks like PHP has more capabilities
> along these lines. Also, I see Adobe (http://cpdf1.adobe.com/) has its own
> pdf service that might somehow be able to be taken advantage of.
>
> If anyone has some expertise and knowledge to share along these lines I
> would be grateful.
>
> Thanks for any help,
> -----------------------------------------------------------------------
> | D A R K  P O R T A L  G A M E S    Tony K. Bounds, Web Wizard       |
> | http://www.darkportalgames.com     [EMAIL PROTECTED]      |
> |_____________________________________________________________________|
> |          You provide the paper. We provide the adventure.           |
> -----------------------------------------------------------------------
>
>
>
> --
> 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]





You might look into HTMLDOC.  This progam takes HTML files as input and converts them 
to PDF.  You could create a template in HTML, use PHP to replace to user specific 
fields and then call HTMLDOC to create the PDF.  HTMLDOC is located at 
http://easysw.com/htmldoc/

Michael


On Saturday, January 20, 2001, at 08:45 PM, DPG Account wrote:

> Hi- 
>  
> I'm new to this list. I'll start out with hopefully a good question. I have 
> a project coming up where I need to take some form input insert it into a 
> premade template and create a custom pdf for a user. The pdf will then be 
> e-mailed to the user or a link to download it e-mailed to them. 
>  
> My question is, which would be better for doing this? I see Cold Fusion has 
> some tags for creating pdf's but it looks like PHP has more capabilities 
> along these lines. Also, I see Adobe (http://cpdf1.adobe.com/) has its own 
> pdf service that might somehow be able to be taken advantage of. 
>  
> If anyone has some expertise and knowledge to share along these lines I 
> would be grateful. 
>  
> Thanks for any help, 
> ----------------------------------------------------------------------- 
> | D A R K  P O R T A L  G A M E S    Tony K. Bounds, Web Wizard       | 
> | http://www.darkportalgames.com     [EMAIL PROTECTED]      | 
> |_____________________________________________________________________| 
> |          You provide the paper. We provide the adventure.           | 
> ----------------------------------------------------------------------- 
>  
>   
>  
>  
> --  
> 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] 
>  
>  
>  




Everyone seems to recommend turning off register_globals, but accessing them
through $HTTP_POST_VARS["var_name"], gets tedious.

I haven't found a better solution (not to say there isn't one) than this
small snippet.

The idea is to turn off "register_globals", as I believe is heavily
recommended by the PHP team, and declare what variables you are expecting on
a per script basis.
Magic-quotes would also be off. Hopefully this makes all external variables
safe.

I was hoping some experienced users would cast their eye over this and
suggest any improvements, and comment if it is worth doing at all

define("ALLOWABLE_HTML_TAGS", "<B><H1>");

function use_ext_var($var_name, $var_location)
{
    global $$var_name, $$var_location;

    $$var_name = ${$var_location}[$var_name];
    $$var_name = stripslashes($$var_name);
    $$var_name = strip_tags($$var_name, ALLOWABLE_HTML_TAGS);

}

use_ext_var("sample_var", "HTTP_GET_VARS");
print $sample_var;

How are other people handling this, or are most of you 'lazy' and just use
globals :)

Regards

D Robinson






For experienced PHP developers having register_globals on should not be a
security issue.  Injecting arbitrary variables into your symbol table is
only a problem if you arbitrarily use such variables without initializing
or checking them for validity.

I think the main point of concern here is that register_globals makes life
very easy on inexperienced developers and these are the same people most
likely to do something silly like:

<?
    include $file;
    ...
?>

Note that doing:

<?
    include $HTTP_POST_VARS['file'];
    ...
?>

really isn't any safer.  People won't be able to put file=/etc/passwd
right in the URL, but they can still trivially fake up a form post and
inject whatever value for 'file' into the POST data.

It all boils down to verifying any and all user-supplied data.

-Rasmus

On Sun, 21 Jan 2001, Dale Robinson wrote:

> Everyone seems to recommend turning off register_globals, but accessing them
> through $HTTP_POST_VARS["var_name"], gets tedious.
>
> I haven't found a better solution (not to say there isn't one) than this
> small snippet.
>
> The idea is to turn off "register_globals", as I believe is heavily
> recommended by the PHP team, and declare what variables you are expecting on
> a per script basis.
> Magic-quotes would also be off. Hopefully this makes all external variables
> safe.
>
> I was hoping some experienced users would cast their eye over this and
> suggest any improvements, and comment if it is worth doing at all
>
> define("ALLOWABLE_HTML_TAGS", "<B><H1>");
>
> function use_ext_var($var_name, $var_location)
> {
>     global $$var_name, $$var_location;
>
>     $$var_name = ${$var_location}[$var_name];
>     $$var_name = stripslashes($$var_name);
>     $$var_name = strip_tags($$var_name, ALLOWABLE_HTML_TAGS);
>
> }
>
> use_ext_var("sample_var", "HTTP_GET_VARS");
> print $sample_var;
>
> How are other people handling this, or are most of you 'lazy' and just use
> globals :)
>
> Regards
>
> D Robinson
>
>
>
> --
> 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]
>





Thank for the extremely quick response,

So setting error_reproting to E_ALL, and making sure you take heed of any
"Undefined variable" notices, will allow you to use register_globals in
safety?

Regards
Dale Robinson

----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Dale Robinson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 7:42 PM
Subject: Re: [PHP] solutions to disadvantages when register_globals is off


> For experienced PHP developers having register_globals on should not be a
> security issue.  Injecting arbitrary variables into your symbol table is
> only a problem if you arbitrarily use such variables without initializing
> or checking them for validity.
>
> I think the main point of concern here is that register_globals makes life
> very easy on inexperienced developers and these are the same people most
> likely to do something silly like:
>
> <?
>     include $file;
>     ...
> ?>
>
> Note that doing:
>
> <?
>     include $HTTP_POST_VARS['file'];
>     ...
> ?>
>
> really isn't any safer.  People won't be able to put file=/etc/passwd
> right in the URL, but they can still trivially fake up a form post and
> inject whatever value for 'file' into the POST data.
>
> It all boils down to verifying any and all user-supplied data.
>
> -Rasmus
>
> On Sun, 21 Jan 2001, Dale Robinson wrote:
>
> > Everyone seems to recommend turning off register_globals, but accessing
them
> > through $HTTP_POST_VARS["var_name"], gets tedious.
> >
> > I haven't found a better solution (not to say there isn't one) than this
> > small snippet.
> >
> > The idea is to turn off "register_globals", as I believe is heavily
> > recommended by the PHP team, and declare what variables you are
expecting on
> > a per script basis.
> > Magic-quotes would also be off. Hopefully this makes all external
variables
> > safe.
> >
> > I was hoping some experienced users would cast their eye over this and
> > suggest any improvements, and comment if it is worth doing at all
> >
> > define("ALLOWABLE_HTML_TAGS", "<B><H1>");
> >
> > function use_ext_var($var_name, $var_location)
> > {
> >     global $$var_name, $$var_location;
> >
> >     $$var_name = ${$var_location}[$var_name];
> >     $$var_name = stripslashes($$var_name);
> >     $$var_name = strip_tags($$var_name, ALLOWABLE_HTML_TAGS);
> >
> > }
> >
> > use_ext_var("sample_var", "HTTP_GET_VARS");
> > print $sample_var;
> >
> > How are other people handling this, or are most of you 'lazy' and just
use
> > globals :)
> >
> > Regards
> >
> > D Robinson
> >
> >
> >
> > --
> > 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]
>
>
>







Simple solution to make sure the variables are POST

somepage.php?var_1=asd&var_2=qwe&var_3=zxc
<?
    $var_1 = $HTTP_POST_VARS['var_1'];
    $var_2 = $HTTP_POST_VARS['var_2'];
    $var_3 = $HTTP_POST_VARS['var_3'];
?>

This way var_1, var_2, var_3 will allways be POST vars and you can still
access them through $var_1, $var_2, $var_3

Ramus had a good note though, dont think just because its not a GET or
Cookie var that a user cant whip up a simple html POST page in about 10sec.

Chris Lee
Mediawaveonline.com



"Dale Robinson" <[EMAIL PROTECTED]> wrote in message
000d01c083e1$54610aa0$0201a8c0@celery">news:000d01c083e1$54610aa0$0201a8c0@celery...
> Everyone seems to recommend turning off register_globals, but accessing
them
> through $HTTP_POST_VARS["var_name"], gets tedious.
>
> I haven't found a better solution (not to say there isn't one) than this
> small snippet.
>
> The idea is to turn off "register_globals", as I believe is heavily
> recommended by the PHP team, and declare what variables you are expecting
on
> a per script basis.
> Magic-quotes would also be off. Hopefully this makes all external
variables
> safe.
>
> I was hoping some experienced users would cast their eye over this and
> suggest any improvements, and comment if it is worth doing at all
>
> define("ALLOWABLE_HTML_TAGS", "<B><H1>");
>
> function use_ext_var($var_name, $var_location)
> {
>     global $$var_name, $$var_location;
>
>     $$var_name = ${$var_location}[$var_name];
>     $$var_name = stripslashes($$var_name);
>     $$var_name = strip_tags($$var_name, ALLOWABLE_HTML_TAGS);
>
> }
>
> use_ext_var("sample_var", "HTTP_GET_VARS");
> print $sample_var;
>
> How are other people handling this, or are most of you 'lazy' and just use
> globals :)
>
> Regards
>
> D Robinson
>
>
>
> --
> 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]
>






> <?
> include $HTTP_POST_VARS['file'];
> ...
> ?>
> 
> really isn't any safer.  People won't be able to put file=/etc/passwd
> right in the URL, but they can still trivially fake up a form post and
> inject whatever value for 'file' into the POST data.
> 
> It all boils down to verifying any and all user-supplied data.
> 
> -Rasmus

totally :)

I toyed with turning off register globals in binarycloud, only to a) have
that pointed out to me, and b) realize that it would be a total hassle.

we're extremely paranoid about user input, and you have to get used to
making your code only accept _exactly_ what it is expecting with regards to
user input.

I've seen:

    file.php?message=hello&[EMAIL PROTECTED]

can you say spam-engine ?

:)

_alex





From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 8:42 PM


> For experienced PHP developers having register_globals on should not be a
> security issue.  Injecting arbitrary variables into your symbol table is
> only a problem if you arbitrarily use such variables without initializing
> or checking them for validity.

<snip>

Are there any real performance gained by turning register_globals off? After
all, it must take the php engine some clock cycles to generate all the
global variables. Have anyone tested it?

- Carsten
~~~~~~~~~~~~~~~~






Hey,
  I just signed up on this list.  I've got a quick
question.

I am using an #include statment, and here it is:

include.html
---
<? include("$page"); ?>
---

so when I include it looks like this
---
include.html?page=main.html
---

That way the page shown in the include statement is
main.html

My problem comes when the page I am including is
passing vars as well.

ie
---
include.html?page=main.html?date=12
---

I get an error msg saying that it could not include my
file.


Any ideas?  Work arounds?  I am using PHP3.

Thanks,

Eric Padgett


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/




> Any ideas?  Work arounds?  I am using PHP3.

Try:
$page = str_replace("?", "&", $page);

That'll change:

include.html?page=main.html?date=12

into:

include.html?page=main.html&date=12

So the variables get passed properly.





Hello Chris,

http://www.php.net/manual/en/features.file-upload.php

CH> Dear group,

CH> in my first page i have a form selcting a file.
CH> The names i used were csvfile, csv_file, and my_file.

CH> After submitting the form the filename changed to a totally different file, 
CH> like    C:\PHP\php72C3.TMP or C:\PHP\phpD2B4.TMP
CH>                 (windows, apache, php4, internet explorer 5 as well as Mozilla 6)
CH> What is happening?
CH> code below.

CH> Chris

CH> ##FORM

CH> <form name="form1" enctype="multipart/form-data" method="post" ACTION=<?php 
echo "$PHP_SELF";?>> NAME="beheerform">
CH>  <input type="hidden" name="FILE_INVOEREN" value="zoek file (op eigen 
computer)">>
CH>  <input type="file" name="my_file" onChange='javascript:alert(this.value);'>
CH>  <input type="submit" name="Submit" value="Invoeren">
CH> </form>

CH> ## NEXT PAGE  (in main)
CH> if (isset($FILE_INVOEREN)):
CH>         echo $my_file;
CH>         if ($my_file==0) die ("Selecteer een file!");

CH> --------------------------------------------------------------------
CH> --  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
CH> --------------------------------------------------------------------

Best regards,
 Andrew Sitnikov                         
 e-mail : [EMAIL PROTECTED]
 GSM    : (+372) 56491109






$GLOBALS[] should have all varibales right ? maybe someone could correct me.

<?
    foreach($GLOBALS as $pos => $val)
    {
        echo "$pos : $val<br>\n";
    }
?>


Chris Lee
Mediawaveonline.com


"Romulo Roberto Pereira" <[EMAIL PROTECTED]> wrote in message
001101c082eb$6536f5c0$[EMAIL PROTECTED]">news:001101c082eb$6536f5c0$[EMAIL PROTECTED]...
Hey!

Is it possible to get the names of the variables allocated in the memory?

thank you,

Rom







$some_associative_array = get_defined_vars();

Newest PHP, though (since 4.0.4).

Maciek

> -----Original Message-----
> From: Romulo Roberto Pereira [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 20, 2001 3:15 PM
> To: php-general
> Subject: [PHP] getting from PHP the vars that are in the memory 
> during the execution of the script...
> 
> 
> Hey!
> 
> Is it possible to get the names of the variables allocated in the memory?
> 
> thank you,
> 
> Rom
> 




At 10:50 AM 1/19/12 +0200, Teodor Cimpoesu wrote:

>I was refering to whole story of using `<?' in xml docs.
>
>-- teodor

The "<?"...">" construct comes from SGML/XML - it is called a
"Processing Instruction"(PI). It's general purpose is to allow
application to leave pieces of information in the XML that
aren't strictly part of the content but allow it to help
process it. Classic use of it to put in page formatting
information into content ( pagebreaks, page no's etc ) that is
only relevant to the paper production system.

Part of the problems is that multiple different applications
can use PI's, so they need to be able to tell which ones are
their's - therefore the first thing that should go in a PI
is some kind of indication as to which application requires
it.

Therefore: Always "<?php" is a much better idea than "<?"

Regs

Brian White
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy

http://www.steptwo.com.au/
[EMAIL PROTECTED]





If I am not mistaken XML tags needs to be identifed. So <? doesn't mean much
in XML... I like both sintaxes and in my company we only use <? ?>... Maybe
we could vote the use or not of this feature?

Rom
----- Original Message -----
From: Brian White <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 5:03 PM
Subject: [PHP] XML Processing Instruction ( was " <? PHP vs. <?" )


At 10:50 AM 1/19/12 +0200, Teodor Cimpoesu wrote:

>I was refering to whole story of using `<?' in xml docs.
>
>-- teodor

The "<?"...">" construct comes from SGML/XML - it is called a
"Processing Instruction"(PI). It's general purpose is to allow
application to leave pieces of information in the XML that
aren't strictly part of the content but allow it to help
process it. Classic use of it to put in page formatting
information into content ( pagebreaks, page no's etc ) that is
only relevant to the paper production system.

Part of the problems is that multiple different applications
can use PI's, so they need to be able to tell which ones are
their's - therefore the first thing that should go in a PI
is some kind of indication as to which application requires
it.

Therefore: Always "<?php" is a much better idea than "<?"

Regs

Brian White
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy

http://www.steptwo.com.au/
[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]





I forgot to mention that if is PHP the parser (since you are creating PHP
scripts in a server that use PHP as CGI or as a module) this could not be
treated by the parser? I mean, the common XML tag is <?xml version...
Couldn't this be solved in the server side?
----- Original Message -----
From: Brian White <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 5:03 PM
Subject: [PHP] XML Processing Instruction ( was " <? PHP vs. <?" )


At 10:50 AM 1/19/12 +0200, Teodor Cimpoesu wrote:

>I was refering to whole story of using `<?' in xml docs.
>
>-- teodor

The "<?"...">" construct comes from SGML/XML - it is called a
"Processing Instruction"(PI). It's general purpose is to allow
application to leave pieces of information in the XML that
aren't strictly part of the content but allow it to help
process it. Classic use of it to put in page formatting
information into content ( pagebreaks, page no's etc ) that is
only relevant to the paper production system.

Part of the problems is that multiple different applications
can use PI's, so they need to be able to tell which ones are
their's - therefore the first thing that should go in a PI
is some kind of indication as to which application requires
it.

Therefore: Always "<?php" is a much better idea than "<?"

Regs

Brian White
-------------------------
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy

http://www.steptwo.com.au/
[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]





> We've had 4.01 running since July so I thought I'd upgrade to 4.04 from the
> tarball last night. Everything went fine w/ the compile, no errors. Install
> said all OK, Then i went and HUP'd apache but when I run phpinfo() the old
> module is still loaded.
>
> What am I doing wrong?  Where should I look to solve my problem. When I look
> in the /modules/ directory the dates on the new modules are yesterday, so
> they've all moved correctly, etc. I intentionally tried to break the
> phpmodule to see which one I'm actually using by changing the name of the
> file but that didn't work.

You renamed the library and restarted the server and it still came up with
4.0.1?  If so, you are doing something dumb.  Like perhaps you compiled
4.0.1 statically into your httpd.  Check this by doing "httpd -l".  If you
see php listed you know it was compiled statically into your binary.

If it isn't static, go look at your LoadModule line in your httpd.conf and
see where it is loading the module from.  Make sure this is pointing at
this new module you built.

Also make sure that the web server you restarted is the right one.  I have
seen many people who install Apache and PHP without realizing that they
already have an Apache instance on their server.  And when they do an
apachectl restart the apachectl script actually restarts the wrong server
on them.

-Rasmus





        Why not building apache with dso support and build a
libphp4.so shared image ? Much less hassle.

m.

-- 
Markus Fischer,  http://josefine.ben.tuwien.ac.at/~mfischer/
EMail:         [EMAIL PROTECTED]
PGP Public  Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1  C2B5 D674 B445 C227 2BD0




Try following the instructions on the devshed page:
http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/

This is an awesome tutorial to get things up and running for a standard web
serveer install with Apache, PHP, MySQL, and SSL, if you need it.

johnny p.

> -----Original Message-----
> From: Chris Mulcahy [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 21, 2001 10:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Build with Apache on Linux
>
>
> OK, I've built Apache and PHP on Linux 50 times already.  Now it's causing
> me problems.
>
> I've rebuilt my server, I've tried PHP 4.0.3 and PHP 4.0.4.  It keeps
> causing me problems.
>
> I could not find libphp4.a and found on the net where someone suggested to
> rename libmodphp4.a to libphp4.a.
>
> During configure, I'm getting an error:
>   /usr/bin/ld: cannot find -lmodphp4
>   collect2: ld returned 1 exit status
>
> It's making me insane.  Attached below is a complete transcript
> (it's small)
> of the apache configure.  PHP configure; make; make install
> appears to work
> perfectly, but it's not going so well with Apache.
>
> Any suggestions greatly appreciated.
>
> Thanks in advance.
> Chris
>
> ---> BEGIN Transcript <---
> [root@gumby apache_1.3.14]#
> ./configure --activate-module=src/modules/php4/libphp4.a
> Configuring for Apache, Version 1.3.14
> make
>  + using installation path layout: Apache (config.layout)
>  + activated php4 module (modules/php4/libphp4.a)
> Creating Makefile
> Creating Configuration.apaci in src
> cd ..;
> gcc  -DLINUX=2 -I/home/cmulcahy/transfer/php-4.0.3pl1
> -I/home/cmulcahy/trans
> fer/php-4.0.3pl1/main -I/home/cmulcahy/transfer/php-4.0.3pl1/main
> -I/home/cm
> ulcahy/transfer/php-4.0.3pl1/Zend
> -I/home/cmulcahy/transfer/php-4.0.3pl1/Zen
> d -I/home/cmulcahy/transfer/php-4.0.3pl1/TSRM
> -I/home/cmulcahy/transfer/php-
> 4.0.3pl1/TSRM -I/home/cmulcahy/transfer/php-4.0.3pl1 -DUSE_EXPAT
> -I./lib/exp
> at-lite -DNO_DL_NEEDED `./apaci`     -o helpers/dummy
> lpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4
> -L../../modules/p
> hp4 -lmodphp4  -lpam  -ldl -lttf -lgd -lresolv -lm -ldl -lcrypt
> -lnsl  -lres
> olv   -lm -lcrypt
> /usr/bin/ld: cannot find -lmodphp4
> collect2: ld returned 1 exit status
> make: *** [dummy] Error 1
> Creating Makefile in src
>  + configured for Linux platform
>  + setting C compiler to gcc
>  + setting C pre-processor to gcc -E
>  + checking for system header files
>  + adding selected modules
>     o php4_module uses ConfigStart/End
>  + checking sizeof various data types
>  + doing sanity check on compiler and options
> ** A test compilation with your Makefile configuration
> ** failed.  The below error output from the compilation
> ** test will give you an idea what is failing. Note that
> ** Apache requires an ANSI C Compiler, such as gcc.
>
> ======== Error Output for sanity check ========
> ============= End of Error Report =============
>
>  Aborting!
>
>
>
> --
> 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]
>
>





Hi,

I'm trying to echo out the field names used as key values in a
mysql_fetch_array:

$link_id = mysql_connect("localhost", "root", $pass);

mysql_select_db("database", $link_id);

$result = mysql_query("select * from lists where id = 1", $link_id);

$rowData = mysql_fetch_array($result);

while (list($fieldName) = each($rowData))
{ echo "$fieldName,"; }

I'm expecting to get this:

id,listname,joinconfirm,leaveconfirm,homepage,author,canjoin,bannedemails,de
scription,subject,masteremail,

but instead getting this:

0,id,1,listname,2,joinconfirm,3,leaveconfirm,4,homepage,5,author,6,canjoin,7
,bannedemails,8,description,9,subject,10,masteremail,

Why are the index numbers for the array showing up?  From the docs,
mysql_fetch_array should create an array of field names to field values...?
To make things worse, if I also echo the data:

while (list($fieldName,  $fieldValue) = each($rowData))
{ echo "$fieldName,$fieldValue," ;}

Then a value is echoed after both the index number and the field value, eg:

0,1,id,1,1,testlist,listname,testlist,  etc...

What am I doing wrong?

Regards,
Jaxon





> $rowData = mysql_fetch_array($result);

mysql_fetch_array can return an array with only numeric indices, only text
(fieldname) indices, *OR* *BOTH*, the default.

You need to use the "optional" argument:

$rowData = mysql_fetch_array($result, MYSQL_ASSOC);


By Day:                                |By Night:
    Don't miss the Zend Web Store's    |   There's not enough room here...
    Grand Opening on January 23, 2001! |   Start here:
    http://www.zend.com                |   http://l-i-e.com/artists.htm






each() assigns four elements... (0 = index), (1 = value), (key = index), (value = 
value)

You are concerned with key and value.
So: list ($fieldname, $value) = each($row)

You may not be using $value but you still need to assign the data to a variable. Or 
list will only assign $fieldname the numerical
index and not the char index. At least that's from what I understand.  Anyone, please 
feel free to correct me.

Kristi


Beware of the false gods we sometimes
worship--money, power and fame--for they
are all fleeting, especially in death and often
in mortality.
                                                   -Anonymous

----- Original Message -----
From: "Jaxon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 8:07 PM
Subject: [PHP] mysql_fetch_array strangeness


> Hi,
>
> I'm trying to echo out the field names used as key values in a
> mysql_fetch_array:
>
> $link_id = mysql_connect("localhost", "root", $pass);
>
> mysql_select_db("database", $link_id);
>
> $result = mysql_query("select * from lists where id = 1", $link_id);
>
> $rowData = mysql_fetch_array($result);
>
> while (list($fieldName) = each($rowData))
> { echo "$fieldName,"; }
>
> I'm expecting to get this:
>
> id,listname,joinconfirm,leaveconfirm,homepage,author,canjoin,bannedemails,de
> scription,subject,masteremail,
>
> but instead getting this:
>
> 0,id,1,listname,2,joinconfirm,3,leaveconfirm,4,homepage,5,author,6,canjoin,7
> ,bannedemails,8,description,9,subject,10,masteremail,
>
> Why are the index numbers for the array showing up?  From the docs,
> mysql_fetch_array should create an array of field names to field values...?
> To make things worse, if I also echo the data:
>
> while (list($fieldName,  $fieldValue) = each($rowData))
> { echo "$fieldName,$fieldValue," ;}
>
> Then a value is echoed after both the index number and the field value, eg:
>
> 0,1,id,1,1,testlist,listname,testlist,  etc...
>
> What am I doing wrong?
>
> Regards,
> Jaxon
>
>
> --
> 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]
>





each() assigns four elements... (0 = index), (1 = value), (key = index), (value = 
value)

You are concerned with key and value.
So: list ($fieldname, $value) = each($row)

You may not be using $value but you still need to assign the data to a variable. Or 
list will only assign $fieldname the numerical
index and not the char index. At least that's from what I understand.  Anyone, please 
feel free to correct me.

Kristi


Beware of the false gods we sometimes
worship--money, power and fame--for they
are all fleeting, especially in death and often
in mortality.
                                                   -Anonymous

----- Original Message -----
From: "Jaxon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 21, 2001 8:07 PM
Subject: [PHP] mysql_fetch_array strangeness


> Hi,
>
> I'm trying to echo out the field names used as key values in a
> mysql_fetch_array:
>
> $link_id = mysql_connect("localhost", "root", $pass);
>
> mysql_select_db("database", $link_id);
>
> $result = mysql_query("select * from lists where id = 1", $link_id);
>
> $rowData = mysql_fetch_array($result);
>
> while (list($fieldName) = each($rowData))
> { echo "$fieldName,"; }
>
> I'm expecting to get this:
>
> id,listname,joinconfirm,leaveconfirm,homepage,author,canjoin,bannedemails,de
> scription,subject,masteremail,
>
> but instead getting this:
>
> 0,id,1,listname,2,joinconfirm,3,leaveconfirm,4,homepage,5,author,6,canjoin,7
> ,bannedemails,8,description,9,subject,10,masteremail,
>
> Why are the index numbers for the array showing up?  From the docs,
> mysql_fetch_array should create an array of field names to field values...?
> To make things worse, if I also echo the data:
>
> while (list($fieldName,  $fieldValue) = each($rowData))
> { echo "$fieldName,$fieldValue," ;}
>
> Then a value is echoed after both the index number and the field value, eg:
>
> 0,1,id,1,1,testlist,listname,testlist,  etc...
>
> What am I doing wrong?
>
> Regards,
> Jaxon
>
>
> --
> 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]
>





> $fd=fopen("words.txt", "r");

Check that $fd is not 0.

> $words = fread($fd, 1000000);
>
> I then convert a string which is passed in a form to this script
>
> $FirstName=strtolower("$FirstName");
>
> And now I check to see if the lowercase version of $FirstName contains any
of
> the words from the $words
>
> if ($FirstName=="$words")
> {
> echo "Bad";
> }
>
> But it doesn`t seem to want to work, anyone give me a pointer as to where
I
> am going wrong with this??

What you have will work only if the file has *EXACTLY* the lower-case of the
$FirstName, with no newlines, and no other names in the file, and the one in
the file must not be Mixed Case.

You are probably looking for something more like this:

if (stristr($words, $FirstName)){
    echo "Bad";
}

http://php.net/stristr






> I am trying to conect to a MySQL db and no matter what code I use I am
always
> getting denied, I know the password is correct as I have tested it
elsewhere.
> Just wondering if this could be caused by the fact that the password has a
+
> and a . in it. Would that get me denied, and how can I get around it other
> than changing the PW ??

Can you use the same username/password to start the "mysql" monitor on the
machine with the database on it?

If so, perhaps you've set it up so only the same machine can use that
username/password, but not an external machine.

By Day:                                |By Night:
    Don't miss the Zend Web Store's    |   There's not enough room here...
    Grand Opening on January 23, 2001! |   Start here:
    http://www.zend.com                |   http://l-i-e.com/artists.htm






> I've been trying to write something to ping a URL on the system level, and
> keep the output in an array.  I've been trying to work with system, exec,
> and passthru, but it looks as though they all return only the last line of
> the output.  How would I put the whole output into the array?  A different

They all *return* the last line, but exec (and some others) accept an array
they can "fill up" with the data you want.

<?php
    $cmd = "ping $IP -c 1";
    exec($cmd, $results, $error);
    while (list(,$line) = each($results)){
        echo $line, "<BR>\n";
    }
    if ($error){
        echo "OS Error $error.  Usually path/permissions.";
    }
?>






ok here's what i get from php.net:

SetCookie()'s behavior is dependant on where it is called within the web
document tree. For example, setting a cookie from a php script in a
directory makes that cookie available only to other scripts in that
directory and its subdirectories. However, setting a cookie of the same name
from a script in the directory's parent directory will override all cookies
of that name in the parent directory's subdirectories.

scenario: im browsing a file in lets call directory 'test'. this file is
including a file in the parent directory. this included file is setting a
cookie.

the problem is when i goto directory 'test2' and use this same included file
in the parent directory, it cant find the cookie.

how should be setting this cookie??

- Noah






> scenario: im browsing a file in lets call directory 'test'. 
> this file is including a file in the parent directory. this included 
> file is setting a cookie.

The point here is that the file is being *included*, therefore the
cookie will only be local to that "test" directory, regardless of
where the file that sets the cookie lives.

> the problem is when i goto directory 'test2' and use this 
> same included file in the parent directory, it cant find the 
> cookie.
> 
> how should be setting this cookie??

I mainly set my cookies with a path of "/". Saves hassles, and the
cookie is accessible everywhere.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!




I am building a library of functions to make it easy to use PHP with
Macromedia Generator.

I have a first version of the library available at :

http://www.markme.com/~mesh/temp/GeneratorLibrary.zip

I would appreciate any comments or suggestions. Especially any suggestions
on how to optimize the code, or just to code it better, as well as any
comments on ways to make the documentation more clear.

This is just a beta. Please do not distribute the link yet. When the library
is ready, I am going to release it to the general public.


FYI : Macromedia Generator is a server side tool that dynamically creates
Flash movies and other media including gifs, jpgs and quick time movies.

thanks in advance (i hope)...

mike chambers

[EMAIL PROTECTED]
http://www.markme.com






This seems trivial at first (and maybe at last!):

<?

$agent = getenv("HTTP_USER_AGENT");

if (preg_match("/MSIE/i", "$agent")) {
        $result = "You are using Microsoft Internet Explorer.";
} else if (preg_match("/Mozilla/i", "$agent")) {
        $result = "You are using Netscape.";
} else if (preg_match("/lynx/i", "$agent")) {
        $result = "You are using Lynx.";
} else if (preg_match("/Amaya/i", "$agent")) {
        $result = "You are using Amaya.";
} else if (preg_match("/Konqueror/i", "$agent")) {
        $result = "You are using Konqueror.";



} else {
        $result = "You are using $agent";
}

?>

<HTML>
<HEAD>
<TITLE>Browser Match Results</TITLE>
</HEAD>
<BODY>

<? echo "<P>$result</p>"; ?>

</BODY>
</HTML>


But, just as it's a good idea to use the HTTP_USER_AGENT environment to
dynamically set the size of type so that Internet Explorer users are not
forced to view huge text (which appears fine in Amaya, Konqueror and the
4.*
series of Netscape), so the 6.* series of Mozilla/Netscape also displays
huge
text. Can anyone show me how to use preg_match to sift out, say

Mozilla/5.0 (X11; U; Linux 2.2.14 i686; en-US; m16) Gecko/20000613 
(that is, the later, Gecko Mozillas)

from the earlier Mozillas

Mozilla/4.72 [en] (X11; I; Linux 2.2.14 i686)?

--Yes, I don't know my regex--

And what are people's experiences of other browsers (which in my case I
have
not got)?

-- 
******************************************************************************
Marx: "Why do Anarchists only drink herbal tea?"
Proudhon: "Because all proper tea is theft."
******************************************************************************




Hello,
        I have a file...its contents are as follows:
Name of person1, string1
Name of person, string
Name of person, string
Name of person, string
Name of person, string




Hello,
    I was just typing a msg and accidentally hit send before I could
finish.. sorry..

I have a file, its contents are as follows:

Name of person1, string1
Name of person2, string2
Name of person3, string3
Name of person4, string4
Name of person5, string5

I want to alphabetize the list from A-Z (using the first column as the
primer key). I was planng on using an array, but I would have to use a 2
dimensional array and I am not too swift on those..

Thanx,
Ray..





Just build an assosciative array like so

    $arr["person1"] = "string1";
    $arr["person2"] = "string2";
    $arr["person3"] = "string3";

    $arr = asort($arr);

this should do what you're looking for.

Gfunk         -          http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.
  

----- Original Message ----- 
From: "Ray Iftikhar" <[EMAIL PROTECTED]>
To: "Php-General List" <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 2:52 PM
Subject: [PHP] [php] - alphabetizing


> Hello,
>     I was just typing a msg and accidentally hit send before I could
> finish.. sorry..
> 
> I have a file, its contents are as follows:
> 
> Name of person1, string1
> Name of person2, string2
> Name of person3, string3
> Name of person4, string4
> Name of person5, string5
> 
> I want to alphabetize the list from A-Z (using the first column as the
> primer key). I was planng on using an array, but I would have to use a 2
> dimensional array and I am not too swift on those..
> 
> Thanx,
> Ray..
> 
> 
> -- 
> 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]
> 





Ray,

You could create an array where the keys are the person names and the
values are the strings. For example:

$people_strings = array ("joe" => "bar", "andy" => "foo");
ksort($people_strings);
reset($people_strings);
while (list ($key, $value) = each ($people_strings)) {
        print "$key -> $value\n";
}

That should print out:

andy -> foo
joe -> bar

The ksort is the magic part, it sorts arrays by their keys.


Regards,

Sean Cazzell





Any ideas?

Normally NuSphere sets it up but it isn't installing PHP even though the
status says done.

Here is what you asked about,

[root@ /root]# httpd -la
Compiled-in modules:
  http_core.c
  mod_so.c
suexec: disabled; invalid wrapper /usr/sbin/suexec
[root@ /root]# ll httpd
m-rw-r--r--    1 root     root            0 Dec 21 15:22 httpd

Thanks,

Chris

Script done on Thu Dec 21 15:23:09 2000

----- Original Message -----
From: "jason davidson" <[EMAIL PROTECTED]>
To: "Chris Boothe" <[EMAIL PROTECTED]>
Sent: Thursday, December 21, 2000 2:39 PM
Subject: Re: [PHP] Apache won't start because of new PHP installation.


> are you sure that httpd has php4 compileed into it...
> Apache/bin/ll httpd
> should give you a list of mods that are compiled into apache
>
> Chris Boothe wrote:
>
> > Here is the typescript of what I tried.
> >
> > Script started on Thu Dec 21 14:15:16 2000
> > [root@ apache]# apachectl start
> > Syntax error on line 239 of /usr/nusphere/apache/conf/httpd.conf:
> > Cannot load /usr/nusphere/apache/libexec/libphp4.so into server: shared
object not open
> > /usr/bin/apachectl start: httpd could not be started
> >
> > [root@ /etc]# cat ld.so.conf
> > /usr/X11R6/lib
> > /usr/kerberos/lib
> > /usr/lib
> > /usr/lib/sane
> > /usr/nusphere/apache/libexec
> > /home/php-4.0.4/libs
> >
> > [root@ /etc]# ldconfig
> >
> > [root@ /etc]# apachectl start
> > Syntax error on line 239 of /usr/nusphere/apache/conf/httpd.conf:
> > Cannot load /usr/nusphere/apache/libexec/libphp4.so into server: shared
object not open
> > /usr/bin/apachectl start: httpd could not be started
> > Script done on Thu Dec 21 14:16:34 2000
> >
> > I have searched the knowledge base and I tried to add the paths to
ld.so.conf and restart apache but it doesn't do anything.
> >
> > I had previously installed NuSphere bundle, but today I tried with the
new release of PHP but I am still having the same problem.
> >
> > What else could it be?
> >
> >  Thanks,
> >
> > Chris Boothe
> > [EMAIL PROTECTED]
>




Hi,
I have a MySQL statement, namely:
SELECT COUNT(*) AS Count FROM images i LEFT JOIN categories c ON
i.cat_id=c.id LEFT JOIN subcategories s ON i.subcat_id=s.id

I want to change the LEFT JOINs to INNER JOINs like so:
SELECT COUNT(*) AS Count FROM images i INNER JOIN categories c ON
i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_id=s.id

But as soon as I do that I get this error message:
MySQL Error: 1064 (You have an error in your SQL syntax near 'INNER JOIN
categories c ON i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_' at
line 1)
Session halted.

Help please. Thanks,

Matt Stone
_______________________________

This email may contain confidential and/or privileged information for the
sole use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you have received this email in error, please
contact the sender and delete all copies. Opinions, conclusions or other
information expressed or contained in this email are not given or endorsed
by the sender unless otherwise affirmed independently by the sender.

_________________________________





No, that is exactly as the PHPLib Debug function is returning... :|

-----Original Message-----
From: Samantha Savvakis [mailto:[EMAIL PROTECTED]]
Sent: Monday, 22 January 2001 3:21 PM
To: Matt Stone
Subject: RE: [PHP] MySQL Query Error


I'm not sure why are getting that error.

Is the statement you are running exactly the same as the one posted in the
email? Check that you don't have a "comma" after the "images i" part. If i
put a comma there, I can simulate your error. Otherwise, your syntax to me
seems fine.

> -----Original Message-----
> From: Matt Stone [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 22 January 2001 15:01
> To: PHP List
> Subject: [PHP] MySQL Query Error
>
>
> Hi,
> I have a MySQL statement, namely:
> SELECT COUNT(*) AS Count FROM images i LEFT JOIN categories c ON
> i.cat_id=c.id LEFT JOIN subcategories s ON i.subcat_id=s.id
>
> I want to change the LEFT JOINs to INNER JOINs like so:
> SELECT COUNT(*) AS Count FROM images i INNER JOIN categories c ON
> i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_id=s.id
>
> But as soon as I do that I get this error message:
> MySQL Error: 1064 (You have an error in your SQL syntax near 'INNER JOIN
> categories c ON i.cat_id=c.id INNER JOIN subcategories s ON i.subcat_' at
> line 1)
> Session halted.
>
> Help please. Thanks,
>
> Matt Stone
> _______________________________
>
> This email may contain confidential and/or privileged information for the
> sole use of the intended recipient. Any review or distribution by
> others is
> strictly prohibited. If you have received this email in error, please
> contact the sender and delete all copies. Opinions, conclusions or other
> information expressed or contained in this email are not given or endorsed
> by the sender unless otherwise affirmed independently by the sender.
>
> _________________________________
>
>
> --
> 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]
>






I am trying to open a binary file from a URL, and then send that file back
to the user's browser (after setting the appropriate content-type).

I think i have a handle on how to open the file :

using either fread() or file()

however, i am not sure how to iterate through the bytes, get the file size,
and write the bytes back to the browser?

can anyone point me in the correct direction? Even if it is just the
function name, that is helpful as I can look up the info in the php manual.

thanks in advance....

mike chambers

[EMAIL PROTECTED]





Might want to check out fpassthru (http://www.php.net/fpassthru).

Good luck -

--Toby

----- Original Message -----
From: "Mike Chambers" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 12:20 AM
Subject: [PHP] writing a binary file to a browser


> I am trying to open a binary file from a URL, and then send that file
back
> to the user's browser (after setting the appropriate content-type).
>
> I think i have a handle on how to open the file :
>
> using either fread() or file()
>
> however, i am not sure how to iterate through the bytes, get the file
size,
> and write the bytes back to the browser?
>
> can anyone point me in the correct direction? Even if it is just the
> function name, that is helpful as I can look up the info in the php
manual.
>
> thanks in advance....
>
> mike chambers
>
> [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]
>
>





Hi there,
  
I'm a beginner using php. Currently, I'm develope a online registration system. I face 
some problems, hope that some one can help me to solve it.

1. I have create a email sending form. After I enter all the particulars, while 
sending this mail to somebody. Can anybody tell me that how can I store the whole 
particular from that email form into my database.

2. Can I send the whole form for example this email form by using mail() function?

3. How can I provide the attachment facility in this mail form? I would like to allow 
user to attach their file and send it out. How can I attach that file and how can I 
send it out by mail function in php?

Please somebody tell me the solution. I am very appreciate your help.


Thanks!
tom
___________________________________________________________________________
Visit http://www.visto.com/info, your free web-based communications center.
Visto.com. Life on the Dot.





1. I have create a email sending form. After I enter all the particulars,
while sending this mail to somebody. Can anybody tell me that how can I
store the whole particular from that email form into my database.

$query = "insert into yourtable (field1, field2, ...) values('$field1',
'$field2', ...)";
mysql_query($query) or die(mysql_error());

2. Can I send the whole form for example this email form by using mail()
function?

$body = "field1 = $field1\r\n";
$body .= "field2 = $field2\r\n";
#etc
$headers = "From: yourmeailhere\r\n";
$headers .= "Reply-to: youremailhere\r\n";
mail("whowantsit", "Subject", $body, $headers);


3. How can I provide the attachment facility in this mail form? I would like
to allow user to attach their file and send it out. How can I attach that
file and how can I send it out by mail function in php?

Probably easiest to use the mail class on Manuel Lemos' class archive.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/venues.htm







Ok, here's the prolem:  I'm trying to create a feature on my site similar to
xdrive.com.  Basically I want the user to be able to upload a file and have
it stored on my server.  I also want to have the ability for the user to
download the file at a later time.  Account authentiaction is handled, no
problem, but I have no idea where to put the files.  I create a directory,
it may be guessed and even the filename might be guessed and any user may be
able to download the file, breaking user authentication.  If I store the
file in a non-apache directory, how does the user download the file?

My goal is to have the second scenario work, create a directory for each
user for file storage, and somehow get the user to be able to download it
after being authenticated.  I do not want to use .htaccess files for this,
either.  I want it to be seemless with the rest of the features of the site.

Thanks in advance for any ideas,

johnny p.





> If I store the file in a non-apache directory, how does the 
> user download the file?

Use a file, "download.php" that will make sure the user is 
authenticated, then fetch the contents of the file, and send the 
file to the browser.

Jason




Do just what you said and create a directory outside of your Apache doc
root. Just make sure the user PHP is running as has permissions to access
the directory ;) Then use PHP's fpassthru, etc., to send the content of the
file back.

You will need to send a mime-type header; take a look around - there are
tutorials over this on phpbuilder.com I'm pretty sure.

Regards,

--Toby

----- Original Message -----
From: "johnny p." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 22, 2001 12:30 AM
Subject: [PHP] file storage/downloader...


> Ok, here's the prolem:  I'm trying to create a feature on my site similar
to
> xdrive.com.  Basically I want the user to be able to upload a file and
have
> it stored on my server.  I also want to have the ability for the user to
> download the file at a later time.  Account authentiaction is handled, no
> problem, but I have no idea where to put the files.  I create a
directory,
> it may be guessed and even the filename might be guessed and any user may
be
> able to download the file, breaking user authentication.  If I store the
> file in a non-apache directory, how does the user download the file?
>
> My goal is to have the second scenario work, create a directory for each
> user for file storage, and somehow get the user to be able to download it
> after being authenticated.  I do not want to use .htaccess files for
this,
> either.  I want it to be seemless with the rest of the features of the
site.
>
> Thanks in advance for any ideas,
>
> johnny p.
>
>
> --
> 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]
>
>





Textpad is pretty good on Micro$ucks products.  It has a free evaluation
which isn't very bothersome (unlike others...).  You can examine it as
www.textpad.com.


""Karl J. Stubsjoen"" <[EMAIL PROTECTED]> wrote in message
003701c0815f$b6f80e40$0afc020a@kstubsjoen">news:003701c0815f$b6f80e40$0afc020a@kstubsjoen...
> So what editor is recommended?  I'm a little familiar with Emacs (kinda
> cool, but I'm use to keywords and such being colored - as in Interdev).
>
> Thanks!
>
>
> --
> 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]
>






M$ Outlook?  I don't know, but try Outlook :-)


Jeff



"Todd Cary" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does a calendar program exist in PHP similar to Yahoo's program?
> (http://www.yahoo.com/calendar)
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [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]
>




Reply via email to