php-general Digest 16 Nov 2002 05:53:22 -0000 Issue 1707

Topics (messages 124636 through 124701):

Re: Escaping characters won't work
        124636 by: . Edwin

Re: GD 1.5
        124637 by: Jason Wong
        124638 by: . Edwin
        124640 by: Mako Shark
        124642 by: . Edwin
        124644 by: Jason Wong
        124645 by: . Edwin
        124648 by: . Edwin

can I retrieve jsp varibable with get or post???
        124639 by: Jeff Bluemel
        124643 by: Marek Kilimajer

Re: PHP extensions
        124641 by: Mako Shark
        124677 by: Justin French

Reasons for error message: Warning: Failed opening '/www/servers/webGNOM/test.php' for 
inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
        124646 by: Lee P. Reilly
        124657 by: Tony Earnshaw

Re: longitude/latitude function
        124647 by: Aaron Gould

Array Searching
        124649 by: Thomas Weber
        124658 by: Joel Boonstra

Specifying file to send in url...
        124650 by: Tom Woody
        124653 by: Marco Tabini
        124655 by: Jason Wong

what else do i need in this upload script?
        124651 by: Tweak2x
        124652 by: Van Andel, Robert
        124656 by: Jason Wong
        124661 by: Tweak2x

How to show autocad (dwf, dwg) files in browser?
        124654 by: Lars Espelid
        124659 by: Merritt, Dave
        124664 by: Lars Espelid

xslt question
        124660 by: Hatem Ben

Javascript + PHP
        124662 by: SED
        124666 by: BigDog

Re: Ereg headache
        124663 by: Gustaf Sjoberg
        124665 by: Gustaf Sjoberg

output buffering problem
        124667 by: webmaster

Re: It only prints lines that beggin with a number? I'm on a  deadline!
        124668 by: Godzilla

Re: -- OT --  [PHP] How to show autocad (dwf, dwg) files in brows er?
        124669 by: Merritt, Dave

PHP Website
        124670 by: Van Andel, Robert
        124672 by: Jason Reid

newbie's question
        124671 by: Frank Wang
        124673 by: Van Andel, Robert
        124678 by: Steve Keller
        124679 by: Steve Keller
        124680 by: Van Andel, Robert
        124701 by: Frank Wang

mail and from line overriding
        124674 by: Frank Wang
        124685 by: Jonathan Rosenberg \(Tabby's Place\)

Strings and php.ini
        124675 by: Khalid El-Kary
        124695 by: . Edwin

Re: Finding last entry in MySQL database
        124676 by: Justin French

Performance
        124681 by: Pupeno
        124683 by: Rasmus Lerdorf

session handling
        124682 by: Anjali Kaur
        124687 by: Justin French

running php as cgi script
        124684 by: Scott
        124686 by: Scott
        124688 by: Marco Tabini
        124689 by: bahwi
        124690 by: . Edwin
        124691 by: Marco Tabini
        124692 by: . Edwin
        124693 by: . Edwin
        124694 by: Marco Tabini
        124696 by: bahwi
        124697 by: Marco Tabini
        124698 by: . Edwin
        124699 by: bahwi
        124700 by: Scott

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 ---
Hello,

"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote:

> At 23:53 14.11.2002, Lars Espelid said:
> --------------------[snip]--------------------
> >Try to execute this code:
> >if (ereg[^0-9], $num))
> >    print "That's not a number!";
> >
> >result: parsing error, expects ')' on the if-line.
>
> You forgot an opening bracket, and need to quote the regex, like
>     if (ereg('[^0-9]', $num))
>         print "That's not a number!";
>

I think I'm missing something here but while the regex might be correct,
don't you think the "print ..." part is incorrect?

I mean, _negative_ numbers are numbers, no?

Wouldn't it be better just to use is_int() or is_numeric()?

- E

...[snip]...
--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 01:34, [EMAIL PROTECTED] wrote:

> Well, I just wanted to say that not *all* support it--esp. , I think, by
> the original authors :)

The official GD library no longer supports GIF ...

> Didn't they remove it from version 1.6? That's why the original poster was
> looking for v1.5? (Maybe he's concerned about copyright, etc.)

... because of patents issues with the some aspects of the GIF format.

If the OP was concerned about such issues then he/she should not be using GIF 
at all!

> PS
> BTW, of course someone can argue about what the word "support" implies. You
> can just add a "patch" and it'll "support" it but that wasn't my point, at
> least...

IIRC the author specifically removed all older versions of GD (those that 
supported GIF). Thus is you're talking 'official' support then GD does not 
support GIF, period, because the older versions aren't supposed to exist 
anymore. So basically if you want GD with GIF you're going have to patch it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The greatest love is a mother's, then a dog's, then a sweetheart's.
                -- Polish proverb
*/

--- End Message ---
--- Begin Message ---

"Jason Wong" <[EMAIL PROTECTED]> wrote:


> If the OP was concerned about such issues then he/she should not be using
GIF
> at all!

True. You've got a point there.

Anyway, that was just my wild guess...

- E
--- End Message ---
--- Begin Message ---
<<If the OP was concerned about such issues then
he/she should not be using GIF at all!>>

This is leading me to believe that I can't use GIFs
because of these issues. Is this true? I know now that
Unisys (Unisys?) made a fuss about some compression or
whatever, but someone told me it was still okay to use
old GDs (am I naive? maybe). Is it now considered
piracy to use GIFs at all? Does this mean I have to
switch over to JPGs, even those images that compress
better with GIFs? I just assumed we were still
permitted, what with Jasc and everybody still allowing
it in their products. Is JPEG (or PNG) the way to go?
I hesitate using PNGs since they seem to be the
least-supported out of the 'big three'.

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--- End Message ---
--- Begin Message ---
And besides,

I thought, those issues shouldn't apply anyway to versions 1.5 and below.
(Of course, the original author thinks otherwise so I'm not going to argue
that...)

- E

>
> "Jason Wong" <[EMAIL PROTECTED]> wrote:
>
>
> > If the OP was concerned about such issues then he/she should not be
using
> GIF
> > at all!
>
> True. You've got a point there.
>
> Anyway, that was just my wild guess...
>
> - E
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 03:25, [EMAIL PROTECTED] wrote:
> And besides,
>
> I thought, those issues shouldn't apply anyway to versions 1.5 and below.
> (Of course, the original author thinks otherwise so I'm not going to argue
> that...)

The patents issue still apply no matter what version you're using. Basically 
you're not allowed to use GIF in anything without a license from Unisys (the 
patent holder).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Maintainer's Motto:
        If we can't fix it, it ain't broke.
*/

--- End Message ---
--- Begin Message ---
Hello,

IANAL, so...

"Mako Shark" <[EMAIL PROTECTED]> wrote:

> <<If the OP was concerned about such issues then
> he/she should not be using GIF at all!>>
>
> This is leading me to believe that I can't use GIFs
> because of these issues. Is this true? I know now that
> Unisys (Unisys?) made a fuss about some compression or
> whatever, but someone told me it was still okay to use
> old GDs (am I naive? maybe). Is it now considered
> piracy to use GIFs at all?

Try Google and see what you find out.

> Does this mean I have to
> switch over to JPGs, even those images that compress
> better with GIFs?

No, not really. You can use PNGs instead.

> I just assumed we were still
> permitted, what with Jasc and everybody still allowing
> it in their products. Is JPEG (or PNG) the way to go?

JPEG? Whatever happened to Forgent?

