Re: [PHP] Thank You for your help

2003-08-28 Thread Leif K-Brooks
[EMAIL PROTECTED] wrote:

2) this question is more directed to Justin French, but in any case, the
reason i wanted to use the PDF forms is so that i don't have to create them
again in CSS or any other format, the forms are already created and all i
need to do is figure out how to make the data that people enter into them
"submittable."  but in any case, have you seen some pretty complex forms
made up of entirely CSS that i can look at?  i guess this solution would be
acceptable pending some examples
 

CSS does not make forms! HTML makes forms, and CSS can be used to style 
them.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] can pdf forms be used to submit data into db?

2003-08-28 Thread John W. Holmes
[EMAIL PROTECTED] wrote:

John, that is EXACTLY what i want, now the question is...have you seen this
implemented somewhere?  so php would pass the data to a database and when a
user/client wants to see that data again, php would "re-generate" the form
with the data that is being requested right?  and that is what FDF can
do...correct?
but help me out here and tell me where i can see some sort of
implementation
and how hard would something like this be
How you describe it is how I understand it.

See this thread at Devshed for an example: 
http://forums.devshed.com/showthread.php?s=&threadid=71168&highlight=fdf

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread Leif K-Brooks
DvDmanDT wrote:

When using register_globals=off, this might be off intrest: (notice $$var)
while(list($var,$val)=each($_REQUEST))$$var=$val;
Why not just turn register_globals on, then?

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread Robert Cummings
This functionality is a feature and is commonly called variable
variables.

http://www.php.net/variables.variable

Cheers,
Rob.

On Wed, 2003-08-27 at 16:42, DvDmanDT wrote:
> Considering the manual has examples using that method (or at least had), and
> many tutorials, I think you can use it...
> When using register_globals=off, this might be off intrest: (notice $$var)
> while(list($var,$val)=each($_REQUEST))$$var=$val;
> 
> -- 
> // DvDmanDT
> MSN: [EMAIL PROTECTED]
> Mail: [EMAIL PROTECTED]
> "Steve Todd" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > Is it possible to define a variable, such as:
> > $foo = "bar";
> >
> > and then do as follows to create a totally different variable:
> > $$foo =  "text here";
> >
> > this seems to mean $bar = "text here";.
> >
> > Is this a bug or can we legally use it.
> >
> > Steve
> >
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread Curt Zirzow
* Thus wrote DvDmanDT ([EMAIL PROTECTED]):
> Considering the manual has examples using that method (or at least had), and
> many tutorials, I think you can use it...
> When using register_globals=off, this might be off intrest: (notice $$var)
> while(list($var,$val)=each($_REQUEST))$$var=$val;

Actually there is a funtion for that, php>=4.1.0:
  http://php.net/import_request_variables 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: IS THIS A BUG?

2003-08-28 Thread DvDmanDT
I also wanna add that it works for functions as well:
$foo="bar";
$foo();

would call the function bar()... I read this in the manual at some point
like a year ago... This isn't something I would recommend using as you could
in 90% of the cases screw it all badly... Could be useful sometimes though
(I got an example, but I'm a bit lazy...)

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Steve Todd" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Is it possible to define a variable, such as:
> $foo = "bar";
>
> and then do as follows to create a totally different variable:
> $$foo =  "text here";
>
> this seems to mean $bar = "text here";.
>
> Is this a bug or can we legally use it.
>
> Steve
>

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



Re: [PHP] multiple mailings

2003-08-28 Thread Curt Zirzow
* Thus wrote Jay Fitzgerald ([EMAIL PROTECTED]):
> sorry for the multiple mailings...I'm not meaning to spam the list, but 
> apparently when i send an email to the list, it takes almost 2 hours for me 
> to receive a copy of it letting me know that it went through ok
 
Yes the mailling list is a little slow rightnow. 



Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: Animating with GD?

2003-08-28 Thread Edward Rudd
Not anymore due to the Unisys LZW patent issues.. GD has no support for
GIF file anymore.
Wait until next june.. Then you can create animated GIF files with GD
(Unisys' patent expires).

On Wed, 27 Aug 2003 21:35:43 +0200, Simon Fredriksson wrote:

> Is it possible to create GIF animations using GD?
> 
> //Simon

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



RE: [PHP] php equivalent to asp's instr()

2003-08-28 Thread Cody Phanekham
Chris,

Ive modified your sample code to use strstr() and it works fine. maybe you've mixed 
the $haystack and $needle around ?



> -Original Message-
> From: Chris W. Parker [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 28 August 2003 07:08
> To: [EMAIL PROTECTED]
> Subject: [PHP] php equivalent to asp's instr()
> 
> 
> Hi.
> 
> I don't know why but I've had the darndest time trying to find an easy
> equivalent of asp's InStr() function in PHP. I know there is
> preg_match(), strpos(), and strstr(), but none of them work 
> like I want
> them to.
> 
> In fact, except for maybe preg_match(), I can't get any of 
> them to work
> right.
> 
> I want a function that will return true if the string is found, and
> false if it is not found.
> 
> Like this:*
> 
> $needle = "&";
> $haystack = "Belle & Sebastian";
> 
> if(FoundInString($needle, $haystack))
> {
>   echo "found!";
> }
> else
> {
>   echo "not found!";
> }
> 
> 
> Anyone have a function to share?
> 
> 
> Thanks,
> Chris.
> 
> 
> * Anyone catch the Belle & Sebastian show at the Greek Theatre in LA
> this past sunday?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



[PHP] list so slow... Sobig?

2003-08-28 Thread Chris W. Parker
Just wanted to get the consesus of the other list members... Is it SoBig
that is making the list so slow? It's taking about hour an or more for
my messages to come back to me.


Chris.

p.s. Probably a good idea to send responses off list if it's just to say
"Yeah that's happening to me too!"

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



Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread Curt Zirzow
* Thus wrote Leif K-Brooks ([EMAIL PROTECTED]):
> DvDmanDT wrote:
> 
> >When using register_globals=off, this might be off intrest: (notice $$var)
> >while(list($var,$val)=each($_REQUEST))$$var=$val;
> >
> Why not just turn register_globals on, then?

There are several reasons why not to turn globals on.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] php equivalent to asp's instr()

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 14:07:34 -0700, you wrote:

>I don't know why but I've had the darndest time trying to find an easy
>equivalent of asp's InStr() function in PHP. I know there is
>preg_match(), strpos(), and strstr(), but none of them work like I want
>them to.
>
>In fact, except for maybe preg_match(), I can't get any of them to work
>right.
>
>I want a function that will return true if the string is found, and
>false if it is not found.
>
>Like this:*
>
>$needle = "&";
>$haystack = "Belle & Sebastian";

Hmm. Would you confirm that this code snippet doesn't work for you?

");
}

if (strpos ($haystack, $needle))
{
echo ("strpos() worked");
}
?>

Because if it doesn't, I think there's a problem with your install.

BTW, strstr and strpos don't return TRUE if a string is found. strpos
returns an index into $haystack, strstr returns a substring of $haystack.

Maybe you're doing this?

if (strpos ($haystack, $needle) == TRUE)

which would (I would assume) fail. Though PHP plays fast and loose with
types, so it might work.

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



Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 18:36:26 -0400, you wrote:

>DvDmanDT wrote:
>
>>When using register_globals=off, this might be off intrest: (notice $$var)
>>while(list($var,$val)=each($_REQUEST))$$var=$val;
>>
>Why not just turn register_globals on, then?

I assume you could use it to only pull in variables from POST or GET, or you
could add some complexity to the loop and verify the variables as they come
in.

(Personally, I agree - just turn the damn switch back on. It's always the
first thing I do to an install.)

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



RE: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread Martin Towell
And also for class names

$foo = "bar";
$blah = new $foo();

$blah would be a new instance of the class bar
I've actually used the above, but it was a special case.. I wouldn't
normally use it.

-Original Message-
From: DvDmanDT [mailto:[EMAIL PROTECTED]
Sent: Thursday, 28 August 2003 8:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: IS THIS A BUG?


I also wanna add that it works for functions as well:
$foo="bar";
$foo();

would call the function bar()... I read this in the manual at some point
like a year ago... This isn't something I would recommend using as you could
in 90% of the cases screw it all badly... Could be useful sometimes though
(I got an example, but I'm a bit lazy...)

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Steve Todd" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Is it possible to define a variable, such as:
> $foo = "bar";
>
> and then do as follows to create a totally different variable:
> $$foo =  "text here";
>
> this seems to mean $bar = "text here";.
>
> Is this a bug or can we legally use it.
>
> Steve
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__ Information from NOD32 1.490 (20030820) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com

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



Re: [PHP] Warning - Page has expired error

2003-08-28 Thread [EMAIL PROTECTED]
Use get instead of post.  for the request method. Then please make sure 
that you are not sending any expires headers in your code.

all the best

Tony Pagliocco wrote:

On a website I am working on, when I go to a page
that pulls a query , then click back to choose another
option, I get an error that says "Warning: page has expired"
then I have to click back twice to get back to the drop down
menu to make a new choice of query. Is there anywhere around this?
Let me know what I can post to help in solving this problem. 

Thanks

 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] can pdf forms be used to submit data into db?

2003-08-28 Thread Evan Nemerson
Take a look at php.net/fdf for input to database (easy part). As for 
automatically filling out the PDF, you can actually embed javascript in a 
PDF, although I'm not exactly sure how to do it. PlanetPDF.com will have the 
info, though. Also, there is an excellent PDF forum over at planetpdf.com 
which has been very helpful in the past for me. If that fails, you could try 
comp.text.pdf but IIRC the forums work better.


On Tuesday 26 August 2003 05:52 pm, [EMAIL PROTECTED] wrote:
> hi guys and gals, aloha from hawaii,
>
> Not sure if this is the right place to ask, but i just need to know if it
> is technically possible to have a pdf form be filled out online and then
> once the user hits submit, php takes the data and puts it into a db or some
> sort of db technology and if the need arises to pull up that record once
> more, php fetches the data from the db and dynamically fills out the pdf
> form and presents it to the end user...can do?  or anyone know who i can
> talk to about this...
>
> thanks and mahalo from hawaii
>
> 
> if anyone can help me or point me in the right direction, i MAY be inclined
> to send some macadamia nuts to the continental US
> 

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



RE: [PHP] Re: Animating with GD?

2003-08-28 Thread Cody Phanekham
Couldn't Unisys just renew/extend the patent?

> -Original Message-
> From: Edward Rudd [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 28 August 2003 09:49
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Animating with GD?
> 
> 
> Not anymore due to the Unisys LZW patent issues.. GD has no 
> support for
> GIF file anymore.
> Wait until next june.. Then you can create animated GIF files with GD
> (Unisys' patent expires).
> 
> On Wed, 27 Aug 2003 21:35:43 +0200, Simon Fredriksson wrote:
> 
> > Is it possible to create GIF animations using GD?
> > 
> > //Simon
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



Re: [PHP] Thank You for your help

2003-08-28 Thread Justin French
On Thursday, August 28, 2003, at 04:29  AM, 
[EMAIL PROTECTED] wrote:

Hi guys, gals,

first off i just wanted to thank all of you who responded to my 
question,
they were very helpful...but the answers bring me to several new 
questions:

1) has anyone seen anything like this done with the reader ver. of 
acrobat
and not the full version of acrobat...could you point me somewhere 
where
FDF is actually implemented?
I can't speak for other software, but you need one of the full versions 
of Acrobat to do forms.  There may be a competitor to Acrobat, or one 
of the PHP-PDF libraries that can do it programatically, but I have no 
idea about that.

2) this question is more directed to Justin French, but in any case, 
the
reason i wanted to use the PDF forms is so that i don't have to create 
them
again in CSS or any other format, the forms are already created and 
all i
need to do is figure out how to make the data that people enter into 
them
"submittable."  but in any case, have you seen some pretty complex 
forms
made up of entirely CSS that i can look at?  i guess this solution 
would be
acceptable pending some examples
I think you mean "forms completely styled with CSS", don't you?  The 
answer is "yes", but it would depend on your definition of "complex".

Do a google search... there's plenty of reading to do out there :)

http://alistapart.com/stories/practicalcss/ is one place to start.

If the forms are already created in PDF, then who created them?  That 
person must have access to the higher versions of Acrobat, therefor 
must be able to edit the files, specifying a target script on the web 
to which they will be to POSTed.

Justin French

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


FW: [PHP] dealing with arrays

2003-08-28 Thread Aris Santillan






hi

this is the piece of code


for($s=0;$s<$num;$s++)
  {
$result = mssql_fetch_array($query);

$result[2] = number_format($result[2], 2);


"";
echo  " ";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";
echo  "";

echo  "";
echo"";

}



if u can e this is a dynamic forms with some hidden fields

all i want is to submit entries with check.

something like the web mail system where in you check item w/c
you want to save / delete / add to junk










-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2003 2:09 PM
To: Php (E-mail)
Subject: Re: [PHP] dealing with arrays


* Thus wrote Ford, Mike   [LSS] ([EMAIL PROTECTED]):
> On 27 August 2003 04:22, Aris Santillan wrote:
> 
> > I Have
> > Entry One
> > 
> > 
> > 
> 
> The way to combat this is to use explicit subscripts in your form field names, like 
> so:
> 
>  Entry One
>  
>  
>  

I would also add some structure to avoid all the different
variables and makes looping much smoother on the processing script.





Then:

foreach ($_REQUEST['elements'] as $id => $element) {
  
  if ($element['checked']) {
// its checked
  } else {
// not checked.. duh..
  }
}


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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

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



Re: [PHP] Re: Animating with GD?

2003-08-28 Thread Ashley M. Kirchner
Edward Rudd wrote:

Not anymore due to the Unisys LZW patent issues.. GD has no support for
GIF file anymore.
Wait until next june.. Then you can create animated GIF files with GD
(Unisys' patent expires).
 

   That patent already expired for the US (June 30, 2003).  Canadian 
patent expires July 7, 2004, the counterpart patents in the United 
Kingdom, France, Germany and Italy expire June 18, 2004, and the 
Japanese counterpart patents expire June 20, 2004. 

--
H| I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 

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


Re: [PHP] Re: Animating with GD?

2003-08-28 Thread Ashley M. Kirchner
Ashley M. Kirchner wrote:

>That patent already expired for the US (June 30, 2003).  Canadian
> patent expires July 7, 2004, the counterpart patents in the United
> Kingdom, France, Germany and Italy expire June 18, 2004, and the
> Japanese counterpart patents expire June 20, 2004.
I forgot to quote the link on Unisys' site:

http://www.unisys.com/about__unisys/lzw/

--
 H| I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] WYSIWYG online editor for Macintosh?

2003-08-28 Thread Joel Rees
> Hi there.  Slightly OT, but it's for a PHP project...  We normally use a
> plug-in WYSIWYG editor so that our clients can manage their content in a
> word-like interface.  Normally this works fine, but this time when we've
> completed the site we've discovered they have an entire department that
> is 100% Macintosh and this editor doesn't work.  Has anyone come across
> one of these that are cross-platform?  Would really appreciate some
> advice

First, the Text Edit application that comes with Mac OS X, coupled with
iDisk, may actually be more than you need. By default, it edits RTF, but
it also edits plain text. iDisk allows you to set up an FTP connection
and edit over the network. It has the OSAX (AppleScript, et. al.)
interface, so there is a way to interface with it programmatically.

BBEdit is supposed to support editing via the web. It's an editor, not a
word processor, but the interface is WYSIWYG, only modal in terms of
switching to raw binary and such. I've used it to good purpose:

http://www.barebones.com
http://www.barebones.com/products/bbedit

Mind you, it's a very powerful editor. Includes some neat integration
with perl, and should be easy enough to interface with php. BareBones's
Newer, cheaper TextWrangler is also supposed to support FTP, if that
would be enough. They have a good record about working with their
customers, too.

Hydra is a cute piece, allows people to simultaneous edit the same
text document over the local network. The Coding Monkeys's page seems to
be down right now.

I have only heard mention in passing of Pepper, but it looks like it has
returned to active development:

http://www.digitalwandering.com/ (Mac fork)
http://www.hekkelman.com/pepper.html (cross-platform)

Alpha has been highly praised by some I count as friends. It has been
compared with Emacs, although it is not really an Emacs work-alike. But
I don't find any recent information on it, the links all stall.

Hmm. Plugged "text editor macintosh" in at google.com, and got more
information than I want to wade through. Then I went to apple.com,
clicked on the "Made4Mac" tab, and wandered onto this page:

http://guide.apple.com/uscategories/productivity.lasso

scrolled down, selected text processing and editing utiliities, and got
quite a few hits.

HTH

-- 
Joel Rees, programmer, Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp

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



[PHP] Re: can pdf forms be used to submit data into a db?

2003-08-28 Thread David Robley
In article , [EMAIL PROTECTED] 
says...
> hi guys and gals, aloha from hawaii,
> 
> Not sure if this is the right place to ask, but i just need to know if it
> is technically possible to have a pdf form be filled out online and then
> once the user hits submit, php takes the data and puts it into a db or some
> sort of db technology and if the need arises to pull up that record once
> more, php fetches the data from the db and dynamically fills out the pdf
> form and presents it to the end user...can do?  or anyone know who i can
> talk to about this...
> 
> thanks and mahalo from hawaii
> 
> 
> if anyone can help me or point me in the right direction, i MAY be inclined
> to send some macadamia nuts to the continental US
> 

I think the FDF (Forms Data Format) functions may be just what you need. 

Cheers
-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] installation problem

2003-08-28 Thread Jeremiah Breindel
I was recently involved in installing PHP 4.3.2 on a NT 4 server with IIS 4.
We followed all of the installation instructions, but whenever we tried to
run a test script through a browser to see if PHP was installed correctly,
all the page did was load.  And load and load and load.  It never displayed
the text it was supposed to, and it never errored out.  Anybody have any
ideas?

Jeremiah Breindel
[EMAIL PROTECTED]

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



[PHP] beginner: cut text after " "

2003-08-28 Thread Andras Kende

Hello All,

I have a very simple question:

Want to remove the string after the first whitespace like:

"here is a text what i have"
to:
"here"


Thanks !!

Andras Kende

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



[PHP] beginner: remove the string after the first whitespace

2003-08-28 Thread Andras Kende

Hello All,

I have a very simple question:

Want to remove the string after the first whitespace like:

"here is a text what i have"
to:
"here"


Thanks !!

Andras Kende

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



Re: [PHP] beginner: cut text after " "

2003-08-28 Thread John W. Holmes
Andras Kende wrote:

Hello All,

I have a very simple question:

Want to remove the string after the first whitespace like:

"here is a text what i have"
to:
"here"
$word = substr($sentence,0,strpos($sentence,' '));

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] beginner: remove the string after the first whitespace