I wish the browsers support JPEG2000--no worries about royalites and/or
license fees. Besides, it's better than JPEG anyway (I mean, image quality
and filesize, etc). Or, maybe, there's something better...

> I hesitate using PNGs since they seem to be the
> least-supported out of the 'big three'.

Not really.

Anyway, I think, this might be of interest:

  http://burnallgifs.org/

or maybe this one:

  http://slashdot.org/articles/02/07/18/157217.shtml?tid=155

- E
--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote:

> On Saturday 16 November 2002 03:25, [EMAIL PROTECTED] wrote:
> > And besides,
> >
> > I thought, those issues shouldn't apply anyway to versions 1.5 and
below.
> > (Of course, the original author thinks otherwise so I'm not going to
argue
> > that...)
>
> The patents issue still apply no matter what version you're using.
Basically
> you're not allowed to use GIF in anything without a license from Unisys
(the
> patent holder).

This sounds likes a different opinion...

  http://www.rime.com.au/gd/

- E
--- End Message ---
--- Begin Message ---
Can I utilize java script variables with get or post?  any information on
integrating the 2, and passing info back & forth?

thanks,

Jeff


--- End Message ---
--- Begin Message ---
php => javascript
1st way:
<script>
var var_name= <?= $var_value ?>
</script>
2nd way:
<input type="hidden" name="input_name" value="<?= $input_value ?>">

javascript => php
1st way:
location='http://server/script.php?var_name="; + js_var_name;
2nd way:
form_name.input_name.value = js_var_name;

hope you get the point :-)

Jeff Bluemel wrote:

Can I utilize java script variables with get or post? any information on
integrating the 2, and passing info back & forth?

thanks,

Jeff





--- End Message ---
--- Begin Message ---
> Email extension?  Aren't you talking about Manuel
> Lemos' mimemail class?
> It's just an include file that you have in your
> directory structure.

I know some people made reference to a 'really good'
e-mail package out there that did attachments and
stuff that seemed to be the better choice considering
the alternative (the one that comes with PHP). I
wanted to check into it.

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--- End Message ---
--- Begin Message ---
That's probably the one -- have a look on phpclasses.org -- handles
attachments, multi-part stuff (HTML email), etc etc.

Justin


on 16/11/02 5:19 AM, Mako Shark ([EMAIL PROTECTED]) wrote:

>> Email extension?  Aren't you talking about Manuel
>> Lemos' mimemail class?
>> It's just an include file that you have in your
>> directory structure.
> 
> I know some people made reference to a 'really good'
> e-mail package out there that did attachments and
> stuff that seemed to be the better choice considering
> the alternative (the one that comes with PHP). I
> wanted to check into it.
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com

Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
Hi there,

Can someone suggest a reason for the following? I am trying to INCLUDE
the JPGraph libraries in my PHP script as follows:

BEGIN CODE
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<?
/*
    _______   ______  __  ___
   / ____/ | / / __ \/  |/  /
  / / __/  |/ / / / / /|_/ /
 / /_/ / /|  / /_/ / /  / /
 \____/_/ |_/\____/_/  /_/  sasdap version
   ,----------------------------------------+
   | Comments to go here.
   `-----------------------------------------------------------------
*/

// Include the  PGraph libraries
include ("jpgraph.php");
include ("jpgraph_log.php");
include ("jpgraph_scatter.php");
include ("jpgraph_error.php");
include ("jpgraph_line.php");

$xData = array(); // holding the R (X) data  
$yData = array(); // holding the P(R) (Y) data
$eData = array(); // holding the error margin data
..
..
..
<snip>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
END CODE

My INCLUDE_PATH is set to /usr/local/lib/php, so the 5 INCLUDED scripts
are in there. However, this code results in the following error message:

Warning: Failed opening '/www/servers/webGNOM/test.php' for inclusion
(include_path='.:/usr/local/lib/php') in Unknown on line 0

I also tried changing the include line to
../../../www/server/webGNOM/JpGraph_1.9.2/ blah blah... but that gave me
the same error. Any ideas anyone?

Cheers,
Lee

--- End Message ---
--- Begin Message ---
fre, 2002-11-15 kl. 20:49 skrev Lee P. Reilly:

> Warning: Failed opening '/www/servers/webGNOM/test.php' for inclusion
> (include_path='.:/usr/local/lib/php') in Unknown on line 0

Permissions? Ownership?

Best,

Tony

-- 

Tony Earnshaw

Cricketers are strange people. They wake up
in October, only to find that their wives had
left them in May.

e-post:         [EMAIL PROTECTED]
www:            http://www.billy.demon.nl




--- End Message ---
--- Begin Message ---
That will be in KM (I'm in Canada).  Just remove the "* 1.6093" to return
Miles.
--
Aaron Gould
[EMAIL PROTECTED]
Web Developer
Parts Canada


----- Original Message -----
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 12:22 PM
Subject: RE: [PHP] longitude/latitude function


> Thanks, Just curious because after looking online it seems there are
several
> ways to do this...many giving a slightly different answer...for example, I
> went to mapquest and put in two cities and the mileage was 1500, the
> function returned 1700.  Also, the function says it prints in miles and
kms
> but it only seems to print one of them...do you know which one?  I guess I
> should look at the freshmeat site before I bother you with any other
> questions.
>
> Thanks again!!!
> Eddie
>
> -----Original Message-----
> From: Aaron Gould [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 15, 2002 11:50 AM
> To: Edward Peloke; [EMAIL PROTECTED]
> Subject: Re: [PHP] longitude/latitude function
>
>
> I got that from http://freshmeat.net/projects/zipdy/?topic_id=66.  It's a
> program called Zipdy that does these calculations.  There's also a similar
> function on the US government census site (can't remember where though),
but
> I liked Zipdy's better.
>
> --
> Aaron Gould
> [EMAIL PROTECTED]
> Web Developer
> Parts Canada
>
>
> ----- Original Message -----
> From: "Edward Peloke" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 15, 2002 11:55 AM
> Subject: RE: [PHP] longitude/latitude function
>
>
> > Thanks Aaron,
> >
> > If you don't mind me asking, where did you get it?  It seems to give a
> > better answer than my function.
> >
> > Thanks!
> > Eddie
> >
> > -----Original Message-----
> > From: Aaron Gould [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 15, 2002 11:04 AM
> > To: Edward Peloke; [EMAIL PROTECTED]
> > Subject: Re: [PHP] longitude/latitude function
> >
> >
> > Try this snippet... I can't vouch for its accuracy since I am not a
> > mathematician:
> >
> > <?
> > // Function takes latitude and longitude  of two places as input
> > // and prints the distance in miles and kms.
> > function calculateDistance($lat1, $lon1, $lat2, $lon2)
> >     // Convert all the degrees to radians
> >     $lat1 = deg2rad($lat1);
> >     $lon1 = deg2rad($lon1);
> >     $lat2 = deg2rad($lat2);
> >     $lon2 = deg2rad($lon2);
> >
> >     // Find the deltas
> >     $delta_lat = $lat2 - $lat1;
> >     $delta_lon = $lon2 - $lon1;
> >
> >     // Find the Great Circle distance
> >     $temp = pow(sin($delta_lat / 2.0), 2) + cos($lat1) * cos($lat2) *
> > pow(sin($delta_lon / 2.0), 2);
> >
> >     $EARTH_RADIUS = 3956;
> >
> >     $distance = ($EARTH_RADIUS * 2 * atan2(sqrt($temp), sqrt(1 - $temp))
*
> > 1.6093);
> >
> >     return $distance;
> > }
> > ?>
> >
> >
> > --
> > Aaron Gould
> > [EMAIL PROTECTED]
> > Web Developer
> > Parts Canada
> >
> >
> > ----- Original Message -----
> > From: "Edward Peloke" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, November 15, 2002 11:20 AM
> > Subject: [PHP] longitude/latitude function
> >
> >
> > > Has anyone ever written a php function to take the longitude and
> latitude
> > of
> > > two destinations and calculate the distance?
> > >
> > > I am working on one but the output is just a little off.
> > >
> > > Thanks,
> > > Eddie
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi,

i have an array like:

Array
(
    [1] => Array
        (
            [alias] => foo
            ...
        )
    [2] => Array
        (
            [alias] => bar
            ...
        )
    ...
)

I need some way to find out, if an alias "foo" is in the array. Any idea how
to do this?

Thanks,
Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
> i have an array like:
>
> Array
> (
>     [1] => Array
>         (
>             [alias] => foo
>             ...
>         )
>     [2] => Array
>         (
>             [alias] => bar
>             ...
>         )
>     ...
> )
>
> I need some way to find out, if an alias "foo" is in the array. Any idea how
> to do this?

Assuming your outer array is called $array_of_arrays:

<?php
$found = 0;
foreach ($array_of_arrays as $array) {
  if ($array['alias'] == 'foo') {
    $found = 1;
    break;
  }
}
if ($found) {
  // you found it!
}
else {
  // too bad!
}
?>

Or, you can look at this:

  http://www.php.net/manual/en/function.in-array.php

if you're not sure what key 'foo' will be at, or this:

  http://www.php.net/manual/en/function.array-search.php

if you're not sure what key 'foo' will be at and you want to know what
that key is.

Joel

-- 
[ joel boonstra | [EMAIL PROTECTED] ]

--- End Message ---
--- Begin Message ---
I may be way off base on this, but is it possible to specify a filename
on a url as in...

The user types in http://server/script.php?filetosend=filename.txt

The script.php recieves that file and processes accordingly?  Because
of the way its specified it would be a GET but I am not sure if this is
even possible.

Something tells me I have seen this done before but I am not sure. 
Thanks for any help on this.  I have done some Googling and Archive
search for something related and have come up blank.

-- 
Tom 

Don't throw your computer out the window, 
throw the Windows out of your computer! 

--- End Message ---
--- Begin Message ---
Sure you can do it, you can retrieve it in your code as
$_GET['filetosend']. However, you have to be very careful with the
user's input, as someone could pass malicious file names, like
"/etc/passwd", which you probably wouldn't want to disclose.

So, unless you impose draconian restrictions and checks--or security is
not a concern... I suggest you think up a different mechanism :=)

Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!
--- Begin Message ---
I may be way off base on this, but is it possible to specify a filename
on a url as in...

The user types in http://server/script.php?filetosend=filename.txt

The script.php recieves that file and processes accordingly?  Because
of the way its specified it would be a GET but I am not sure if this is
even possible.

Something tells me I have seen this done before but I am not sure. 
Thanks for any help on this.  I have done some Googling and Archive
search for something related and have come up blank.

-- 
Tom 

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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

--- End Message ---
--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 04:59, Tom Woody wrote:
> I may be way off base on this, but is it possible to specify a filename
> on a url as in...
>
> The user types in http://server/script.php?filetosend=filename.txt
>
> The script.php recieves that file and processes accordingly?  Because
> of the way its specified it would be a GET but I am not sure if this is
> even possible.

Do you mean you want to send a _local_ file called "filename.txt" to the 
_server_ via the URL? If so, then no, it's not possible.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"The lymbic system in my brain is so electrically active, it qualifies
 as a third brain.  Normal humans have two brains, left and right.

        - Jeff Merkey 
*/

--- End Message ---
--- Begin Message ---
ok, this is upload.php:

<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>


what else do i need to make afile upload?


--- End Message ---
--- Begin Message ---
This looks fine except the MAX_FILE_SIZE looks rather small.  I had an issue
with it earlier this week and found that the fileI was trying to upload was
larger than the MAX_FILE_SIZE.  I believe this is measured in bytes, so your
file cannot be larger than 1KB.  Are you getting any errors?

Robbert van Andel 

-----Original Message-----
From: Tweak2x [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 1:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] what else do i need in this upload script?


ok, this is upload.php:

<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>


what else do i need to make afile upload?



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


 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 


--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 05:04, Tweak2x wrote:
> ok, this is upload.php:
>
> <form enctype="multipart/form-data" action="upload.php" method="post">
> <input type="hidden" name="MAX_FILE_SIZE" value="1000">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send File">
> </form>
>
>
> what else do i need to make afile upload?

Why don't just try the example in the manual as someone (I believe) already 
suggested?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Satire is what closes Saturday night.
                -- George Kaufman
*/

--- End Message ---
--- Begin Message ---
it dosnt work for me
----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 4:20 PM
Subject: Re: [PHP] what else do i need in this upload script?


> On Saturday 16 November 2002 05:04, Tweak2x wrote:
> > ok, this is upload.php:
> >
> > <form enctype="multipart/form-data" action="upload.php" method="post">
> > <input type="hidden" name="MAX_FILE_SIZE" value="1000">
> > Send this file: <input name="userfile" type="file">
> > <input type="submit" value="Send File">
> > </form>
> >
> >
> > what else do i need to make afile upload?
>
> Why don't just try the example in the manual as someone (I believe)
already
> suggested?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Satire is what closes Saturday night.
> -- George Kaufman
> */
>


--- End Message ---
--- Begin Message ---
HI,

I have downloaded Volo View Express from www.autodesk.com (plugin to
web-browser) and can see the sample autocad-file that is presented on their
site.

Code ment to display the file drawing1.dwg on my page (none working):
1)
<img src="drawing1.dwg">
Displays no image.

2)
<OBJECT data="drawing1.dwg"
        type="image/vnd.dwg">
A nice drawing.
</OBJECT>
The only thing I can see is a blue rectangle whith the following error
message inside it:
"Drawing File Format Unrecogr"

3)
<object>
<param name="Filename" value="drawing1.dwg">
<embed name=thanks src="drawing1.dwg"
pluginspage="http://www.autodesk.com/whip";>
</object>
The only thing I can see is a blue rectangle whith the following error
message inside it:
"Drawing File Format Unrecogr"

I'm running Apache 1.3.26.

This is what I have written into httpd.conf:
    AddType model/vnd.dwf .dwf
    #drawing/x-dwf .dwf
    AddType image/vnd.dxf .dxf
    AddType image/vnd.dwg .dwg

This is what I have written into mime.types and mime.types.default:
    image/vnd.dwg
    image/vnd.dxf

Appreciate any help. Thanks


Lars




--- End Message ---
--- Begin Message ---
Lars,

You say you downloaded the Volo View Express, but your plug-in page points
to the WHIP viewer plug.  Regardless, there are two versions of Volo View.
Did you download the DWF version only of Volo View?

Dave

-----Original Message-----
From: Lars Espelid [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to show autocad (dwf, dwg) files in browser?


HI,

I have downloaded Volo View Express from www.autodesk.com (plugin to
web-browser) and can see the sample autocad-file that is presented on their
site.

Code ment to display the file drawing1.dwg on my page (none working):
1)
<img src="drawing1.dwg">
Displays no image.

2)
<OBJECT data="drawing1.dwg"
        type="image/vnd.dwg">
A nice drawing.
</OBJECT>
The only thing I can see is a blue rectangle whith the following error
message inside it:
"Drawing File Format Unrecogr"