2003-08-28 Thread murugesan
This code is working for me



-murugesan
- Original Message - 
From: "Andras Kende" <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Sent: Thursday, August 28, 2003 10:03 AM
Subject: [PHP] beginner: remove the string after the first whitespace


> 
> Hello All,
> 
> I have a very simple question:
> 
> Want to remove the string after the first whitespace like:
> 
> "here is a text what i have"
> to:
> "here"
> 
> 
> Thanks !!
> 
> Andras Kende
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] beginner: cut text after " "

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 21:30:25 -0700, you wrote:

>Want to remove the string after the first whitespace like:
>
>"here is a text what i have"
>to:
>"here"

I'd explode() the string into an array, and take the 0th element of the
array.

$s = 'here is a text what i have';
$a = explode (' ', $s);
echo ($a[0]);

If you want to match  /whitespace/ (tab, space, etc), replace explode() with
split() using the correct regular expression.

(Note: explode() takes a 3rd optional parameter, limit, if you want a
remainder string, too.)

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



[PHP] fread(): SSL: fatal protocol error

2003-08-28 Thread Ray Van Dolson
I'm running PHP 4.3.3 compiled with --with-openssl against Red Hat 8.0's 
latest OpenSSL libraries (patched versions of 0.9.6) and am having some 
strange issues using fopen(), fread() and friends.  Here's my code:

function echo_test() {
  $opts = array(
'ssl' => array(
  'allow_self_signed' => "TRUE"
  )
   );
  $context = stream_context_create($opts);

  $handle = fopen("https://www.secureurl.org/";, "r", FALSE, $context);

  while (TRUE) {
$data = fread($handle, 1024);
if (strlen($data) == 0) {
  break;
}
$stuff .= stripslashes($data);
  }
  fclose($handle);
  return $stuff;
}

When I run this code, the content IS returned correctly and in in the 
server SSL logs I see that a request was made via SSL.  So I'm getting 
the results I want... EXCEPT for this:

Warning: fread(): SSL: fatal protocol error in /WWW/inc/ECHO.php on line 
23

Any idea what this is?  I thought not allowing self signed certs might 
be the problem since this server is using a self-signed one... but 
adding that to my options (reflected above) didn't help any.

I can very easily force the errors not to show up and mosey on since I 
am able to access the data, but I'm curious why this is happening.  Any 
ideas?  There were a few other posts on this topic, but none with any 
concrete answers or solutions...

-- 
Ray Van Dolson ([EMAIL PROTECTED])
http://www.bludgeon.org/~rayvd/

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



[PHP] Re: mail mime attachment

2003-08-28 Thread Manuel Lemos
Hello,

On 08/27/2003 06:37 AM, Moritz Steiner wrote:
Hi,
has somebody a working code example of sending a mail with attachment,
my code is unfortunately not working...
That may be a bug in the mail() function. You may want to try this other 
class that has work arrounds for some of the mail() function problems:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: speed of mail() on two servers

2003-08-28 Thread Manuel Lemos
Hello,

On 08/27/2003 11:34 AM, David T-G wrote:
% For the delivery, you can always tune qmail to try deliverying messages 
% to more recipients at the same time tweaking concurrencyremote option. 
% The default it 20 recipients at the same time but you can increase it to 
% 120 without patches.

Hmmm...  That's worth a look; where do I set that?
RTFM! :-)

/var/qmail/control/concurrencyremote

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: SMTP server response: 550 5.7.1 Unable to relay for

2003-08-28 Thread Manuel Lemos
Hello,

On 08/27/2003 04:04 PM, ÀLex Camps wrote:
i have windows xp with apache,php and argomail
but i cant send emails from php why?
It seems you need to authenticate with the SMTP server. You can't do 
that with the mail() function. Try these classes in conjunction. They 
come with a function named smtp_mail() that you can use as replacement 
to the mail() function but you can also specify the user and password to 
authenticat with the SMTP server:

http://www.phpclasses.org/mimemessage

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php equivalent to asp's instr()

2003-08-28 Thread David Cuddeback
Hi Chris,