3)
<object>
<param name="Filename" value="drawing1.dwg">
<embed name=thanks src="drawing1.dwg"
pluginspage="http://www.autodesk.com/whip";>
</object>
The only thing I can see is a blue rectangle whith the following error
message inside it:
"Drawing File Format Unrecogr"

I'm running Apache 1.3.26.

This is what I have written into httpd.conf:
    AddType model/vnd.dwf .dwf
    #drawing/x-dwf .dwf
    AddType image/vnd.dxf .dxf
    AddType image/vnd.dwg .dwg

This is what I have written into mime.types and mime.types.default:
    image/vnd.dwg
    image/vnd.dxf

Appreciate any help. Thanks


Lars





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Only my third code-example points to the whip-viewer plug, and that's most
likely wrong. My first and second example may also be wrong, someone know
how to get it right?

I have tried these two viewers:

Volo View Express 2.01.
On this page http://www.autodesk.no/adsk/index/0,,837403-123112,00.html it
says:
"DWF-Only Version of Volo View Express. Views only DWF files and does not
view DWG or DXF files."
When I fill out the form and continue, the next page says:
"This version should understand DWG, DXFT, and DWF (ePlot and eView) files."
What is right?

WHIP! 4.0
On this page http://www.autodesk.com/cgi-bin/whipreg.pl it says:
"you can view and print AutoCAD drawings without using AutoCAD."
On the next page a plug-in is downloaded and I can see a .dwf file in my
browser.

Still, when I try to execute my code to view drawing1.dwg it won't work.

Is my code right, and if it is where can I download a ".dwg-plug-in".

regards,

Lars




"Dave Merritt" <[EMAIL PROTECTED]> skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Lars,
>
> You say you downloaded the Volo View Express, but your plug-in page points
> to the WHIP viewer plug.  Regardless, there are two versions of Volo View.
> Did you download the DWF version only of Volo View?
>
> Dave
>
> -----Original Message-----
> From: Lars Espelid [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 15, 2002 4:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to show autocad (dwf, dwg) files in browser?
>
>
> HI,
>
> I have downloaded Volo View Express from www.autodesk.com (plugin to
> web-browser) and can see the sample autocad-file that is presented on
their
> site.
>
> Code ment to display the file drawing1.dwg on my page (none working):
> 1)
> <img src="drawing1.dwg">
> Displays no image.
>
> 2)
> <OBJECT data="drawing1.dwg"
>         type="image/vnd.dwg">
> A nice drawing.
> </OBJECT>
> The only thing I can see is a blue rectangle whith the following error
> message inside it:
> "Drawing File Format Unrecogr"
>
> 3)
> <object>
> <param name="Filename" value="drawing1.dwg">
> <embed name=thanks src="drawing1.dwg"
> pluginspage="http://www.autodesk.com/whip";>
> </object>
> The only thing I can see is a blue rectangle whith the following error
> message inside it:
> "Drawing File Format Unrecogr"
>
> I'm running Apache 1.3.26.
>
> This is what I have written into httpd.conf:
>     AddType model/vnd.dwf .dwf
>     #drawing/x-dwf .dwf
>     AddType image/vnd.dxf .dxf
>     AddType image/vnd.dwg .dwg
>
> This is what I have written into mime.types and mime.types.default:
>     image/vnd.dwg
>     image/vnd.dxf
>
> Appreciate any help. Thanks
>
>
> Lars
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
hey all
I'm using xslt_process(), and noticed that it add a meta just after the
<head> :

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Where can i change it, or desactivate it ?

thanks
Hatem

--- End Message ---
--- Begin Message ---
I need to finish a project using PHP and JavaScript but the references
for JavaScript I'm using is rather old. I'm looking for a JavaScript
postlist similar to this but without any luck. I have tried Google but
it finds every site containing JavaScript where a postlist is mentioned.
Since there are many pros on this list, maybe someone can point me to a
JavaScript postlist similar to this.

Thanks,
Sumarlidi E. Dadason

SED - Graphic Design
_________________________________
Tel: 896-0376, 461-5501
E-mail: [EMAIL PROTECTED]
website: www.sed.is

--- End Message ---
--- Begin Message ---
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&group=comp.lang.javascript


On Fri, 2002-11-15 at 23:07, SED wrote:
> I need to finish a project using PHP and JavaScript but the references
> for JavaScript I'm using is rather old. I'm looking for a JavaScript
> postlist similar to this but without any luck. I have tried Google but
> it finds every site containing JavaScript where a postlist is mentioned.
> Since there are many pros on this list, maybe someone can point me to a
> JavaScript postlist similar to this.
> 
> Thanks,
> Sumarlidi E. Dadason
> 
> SED - Graphic Design
> _________________________________
> Tel: 896-0376, 461-5501
> E-mail: [EMAIL PROTECTED]
> website: www.sed.is

-- 
.: B i g D o g :.


--- End Message ---
--- Begin Message ---
hi,
this is probably not at all what you want, but i wrote it just in case.

<?
function pos1($numbers) {
        if ($numbers) {
                if ($numbers == '1')
                        return "only";
                if (ereg("^1.+", $numbers))
                        return "left";
                if (ereg(".+1$", $numbers))
                        return "right";
                if (ereg(".+(1).+", $numbers))
                        return "middle";
        }
        return false;
}
$text = "3, 2, 1, 4";
if pos1($text)
        echo pos1($text);
?>

if 1 is in the string it will return either "middle", "left", "right" or "only".. if 
it is not it will return false.

On Fri, 15 Nov 2002 08:49:23 -0800 (PST)
[EMAIL PROTECTED] (Mako Shark) wrote:

>I have a real problem that I can't seem to figure out.
>I need an ereg pattern to search for a certain string
>(below). All this is being shelled to a Unix grep
>command because I'm looking this up in very many
>files.
>
>I've made myself a <INPUT TYPE="HIDDEN" tag> that
>contains in the value attribute a list of
>comma-delimited numbers. I need to find if a certain
>number is in these tags (and each file contains one
>tag). I need an ereg statement that will let me search
>these lines to see if a number exists, obviously in
>the beginning or the end or the middle or if it's the
>only number in the list. Here's what I mean (searching
>for number 1):
>
><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>"1,2,3,4,5">   //beginning
>
><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>"0,1,2,3,4,5">   //middle
>
><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>"5,4,3,2,1">   //end
>
><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE = "1">  
> //only
>
>This is frustrating me, because each solution I come
>up with doesn't work. Here is my grep/ereg statement
>so far:
>
>$commanumberbeginning = "[[0-9]+,]*"; //this allows 0
>or more numbers before it, and if there are any, they
>must have 1 or more digits followed by a comma
>
>$commanumberend = "[,[0-9]+]*"; // this allows 0 or
>more numbers after it, and if there are any, they must
>have a comma followed by 1 or more digits
>
>$ereg-statement=$commanumberbeginning .
>$numbertosearchfor . $commanumberbeginning;
>//$numbertosearchfor will be obtained through a select
>control in a form
>
>grep '<INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>"$ereg-statement">' *.html
>
>This problem is kicking my butt. Any help?
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Web Hosting - Let the expert host your site
>http://webhosting.yahoo.com
--- End Message ---
--- Begin Message ---
or.. if there can be only one instance of the number you can easily calculate it's 
position with

strlen($numbers)

and strpos($numbers, "1");

if strlen returns 5 and strpos 5 you'll know it was far right.. if strpos returns 1 
and strlen >1 it's to the left.. and if strpos < strlen but not 1 it's in the middle.. 
etc.

On Sat, 16 Nov 2002 00:04:50 +0100
[EMAIL PROTECTED] (Gustaf Sjoberg) wrote:

>hi,
>this is probably not at all what you want, but i wrote it just in case.
>
><?
>function pos1($numbers) {
>        if ($numbers) {
>                if ($numbers == '1')
>                        return "only";
>                if (ereg("^1.+", $numbers))
>                        return "left";
>                if (ereg(".+1$", $numbers))
>                        return "right";
>                if (ereg(".+(1).+", $numbers))
>                        return "middle";
>        }
>        return false;
>}
>$text = "3, 2, 1, 4";
>if pos1($text)
>        echo pos1($text);
>?>
>
>if 1 is in the string it will return either "middle", "left", "right" or "only".. if 
>it is not it will return false.
>
>On Fri, 15 Nov 2002 08:49:23 -0800 (PST)
>[EMAIL PROTECTED] (Mako Shark) wrote:
>
>>I have a real problem that I can't seem to figure out.
>>I need an ereg pattern to search for a certain string
>>(below). All this is being shelled to a Unix grep
>>command because I'm looking this up in very many
>>files.
>>
>>I've made myself a <INPUT TYPE="HIDDEN" tag> that
>>contains in the value attribute a list of
>>comma-delimited numbers. I need to find if a certain
>>number is in these tags (and each file contains one
>>tag). I need an ereg statement that will let me search
>>these lines to see if a number exists, obviously in
>>the beginning or the end or the middle or if it's the
>>only number in the list. Here's what I mean (searching
>>for number 1):
>>
>><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>>"1,2,3,4,5">   //beginning
>>
>><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>>"0,1,2,3,4,5">   //middle
>>
>><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>>"5,4,3,2,1">   //end
>>
>><INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE = "1">  
>> //only
>>
>>This is frustrating me, because each solution I come
>>up with doesn't work. Here is my grep/ereg statement
>>so far:
>>
>>$commanumberbeginning = "[[0-9]+,]*"; //this allows 0
>>or more numbers before it, and if there are any, they
>>must have 1 or more digits followed by a comma
>>
>>$commanumberend = "[,[0-9]+]*"; // this allows 0 or
>>more numbers after it, and if there are any, they must
>>have a comma followed by 1 or more digits
>>
>>$ereg-statement=$commanumberbeginning .
>>$numbertosearchfor . $commanumberbeginning;
>>//$numbertosearchfor will be obtained through a select
>>control in a form
>>
>>grep '<INPUT TYPE = "HIDDEN" NAME = "numbers" VALUE =
>>"$ereg-statement">' *.html
>>
>>This problem is kicking my butt. Any help?
>>
>>__________________________________________________
>>Do you Yahoo!?
>>Yahoo! Web Hosting - Let the expert host your site
>>http://webhosting.yahoo.com
--- End Message ---
--- Begin Message ---
I'm trying to enable output buffering to speed up the load time of some
of our php web pages.  I've consulted the manual and enabled the
following:

output_buffering = On
output_handler = ob_gzhandler

At the beginning of my .php script, I include the following:

ob_start(ob_gzhandler);

This returns complete garbage when I run the page.  Is there something I
missed within the setup?  Or maybe something I need to install for
Apache?

php version = 4.1.2
RedHat = 7.2

Thanks for any advice,
-Elkan

--- End Message ---
--- Begin Message ---
Thanks so much guys, that worked perfectly. I do ok with php but am still on
the bumpy part of the road with SQL queries.

Thanks again!

Regards,
Tim

"1lt John W. Holmes" <[EMAIL PROTECTED]> wrote in message
00da01c28cad$b9a90d50$a629089b@TBHHCCDR">news:00da01c28cad$b9a90d50$a629089b@TBHHCCDR...
> > >$result = mysql_query ("SELECT * FROM `data` WHERE categories");
>
> Where categories is what?? You don't have any comparison...
>
> What it's doing is evaluating the column as true or false. Any integer
> column > 0 will evaluate to true, so that row will be returned. "1A" will
be
> converted to 1, so it'll be returned as true. "CD" will be converted to
> zero, so that row will not be returned...
>
> ---John Holmes...
>


--- End Message ---
--- Begin Message ---
Okay, the WHIP viewer is only for DWF files from ACAD 13, 14, & 2000 only.
It does NOT handle DWG files or DWF from ACAD 2002 based products
(Inventor),  Volo View Express 2.01 handles DWF, DWG, & DXF only if you
download the english language version.  Non-english versions of VVE will NOT
view DWG & DXF files only DWF files from ACAD 2002.

What version fo ACAD are you dealing with?  If it' 13, 14, or 2000 or going
to have to use WHIP & DWF files.  If it's ACAD 2002 and you can use an
english language viewer then you can use DWF, DWG, or DXF.  If it's ACAD
2002 and your using a non-english viewer then it's DWF only.  

If you have a site that has a mixture of ACAD versions from 13 thru 2002, or
going to have to have to either distinguish between the versions somehow and
use the appropriate viewer or you will have to open each file into ACAD 2002
and save each one back into 2002 format.  The file format for DWF changed
between ACAD 2000 & 2002.  Sucks I know, esp. the english/non-english thing.

Dave

-----Original Message-----
From: Lars Espelid [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 6:09 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to show autocad (dwf, dwg) files in browser?



Only my third code-example points to the whip-viewer plug, and that's most
likely wrong. My first and second example may also be wrong, someone know
how to get it right?

I have tried these two viewers:

Volo View Express 2.01.
On this page http://www.autodesk.no/adsk/index/0,,837403-123112,00.html it
says:
"DWF-Only Version of Volo View Express. Views only DWF files and does not
view DWG or DXF files."
When I fill out the form and continue, the next page says:
"This version should understand DWG, DXFT, and DWF (ePlot and eView) files."
What is right?

WHIP! 4.0
On this page http://www.autodesk.com/cgi-bin/whipreg.pl it says:
"you can view and print AutoCAD drawings without using AutoCAD."
On the next page a plug-in is downloaded and I can see a .dwf file in my
browser.

Still, when I try to execute my code to view drawing1.dwg it won't work.

Is my code right, and if it is where can I download a ".dwg-plug-in".

regards,

Lars




"Dave Merritt" <[EMAIL PROTECTED]> skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Lars,
>
> You say you downloaded the Volo View Express, but your plug-in page points
> to the WHIP viewer plug.  Regardless, there are two versions of Volo View.
> Did you download the DWF version only of Volo View?
>
> Dave
>
> -----Original Message-----
> From: Lars Espelid [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 15, 2002 4:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to show autocad (dwf, dwg) files in browser?
>
>
> HI,
>
> I have downloaded Volo View Express from www.autodesk.com (plugin to
> web-browser) and can see the sample autocad-file that is presented on
their
> site.
>
> Code ment to display the file drawing1.dwg on my page (none working):
> 1)
> <img src="drawing1.dwg">
> Displays no image.
>
> 2)
> <OBJECT data="drawing1.dwg"
>         type="image/vnd.dwg">
> A nice drawing.
> </OBJECT>
> The only thing I can see is a blue rectangle whith the following error
> message inside it:
> "Drawing File Format Unrecogr"
>
> 3)
> <object>
> <param name="Filename" value="drawing1.dwg">
> <embed name=thanks src="drawing1.dwg"
> pluginspage="http://www.autodesk.com/whip";>
> </object>
> The only thing I can see is a blue rectangle whith the following error
> message inside it:
> "Drawing File Format Unrecogr"
>
> I'm running Apache 1.3.26.
>
> This is what I have written into httpd.conf:
>     AddType model/vnd.dwf .dwf
>     #drawing/x-dwf .dwf
>     AddType image/vnd.dxf .dxf
>     AddType image/vnd.dwg .dwg
>
> This is what I have written into mime.types and mime.types.default:
>     image/vnd.dwg
>     image/vnd.dxf
>
> Appreciate any help. Thanks
>
>
> Lars
>
>
>
>
>
> --
> 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
--- End Message ---
--- Begin Message ---
Anyone else having trouble accessing PHP.net?