I've always used strstr() for this _exact_ same purpose and it's worked just
fine.  I find it much more useful as an InStr()-like function than for
actually doing anything with the string it returns.  You'll want to note
that the parameter order is $haystack before $needle.  That goes for
strpos() as well.  I noticed that in your original post, you're using a
hypothetical function FoundInString($needle,$haystack).  If you used the
same order ($needle,$haystack) when you tried strstr() or strpos(), then it
would fail because it's a bit difficult to find a haystack in a needle. =/

I _strongly_ recommend using one of these built-in functions, as they will
run much faster than any programmer-defined function.  Below I will explain
how and potential pitfalls.

Only problem I noticed is that you want the function to return an explicit
true if the string is found (and false if it is not).  Both functions will
return an explicit false if the needle is not found, but neither return an
explicit true.  Don't let that stop you from using them though.  If needle
is found, strstr() returns a string and strpos() returns an integer
(possibly 0).  An if statement will consider a string (as returned by
strstr()) as logically true, so you can use strstr() by itself inside an if
statement.  strpos() however returns the offset from the beginning of
$haystack where it found $needle.  This means that if $needle is at the
beginning of $haystack, then it will return an integer 0.  This of course is
considered false by an if statement.  However, you can use
if(strpos($haystack,$needle)!==false).  If you take a look at
http://us3.php.net/manual/en/language.operators.comparison.php, you'll see
that PHP's $a===$b and $a!==$b operators result in a true only if $a and $b
are of the same type (bool, int, etc).  Since an integer 0 is not the same
as a boolean false, strpos()!==false will not choke when it returns an
integer 0.

If you want the function to return an explicit true because you want to
assign the result to a variable, you can do this:
$foo = (strstr($haystack,$needle)!==false)
or anywhere else you plan to use it for that matter.

Documentation for strstr() and strpos()
http://us3.php.net/strstr
http://us3.php.net/strpos

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



[PHP] how to block a user downloading a file?

2003-08-28 Thread fatih olcer
hi,
how to block a user downloading a file?
eg : when  a user enter an address like 
  http://localhost/downloads/testfile.cab
i want to forward him to an other address like
 http://localhost

i'm PHP newbie thanks for help.

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



php-general Digest 28 Aug 2003 08:29:13 -0000 Issue 2263

2003-08-28 Thread php-general-digest-help

php-general Digest 28 Aug 2003 08:29:13 - Issue 2263

Topics (messages 160955 through 161010):

IS THIS A BUG?
160955 by: Steve Todd
160958 by: DvDmanDT
160967 by: John W. Holmes
160968 by: Curt Zirzow
160971 by: Chris Shiflett
160972 by: Chris W. Parker
160973 by: Chris Sherwood
160974 by: Leif K-Brooks
160978 by: Leif K-Brooks
160979 by: Robert Cummings
160980 by: Curt Zirzow
160981 by: DvDmanDT
160986 by: Curt Zirzow
160988 by: David Otton
160989 by: Martin Towell

SOLUTION [PHP] including .shtml file within my php script
160956 by: Gronquist, Jim M

multiple mailings
160957 by: Jay Fitzgerald
160982 by: Curt Zirzow

How to exec PHP as CGI
160959 by: Lowell Allen

Re: can pdf forms be used to submit data into db?
160960 by: Curt Zirzow
160961 by: Curt Zirzow
160969 by: John W. Holmes
160970 by: Ryan.K.Look.courts.state.hi.us
160977 by: John W. Holmes
160991 by: Evan Nemerson

Re: dealing with arrays
160962 by: Curt Zirzow
160994 by: Aris  Santillan

php equivalent to asp's instr()
160963 by: Chris W. Parker
160965 by: DvDmanDT
160984 by: Cody Phanekham
160987 by: David Otton
161009 by: David Cuddeback

Re: Implode slows down file reading? [was: str_replace performance in large mailing 
script]
160964 by: Curt Zirzow

Re: Website templating schemes
160966 by: John W. Holmes

Re: SMTP server response: 550 5.7.1 Unable to relay for
160975 by: Chris W. Parker
161008 by: Manuel Lemos

Re: Thank You for your help
160976 by: Leif K-Brooks
160993 by: Justin French

Re: Animating with GD?
160983 by: Edward Rudd
160992 by: Cody Phanekham
160995 by: Ashley M. Kirchner
160996 by: Ashley M. Kirchner

list so slow... Sobig?
160985 by: Chris W. Parker

Re: Warning - Page has expired error
160990 by: jabber.raditha.com

Re: WYSIWYG online editor for Macintosh?
160997 by: Joel Rees

Re: can pdf forms be used to submit data into a db?
160998 by: David Robley

installation problem
160999 by: Jeremiah Breindel

beginner: cut text after " "
161000 by: Andras Kende
161002 by: John W. Holmes
161004 by: David Otton

beginner: remove the string after the first whitespace
161001 by: Andras Kende
161003 by: murugesan

Re: fatal protocol error
161005 by: Ray Van Dolson

Re: mail mime attachment
161006 by: Manuel Lemos

Re: speed of mail() on two servers
161007 by: Manuel Lemos

how to block a user downloading a file?
161010 by: fatih olcer

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 ---
Is it possible to define a variable, such as:
$foo = "bar";
 
and then do as follows to create a totally different variable:
$$foo =  "text here";
 
this seems to mean $bar = "text here";.
 
Is this a bug or can we legally use it.
 
Steve
--- End Message ---
--- Begin Message ---
Considering the manual has examples using that method (or at least had), and
many tutorials, I think you can use it...
When using register_globals=off, this might be off intrest: (notice $$var)
while(list($var,$val)=each($_REQUEST))$$var=$val;

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
"Steve Todd" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Is it possible to define a variable, such as:
> $foo = "bar";
>
> and then do as follows to create a totally different variable:
> $$foo =  "text here";
>
> this seems to mean $bar = "text here";.
>
> Is this a bug or can we legally use it.
>
> Steve
>
--- End Message ---
--- Begin Message ---
Steve Todd wrote:

Is it possible to define a variable, such as:
$foo = "bar";
 
and then do as follows to create a totally different variable:
$$foo =  "text here";
 
this seems to mean $bar = "text here";.
 
Is this a bug or can we legally use it.
Yes it's legal.

http://us2.php.net/manual/en/language.variables.variable.php

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
* Thus wrote Steve Todd ([EMAIL PROTECTED]):
> Is it possible to define a variable, such as:
> $foo = "bar";
>  
> and then do as follows to create a totally different variable:
> $$foo =  "text here";
>  
> this seems to mean $bar = "text here";.
>  
> Is this a bug or can we legally use it.

perfectly legal, its called a variable variable...

http://php.net/variables.variable


Curt
-- 
"I used to thin

[PHP] parsing domains

2003-08-28 Thread CollegeSucks.com Mike
Quick question...

I parse domains in my scripts like this to get the .domain.com out of www.domain.com. 
However, if someone visits my site with just domain.com in the url, I get .com back as 
the parsed domain. How can I make it so I aways get the .domain.com no matter what 
they use?

Here is an example of what I use now...


$parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain);
-- 
___
Get your free Verizonmail at www.verizonmail.com

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



[PHP] Bug...

2003-08-28 Thread Joe Privett
Hi,

I am running PHP 4.2.3 on Apache 1.3 and using COM to write 3 reports using
Excel.  The problem I am having is that something is going wrong with this
process, but I can not put my finger on it as no clues are presenting
themselves.
I run the script through a browser.  The overall script takes about 36
minutes to run.  I have changed the php.ini values to allow the script to
run for longer than this.  The script runs, but I always end up with a 500
error.  The script also always only manages to produce just two of the three
reports, but as no error messages are being returned by PHP, I am assuming
that my code is sound.  If I configure the script to produce a single
report, and produce each report individually, it works successfully.
Therefore, I am stumped as to why it won't run the entire script.  My
initial thoughts are that it is some sort of timeout happening somewhere,
but I can't think where.  Can you help?

Joe


DISCLAIMER:
 This email is private and confidential and is for the addressee only. If
misdirected, please notify us and confirm that it has been deleted from your
system and any hard copies destroyed. You are strictly prohibited from
using, printing, distributing or disseminating it or any information
contained in it to save to the intended recipient.


__
This message has been checked for all viruses by BTnet VirusScreen.
The service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service,
please visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==

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



Re: [PHP] how to block a user downloading a file?

2003-08-28 Thread Tassos T
fatih olcer wrote:

hi,
how to block a user downloading a file?
eg : when  a user enter an address like 
 http://localhost/downloads/testfile.cab
i want to forward him to an other address like
http://localhost

i'm PHP newbie thanks for help.

 

hi,
 you have to use this code :
http://localhost";);
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parsing domains

2003-08-28 Thread Tom Rogers
Hi,

Thursday, August 28, 2003, 6:30:44 PM, you wrote:
CcM> Quick question...

CcM> I parse domains in my scripts like this to get the .domain.com out of 
www.domain.com. However, if someone visits my site with just domain.com in the url, I 
get .com back as the parsed domain.
CcM> How can I make it so I aways get the .domain.com no matter what they use?

CcM> Here is an example of what I use now...


CcM> $parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain);
CcM> -- 
CcM> ___
CcM> Get your free Verizonmail at www.verizonmail.com


do a str_replace('/www.','/',$parseddomain); then do your preg_replace

-- 
regards,
Tom

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



[PHP] Re: parsing domains

2003-08-28 Thread Kae Verens
Collegesucks.Com Mike wrote:
Quick question...

I parse domains in my scripts like this to get the .domain.com out of www.domain.com. However, if someone visits my site with just domain.com in the url, I get .com back as the parsed domain. How can I make it so I aways get the .domain.com no matter what they use?

Here is an example of what I use now...

$parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain);


this should do it:
$parseddomain=preg_replace('/.*?([^.]*\.[^.]*)/','\\1',$domain);
Kae

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


Re: [PHP] parsing domains

2003-08-28 Thread Mike J
> str_replace('/www.','/',$parseddomain);

wont this just make me get a .com when I use my thing to parse the domain?


-- 
___
Get your free Verizonmail at www.verizonmail.com

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



Re: [PHP] parsing domains

2003-08-28 Thread John T. Beresford
So why does college suck? Afraid of learning?

Anyway, you can solve your problem by simple parsing. An example is below.


This will result in "edmondpaper.com"

Obviously there are ways of refining this further, but if college 
sucks, you might not be interested in learning more :-).



At 3:30 AM -0500 on 8/28/03, CollegeSucks.com Mike wrote:
I parse domains in my scripts like this to get the .domain.com out 
of www.domain.com. However, if someone visits my site with just 
domain.com in the url, I get .com back as the parsed domain. How can 
I make it so I aways get the .domain.com no matter what they use?
Here is an example of what I use now...
$parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain);
--
===
John T. Beresford
Apple Certified Technical Coordinator
http://www.deewi.com/
405.760.0794
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] parsing domains

2003-08-28 Thread Mike J
> So why does college suck? Afraid of learning?

Feel free to ask me off the list and I'll explain why I started the site.


Thanks for the code. Anyway way of making it one line and with the leading "."?

J.
-- 
___
Get your free Verizonmail at www.verizonmail.com

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



Re[2]: [PHP] parsing domains

2003-08-28 Thread Tom Rogers
Hi,

Thursday, August 28, 2003, 7:02:44 PM, you wrote:
>> str_replace('/www.','/',$parseddomain);

MJ> wont this just make me get a .com when I use my thing to parse the domain?


MJ> -- 
MJ> ___
MJ> Get your free Verizonmail at www.verizonmail.com


No it should just get rid of the www so your left with domain.com
and now that I see what you are after it should have been:

$domain = str_replace('www.','',$domain);

and if you need the dot now add it in

$parseddomain = '.'.$domain;

No need for the preg_replace at all

-- 
regards,
Tom

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



Re: Re[2]: [PHP] parsing domains

2003-08-28 Thread Mike J
> No it should just get rid of the www so your left 
> with domain.com and now that I see what you are 
> after it should have been:


I don't aways use www.domain.com. Sometimes I use test.domain.com. I have about 14k of 
these pointing to the same script. Otherwise I would just remove the www -lol.

J.
-- 
___
Get your free Verizonmail at www.verizonmail.com

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



Re: [PHP] how to block a user downloading a file?

2003-08-28 Thread [EMAIL PROTECTED]
Hello,

Since this is a cab file, i don't think you will be able to modify it. 
Why don't you put the cabs outside the document root? there was a 
discussion on doing something similar just this week on this very list.

If you insist on having the stuff on the document root you can use 
.htaccess files with the appropriate allow / deny directives. but i have 
a hunch you may be on windows :-)

best regards
raditha


Tassos T wrote:

fatih olcer wrote:

hi,
how to block a user downloading a file?
eg : when  a user enter an address like  
http://localhost/downloads/testfile.cab
i want to forward him to an other address like
http://localhost

i'm PHP newbie thanks for help.

 

hi,
 you have to use this code :
http://localhost";);
?>


--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] converting gif to jpeg

2003-08-28 Thread Merlin
Hello,

I am wondering if it is possible and legal to convert gif to jpeg with 
php. This would be helpful for clients to upload their logo, since most 
have it as a gif document.

Thanx for any comment on that.

Merlin

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


Re: [PHP] speed of mail() on two servers

2003-08-28 Thread David T-G
Jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% having you tried ezmlm or to directly inject the message into the que?

Yes, I've tried qmail-inject.  I got down to about 0.41s/msg which is
still terrible.


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Linking to files outside the directory structure...?

2003-08-28 Thread Tristan . Pretty
Getting there.
I'm using...
$path = "/home/risk/public_html/$bu/$file";
//Where $bu is the folder name where the file is, I've passed that from 
the previous form, no worries there. I've also passed the file name from 
the previous form, as I have the file type.
header("Content-Disposition: attachment; filename=$file");
header("Content-Length: " . filesize($path));
header("Content-Type: application/$type");
readfile("$path");

yet when I get this header called, I get prompted to save teh file, all 
good, but I can only save it as an HTML doc, even though in the save 
dialog box, it tells me it's an acrobat fiel (in the case of pdf's etc)
How acn I force it to save as pdf, or zip etc...?






"[EMAIL PROTECTED]" I wanna protect a few files from reandom downloads.
>I'm moving hosts soon, and will loose my mod_auth_mysql module that let 
it 
>talk to the .htaccess file.
>
>What I want to do is store a number of files, outside of my web folder, 
>say one level under it, but still get my browser to retrive that file.
>Perhaps with some coding in PHP?
>
>is this at all possible, or am I barking up the wrong tree...?
>
>Any ideas?
>Tris...
>
>*
>The information contained in this e-mail message is intended only for 
>the personal and confidential use of the recipient(s) named above. 
>If the reader of this message is not the intended recipient or an agent
>responsible for delivering it to the intended recipient, you are hereby 
>notified that you have received this document in error and that any
>review, dissemination, distribution, or copying of this message is 
>strictly prohibited. If you have received this communication in error, 
>please notify us immediately by e-mail, and delete the original message.
>***
>
>
> 
>


-- 
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.

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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



[PHP] session_start() : read failed: Value too large for defined datatype (75) ...

2003-08-28 Thread Richard NAGY
Hello,

I'm using an apache server 1.3.28 on RedHat GNU/Linux 6.2 with php
4.3.1. Before, I was using apache 1.3.14 with php 4.0.6. Since I have
upgraded, I have problems with session_start. I have tried to set
register_globals either to on or to off but it has no effect on this
problem.

Example :

Warning: session_start() [function.session-start]: read failed: Value
too large for defined data type (75) in
/var/www/htdocs/site/ssl/accueil/connexion.php on line 28

(Before upgrading, it was running without any problem.)


How can I solve this problem? 
Thanks in advance.


-- 
***
Richard NAGY
Nameshield
46, rue Jean BODIN
F-49000 Angers
Tél : +33 2 41 18 28 28
***

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



[PHP] Re: converting gif to jpeg

2003-08-28 Thread Kae Verens
Merlin wrote:
Hello,

I am wondering if it is possible and legal to convert gif to jpeg with 
php. This would be helpful for clients to upload their logo, since most 
have it as a gif document.

Thanx for any comment on that.
ImageMagick can read .gif, so you could filter the uploaded file through 
that and convert it to .jpg.

Kae

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


Re: [PHP] speed of mail() on two servers

2003-08-28 Thread [EMAIL PROTECTED]
Hello,

I recall someone (pardone me i don't save list mails) pointing out that 
the delay could actually be in generating the message rather than in the 
sending. You are sending a customized message to each user aren't you? 
Would you be creating this message from what's in a mysql database or 
something like that?

Have you tried running your php script from the command line instead of 
the web space? It could be that your httpd.conf has some processor and 
memory usage restrictions imposed. I once worked on a server on which it 
was impossible to send mail from cgi script. the apache configurations 
turned out to be the culprit.

all the best



David T-G wrote:

Jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% having you tried ezmlm or to directly inject the message into the que?

Yes, I've tried qmail-inject.  I got down to about 0.41s/msg which is
still terrible.
Thanks & HAND

:-D
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Bug...

2003-08-28 Thread WebDevMagazine
Yes I can help you.please send me your OS , php version and what COM you are
triyng to use.



Regards
Bogomil

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



RE: [PHP] Bug...

2003-08-28 Thread Jay Blanchard
[snip]
I run the script through a browser.  The overall script takes about 36
minutes to run.  I have changed the php.ini values to allow the script
to
run for longer than this.  The script runs, but I always end up with a
500
error.  
[/snip]

Have you also set your webserver software time accordingly? Apache, IIS,
and others come with a default time for a response.

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



[PHP] Urgent help required for using Cron

2003-08-28 Thread Safal Solutions
Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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



RE: [PHP] Bug...

2003-08-28 Thread Jay Blanchard
And you get a 500 error?

First off, it is probably not a bug. If the first two reports get
generated there may be a problem in the code for the third report.

-Original Message-
From: Joe Privett [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 28, 2003 6:28 AM
To: Jay Blanchard
Subject: RE: [PHP] Bug...


In the httpd.conf file for Apache, I have changed the 'Timeout' to 7200
seconds.

Joe

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 28 August 2003 12:24
To: Joe Privett; [EMAIL PROTECTED]
Subject: RE: [PHP] Bug...


[snip]
I run the script through a browser.  The overall script takes about 36
minutes to run.  I have changed the php.ini values to allow the script
to
run for longer than this.  The script runs, but I always end up with a
500
error.  
[/snip]

Have you also set your webserver software time accordingly? Apache, IIS,
and others come with a default time for a response.

__
This message has been scanned for all viruses by BTnet VirusScreen.
The service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service,
please visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==


DISCLAIMER:
 This email is private and confidential and is for the addressee only.
If
misdirected, please notify us and confirm that it has been deleted from
your
system and any hard copies destroyed. You are strictly prohibited from
using, printing, distributing or disseminating it or any information
contained in it to save to the intended recipient.


__
This message has been checked for all viruses by BTnet VirusScreen.
The service is delivered in partnership with MessageLabs.

This service does not scan any password protected or encrypted
attachments.  

If you are interested in finding out more about the service,
please visit our website at
http://www.btignite.com/internetservices/btnet/products_virusscreen.htm
==

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



Re: [PHP] Urgent help required for using Cron

2003-08-28 Thread [EMAIL PROTECTED]
Hi

briefly: you need to create a cron job by typing crontab -e at the 
command line.
each line in the crontab has five fields which define the time at which 
the cron job will run.
more info in man cron and man crontab.

Cron sends a mail to the owner of the job when a job fails. you can pipe 
it to a program (this has been discussed extensively in this group this 
week so i will not go into details)

all the best

Safal Solutions wrote:

Hi friends,
 I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.
I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.
Thanking you,

Siva

 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] PHP Interview questions

2003-08-28 Thread Jay Blanchard
[snip]
However, Curt does bring up a good pointgiven a real world situation
create the decision logic (in code format) that demonstrates you grep
the path needed to arrive at a conclusion. As many of us model business
processes this is a valid method for determining familiarity with the
problem solving method in a code based world.

Some of you requested another situation
[/snip]

Many of you will have seen this one, but perhaps never applied
programming logic to it.

You come to a fork in the road. One fork takes to to Utopia (where you'd
like to go) and the other takes you to the Black Forest (where you
definitely do not want to go). There are two men standing there. You
know that one always tells the truth, the other always liesbut you
do not know which one performs which way.

What is the one question that you can ask that will let you know which
way is the way to Utopia?

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



RE: [PHP] PHP Interview questions

2003-08-28 Thread Eyles, Richard
[snip]
You come to a fork in the road. One fork takes to to Utopia (where you'd
like to go) and the other takes you to the Black Forest (where you
definitely do not want to go). There are two men standing there. You
know that one always tells the truth, the other always liesbut you
do not know which one performs which way.

What is the one question that you can ask that will let you know which
way is the way to Utopia?
[/snip]

Which road would the other man point to if I asked him the way to Utopia?

Then take the other road!

Cheers

Richard
--
Richard Eyles
Principal Pharmacist Computer Services
Portsmouth Hospitals NHS Trust 023 9237 2923 / Ext 5283


RE: [PHP] PHP Interview questions

2003-08-28 Thread Jay Blanchard
[snip]
Which road would the other man point to if I asked him the way to
Utopia?
[/snip]

Can you do it programmitically (with pseudo-code)? After all, we need to
keep this on-topic :)

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



RE: [PHP] Urgent help required for using Cron

2003-08-28 Thread Jay Blanchard
[snip]
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time
using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a
message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the
mail
we want Cron to indicate to us that the mail was successfully sent or
not
sent.  This we want to know through a program because we want to use
this as
a part of automation of sending mails.
[/snip]

Did you have a look at the tutorial I sent you?
http://www.unixgeeks.org/security/newbie/unix/cron-1.html
What, specifically, do you not understand?

1. From the command line type "crontab -e". This brings up the cron list
in vi
2. type "i" for the insert command
3. on the last line type the time you would like the cron to run, along
with commands

15 3 * * * /usr/local/bin/php /path/to/my/mail_script.php

will run the PHP script each morning at 3:15 AM

4. Hit 'escape' and type :w! to save
5. type :q! to quit

The cron job will now run each morning at 3:15 AM

HTH!

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



RE: [PHP] Urgent help required for using Cron