Robbert van Andel 




 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 


--- End Message ---
--- Begin Message ---
Nope, though if you are you could always just try using one of the mirrors.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

----- Original Message -----
From: "Van Andel, Robert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 4:56 PM
Subject: [PHP] PHP Website


> Anyone else having trouble accessing PHP.net?
>
> Robbert van Andel
>
>
>
>
>  "The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited. If you received
> this in error, please contact the sender and delete the material from all
> computers."
>
>
>


--- End Message ---
--- Begin Message ---
Hi,
what is the correct way of testing if a string is empty or not?

fw


--- End Message ---
--- Begin Message ---
Don't know about a correct way but you can use if(empty($variable))

Robbert van Andel 


-----Original Message-----
From: Frank Wang [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 7:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] newbie's question


Hi,
what is the correct way of testing if a string is empty or not?

fw



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


 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 


--- End Message ---
--- Begin Message ---
At 11/15/2002 06:09 PM, you wrote:

Don't know about a correct way but you can use if(empty($variable))
I may be crazy, but wouldn't if ($variable) work just as well? If the string is empty it'll return a negatory on that check.

Lemme double check that.

$testVar = "";
if ($testVar) {
echo "Yes";
}
else {
echo "No";
}

Yeah, ok. That ran just fine under 4.2.3.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

--- End Message ---
--- Begin Message --- Err... sorry. The logic was there but my fingers got a bit ahead of my brain. The check works, but if you want to just check if it's empty turn the conditional to a negative, like so:

if (!$testVar) {
etc.
}

That makes it "If NOT $testVar"



> I may be crazy, but wouldn't if ($variable) work just as well? If the string is empty it'll return a negatory on that check.
>
> Lemme double check that.
>
> $testVar = "";
> if ($testVar) {
> echo "Yes";
> }
> else {
> echo "No";
> }
>
> Yeah, ok. That ran just fine under 4.2.3.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

--- End Message ---
--- Begin Message ---
Yes it would.  I like to make things complicated :)

Robbert van Andel 


-----Original Message-----
From: Steve Keller [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 15, 2002 5:11 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] newbie's question


Err... sorry. The logic was there but my fingers got a bit ahead of my 
brain. The check works, but if you want to just check if it's empty turn 
the conditional to a negative, like so:

if (!$testVar) {
        etc.
}

That makes it "If NOT $testVar"



 > I may be crazy, but wouldn't if ($variable) work just as well? If the 
string is empty it'll return a negatory on that check.
 >
 > Lemme double check that.
 >
 > $testVar = "";
 > if ($testVar) {
 >   echo "Yes";
 > }
 > else {
 >   echo "No";
 > }
 >
 > Yeah, ok. That ran just fine under 4.2.3.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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


 "The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers." 


--- End Message ---
--- Begin Message ---
Hi,

That looks good to me, thanks.

"Steve Keller" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Err... sorry. The logic was there but my fingers got a bit ahead of my
> brain. The check works, but if you want to just check if it's empty turn
> the conditional to a negative, like so:
>
> if (!$testVar) {
> etc.
> }
>
> That makes it "If NOT $testVar"
>
>
>
>  > I may be crazy, but wouldn't if ($variable) work just as well? If the
> string is empty it'll return a negatory on that check.
>  >
>  > Lemme double check that.
>  >
>  > $testVar = "";
>  > if ($testVar) {
>  >   echo "Yes";
>  > }
>  > else {
>  >   echo "No";
>  > }
>  >
>  > Yeah, ok. That ran just fine under 4.2.3.
> --
> S. Keller
> UI Engineer
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Email: [EMAIL PROTECTED]
> Web: www.healthtvchannel.org
>


--- End Message ---
--- Begin Message ---
Hi,

I have something like following:

$from = "[EMAIL PROTECTED]";
$email = "[EMAIL PROTECTED]";
$msg = "abcde";

 mail($email, $subj, $msg, $from);

the message sent always has the 'from' line taken from php.ini, not $from,
is there a way to override this ? Thanks.

Frank


--- End Message ---
--- Begin Message ---
You need to change the first statement to

        $from = "From: [EMAIL PROTECTED]";

--
JR

> -----Original Message-----
> From: Frank Wang [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 15, 2002 10:15 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] mail and from line overriding
>
>
> Hi,
>
> I have something like following:
>
> $from = "[EMAIL PROTECTED]";
> $email = "[EMAIL PROTECTED]";
> $msg = "abcde";
>
>  mail($email, $subj, $msg, $from);
>
> the message sent always has the 'from' line taken from php.ini, not $from,
> is there a way to override this ? Thanks.
>
> Frank
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message --- hi,

are there any php.ini directives that control the PHP string functions?
sorry i'm not percise but infact i have a 1200 lines script that acts well on a windows machine with PHP 4.2.3 Apache 1.3.24, but on a linux machine with PHP 4.2.1 (keep it secret :)) and Apache 1.3.20 it acts bad
but the script wholly depends on string functions nothing more!

thanx in advance

khalid





_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Hello,

"Khalid El-Kary" <[EMAIL PROTECTED]>wrote:
> hi,
>
> are there any php.ini directives that control the PHP string functions?

You mean something like this? (Under "; Safe Mode")

----->
; This directive allows you to disable certain functions for security
reasons.
; It receives a comma-deliminated list of function names.  This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions =
<-----

> sorry i'm not percise but infact i have a 1200 lines script that acts well
> on a windows machine with PHP 4.2.3 Apache 1.3.24, but on a linux machine
> with PHP 4.2.1 (keep it secret :)) and Apache 1.3.20 it acts bad
> but the script wholly depends on string functions nothing more!
>

Why don't you just compare you php.ini files?

- E
--- End Message ---
--- Begin Message ---
on 15/11/02 8:11 PM, Tim Thorburn ([EMAIL PROTECTED]) wrote:

> I'm creating a form which will allow individuals to add themselves to an
> online database and ask if they'd like to upload a picture.  I have the
> form setup which allows the individuals to add themselves - currently it
> asks if they have a picture to upload (a yes or no drop menu).  On the
> screen after the individual adds them self, I'd like to check the database
> for the last entry (the one just made) and then see if the picture column
> has a yes or a no stored.
> 
> What I don't know is how to select the last entry in a database ... I'm
> sure its something very simple, but with being up until 5am working on this
> site - it's slipped by caffeine powered brain.

To answer your question first, assuming you have an numeric, unique id
column, you would do something like

SELECT * FROM tablename ORDER BY id DESC LIMIT 1