2003-08-28 Thread Javier Tacon
For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it doesn't say if 
your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your script.
You can use a some mail classes that they have debug options (for example I use 
phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

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

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



RE: [PHP] PHP Interview questions

2003-08-28 Thread Brian S. Drexler
Oh manit is WAY too early for a question like this...

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 7:31 AM
To: Jay Blanchard; Curt Zirzow; PHP General
Subject: RE: [PHP] PHP Interview questions


[snip]
However, Curt does bring up a good pointgiven a real world situation
create the decision logic (in code format) that demonstrates you grep
the path needed to arrive at a conclusion. As many of us model business
processes this is a valid method for determining familiarity with the
problem solving method in a code based world.

Some of you requested another situation
[/snip]

Many of you will have seen this one, but perhaps never applied
programming logic to it.

You come to a fork in the road. One fork takes to to Utopia (where you'd
like to go) and the other takes you to the Black Forest (where you
definitely do not want to go). There are two men standing there. You
know that one always tells the truth, the other always liesbut you
do not know which one performs which way.

What is the one question that you can ask that will let you know which
way is the way to Utopia?

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

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

Re: [PHP] Re: Animating with GD?

2003-08-28 Thread Blue Prawn
> >Not anymore due to the Unisys LZW patent issues.. GD has no support for
> >GIF file anymore.
> >Wait until next june.. Then you can create animated GIF files with GD
> >(Unisys' patent expires).
>
> That patent already expired for the US (June 30, 2003).  Canadian
> patent expires July 7, 2004, the counterpart patents in the United
> Kingdom, France, Germany and Italy expire June 18, 2004, and the
> Japanese counterpart patents expire June 20, 2004.


There are NO patent for software in France (so we could use gif support)


But it will perhaps change next on 1 september 2003.

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



[PHP] reboot pc with PHP

2003-08-28 Thread Petre Agenbag
Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small "admin" utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
"routine" commands, I'd like to make a simple password protected webpage
that would have simple links on them like "reboot", "redial" etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

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



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small "admin" utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
"routine" commands, I'd like to make a simple password protected webpage
that would have simple links on them like "reboot", "redial" etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

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

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



[PHP] Re: reboot pc with PHP

2003-08-28 Thread Catalin Trifu
if you are really not interested in the security,
then you can run the apache server as root; then you have
root privileges for your PHP scripts.
then you can use the system() function with no restrictions

Cheers,
Catalin

"Petre Agenbag" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi List
>
> I've gone through the list for previous questions and the only one that
> seems to be a solution is to use sudo, however, I cannot seem to get it
> right.
>
> Just as background:
>
> I want to make a small "admin" utill for an intranet machine, so the
> security risks don't bother me at all.
>
> Instead of myself having to ssh into the box to reboot or do other
> "routine" commands, I'd like to make a simple password protected webpage
> that would have simple links on them like "reboot", "redial" etc, so
> that someone with some sort of responsibility can do it themselves.
>
> Obviously these command(s) need to be run as root, so I looked at the
> /etc/sudoers and added apache , BUT, in the error log it prompts for a
> password.
>
> I tried to add the option NOPASSWD: ALL to the file, but it says there's
> a syntax error.
>
> What am I missing?
>
> Any other ways of doing this?  PS, I don't even want to consider Webmin,
> it's way too complicated, I just want a handfull of predefined commands
> to be run, nothing else)
>
> Thanks
>

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



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

A more easy solution is that:

Make a cron that executes every minut /tmp/rreboot.sh for user root
crontab -e
Add the line:
* * * * *  /tmp/rreboot.sh

The script is:
/tmp/rreboot.sh
---
#!/bin/sh
if [ -f "/tmp/rreboot" ]; then
 rm -f /tmp/rreboot
 shutdown -r now
fi
---
Make executable the file with chmod +x /tmp/rreboot.sh

And a simple PHP like:
 /tmp/rreboot");
echo "Ok, i'll reboot in a few seconds";
?>


So, when anyone calls to this PHP, creates a file, that if its detected by rreboot.sh, 
the root will reboot the machine.



-Mensaje original-
De: Javier Tacon 
Enviado el: jueves, 28 de agosto de 2003 15:07
Para: Petre Agenbag; [EMAIL PROTECTED]
Asunto: RE: [PHP] reboot pc with PHP



You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small "admin" utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
"routine" commands, I'd like to make a simple password protected webpage
that would have simple links on them like "reboot", "redial" etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

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



Re: [PHP] reboot pc with PHP

2003-08-28 Thread Matthew Harrison
On Thu, Aug 28, 2003 at 03:35:59PM +0200, Javier Tacon wrote:
> 
> A more easy solution is that:
> 
> Make a cron that executes every minut /tmp/rreboot.sh for user root
> crontab -e
> Add the line:
> * * * * *  /tmp/rreboot.sh
> 
> The script is:
> /tmp/rreboot.sh
> ---
> #!/bin/sh
> if [ -f "/tmp/rreboot" ]; then
>  rm -f /tmp/rreboot
>  shutdown -r now
> fi
> ---
> Make executable the file with chmod +x /tmp/rreboot.sh
>

just one little point (i'm glad i don't have to give a setuid lecture) personally
i would make sure that the location of the check file is extremely secure.

under normal circumstances, any user could write the rreboot file and cause a reboot

also, remember to remove the file again in rc.local before cron starts etc.

but i like the idea. its much more secure (from a web perspective).

> And a simple PHP like:
>  exec("echo rreboot > /tmp/rreboot");
> echo "Ok, i'll reboot in a few seconds";
> ?>
> 
> 
> So, when anyone calls to this PHP, creates a file, that if its detected by 
> rreboot.sh, the root will reboot the machine.
> 
> 
> 
> -Mensaje original-
> De: Javier Tacon 
> Enviado el: jueves, 28 de agosto de 2003 15:07
> Para: Petre Agenbag; [EMAIL PROTECTED]
> Asunto: RE: [PHP] reboot pc with PHP
> 
> 
> 
> You can write a little script with expect (man expect) and execute it from php with 
> exec().
> 
> Other solution its to write a .procmailrc in root that executes the reboot when 
> coming a mail with some text in subject or boyd, so, from php you only need to send 
> a mail.
> 
> 
> -Mensaje original-
> De: Petre Agenbag [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 14:48
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] reboot pc with PHP
> 
> 
> Hi List
> 
> I've gone through the list for previous questions and the only one that
> seems to be a solution is to use sudo, however, I cannot seem to get it
> right.
> 
> Just as background:
> 
> I want to make a small "admin" utill for an intranet machine, so the
> security risks don't bother me at all.
> 
> Instead of myself having to ssh into the box to reboot or do other
> "routine" commands, I'd like to make a simple password protected webpage
> that would have simple links on them like "reboot", "redial" etc, so
> that someone with some sort of responsibility can do it themselves.
> 
> Obviously these command(s) need to be run as root, so I looked at the
> /etc/sudoers and added apache , BUT, in the error log it prompts for a
> password.
> 
> I tried to add the option NOPASSWD: ALL to the file, but it says there's
> a syntax error.
> 
> What am I missing?
> 
> Any other ways of doing this?  PS, I don't even want to consider Webmin,
> it's way too complicated, I just want a handfull of predefined commands
> to be run, nothing else)
> 
> Thanks
>  
> 
> -- 
> 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

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]
-
ASCII ribbon campaign ( )
 - against HTML email  X
   & Usenet posts / \

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



[PHP] Including classes inside functions vs outside - scope/globalquestion?

2003-08-28 Thread Verdon vaillancourt
Hi :)

Somewhat newbie question...

I'm trying to include some open source classes into a project I am working
on. The classes build a set of relational select menus from the contents of
two tables. I have not trouble using the classes in a simple test page, but
am running into problems when I try to use them as part of a function. For
instance the following works just fine...

init() ;
$ls = new linked_select("conn","testselect","clients","Select
Client","id","company",1,"pieces","Select
Piece","id","title","client_id",0,1) ;
$ls->create_javascript();
$ls->create_base_select();
$ls->create_sub_select_multi();
// the end of the class stuff

echo "a bunch more of my own stuff";

include("foot.php");
?>

While this does not...

init() ;
$ls = new linked_select("conn","testselect","clients","Select
Client","id","company",1,"pieces","Select
Piece","id","title","client_id",0,1) ;
$ls->create_javascript();
$ls->create_base_select();
$ls->create_sub_select_multi();
// the end of the class stuff
echo "a bunch more of my own stuff";
}

$main_content = whatever();
echo "$main_content";

include("foot.php");
?>

It returns an error like 'Call to undefined function:  debug() in
/xxx/xxx/mysql_recordset.php on line 40'. When I check this line out, it is
' $GLOBALS[$this->connobj]->debug() ;'.

Now I know this function exists (it's in the required file
'mysql_connection.php'), and works from my simple test. Quickly commenting
out the line 40 allows the page to finish rendering, but the select menus
are empty, so my guess is the 'connobj' is not being passed along or the 3
required class files are not talking to each other in some way ;)

Doing some reading in the manual tells me it's a scope issue (I think). I
thought though that $GLOBALS was a super global but I guess I just don't get
the concept yet. I've tried declaring all sorts of things as global in my
function whatever() to no avail.

Is there something really basic that I am missing in understanding, or is
this a more complex thing?

TIA,
Verdon
Ps. Cc'ing to me when/if replying to list would be appreciated as I am on
digest mode :)

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



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

Exactly ..
Well, the script removes the rreboot file before the shutdown.

For security choose a directory for rreboot file placed in a directory that only can 
be readed/writed by apache, and the php file in the example its very simple, but you 
can ask for a password, create a log, etc ..

chown 700 /directory/for/rrebootfile
chown apache.nobody /directory/for/rrebootfile


-Mensaje original-
De: Matthew Harrison [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 15:49
Para: Javier Tacon
CC: Petre Agenbag; [EMAIL PROTECTED]
Asunto: Re: [PHP] reboot pc with PHP


On Thu, Aug 28, 2003 at 03:35:59PM +0200, Javier Tacon wrote:
> 
> A more easy solution is that:
> 
> Make a cron that executes every minut /tmp/rreboot.sh for user root
> crontab -e
> Add the line:
> * * * * *  /tmp/rreboot.sh
> 
> The script is:
> /tmp/rreboot.sh
> ---
> #!/bin/sh
> if [ -f "/tmp/rreboot" ]; then
>  rm -f /tmp/rreboot
>  shutdown -r now
> fi
> ---
> Make executable the file with chmod +x /tmp/rreboot.sh
>

just one little point (i'm glad i don't have to give a setuid lecture) personally
i would make sure that the location of the check file is extremely secure.

under normal circumstances, any user could write the rreboot file and cause a reboot

also, remember to remove the file again in rc.local before cron starts etc.

but i like the idea. its much more secure (from a web perspective).

> And a simple PHP like:
>  exec("echo rreboot > /tmp/rreboot");
> echo "Ok, i'll reboot in a few seconds";
> ?>
> 
> 
> So, when anyone calls to this PHP, creates a file, that if its detected by 
> rreboot.sh, the root will reboot the machine.
> 
> 
> 
> -Mensaje original-
> De: Javier Tacon 
> Enviado el: jueves, 28 de agosto de 2003 15:07
> Para: Petre Agenbag; [EMAIL PROTECTED]
> Asunto: RE: [PHP] reboot pc with PHP
> 
> 
> 
> You can write a little script with expect (man expect) and execute it from php with 
> exec().
> 
> Other solution its to write a .procmailrc in root that executes the reboot when 
> coming a mail with some text in subject or boyd, so, from php you only need to send 
> a mail.
> 
> 
> -Mensaje original-
> De: Petre Agenbag [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 14:48
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] reboot pc with PHP
> 
> 
> Hi List
> 
> I've gone through the list for previous questions and the only one that
> seems to be a solution is to use sudo, however, I cannot seem to get it
> right.
> 
> Just as background:
> 
> I want to make a small "admin" utill for an intranet machine, so the
> security risks don't bother me at all.
> 
> Instead of myself having to ssh into the box to reboot or do other
> "routine" commands, I'd like to make a simple password protected webpage
> that would have simple links on them like "reboot", "redial" etc, so
> that someone with some sort of responsibility can do it themselves.
> 
> Obviously these command(s) need to be run as root, so I looked at the
> /etc/sudoers and added apache , BUT, in the error log it prompts for a
> password.
> 
> I tried to add the option NOPASSWD: ALL to the file, but it says there's
> a syntax error.
> 
> What am I missing?
> 
> Any other ways of doing this?  PS, I don't even want to consider Webmin,
> it's way too complicated, I just want a handfull of predefined commands
> to be run, nothing else)
> 
> Thanks
>  
> 
> -- 
> 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

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]
-
ASCII ribbon campaign ( )
 - against HTML email  X
   & Usenet posts / \

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



Re: [PHP] reboot pc with PHP

2003-08-28 Thread Matthew Harrison
of course, i've only just seen that the script removes it. it's been a long
day, my apologies.

just out of curiosity, why would you want the ability to reboot your box
like that?

On Thu, Aug 28, 2003 at 04:06:25PM +0200, Javier Tacon wrote:
> 
> Exactly ..
> Well, the script removes the rreboot file before the shutdown.
> 
> For security choose a directory for rreboot file placed in a directory that only can 
> be readed/writed by apache, and the php file in the example its very simple, but you 
> can ask for a password, create a log, etc ..
> 
> chown 700 /directory/for/rrebootfile
> chown apache.nobody /directory/for/rrebootfile
> 
> 
> -Mensaje original-
> De: Matthew Harrison [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 15:49
> Para: Javier Tacon
> CC: Petre Agenbag; [EMAIL PROTECTED]
> Asunto: Re: [PHP] reboot pc with PHP
> 
> 
> On Thu, Aug 28, 2003 at 03:35:59PM +0200, Javier Tacon wrote:
> > 
> > A more easy solution is that:
> > 
> > Make a cron that executes every minut /tmp/rreboot.sh for user root
> > crontab -e
> > Add the line:
> > * * * * *  /tmp/rreboot.sh
> > 
> > The script is:
> > /tmp/rreboot.sh
> > ---
> > #!/bin/sh
> > if [ -f "/tmp/rreboot" ]; then
> >  rm -f /tmp/rreboot
> >  shutdown -r now
> > fi
> > ---
> > Make executable the file with chmod +x /tmp/rreboot.sh
> >
> 
> just one little point (i'm glad i don't have to give a setuid lecture) personally
> i would make sure that the location of the check file is extremely secure.
> 
> under normal circumstances, any user could write the rreboot file and cause a reboot
> 
> also, remember to remove the file again in rc.local before cron starts etc.
> 
> but i like the idea. its much more secure (from a web perspective).
> 
> > And a simple PHP like:
> >  > exec("echo rreboot > /tmp/rreboot");
> > echo "Ok, i'll reboot in a few seconds";
> > ?>
> > 
> > 
> > So, when anyone calls to this PHP, creates a file, that if its detected by 
> > rreboot.sh, the root will reboot the machine.
> > 
> > 
> > 
> > -Mensaje original-
> > De: Javier Tacon 
> > Enviado el: jueves, 28 de agosto de 2003 15:07
> > Para: Petre Agenbag; [EMAIL PROTECTED]
> > Asunto: RE: [PHP] reboot pc with PHP
> > 
> > 
> > 
> > You can write a little script with expect (man expect) and execute it from php 
> > with exec().
> > 
> > Other solution its to write a .procmailrc in root that executes the reboot when 
> > coming a mail with some text in subject or boyd, so, from php you only need to 
> > send a mail.
> > 
> > 
> > -Mensaje original-
> > De: Petre Agenbag [mailto:[EMAIL PROTECTED]
> > Enviado el: jueves, 28 de agosto de 2003 14:48
> > Para: [EMAIL PROTECTED]
> > Asunto: [PHP] reboot pc with PHP
> > 
> > 
> > Hi List
> > 
> > I've gone through the list for previous questions and the only one that
> > seems to be a solution is to use sudo, however, I cannot seem to get it
> > right.
> > 
> > Just as background:
> > 
> > I want to make a small "admin" utill for an intranet machine, so the
> > security risks don't bother me at all.
> > 
> > Instead of myself having to ssh into the box to reboot or do other
> > "routine" commands, I'd like to make a simple password protected webpage
> > that would have simple links on them like "reboot", "redial" etc, so
> > that someone with some sort of responsibility can do it themselves.
> > 
> > Obviously these command(s) need to be run as root, so I looked at the
> > /etc/sudoers and added apache , BUT, in the error log it prompts for a
> > password.
> > 
> > I tried to add the option NOPASSWD: ALL to the file, but it says there's
> > a syntax error.
> > 
> > What am I missing?
> > 
> > Any other ways of doing this?  PS, I don't even want to consider Webmin,
> > it's way too complicated, I just want a handfull of predefined commands
> > to be run, nothing else)
> > 
> > Thanks
> >  
> > 
> > -- 
> > 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
> 
> -- 
> Mat Harrison
> Technical Developer
> 3d Computer Systems Ltd.
> [EMAIL PROTECTED]
> -
> ASCII ribbon campaign ( )
>  - against HTML email  X
>& Usenet posts / \

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]
-
ASCII ribbon campaign ( )
 - against HTML email  X
   & Usenet posts / \

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



[PHP] PHP5 - self referencing classes

2003-08-28 Thread Thomas Hebinck
Hi all,

I have a class which creates a new object and caches this object (see source
at the bottom). The new object holds a link on the creator class.
The __descructor function of both classes are never called - because the
classes are destroyed (killed), when the script terminates.

Is there a way to "destruct" a class on another way manually?

Does anyone know about any deeper documentation about objects in PHP5?

Thanks!

Bye,
Thomas.

-

';
  }

  function __destruct() {
echo __CLASS__ . '::' . __FUNCTION__ . '';
  }

  function get_b() {
if (!isset($this->b)) {
  $this->b=new b($this);
}
return $this->b;
  }
}

class b {
  private $p_caller;

  function __construct($caller) {
echo __CLASS__ . '::' . __FUNCTION__ . '';
$this->p_caller=$caller;
  }

  function __destruct() {
echo __CLASS__ . '::' . __FUNCTION__ . '';
  }
}

$a=new a;
$b=$a->get_b();
unset($a);
unset($b);

?>

Just prints:

a::__construct
b::__construct

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



[PHP] GD & PHP

2003-08-28 Thread Mike At Spy

Is there anything special I have to do to enable GD when using PHP 4.3.2?

I'm getting an error of:

Fatal error: Call to undefined function: imagecreatefromjpeg() in
/home/sites/site37/web/photos/functions.php on line 594

When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
Should I be using imagecreatefromgd()?

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



[PHP] building php witk libiconv

2003-08-28 Thread Alain Bonnefoy
Hi,

I don't know what to do with libiconv to build php4.3.3.
My libiconv-1.9 is installed in /opt
if I invoke configure  --with-iconv=/opt the script runs fine but I 
get the following message at compile time:

gcc: /usr//lib/.libs/libiconv.so: No such file or directory
gcc: /opt//lib/.libs/libiconv.so: No such file or directory
What is strange is that /lib/.libs is a directory tree in the 
libiconv-1.9 source directory.
So, I tried to invoke configure  
--with-iconv=/home/a.bonnefoy/portage/libiconv-1.9.
But now configure complains asking me to reinstall libiconv.

What to do???

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


RE: [PHP] GD & PHP

2003-08-28 Thread Javier Tacon

You need to compile PHP with the option --with-gd in the configure step.

The function is imagecreatefromjpeg()


-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 17:32
Para: [EMAIL PROTECTED]
Asunto: [PHP] GD & PHP



Is there anything special I have to do to enable GD when using PHP 4.3.2?

I'm getting an error of:

Fatal error: Call to undefined function: imagecreatefromjpeg() in
/home/sites/site37/web/photos/functions.php on line 594

When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
Should I be using imagecreatefromgd()?

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

2003-08-28 Thread Alvaro Martinez
I want to obtain only one instance of one class. In other to do that, I call
to a static method, that creates the instance(if it doesnt exit) or returns
the reference of the instance.
The call to the static method is the next:

   $conexiondb=db::getInstancia();

Well, but if I call to db::getInstancia() another time, I obtain another new
object  :-(

The code of the db class is the next (it is a Singleton Pattern, but it
doesnt work)

class db{
   var $_miInstancia;

   function db (){
  // funcion que se conecta con la BBDD
 static $miInstancia;
 $this->_miInstancia=&$miInstancia;

 $result = @mysql_pconnect("inforalv", "discoteca", "password");
 if (!$result)
   return false;
 if ([EMAIL PROTECTED]("discoteca"))
   return false;
   }

&function getInstancia(){
   if (!isset($this))
  $_miInstancia=new db();
   return $_miInstancia;
}
}

I think that the problem is that the var _miInstance is not static and I
dont know how to do it.
Could you please tell me if there is anything wrong?

Thanks.

Alvaro

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



Re: [PHP] Re: Website templating schemes

2003-08-28 Thread rush
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Wow... where'd you pull that from?? Any facts to back that up? :)

:) no, I was think in terms of how easy is to write template oriented
software, and how flexible te results are, which are all pretty subjective
things, that is why I used "I think" fomulation :). Anyhow, it was not my
intent to refer to the execution efficiency. My appologoizes for beeing
misleading.

> FYI: I've got a template benchmark site running at
> http://sepodati.realxl.net/tpl_bench/
>
> Any interest in looking over the code and adding a TemplateTamer
> benchmark to the list?

I'll take a look, but I am not sure I could fit into the structure of the
benchmark. Problem is that this benchmark oriented towards the simple
templating class (or functions) that user has to initialize and make some
calls in order to has his variables substituted. This benchmark then wraps
this substitution calls in the loop to see how efficient is template engine
at simple variable substitutions.

TemplateTamer works other way around, it basically provides you a light
framework, and code generator. You as a progaramer have a duty to provide
the data for the variables (by returning them in the array as result of the
getData() function), and there is no more you are doing. You do not
initialize templates, you do not load various template files into the
template engine, you do not assign variable one by one, you do not call
substitute function, you do not echo the youtput in order for your page to
appear. All this is handled by code that was generated by TemplateTamer or
by framework. Actually first (internal) versions of TemplateTamer did not
have its own template engine, they were just using FastTemplate for the
task.

I believe such approach can be a real time saver and more easy way to work,
but it seems difficult to fit into your benchmark, but I will give it a try
if nothing else to get one more link :) . Another problem is that thing that
is benchmarked is plain page without structure. No subtemplates, not
conditional parts, no repeated subtemplates. And I believe this is where the
real action is for the templates, and this is all you have in the real world
situations. Also I believe that in real world situations, time that is spent
in the any template engine is not that important, usually the bottleneck is
somewhere else, database most usually. But I am driffting.

Thanks for the response!

rush
--
http://www.templatetamer.com/

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



RE: [PHP] GD & PHP

2003-08-28 Thread Mike At Spy

Cool - thanks. :)

-Mike


> -Original Message-
> From: Javier Tacon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 28, 2003 11:33 AM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: RE: [PHP] GD & PHP
> 
> 
> 
> You need to compile PHP with the option --with-gd in the configure step.
> 
> The function is imagecreatefromjpeg()
> 
> 
> -Mensaje original-
> De: Mike At Spy [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 17:32
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] GD & PHP
> 
> 
> 
> Is there anything special I have to do to enable GD when using PHP 4.3.2?
> 
> I'm getting an error of:
> 
> Fatal error: Call to undefined function: imagecreatefromjpeg() in
> /home/sites/site37/web/photos/functions.php on line 594
> 
> When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
> Should I be using imagecreatefromgd()?
> 
> -- 
> 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] PHP won't parse under https, but will with http