BUT, it's *possible* that another row could be inserted before you get the
chance to check... the real key here (assuming you are using MySQL) is to
use mysql_insert_id().


Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm very intresting in achiving high performances with my scripts.
I have a couple of questions about performance.
When passing arrays (they are not very huge anyway) to a function, passing 
them as reference is faster, isn't it ?
And when I have a chain of ifs, is ti better (from the performance point of 
view) to change it for a switch ?
And by the way, do you know of any documents related to performance in PHP ?
Thank you.
- -- 
Pupeno: [EMAIL PROTECTED]
http://www.pupeno.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE91ZljLr8z5XzmSDQRAmIEAJoCvB/jpYbwkXjc1tjqY4+sNON4TQCePEoT
EZkh5dHGguO8C4J5MRppQTo=
=bi6p
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
> I'm very intresting in achiving high performances with my scripts.
> I have a couple of questions about performance.
> When passing arrays (they are not very huge anyway) to a function, passing
> them as reference is faster, isn't it ?

No

> And when I have a chain of ifs, is ti better (from the performance point of
> view) to change it for a switch ?

It really doesn't matter.  You are focusing on the wrong bits here.  Look
at the architecture of your app.  Make sure any database calls are optimal
and look at using a reverse-proxy cache out in front of your system and
sending appropriate cache headers.  Or break up your app into stuff that
can be cached and stuff that can't and look at something like
pear/Cache_Lite or roll your own that is specific to your application.
All of these will give you order of magnitude speedups while what you are
worrying about won't even be measurable.  We can argue all day long about
the theoretical speed of passing by reference vs. pass by value, but in
the end you won't be able to measure it.

PS. Please, don't pgp-sign mailing list messages. See this link for some
tips on using the PHP mailing lists:

http://www.php.net/mailing-lists.php

-Rasmus

--- End Message ---
--- Begin Message ---
i want to access some variables generated in one page
in all the other pages, so i thought of using
$_SESSION.

what i did is :

in page1.php i do: 

   $temp = 'someValue';
   session_start();
   $_SESSION['abc'] = $temp;


in page2.php :

session_start();
echo($_SESSION['abc']);


but i am not able to get the value of abc.

please help me out. i went thru the documentation
online but cudnt grasp much as to where i am going
wrong.

thank you.
anjali.


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
--- End Message ---
--- Begin Message ---
Have you got cookies enabled in your browser?
Check if PHP is setting the cookie in your browser -- it should be named
PHPSESSID by default, but might be named something else...

If you haven't got cookies enabled on your browser, then you have to pass
the session id around in the URL, linking page 1 to page 2.


Justin


on 16/11/02 12:36 PM, Anjali Kaur ([EMAIL PROTECTED]) wrote:

> i want to access some variables generated in one page
> in all the other pages, so i thought of using
> $_SESSION.
> 
> what i did is :
> 
> in page1.php i do:
> 
> $temp = 'someValue';
> session_start();
> $_SESSION['abc'] = $temp;
> 
> 
> in page2.php :
> 
> session_start();
> echo($_SESSION['abc']);
> 
> 
> but i am not able to get the value of abc.
> 
> please help me out. i went thru the documentation
> online but cudnt grasp much as to where i am going
> wrong.
> 
> thank you.
> anjali.
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com

Justin French
--------------------
http://Indent.com.au
Web Developent & 
Graphic Design
--------------------

--- End Message ---
--- Begin Message ---
I'm trying to run a simple test php script as a cgi script on my ISP's server 
and haven't been able to get it to work, although according them it is 
possible.

I have an example from a book  which gives the following steps:

1. Put the script in the cgi-bin
2. run chmod 755
3. include "#!/usr/bin/php" at the top. (I have checked that this is the 
correct location of php on the server)

The test script they give looks like this:

#!/usr/bin/php

echo "This is a small CGI program."

Doesn't look like the usual php syntax to me, but I guess this is different.
Anyway I've tried it a bunch of different ways and it hasn't worked and I 
haven't been able to find much on the subject from Google. 
Can someone tell me where I'm going wrong?

Thanks,
SW






--- End Message ---
--- Begin Message ---
Forgot to include the error I'm getting is:

CGIwrap Error: System Error: execv() failed

Error: No such file or directory (2)

Although the file and path are correct.

On Friday 15 November 2002 10:52 pm, you wrote:
> I'm trying to run a simple test php script as a cgi script on my ISP's
> server and haven't been able to get it to work, although according them it
> is possible.
>
> I have an example from a book  which gives the following steps:
>
> 1. Put the script in the cgi-bin
> 2. run chmod 755
> 3. include "#!/usr/bin/php" at the top. (I have checked that this is the
> correct location of php on the server)
>
> The test script they give looks like this:
>
> #!/usr/bin/php
>
> echo "This is a small CGI program."
>
> Doesn't look like the usual php syntax to me, but I guess this is
> different. Anyway I've tried it a bunch of different ways and it hasn't
> worked and I haven't been able to find much on the subject from Google.
> Can someone tell me where I'm going wrong?
>
> Thanks,
> SW
--- End Message ---
--- Begin Message ---
The script looks ok to me...

The difference that you probably see is the first line. This is the
"shebang", a line that tells the script interpreter which application
the script should be interpreted with. This, together with the
permissions you've provided, makes the script "self-executing", in that
the shell automatically invokes the php executable when it finds the
shebang and it feeds the rest of the script to it.

You could obtain the same result by removing the shebang and passing the
file as a parameter to the php executable, although it would be less
practical in many cases.

Two possibilities: one, your host does not allow shell php scripts. In
this case, you're out of luck (you *could* execute your script through
the web using a shell interface like lynx or curl, but that's probably
not what you want to do, and it would mean some serious security
implications). The other possibility is that you're simply looking for
the PHP executable in the wrong place (only because the author of the
book had it in /usr/bin doesn't mean you will, too). It most likely is
in /usr/local/bin, so that your shebang should read:

#!/usr/local/bin/php

However, here's a quick test to determine if CGI PHP is installed on
your server:

echo "<? echo 'PHP LIVES!'; ?>" | php

If this prints "PHP LIVES!", you have PHP installed on your machine and
your just pointing to the wrong place. If the suggestion above does not
work, try typing:

which php

that will return the location of your PHP executable. If the test
doesn't work, than you most likely have no access to a CGI version of
PHP, or it is not in your execution path.

Marco

-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Fri, 2002-11-15 at 22:52, Scott wrote:
> I'm trying to run a simple test php script as a cgi script on my ISP's server 
> and haven't been able to get it to work, although according them it is 
> possible.
> 
> I have an example from a book  which gives the following steps:
> 
> 1. Put the script in the cgi-bin
> 2. run chmod 755
> 3. include "#!/usr/bin/php" at the top. (I have checked that this is the 
> correct location of php on the server)
> 
> The test script they give looks like this:
> 
> #!/usr/bin/php
> 
> echo "This is a small CGI program."
> 
> Doesn't look like the usual php syntax to me, but I guess this is different.
> Anyway I've tried it a bunch of different ways and it hasn't worked and I 
> haven't been able to find much on the subject from Google. 
> Can someone tell me where I'm going wrong?
> 
> Thanks,
> SW
> 
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message --- That is in no way a correct php program. What error are you getting on the page? Or are you seeing the source? If you are seeing the source when you try to view the script it is a problem on their end(they may want them named as .cgi instead of .php, although rare now, this might be how they are doing it).

--Joseph Guhlin
http://www.bahwi.cc/
Web Developer / Unix Consultant


Scott wrote:

I'm trying to run a simple test php script as a cgi script on my ISP's server and haven't been able to get it to work, although according them it is possible.

I have an example from a book which gives the following steps:

1. Put the script in the cgi-bin
2. run chmod 755
3. include "#!/usr/bin/php" at the top. (I have checked that this is the correct location of php on the server)

The test script they give looks like this:

#!/usr/bin/php

echo "This is a small CGI program."

Doesn't look like the usual php syntax to me, but I guess this is different.
Anyway I've tried it a bunch of different ways and it hasn't worked and I haven't been able to find much on the subject from Google. Can someone tell me where I'm going wrong?

Thanks,
SW









--- End Message ---
--- Begin Message ---
Hello,

"Scott" <[EMAIL PROTECTED]> wrote:

>
> Forgot to include the error I'm getting is:
>
> CGIwrap Error: System Error: execv() failed
>
> Error: No such file or directory (2)
>
> Although the file and path are correct.
>

Are you sure it's correct? Most cgi-bin folders are located outside your
home folder. Maybe you can double check.

And make sure that you're uploading *not* in binary format...

Just guessing,

- E

...[snip]...
--- End Message ---
--- Begin Message ---
Joseph, I think he's trying to run the script from the shell--in which
case it looks okay to me (besides perhaps a terminating semicolon on the
last line)

Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Fri, 2002-11-15 at 23:12, bahwi wrote:
> That is in no way a correct php program. What error are you getting on 
> the page? Or are you seeing the source? If you are seeing the source 
> when you try to view the script it is a problem on their end(they may 
> want them named as .cgi instead of .php, although rare now, this might 
> be how they are doing it).
> 
> --Joseph Guhlin
> http://www.bahwi.cc/
> Web Developer / Unix Consultant
> 
> 
> Scott wrote:
> 
> >I'm trying to run a simple test php script as a cgi script on my ISP's server 
> >and haven't been able to get it to work, although according them it is 
> >possible.
> >
> >I have an example from a book  which gives the following steps:
> >
> >1. Put the script in the cgi-bin
> >2. run chmod 755
> >3. include "#!/usr/bin/php" at the top. (I have checked that this is the 
> >correct location of php on the server)
> >
> >The test script they give looks like this:
> >
> >#!/usr/bin/php
> >
> >echo "This is a small CGI program."
> >
> >Doesn't look like the usual php syntax to me, but I guess this is different.
> >Anyway I've tried it a bunch of different ways and it hasn't worked and I 
> >haven't been able to find much on the subject from Google. 
> >Can someone tell me where I'm going wrong?
> >
> >Thanks,
> >SW
> >
> >
> >
> >
> >
> >
> >
> >  
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
"Scott" <[EMAIL PROTECTED]> wrote:

> I'm trying to run a simple test php script as a cgi script on my ISP's
server
> and haven't been able to get it to work, although according them it is
> possible.
>
> I have an example from a book  which gives the following steps:
>
> 1. Put the script in the cgi-bin
> 2. run chmod 755
> 3. include "#!/usr/bin/php" at the top. (I have checked that this is the
> correct location of php on the server)
>
> The test script they give looks like this:
>
> #!/usr/bin/php
>
> echo "This is a small CGI program."
>
> Doesn't look like the usual php syntax to me,

Maybe that's why it doesn't work ;)

You should use the <?php ?> tags.

- E

...[snip]...
--- End Message ---
--- Begin Message ---
... and yes, you forgot the semi-colon :)

Also, are you trying to do something like these?

  http://www.phpbeginner.com/columns/ray/cli

- E
--- End Message ---
--- Begin Message ---
If you look at the error he's getting, I think there's something a bit
more critical than the PHP tags... although you're right and I missed
that :-( d'oh!

Marco

On Fri, 2002-11-15 at 23:20, @ Edwin wrote:
> 
> "Scott" <[EMAIL PROTECTED]> wrote:
> 
> > I'm trying to run a simple test php script as a cgi script on my ISP's
> server
> > and haven't been able to get it to work, although according them it is
> > possible.
> >
> > I have an example from a book  which gives the following steps:
> >
> > 1. Put the script in the cgi-bin
> > 2. run chmod 755
> > 3. include "#!/usr/bin/php" at the top. (I have checked that this is the
> > correct location of php on the server)
> >
> > The test script they give looks like this:
> >
> > #!/usr/bin/php
> >
> > echo "This is a small CGI program."
> >
> > Doesn't look like the usual php syntax to me,
> 
> Maybe that's why it doesn't work ;)
> 
> You should use the <?php ?> tags.
> 
> - E
> 
> ...[snip]...
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message --- Oh, sorry, I'm running the 4.2.3 standalone version(from FreeBSD Ports system) and I have to use the tags still.
It looks like a CGIwrap problem, but I'm not familiar with that. =/

--Joseph
http://www.josephguhlin.com/

Marco Tabini wrote:

Joseph, I think he's trying to run the script from the shell--in which
case it looks okay to me (besides perhaps a terminating semicolon on the
last line)

Marco


--- End Message ---
--- Begin Message ---
No, that was actually my mistake, and you were right. I guess I've
either had too much to drink, or too little. I'll try and post again in
a couple of hours and let's see which of the two is the case :-)


Marco

On Fri, 2002-11-15 at 23:26, bahwi wrote:
> Oh, sorry, I'm running the 4.2.3 standalone version(from FreeBSD Ports 
> system) and I have to use the tags still.
> It looks like a CGIwrap problem, but I'm not familiar with that. =/
> 
> --Joseph
> http://www.josephguhlin.com/
> 
> Marco Tabini wrote:
> 
> >Joseph, I think he's trying to run the script from the shell--in which
> >case it looks okay to me (besides perhaps a terminating semicolon on the
> >last line)
> >
> >Marco
> >  
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
Hello Marco,

"Marco Tabini" <[EMAIL PROTECTED]> wrote:

> If you look at the error he's getting, I think there's something a bit
> more critical than the PHP tags...

You're right. Most probably there's something more...

> although you're right and I missed
> that :-( d'oh!

:-)

Anyway, regarding the error, just a simple Google search might help:

  Keyword: "CGIwrap Error: System Error: execv() failed"

As many people always say, "Google is your friend." ;-)

- E

PS
Very interesting (sample) article there about PDFs
(http://www.phparch.com/). Good job!

...[snip]...
--- End Message ---
--- Begin Message --- Haha, well I posted my version number because I haven't tested the new one that actually comes default with a CLI. So I don't know if the end tags are necessary or not.

Marco Tabini wrote:

No, that was actually my mistake, and you were right. I guess I've
either had too much to drink, or too little. I'll try and post again in
a couple of hours and let's see which of the two is the case :-)


Marco

On Fri, 2002-11-15 at 23:26, bahwi wrote:

Oh, sorry, I'm running the 4.2.3 standalone version(from FreeBSD Ports system) and I have to use the tags still.
It looks like a CGIwrap problem, but I'm not familiar with that. =/

--Joseph
http://www.josephguhlin.com/

Marco Tabini wrote:


Joseph, I think he's trying to run the script from the shell--in which
case it looks okay to me (besides perhaps a terminating semicolon on the
last line)

Marco



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





--- End Message ---
--- Begin Message ---
I'm not intending to run the script from the shell. What I am trying to do is 
encrypt emails with Gnupg.  The problem is Gnupg runs as my user name and php 
runs as nobody.  So I'm trying to run a php script as cgi to deliver the data 
to Gnupg since a cgi script will run as my username.  I am using a perl 
script right now and it works, but the rest of the application is in php, so 
its causing some me some design difficulties.
I'm going to try some the suggestions posted and see if I can get it working. 
 Thanks,
SW

On Friday 15 November 2002 11:04 pm, you wrote:
> Joseph, I think he's trying to run the script from the shell--in which
> case it looks okay to me (besides perhaps a terminating semicolon on the
> last line)
>
> Marco
--- End Message ---

Reply via email to