2003-08-28 Thread Jason Jacobs
I'm not sure if this is the right forum for this question, but I'm hoping someone can 
help nonetheless. :)

I installed an SSL Cert. on a site the other day for a checkout page, and the php 
won't parse.  If I take the "s" off, it parses just fine.  I have a feeling it's an 
httpd.conf setting, but I don't know where to look.  Maybe it's a php.ini issue to 
make it parse on port (whatever SSL is)?  Thanks for any suggestions.

-jason

--
web developer
Factory7.com
354-9977 

[PHP] Parsing Current Server Domain

2003-08-28 Thread jeffrey pearson
Does anyone know how I would parse the domain that scripts are currently being 
executed in?

For example:

I use seperate domains for development and production. There are times I have to 
specify a hard coded url instead of a relative one. So for the development it would be;

dev.domain.com/somefile.php

where on the live site it would be

www.domain.com/somefile.php

I would like the script to be able to parse the domain part so it would be;

$currentdomain/somefile.php


AAny suggestions would be greatly appreciated.

Jeff Pearson

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



Re: [PHP] Parsing Current Server Domain

2003-08-28 Thread Curt Zirzow
* Thus wrote jeffrey pearson ([EMAIL PROTECTED]):
> Does anyone know how I would parse the domain that scripts are currently being 
> executed in?
> 
> ...
>
> dev.domain.com/somefile.php
> 
> where on the live site it would be
> 
> www.domain.com/somefile.php

In most cases $_SERVER['HTTP_HOST'] is what you want.  It wont be
available if you access the site with the ip address.



Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: PHP won't parse under https, but will with http

2003-08-28 Thread Catalin Trifu
Hi,

Is this a virtual host ?
How did you define the AddType in httpd.conf ? as global
directive or for each vhost ?
Also check that u'r apache listens to 443. Does pure .html
page display ?

Cheers,
Catalin

"Jason Jacobs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I'm not sure if this is the right forum for this question, but I'm hoping
someone can help nonetheless. :)

I installed an SSL Cert. on a site the other day for a checkout page, and
the php won't parse.  If I take the "s" off, it parses just fine.  I have a
feeling it's an httpd.conf setting, but I don't know where to look.  Maybe
it's a php.ini issue to make it parse on port (whatever SSL is)?  Thanks for
any suggestions.

-jason

--
web developer
Factory7.com
354-9977

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



[PHP] Re: Including classes inside functions vs outside - scope/global

2003-08-28 Thread Greg Beaver
Hi Verdon,

Be sure that $connobj is declared as a global variable in the 
mysql_connection.php file.  You can do this in two ways:

1) instead of $connobj = blah, use $GLOBALS['connobj'] = blah
2) global $connobj; $connobj = blah
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Verdon Vaillancourt wrote:
Hi :)

Somewhat newbie question...

I'm trying to include some open source classes into a project I am working
on. The classes build a set of relational select menus from the contents of
two tables. I have not trouble using the classes in a simple test page, but
am running into problems when I try to use them as part of a function. For
instance the following works just fine...

include_once("config.php");
include_once ("functions.php");
include_once("head.php");
loginCheck(3);
global $config;
echo "a bunch of my own stuff";

// this is the class stuff I am trying to include
require("mysql_connection.php");
require("mysql_recordset.php");
require ("linked_select_class.php");
$conn = new mysql_conn("localhost","user","pass","database") ;
$conn->init() ;
$ls = new linked_select("conn","testselect","clients","Select
Client","id","company",1,"pieces","Select
Piece","id","title","client_id",0,1) ;
$ls->create_javascript();
$ls->create_base_select();
$ls->create_sub_select_multi();
// the end of the class stuff
echo "a bunch more of my own stuff";

include("foot.php");
?>
While this does not...


include_once("config.php");
include_once ("functions.php");
include_once("head.php");
loginCheck(3);
global $config;
function whatever() {
global $config;
echo "a bunch of my own stuff";
// this is the class stuff I am trying to include
require("mysql_connection.php");
require("mysql_recordset.php");
require ("linked_select_class.php");
$conn = new mysql_conn("localhost","user","pass","database") ;
$conn->init() ;
$ls = new linked_select("conn","testselect","clients","Select
Client","id","company",1,"pieces","Select
Piece","id","title","client_id",0,1) ;
$ls->create_javascript();
$ls->create_base_select();
$ls->create_sub_select_multi();
// the end of the class stuff
echo "a bunch more of my own stuff";
}
$main_content = whatever();
echo "$main_content";
include("foot.php");
?>
It returns an error like 'Call to undefined function:  debug() in
/xxx/xxx/mysql_recordset.php on line 40'. When I check this line out, it is
' $GLOBALS[$this->connobj]->debug() ;'.
Now I know this function exists (it's in the required file
'mysql_connection.php'), and works from my simple test. Quickly commenting
out the line 40 allows the page to finish rendering, but the select menus
are empty, so my guess is the 'connobj' is not being passed along or the 3
required class files are not talking to each other in some way ;)
Doing some reading in the manual tells me it's a scope issue (I think). I
thought though that $GLOBALS was a super global but I guess I just don't get
the concept yet. I've tried declaring all sorts of things as global in my
function whatever() to no avail.
Is there something really basic that I am missing in understanding, or is
this a more complex thing?
TIA,
Verdon
Ps. Cc'ing to me when/if replying to list would be appreciated as I am on
digest mode :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] GD & PHP

2003-08-28 Thread Mike At Spy

I get an error about png libraries not found, though my configure line only
adds --with-gd to it from my previous configure (pretty recent).  Do I need
png and/or some sort of jpeg libraries installed first?

I don't mention png in my configure line:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gettext=/usr --e
nable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin 
--with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-dba 
--with-gdbm --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars -
-enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-d
ebug --with-libdir=/usr/lib --with-db3 --with-interbase=shared --with-pgsql=
shared --with-ldap --with-pdflib=shared --with-mcrypt --with-gd

Thanks,

-Mike



> -Original Message-
> From: Javier Tacon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 28, 2003 11:33 AM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: RE: [PHP] GD & PHP
>
>
>
> You need to compile PHP with the option --with-gd in the configure step.
>
> The function is imagecreatefromjpeg()
>
>
> -Mensaje original-
> De: Mike At Spy [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 17:32
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] GD & PHP
>
>
>
> Is there anything special I have to do to enable GD when using PHP 4.3.2?
>
> I'm getting an error of:
>
> Fatal error: Call to undefined function: imagecreatefromjpeg() in
> /home/sites/site37/web/photos/functions.php on line 594
>
> When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
> Should I be using imagecreatefromgd()?
>
> --
> 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



Re: [PHP] building php witk libiconv

2003-08-28 Thread Tom Rogers
Hi,

Friday, August 29, 2003, 12:52:11 AM, you wrote:
AB> Hi,

AB> I don't know what to do with libiconv to build php4.3.3.
AB> My libiconv-1.9 is installed in /opt

AB> if I invoke configure  --with-iconv=/opt the script runs fine but I 
AB> get the following message at compile time:

AB> gcc: /usr//lib/.libs/libiconv.so: No such file or directory
AB> gcc: /opt//lib/.libs/libiconv.so: No such file or directory


AB> What is strange is that /lib/.libs is a directory tree in the 
AB> libiconv-1.9 source directory.
AB> So, I tried to invoke configure  
AB> --with-iconv=/home/a.bonnefoy/portage/libiconv-1.9.
AB> But now configure complains asking me to reinstall libiconv.

AB> What to do???

AB> Thanks,
AB> Alain.


What happens if you just use --with-iconv ?

-- 
regards,
Tom

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



RE: [PHP] GD & PHP

2003-08-28 Thread Javier Tacon

Try to add --with-jpeg, but probably you need to install some libraries, like libjpeg 
(http://freshmeat.net/projects/libjpeg/?topic_id=105%2C809)



-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 18:22
Para: Javier Tacon; [EMAIL PROTECTED]
Asunto: RE: [PHP] GD & PHP



I get an error about png libraries not found, though my configure line only
adds --with-gd to it from my previous configure (pretty recent).  Do I need
png and/or some sort of jpeg libraries installed first?

I don't mention png in my configure line:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gettext=/usr --e
nable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin 
--with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-dba 
--with-gdbm --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars -
-enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-d
ebug --with-libdir=/usr/lib --with-db3 --with-interbase=shared --with-pgsql=
shared --with-ldap --with-pdflib=shared --with-mcrypt --with-gd

Thanks,

-Mike



> -Original Message-
> From: Javier Tacon [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 28, 2003 11:33 AM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: RE: [PHP] GD & PHP
>
>
>
> You need to compile PHP with the option --with-gd in the configure step.
>
> The function is imagecreatefromjpeg()
>
>
> -Mensaje original-
> De: Mike At Spy [mailto:[EMAIL PROTECTED]
> Enviado el: jueves, 28 de agosto de 2003 17:32
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] GD & PHP
>
>
>
> Is there anything special I have to do to enable GD when using PHP 4.3.2?
>
> I'm getting an error of:
>
> Fatal error: Call to undefined function: imagecreatefromjpeg() in
> /home/sites/site37/web/photos/functions.php on line 594
>
> When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
> Should I be using imagecreatefromgd()?
>
> --
> 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] var static

2003-08-28 Thread Alvaro Martinez
I want to obtain only one instance of one class. In other to do that, I call
to a static method, that creates the instance(if it doesnt exit) or returns
the reference of the instance.
The call to the static method is the next:

   $conexiondb=db::getInstancia();

Well, but if I call to db::getInstancia() another time, I obtain another new
object  :-(

The code of the db class is the next (it is a Singleton Pattern, but it
doesnt work)

class db{
   var $_miInstancia;

   function db (){
  // funcion que se conecta con la BBDD
 static $miInstancia;
 $this->_miInstancia=&$miInstancia;

 $result = @mysql_pconnect("inforalv", "discoteca", "password");
 if (!$result)
   return false;
 if ([EMAIL PROTECTED]("discoteca"))
   return false;
   }

&function getInstancia(){
   if (!isset($this))
  $_miInstancia=new db();
   return $_miInstancia;
}
}

I think that the problem is that the var _miInstance is not static and I
dont know how to do it.
Could you please tell me if there is anything wrong?

Thanks.

Alvaro

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



RE: [PHP] var static

2003-08-28 Thread Dynamical.biz
Although PHP supports static variables in functions (see here), it has no
support for static variables in classes.
http://www.php.net/manual/en/language.variables.scope.php

(espero que te sirva)


saludos

aniceto lópez :: DYNAMICAL.BIZ
web development & host services
Barcelona - Spain




-Mensaje original-
Asunto: [PHP] var static


I want to obtain only one instance of one class. In other to do that, I call
to a static method, that creates the instance(if it doesnt exit) or returns
the reference of the instance.
The call to the static method is the next:

   $conexiondb=db::getInstancia();

Well, but if I call to db::getInstancia() another time, I obtain another new
object  :-(

The code of the db class is the next (it is a Singleton Pattern, but it
doesnt work)

class db{
   var $_miInstancia;

   function db (){
  // funcion que se conecta con la BBDD
 static $miInstancia;
 $this->_miInstancia=&$miInstancia;

 $result = @mysql_pconnect("inforalv", "discoteca", "password");
 if (!$result)
   return false;
 if ([EMAIL PROTECTED]("discoteca"))
   return false;
   }

&function getInstancia(){
   if (!isset($this))
  $_miInstancia=new db();
   return $_miInstancia;
}
}

I think that the problem is that the var _miInstance is not static and I
dont know how to do it.
Could you please tell me if there is anything wrong?

Thanks.

Alvaro

--
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] LWP::Parallel in PHP

2003-08-28 Thread Alex
Hello all!
I am looking for PHP analog of Perl LWP::Parallel.
I need to fetch several URL(pages) from PHP at the same time.
I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec.
Totally it's about 10 seconds in average.
I suppose if I fetched them parallel I would speed up the script 5 times.
I am looking mostly for PHP solutions.
(Hope they exist :)

Have anybody faced with such problem?
Any ideas/suggestions will be appreciated.

Alex.

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



[PHP] MS SQL query problem

2003-08-28 Thread Omar
I have a sql query, something like
SELECT x FROM server1.table WHERE x IN (SELECT x FROM server2.table)

I get a warning when loading the page. This is the warning:
Warning: MS SQL message: Heterogeneous queries require the ANSI_NULLS and
ANSI_WARNINGS options to be set for the connection. This ensures consistent
query semantics. Enable these options and then reissue your query. (severity
16)

I don´t know what to do, where to look...
Thanks for any help.

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



[PHP] Re: PHP won't parse under https, but will with http

2003-08-28 Thread Jason Jacobs
>> Is this a virtual host ? How did you define the AddType in httpd.conf ?
Yes.  And I believe our AddTypes are set for each v-host.  In this case, the v-host 
has its own AddTypes.

AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps

Like I mentioned, the php works fine with http.  Also, html files work fine.

>> Also check that u'r apache listens to 443. 
I tried to add Listen 443, but the server start failed saying something like no 
listening sockets available.  I also tried Listen 64.83.52.19:443, but I got the same 
thing.  I checked to make sure that mod_ssl was loaded, and while I didn't see it in 
the LoadModule list, httpd told me it was already loaded when I added it to the list.

I now know this is an Apache issue, so if I should take it to an Apache list I can do 
that.  Thanks!

-j




Re: [PHP] var static

2003-08-28 Thread Tom Rogers
Hi,

Friday, August 29, 2003, 3:01:45 AM, you wrote:
AM> I want to obtain only one instance of one class. In other to do that, I call
AM> to a static method, that creates the instance(if it doesnt exit) or returns
AM> the reference of the instance.
AM> The call to the static method is the next:

AM>$conexiondb=db::getInstancia();

AM> Well, but if I call to db::getInstancia() another time, I obtain another new
AM> object  :-(

AM> The code of the db class is the next (it is a Singleton Pattern, but it
AM> doesnt work)

AM> class db{
AM>var $_miInstancia;

AM>function db (){
AM>   // funcion que se conecta con la BBDD
AM>  static $miInstancia;
AM>  $this->_miInstancia=&$miInstancia;

AM>  $result = @mysql_pconnect("inforalv", "discoteca", "password");
AM>  if (!$result)
AM>return false;
AM>  if ([EMAIL PROTECTED]("discoteca"))
AM>return false;
AM>}

AM> &function getInstancia(){
AM>if (!isset($this))
AM>   $_miInstancia=new db();
AM>return $_miInstancia;
AM> }
AM> }

AM> I think that the problem is that the var _miInstance is not static and I
AM> dont know how to do it.
AM> Could you please tell me if there is anything wrong?

AM> Thanks.

AM> Alvaro

static calls to a class will never have $this set so you have to set
your reference globally something like this:

c = $count;
// funcion que se conecta con la BBDD
$result = @mysql_pconnect("inforalv", "discoteca", "password");
if (!$result)
return false;
if ([EMAIL PROTECTED]("discoteca"))
return false;
}
function &getInstancia($count=false){
global $_miInstancia;
if (!isset($_miInstancia['db'])){
new db($count);
}
return $_miInstancia;
}
}
$conexiondb =& db::getInstancia(1);
print_r($conexiondb);
$conexiondb2 =& db::getInstancia();
print_r($conexiondb2);

?>

(The $count was just to prove we only have the one instance)
-- 
regards,
Tom

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



[PHP] Loading advise (no problem)

2003-08-28 Thread Ryan A
Hi,
No problem, Just need a little advise on improving my page display time, let
me explain:

I am using some ad software (written in php) which is giving me 5 ads
(banners) to display on a page dynamically (eg: they rotate, banner code is
given at the end of this mail)
I have put all 5 banners on a page my themselfes, renamed the file to
TestingAds.php and used a microtime function to see whats the script
execution time like so:


html and banner code here


I ran TestingAds.php 10 times and these are the numbers, you dont have to
take an averige to see they are pretty good:
 0.00024902820587158
 0.00027501583099365
 0.00025904178619385
 0.00027906894683838
 0.00043702125549316
 0.00036203861236572
 0.00045394897460938
 0.00024497509002686
 0.00025498867034912
 0.00025796890258789

then i took those ads and placed them exactly where they have to go on my
index.php page, then reloaded the page 10 times and got these numbers:
 0.00018906593322754
 0.00066602230072021
 0.00055098533630371
 0.00054502487182617
 0.00054800510406494
 0.00055789947509766
 0.00054597854614258
 0.00056195259094238
 0.00056302547454834
 0.00049996376037598

The numbers look pretty good (i think), but when i actually visit the page
it takes  a bit long to load...even though I am on a pretty fast connection,
any idea why this is the case? my page takes around 20 seconds to load and
there is a white screen till everything is loaded then BLAM its all done.
What can i do so that my page loads faster or atleast shows the page to the
visitor and then loads one ad after another so the visitor can see the page
loading instead of just a white screen?


This is the banner code:
http://jumac.com/ads/ads.php?jscript;zone=tower";>http://jumac.com/ads/ads.php?iframe;zone=tower"; MARGINWIDTH=0
MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=NO WIDTH=121
HEIGHT=601>http://jumac.com/ads/ads.php?banner=NonSSI;page=01;zone=tower";
TARGET="_blank">http://jumac.com/ads/ads.php?page=01;zone=tower";
BORDER=0>

here is the TestingAds page:
http://bestwebhosters.com/TestingAds.php

I have not included the main page that i have already setup the ads because
right now its still be touched up and nothing on the page works but if you
still want to see it just write to me and tell me.

Thanks for your time.
Cheers,
-Ryan







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



Re: [PHP] LWP::Parallel in PHP

2003-08-28 Thread David Otton
On Thu, 28 Aug 2003 20:25:05 +0300, you wrote:

>I am looking for PHP analog of Perl LWP::Parallel.
>I need to fetch several URL(pages) from PHP at the same time.
>I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec.
>Totally it's about 10 seconds in average.
>I suppose if I fetched them parallel I would speed up the script 5 times.
>I am looking mostly for PHP solutions.
>(Hope they exist :)

Think you're out of luck. Yes, it's a problem I've run up against more than
once. There's no thread support in PHP [4. Anyone know if it's in 5?].

I suppose you might be able to hack something together by spawning external
processes, but... might as well just do it all externally then.

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



[PHP] Re: installation problem

2003-08-28 Thread Shadow
can you display phpinfo?  Did you check the php.ini file?

Shadow

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



Re: [PHP] var static

2003-08-28 Thread Alvaro Martinez
I've found the solution myself.
The db class is the next:

class db{

function db (){
// funcion que se conecta con la BBDD
$result = @mysql_pconnect("inforalv", "discoteca", "password");
if (!$result)
return false;
if ([EMAIL PROTECTED]("discoteca"))
return false;
}

function &getInstancia(){
static $miInstancia;
if (!get_class($miInstancia) == 'db')
$miInstancia=new db();
return $miInstancia;
}


and the call to this class is the next:

$conexiondb1=&db::getInstancia();
$conexiondb2=&db::getInstancia();

In the second call I obtain the same object.

Muchas gracias por vuestra ayuda

Alvaro

"Dynamical.Biz" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]

Although PHP supports static variables in functions (see here), it has no
support for static variables in classes.
http://www.php.net/manual/en/language.variables.scope.php

(espero que te sirva)


saludos

aniceto lópez :: DYNAMICAL.BIZ
web development & host services
Barcelona - Spain




-Mensaje original-
Asunto: [PHP] var static


I want to obtain only one instance of one class. In other to do that, I call
to a static method, that creates the instance(if it doesnt exit) or returns
the reference of the instance.
The call to the static method is the next:

   $conexiondb=db::getInstancia();

Well, but if I call to db::getInstancia() another time, I obtain another new
object  :-(

The code of the db class is the next (it is a Singleton Pattern, but it
doesnt work)

class db{
   var $_miInstancia;

   function db (){
  // funcion que se conecta con la BBDD
 static $miInstancia;
 $this->_miInstancia=&$miInstancia;

 $result = @mysql_pconnect("inforalv", "discoteca", "password");
 if (!$result)
   return false;
 if ([EMAIL PROTECTED]("discoteca"))
   return false;
   }

&function getInstancia(){
   if (!isset($this))
  $_miInstancia=new db();
   return $_miInstancia;
}
}

I think that the problem is that the var _miInstance is not static and I
dont know how to do it.
Could you please tell me if there is anything wrong?

Thanks.

Alvaro

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

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



Re: [PHP] var static

2003-08-28 Thread Robert Cummings
Globals!? YUCK :) A better solution IMHO that maintains encapsulation,
is to use a static var in a function:

function &getClassVar( $name )
{
return getAndSetClassVar( $name, false );
}

function &setClassVar( $name, $value )
{
return getAndSetClassVar( $name, true, $value );
}

function &getAndSetClassVar( $name, $set, &$value )
{
static $classVars = array();

if( !$set )
{
return $classVars[$name];
}

$classVars[$name] = &$value;

return $value;
}

Admittedly this is slower than using a global, but it doesn't pollute
the global scope and ensures you'll never have naming conflicts.

HTH,
Rob.

On Thu, 2003-08-28 at 13:48, Tom Rogers wrote:
> 
> static calls to a class will never have $this set so you have to set
> your reference globally something like this:
> 
>  $_miInstancia = array();
> class db{
> var $c;
> function db ($count=false){
> global $_miInstancia;
> $_miInstancia['db'] =& $this;
> if($count)$this->c = $count;
> // funcion que se conecta con la BBDD
> $result = @mysql_pconnect("inforalv", "discoteca", "password");
> if (!$result)
> return false;
> if ([EMAIL PROTECTED]("discoteca"))
> return false;
> }
> function &getInstancia($count=false){
> global $_miInstancia;
> if (!isset($_miInstancia['db'])){
> new db($count);
> }
> return $_miInstancia;
> }
> }
> $conexiondb =& db::getInstancia(1);
> print_r($conexiondb);
> $conexiondb2 =& db::getInstancia();
> print_r($conexiondb2);
> 
> ?>
> 
> (The $count was just to prove we only have the one instance)
> -- 
> regards,
> Tom
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Question about mail()

2003-08-28 Thread Matthias Wulkow

Hi php-general,


I have a question about the mail function. In the API I saw, that when
running on linux, I just need the binary sendmail, usually located on
/usr/sbin. Windows users need a running mail-server.
I have php working on a linux machine. Why do I need to have postfix running then to 
make it work? I posted
before, because no mails were sent. I had the sendmail-binary
(postfix) installed, but postfix was not running.
Maybe someone can explain it to me...

SvT


-- 
Who is the ennemy?

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



  1   2   >