[PHP] Output (Urgent!)

2001-07-17 Thread Fredrik A. Takle

Why doesn't this work? Any ideas?!

  $resolution = "document.write(screen.width)";

  if ($resolution >= '1024') {
$resolution = "1024";
  } else {
$resolution = "800";
  }
echo $resolution;

It always output 1024

Best regards
Fredrik A. Takle
Bergen, Norway



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] "report" generation with PHP

2001-07-17 Thread Philip Murray

What about using a Windows COM object? There should be one for Access and if
not you can use the Word one and generate word documents. It's pretty easy
to use and there's lots of (ASP) documentation, but you can translate that
to PHP no probs.

I myself have done this to create a (VERY) quick (as in development time)
SOAP client using the MSSOAP.SoapClient COM object.

 -  -- -  -   -
Philip Murray - [EMAIL PROTECTED]
http://www.open2view.com - Open2View.com
- -  -- -   -

- Original Message -
From: "Marius Andreiana" <[EMAIL PROTECTED]>
To: "Matt Garman" <[EMAIL PROTECTED]>
Cc: "PHP General List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 7:23 PM
Subject: Re: [PHP] "report" generation with PHP


> În 16 Jul 2001 17:17:57 -0500 Matthew Garman a scris:
>
> > Does all that work under Windows?
> don't know, but you can setup a linux box only for fop, leave
> the php site on windows as it is now (ouch!)
>
> > Fop looked like it was part of the
> > Apache project, and we're running IIS 5.0 on Windows 2000 Pro (not my
> > decision!).
> not my problem :)
>
>
> Marius Andreiana
> --
> You don't have to go to jail for helping your neighbour
> http://www.gnu.org/philosophy/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] email counter

2001-07-17 Thread Jorg Krause

Hi,

> Brian White [mailto:[EMAIL PROTECTED]] wrote on Tuesday, July 17, 2001
5:52 AM
> To: Jack; [EMAIL PROTECTED]
> Subject: Re: [PHP] email counter
>
>
> How about changing link to
>
>  Big George 
>
> Where mymailer.php is something like
>
>  /*
> Do whatever it is you need to do with $email
>   */
>
> header("Location: mailto:$email"; );
>
> ?>
>

Works, but changes the previous open window into a empty sheet
and displays "mailto:[EMAIL PROTECTED]";, so the old page
disappears (the user has to click the back button). I think this
solution is not really good for common usage.

Try to use javascript:


x = window.open("mailto:", "Site");


It's easy to combine it with PHP to count the send mails.

Joerg
www.php.comzept.de


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] "report" generation with PHP

2001-07-17 Thread Jörg Krause

> On Mon, Jul 16, 2001 at 05:19:41PM +0300, Marius Andreiana wrote:
> > În 16 Jul 2001 09:07:17 -0500 garman a scris:
> > > I forgot to mention that I already looked into the PDF extensions.
> > > Although
> > > it looks like it would do exactly what I want, the PDFLib
> isn't free for
> > You can generate xml in php, write xsl to convert xml in xml-fo
> > and then use fop to generate pdf, it really works :)
> > http://xml.apache.org/fop/index.html
>
> Does all that work under Windows?  Fop looked like it was part of the
> Apache project, and we're running IIS 5.0 on Windows 2000 Pro (not my
> decision!).
>
Answer:
Yes, all that stuff runs under Win2K. It's java-based and needs JDK 1.3
from Sun. You'll be able to call this from command windows.

Question:
PHP has Java-Support build in, has anybody checked out this with a tool
like FOP (calling Java program from PHP)? Is it stable, good for
production environment?

Joerg
www.php.comzept.de


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] "report" generation with PHP

2001-07-17 Thread Marius Andreiana

În 17 Jul 2001 19:47:23 +1200 Philip Murray a scris:
> What about using a Windows COM object? There should be one for Access and if
> not you can use the Word one and generate word documents
Don't use Words for that... We've had to generate invoices to be snail-mailed,
imagine if the address in the invoiced didn't matched the envelope's transparent
area... (don't think a word document can handle 6000 invoices anyway)

Marius Andreiana
--
You don't have to go to jail for helping your neighbour
http://www.gnu.org/philosophy/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Strange Behavior... is it php bug? please help... i'm dying.!!!

2001-07-17 Thread Martin Marconcini

Hi.

I'm running Apache 1.3.19/php 4.06 under OpenBSD.
I have 30 virtual domains... all plain html (or w/ little php), some
date functions and mysql queries. 
But one of them has a lot of php. 
It's giving me a strange problem...
Here is index.php





Simple (the commonHeader / commonFooter idea was taken from php.net
itself) (open source eh?) ;)

Now. This works fine from SOME PLACES, and I mean, from the internal
network and from many places around the globe, but I've found that from
certain places (no pattern found) it will just say, web site found
waiting for reply. (I will paste the commonheader/footer contents
below).
There seems not to be any kind of pattern. From places where this
doesn't work, other sites (from the 30) will work just fine, even
w/php).

I've found that removing what I will show you on commondeader function
it will work. For testing purposes I Commented out commonFooter.
Functions like print_link, print_image etc. are also on layout.inc (and
they work, because if I comment out Commonheader/footer from index.php,
the home.inc has some of these functions and the page will display
correctly.)

Here is commonHeader. 
If I REMOVE almost everything (unable to find a pattern either) it will
"work". But it doesn’t work like this... as I've said it will say web
site found waiting for reply (tested on IE 5.5 and Lynx from linux, but
lynx from localhost works and my IE from windows98 works either!)













  

  


  

Buenos Aires, 
  
  

 
   
  


  
  
 
  





ANY ideas?? I am crazy about this... and have no idea
what it could be. There are no firewalling rules on the box (all is
open) and as I've told you... I can access from certain places.. (for
example I go to a friend's dial up account and it works fine but other
ppl tells me it's not working!)

If commonheader is reduced to 






hello



WORKS!!! (although as I've told you I haven't found what exactly is
happening)


Any help would be appreciated...
Thanks in advance.

Regards,

Martin Marconcini

"Life must be lived looking forward and can be understood only looking
backward." Soren Kierkegaard



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] variables.

2001-07-17 Thread Johan Vikerskog (ECS)

ok, i still am a newbie to this and therefor ill ask this silly question.

I have made a small test script which checks the inputted name and pass against my 
database and if
it was successfull it typed out success! and if it wasnt successfull it types out 
wrong password!

My problem is. everytime i reload the page it prints out the last result.
I mean when i want to reload the page it should be empty.
But it isnt.

Does anyone know how i can do this?
If you dont understand my question ill post the script here, i just thought i wouldent 
flame your mailboxes.

//Johan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] "report" generation with PHP

2001-07-17 Thread Marius Andreiana

În 17 Jul 2001 09:56:23 +0200 Jörg Krause a scris:
> PHP has Java-Support build in, has anybody checked out this with a tool
> like FOP (calling Java program from PHP)? Is it stable, good for
> production environment?
Yes, I'd like an answer to this too. Right now I can only call it
with system calls from PHP, but with a native function would be
much nicer (could show the progress too)

Marius Andreiana
--
You don't have to go to jail for helping your neighbour
http://www.gnu.org/philosophy/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Hi all.

2001-07-17 Thread Johan Vikerskog (ECS)

When i install PHP.

Do i have to make anything special to activate the ldap function?

//Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] return

2001-07-17 Thread Dave Freeman

On 16 Jul 01, at 15:25, Tyler Longren wrote:

>  function expDate($date) {
> $month = substr("$date", 0, 2);
> $len = strlen($date);
> $year = substr("$date", $len-2, $len);
> return $month;
> return $year;
> }
> expDate("11/2002");
> print "$month $year";
> ?>



would do it I expect.

CYA, Dave


---
Outback Queensland Internet - Longreach, Outback Queensland - Australia
http://www.outbackqld.net.au  mailto:[EMAIL PROTECTED]
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] installation help!!!!!

2001-07-17 Thread Michael P. Carel

Hi,

I really have difficulties installing PHP3with mysql support, i've red alot of 
documentation but i havent installed it successfully.
I've compiled it many times but it doesnt work. I've been using RedHat6.2, 
Apache-1.3.14-6.2.i386.rpm,MySQL-3.23.39-1.i386.rpm,PHP3.0.18.
I've compiled this ver of PHP but my Apache crush down whenever i've finish all the 
installation instruction.I've installed apache first using the RPM binary version and 
MySQL . Please help i really cant make it!
Do you have any RPM version of PHP3 or PHP4 that automatically support Mysql and 
RedHat linux.

mike





[PHP] Error compiling apache / php --with-t1lib

2001-07-17 Thread Sverre Johan Tøvik

Hi,

I'm having trouble compiling php with t1lib support. Actually, php 
compiles fine, it stops when compiling apache.

./configure
make
make install

php works fine.

./configure

apache works.

But when I make apache, I get:

gcc  -DLINUX=22 -I/usr/src/network/php-4.0.0 
-I/usr/src/network/php-4.0.0/Zend -I/usr/src/network/php-4.0.0/Zend 
-I/usr/src/network/php-4.0.0 -DUSE_EXPAT -I./lib/expat-lite 
-DNO_DL_NEEDED `./apaci`\
   -o httpd buildmark.o modules.o modules/standard/libstandard.a 
modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a 
lib/expat-lite/libexpat.a  -Wl,-rpath,/usr/local/lib/lib 
-Wl,-rpath,/usr/local/pgsql/lib  -rdynamic -L/usr/local/lib/lib 
-L/usr/local/pgsql/lib -Lmodules/php4 -L../modules/php4 
-L../../modules/php4 -lmodphp4  -lgdbm  -ldl -lpq -ljpeg -lz -lpng 
-lgd -lresolv -lm -ldl -lcrypt -lnsl  -lresolv -L/usr/local/lib/lib 
-ljpeg  -lm -lcrypt
modules/php4/libphp4.a(gd.o): In function `php_minit_gd':
/usr/src/network/php-4.0.0/ext/gd/gd.c:205: undefined reference to 
`T1_SetBitmapPad'
/usr/src/network/php-4.0.0/ext/gd/gd.c:206: undefined reference to `T1_InitLib'

... and lots of similar stuff (all "undefined reference to `T1_[*]`), 
followed by:

collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/usr/src/network/apache_1.3.19/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/usr/src/network/apache_1.3.19'
make: *** [build] Error 2


***

Can anyone tell me what's up? (Or down, rather...)

Thanks in advance!


Regards,

Sverre Johan Toevik
-- 
 I speak for myself only! 
"to be yourself, in a world that tries, night and day, to make you just
like everybody else - is to fight the greatest battle there ever is to
fight, and never stop fighting" -- e.e. cummings

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Static vs. module, realworld performance difference?

2001-07-17 Thread Sverre Johan Tøvik

Hi,

I've been advised that compiling php static is "faster" than the 
module version. Can anyone tell me what the realworld performance 
difference is? If it's not significant, the extra compile time hardly 
seems worth it.

TIA!


Regards,

Sverre Johan Toevik
-- 
 I speak for myself only! 
"to be yourself, in a world that tries, night and day, to make you just
like everybody else - is to fight the greatest battle there ever is to
fight, and never stop fighting" -- e.e. cummings

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] "report" generation with PHP

2001-07-17 Thread Philip Murray



> În 17 Jul 2001 19:47:23 +1200 Philip Murray a scris:
> > What about using a Windows COM object? There should be one for Access
and if
> > not you can use the Word one and generate word documents
> Don't use Words for that... We've had to generate invoices to be
snail-mailed,

I've also done the same thing. Approximately 400 invoices a day all from a
backend administration website. However, we forked out a license to use the
PDF library.

> imagine if the address in the invoiced didn't matched the envelope's
transparent
> area... (don't think a word document can handle 6000 invoices anyway)

Yes, well true. But, the point was there is the facility to use a COM object
instead of some multi-server or java kludge. If you can find a COM object to
do the task (Matt: you talked about using Access for your needs) then
that'll probably be the easiest/fasted solution on Win32 (short of paying
for PDF).

On a side note, is there some Adobe license which prevents people writing
Free for use PDF libraries? Or is it just by chance that the 2 that exist
require you to purchase a license?

Philip Murray


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Output (Urgent!)

2001-07-17 Thread Morten Winkler Jørgensen

Hi Frederik

Run this code. It does what you want it to.
In your original code you compared two strings in the IF-statement.
When the $resolution gotten from your JavaScript returned '800' it would
have a lexical higher value than '1024' and thereby do exacely what
you wanted it to - actually the code would always return \1024\ since
your screen resolution would never return a string with a lexical
lower value than '1024'.

By multiplying the string '1024' by 1 you get the integervalue 1024
(that's a trick PHP offers ;) ) which you then compare to the
integervalue 1024.

That's the trick

$resolution = "document.write(screen.width)";
echo "--".$resolution."--";
if (($resolution*1) >= 1024) {
  $resolution = "1024";
} else {
  $resolution = "800";
}
echo "**".$resolution."**";

Venlig hilsen ha' en bra dag,
Morten Winkler



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Information about FastTemplate, PHPlib and making big sites.

2001-07-17 Thread Schill, Johannes

Hello,

I'm quite new to this list so i guess you've had this subject hundereds of
times before(?).

Anyway - I'm looking for articles/information about PHPlib, FastTemplate and
their clones.

I'm also looking for information about how to do big/complex sites. OOP in
php, filestructures etc.
Right now I don't even know what a file containing classes should be named,
i've seen such files with
.php, .inc, .obj and .object as extension.

Thanks!

Best regards,
Johannes Schill


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Hi all.

2001-07-17 Thread Christopher Ostmo

Johan Vikerskog (ECS) pressed the little lettered thingies in this order...

> When i install PHP.
> 
> Do i have to make anything special to activate the ldap function?
> 
> //Johan
> 

./configure --with-ldap

http://www.php.net/manual/en/install.configure.php

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Output (Urgent!)

2001-07-17 Thread Fredrik A. Takle

This fixed it, but I don't like it! If you have any other suggestions,  feel
free to email me.


  if (screen.width >= 1024) {
var resolution = ("1024")
  } else {
var resolution = ("800")
  }


Best Regards
Fredrik A. Takle

"Fredrik A



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Output (Urgent!)

2001-07-17 Thread Adrian Ciutureanu

I don't think this code do what he want... You are trying to mix
client-side code with server-side code, but you can't do in that way.
The ONLY way to obtain client screen resolution into a PHP variable is
send data from client to server.

> -Original Message-
> From: Morten Winkler Jørgensen [mailto:[EMAIL PROTECTED]]
> Sent: 17 iulie 2001 12:14
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Output (Urgent!)
> 
> 
> Hi Frederik
> 
> Run this code. It does what you want it to.
> In your original code you compared two strings in the IF-statement.
> When the $resolution gotten from your JavaScript returned 
> '800' it would
> have a lexical higher value than '1024' and thereby do exacely what
> you wanted it to - actually the code would always return \1024\ since
> your screen resolution would never return a string with a lexical
> lower value than '1024'.
> 
> By multiplying the string '1024' by 1 you get the integervalue 1024
> (that's a trick PHP offers ;) ) which you then compare to the
> integervalue 1024.
> 
> That's the trick
> 
> $resolution = " LANGUAGE=\"JavaScript\">document.write(screen.width)";
> echo "--".$resolution."--";
> if (($resolution*1) >= 1024) {
>   $resolution = "1024";
> } else {
>   $resolution = "800";
> }
> echo "**".$resolution."**";
> 
> Venlig hilsen ha' en bra dag,
> Morten Winkler
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] displaying icons

2001-07-17 Thread Petr Jůza

Hi everybody!
Please, have somebody any experience with displaying icons (type files
*.ico) in web pages?

When I have a pure html file that contain , all is
OK - the icon is shown.
But when I create a html page with assistance PHP, the icon isn't shown.

Please, could you help me??
Thank you!

Best Regards, PETER.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Output (Urgent!)

2001-07-17 Thread Jason Rennie

>   $resolution = " LANGUAGE=\"JavaScript\">document.write(screen.width)";
> 
>   if ($resolution >= '1024') {
> $resolution = "1024";
>   } else {
> $resolution = "800";
>   }
> echo $resolution;
> 
> It always output 1024


At a guess becasue your mixing and matching languages.

If you got the input from a hidden field in a form (perhaps an entry
page?) then it would be possible to get the data you want.

Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Output (Urgent!)

2001-07-17 Thread Joseph

How you want to get a value from client side to php on the same page?
Joseph

"Orv î?÷inklÏ ²ørÏkîskî" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Frederik
>
> Run this code. It does what you want it to.
> In your original code you compared two strings in the IF-statement.
> When the $resolution gotten from your JavaScript returned '800' it would
> have a lexical higher value than '1024' and thereby do exacely what
> you wanted it to - actually the code would always return \1024\ since
> your screen resolution would never return a string with a lexical
> lower value than '1024'.
>
> By multiplying the string '1024' by 1 you get the integervalue 1024
> (that's a trick PHP offers ;) ) which you then compare to the
> integervalue 1024.
>
> That's the trick
>
> $resolution = "document.write(screen.width)";
> echo "--".$resolution."--";
> if (($resolution*1) >= 1024) {
>   $resolution = "1024";
> } else {
>   $resolution = "800";
> }
> echo "**".$resolution."**";
>
> Venlig hilsen ha' en bra dag,
> Morten Winkler
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Output (Urgent!)

2001-07-17 Thread Tim Ward

all this is happening on the server. on the server $resolution is just a
string so "if ($resolution >= '1024')" compares the two strings (using ascii
values) and finds that "<"(60) is greater than "1"(49). If you want the
server to know the screen width of the client you'll need to dig into the
header info sent with the request, or you may need to get javascript to send
it back to you, I'm not too sure about this.

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -Original Message-
> From: Fredrik A. Takle [mailto:[EMAIL PROTECTED]]
> Sent: 17 July 2001 08:35
> To: [EMAIL PROTECTED]
> Subject: Output (Urgent!)
> 
> 
> Why doesn't this work? Any ideas?!
> 
>   $resolution = " LANGUAGE=\"JavaScript\">document.write(screen.width)";
> 
>   if ($resolution >= '1024') {
> $resolution = "1024";
>   } else {
> $resolution = "800";
>   }
> echo $resolution;
> 
> It always output 1024
> 
> Best regards
> Fredrik A. Takle
> Bergen, Norway
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Output (Urgent!)

2001-07-17 Thread Morten Winkler Jørgensen


>> How you want to get a value from client side to php on the same page?

Well. Actually I didn't invent the code. I just correcteded it so it
worked on my installation. I must admit I was amazed that it somehow
worked, but it did.


Kind regards,
Morten Winkler



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Output (Urgent!)

2001-07-17 Thread Adrian Ciutureanu

How do you know it worked? :)

> -Original Message-
> From: Morten Winkler Jørgensen [mailto:[EMAIL PROTECTED]]
> Sent: 17 iulie 2001 12:54
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Output (Urgent!)
> 
> 
> 
> >> How you want to get a value from client side to php on the 
> same page?
> 
> Well. Actually I didn't invent the code. I just correcteded it so it
> worked on my installation. I must admit I was amazed that it somehow
> worked, but it did.
> 
> 
> Kind regards,
> Morten Winkler
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: variables.

2001-07-17 Thread elias

Hmm...
It seems that you're variables are beeing reposted upon each page reload.

yes, some code might help.

"Johan Vikerskog" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]..
.
> ok, i still am a newbie to this and therefor ill ask this silly question.
>
> I have made a small test script which checks the inputted name and pass
against my database and if
> it was successfull it typed out success! and if it wasnt successfull it
types out wrong password!
>
> My problem is. everytime i reload the page it prints out the last result.
> I mean when i want to reload the page it should be empty.
> But it isnt.
>
> Does anyone know how i can do this?
> If you dont understand my question ill post the script here, i just
thought i wouldent flame your mailboxes.
>
> //Johan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] "report" generation with PHP

2001-07-17 Thread Marius Andreiana

În 17 Jul 2001 20:41:59 +1200 Philip Murray a scris:
> On a side note, is there some Adobe license which prevents people writing
> Free for use PDF libraries? 
don't think so; fop is free

Marius Andreiana
--
You don't have to go to jail for helping your neighbour
http://www.gnu.org/philosophy/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jennifer

> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > According to the manual, you can only get closest value of your
> > > desired color by letting the ImageColorClosest() find it. Therefore,
> > > if the image is totally black, you can not get the yellow color. I
> > > have not found a way to do this though I believe I have tried
> > > everything. And yet, I have not found any documents covering this
> > > other than PHP-manual.

I didn't get this from reading the manual, but I struggled with
this problem for days and finally gave up.  I posted to some
other forums when this one was done and found no answers.

Now, I know it isn't just me and I know what the problem is, but
I still don't know a solution.

I am creating an image on the fly and I have no problem if I am
just using a background color and adding text to it or if I use
ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to
add text on top of that or even a rectangle or anything on top,
it seems to ignore the color that I specify and always came out
grey. (Of course now if I use ImageColorClosest(), some colors
work because they are in my image.)

It doesn't matter what I output it as, only what I read it in as.

And if I read it in as a png, the image quality is horrible which
I also don't understand. It seems to have drastically reduced the
number of colors used.

My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
4.0.1pl2

Here is my test page.
http://216.122.251.174/test/test.php

Here is the source for the graphic
http://216.122.251.174/test/button.phps

Any idea on how solutions?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Adding elements to an array

2001-07-17 Thread Sharat Hegde

Hello,

I have a requirement to add elements to an associate array dynamically based
on some conditions. I initialize the array with the 1st associate array
element
$MyArray = array('DATETIME' => $DateTime);

How do I add more elements to this associate array. I am using PHP 3 and
array_merge and other functions for arrays are not supported in PHP3. I am
trying the following:
$MyArray[] = array("BUYVAL" => "1.23");
but if I try and get the value of $MyArray[BUYVAL], I get nothing.

I am sure this must be simple, but I do not seem to be getting it right!!

Regards,
Sharat Hegde
Phone: 6560360 Ext 4680


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] ldap

2001-07-17 Thread Johan Vikerskog (ECS)

I made a search in ldap.
I got one entrie.

How do i list the email for that entry? Ill get one answer from this, now i want to 
print out the email adress for that entry.
How do i do that?

//Johan

LDAP query test";
echo "Connecting ...";
$ds=ldap_connect("SERVER");

$dn = "o=Company, c=SV";
$filter="(|(sn=name)(givenname=name))";
$justthese = array( "ou", "sn", "givenname", "mail");

$sr=ldap_search($ds, $dn, $filter, $justthese);

$info = ldap_get_entries($ds, $sr);

print $info["count"]." entries returned";

?>



Johan Vikerskog
Technician - CAE Tools Support
Research & Technology Development
'''
Ericsson Mobile Communications AB
Mobile Phones & Terminals   Telephone: +46 46 19 33 38
Nya VattentornetTelefax:+46 46 19 32 36 
SE-221 83 Lund, Sweden  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Output (Urgent!)

2001-07-17 Thread elias

Well, Yes...
you have to stick to JavaScript + JavaScript and not JavaScript + PHP!
You can let PHP talk w/ JavaScript and not the reverse!

 
   if (screen.width >= 1024) {
 var resolution = "1024";
   } else {
 var resolution = "800";
   }
  document.write(resolution);
 

btw, why don't you like it?
"Fredrik A. Takle" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This fixed it, but I don't like it! If you have any other suggestions,
feel
> free to email me.
>
> 
>   if (screen.width >= 1024) {
> var resolution = ("1024")
>   } else {
> var resolution = ("800")
>   }
> 
>
> Best Regards
> Fredrik A. Takle
>
> "Fredrik A
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jennifer



Jennifer wrote:
> it seems to ignore the color that I specify and always came out
> grey. (Of course now if I use ImageColorClosest(), some colors
> work because they are in my image.)
> 
> 
> Any idea on how solutions?
> 


Oops.  I didn't read far enough.  I found the following in a
separate thread.


> I experienced the same, but i use following workaround: 
> Create a new Jpeg, Allocate your colours, and copy your original jpg
> into the new one. then you have all the colours you have allocated in
> your new pic...

So now my question is, how do I copy one image into another?

I see ImageCopy(), but it mentions copying a part of the image,
so do I have to use GetImageSize to determine the size of the src
image first?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] email counter

2001-07-17 Thread Steve Brett

how about using php mail functions if you've got the support on your server


then a simple form to send the mail and you can track everything you need to
...

Steve

"Jorg krause" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> > Brian White [mailto:[EMAIL PROTECTED]] wrote on Tuesday, July 17,
2001
> 5:52 AM
> > To: Jack; [EMAIL PROTECTED]
> > Subject: Re: [PHP] email counter
> >
> >
> > How about changing link to
> >
> >  Big George 
> >
> > Where mymailer.php is something like
> >
> >  > /*
> > Do whatever it is you need to do with $email
> >   */
> >
> > header("Location: mailto:$email"; );
> >
> > ?>
> >
>
> Works, but changes the previous open window into a empty sheet
> and displays "mailto:[EMAIL PROTECTED]";, so the old page
> disappears (the user has to click the back button). I think this
> solution is not really good for common usage.
>
> Try to use javascript:
>
> 
> x = window.open("mailto:", "Site");
> 
>
> It's easy to combine it with PHP to count the send mails.
>
> Joerg
> www.php.comzept.de
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Adding elements to an array

2001-07-17 Thread Adrian Ciutureanu

$MyArray['BUYVAL'] = 1.23;

> -Original Message-
> From: Sharat Hegde [mailto:[EMAIL PROTECTED]]
> Sent: 17 iulie 2001 13:11
> To: [EMAIL PROTECTED]
> Subject: [PHP] Adding elements to an array
> 
> 
> Hello,
> 
> I have a requirement to add elements to an associate array 
> dynamically based
> on some conditions. I initialize the array with the 1st 
> associate array
> element
>   $MyArray = array('DATETIME' => $DateTime);
> 
> How do I add more elements to this associate array. I am 
> using PHP 3 and
> array_merge and other functions for arrays are not supported 
> in PHP3. I am
> trying the following:
>   $MyArray[] = array("BUYVAL" => "1.23");
> but if I try and get the value of $MyArray[BUYVAL], I get nothing.
> 
> I am sure this must be simple, but I do not seem to be 
> getting it right!!
> 
> Regards,
> Sharat Hegde
> Phone: 6560360 Ext 4680
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Adding elements to an array

2001-07-17 Thread Joseph

Try
$MyArray = array('DATETIME' => $DateTime);
$MyArray["BUYVAL" ] = "1.23";

"Sharat Hegde" <[EMAIL PROTECTED]> wrote in message
30402B4CB8C7D311A3C600C04F1513BC7E8976@bg2ipmail">news:30402B4CB8C7D311A3C600C04F1513BC7E8976@bg2ipmail...
> Hello,
>
> I have a requirement to add elements to an associate array dynamically
based
> on some conditions. I initialize the array with the 1st associate array
> element
> $MyArray = array('DATETIME' => $DateTime);
>
> How do I add more elements to this associate array. I am using PHP 3 and
> array_merge and other functions for arrays are not supported in PHP3. I am
> trying the following:
> $MyArray[] = array("BUYVAL" => "1.23");
> but if I try and get the value of $MyArray[BUYVAL], I get nothing.
>
> I am sure this must be simple, but I do not seem to be getting it right!!
>
> Regards,
> Sharat Hegde
> Phone: 6560360 Ext 4680
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Known bugs with HTTP upload on Windows NT?

2001-07-17 Thread elias

Hmm...
do you have write access on that directory?
IUSR_xxx and IWAM_ users must be appropriate writes on that folder...

"Adam Whitehead" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi All-
>
> I'm having trouble with a simple script that allows HTTP upload. It's a
> direct copy
> of the code available on the PHP web site.
>
> The script works fine on a UNIX machine running PHP 4.0.6 and a Windows 98
> machine running 4.0.6.
>
> However when I test it on a Windows NT machine running PHP 4.0.6, as soon
> as
> the submit button is clicked it causes a page fault in php.exe.
>
> Is this a known issue? In php.ini, the temporary upload path is set to a
> correct
> location and no amount of tweaking this path makes any difference.
>
> The script looks like this:
>
>  if (is_uploaded_file($userfile)) {
>   move_uploaded_file($userfile,"H:\\www\\uploadtest.txt");
>   echo "Done.";
> }
> ?>
>
> 
>   
> Send this file: 
> 
> 
>
> Regards,
> Adam Whitehead
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_query problem (more suggestions)

2001-07-17 Thread Alvin Tan

Hi Brad,

Took another go at it:

This works for me:

$sql= "SELECT * FROM login_table where Pass = password('$password')";
$testResult = mysql_query($sql) or die ("ouch");
$b = mysql_num_rows($testResult);
echo $b;

for sure. I password(ed) the INSERT and it shows the encrypted version in 
the table, then i created another form and this works! I get the num_rows...

@lvin

btw, check you caps again, both your code had different spellings: 
Login_Table and login_table

At 03:08 PM 7/17/01, Brad Wright wrote:
>Alvin,
>the values for Pass in the table have been passed into the table using the
>password('') command and I have also veiwed he content of the tables to
>confirm it. IE the value (i've only got one row in the table at the moment)
>I have passed to the table IS encrypted.
>this is the insert command:
>$query = "insert INTO Login_Table(Login,Pass)
> values ('$Login', password('$Pass'))";
>
>The most puzzling thig is that this works, but the use of the same (mySQL)
>password function, in the SELECT statement doesnt work.
>
>
>
>
> > From: Alvin Tan <[EMAIL PROTECTED]>
> > Date: Tue, 17 Jul 2001 14:38:58 +0800
> > To: Brad Wright <[EMAIL PROTECTED]>, Jason Murray
> > <[EMAIL PROTECTED]>, PHP General List
> > <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] mysql_query problem (more suggestions)
> >
> > Hi again,
> >
> > Just a long shot: since password() encrypts the password that's passed
> > through it, how did the original password get in to db anyway? Was it
> > encrypted too? Cause if the password in the db is plain text and the user
> > submits a plain text in a form called $password, the password() function
> > WILL encrypt the form input and there will be no matches.
> >
> > try removing the password() function in the sql query and substitute it for
> > $password only. If there is a match, then we know we need to put in the db
> > an INSERT statement with password()..
> >
> > @lvin
> >
> > At 01:57 PM 7/17/01, Brad Wright wrote:
> >> Jason,
> >> I have tried what yoiu suggested. result  is the same.
> >>
> >>> From: Jason Murray <[EMAIL PROTECTED]>
> >>> Date: Tue, 17 Jul 2001 15:28:11 +1000
> >>> To: "'Brad Wright'" <[EMAIL PROTECTED]>, Alvin Tan
> >>> <[EMAIL PROTECTED]>, PHP General List <[EMAIL PROTECTED]>
> >>> Subject: RE: [PHP] mysql_query problem (more suggestions)
> >>>
>  Unless i have actually defined a function 'password()',  calling 'echo
>  password('$password') will (...does, i just double checked)
>  causes a Fatal
>  Error 'Undefined Function'.
>  Nice try tho :)
> >>>
> >>> the original mail said to echo $query, which will include some
> >>> text in it that says "password('ifovhfoiuf')" ... you should
> >>> then paste that entire query into your MySQL interpreter and
> >>> see what the reaction is instead of trying to secondguess it :)
> >>>
> >>> Jason
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Adding elements to an array

2001-07-17 Thread Patrik Wallstrom

On Tue, 17 Jul 2001, Sharat Hegde wrote:

> Hello,
>
> I have a requirement to add elements to an associate array dynamically based
> on some conditions. I initialize the array with the 1st associate array
> element
>   $MyArray = array('DATETIME' => $DateTime);
>
> How do I add more elements to this associate array. I am using PHP 3 and
> array_merge and other functions for arrays are not supported in PHP3. I am
> trying the following:
>   $MyArray[] = array("BUYVAL" => "1.23");
> but if I try and get the value of $MyArray[BUYVAL], I get nothing.

What you have done here is that you have added an array to your array, but
you wished to have the value added to your array. The $MyArray[] pushes a
new value to the array, in this case another array. You want
$MyArray['BUYVAL'] = 1.23.

More info on arrays from the php docs:
http://php.net/manual/en/language.types.array.php

--
 patrik wallstrom |  f o o d f i g h t
 tel: +46-8-6188428   |  s t o c k h o l m
 gsm: +46-708405080   |  - - - - - - - - -


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread maatt

I was doing something similar just yesterday. Ended up with a little
function to automatically write hidden s for every variable that's
submitted, whether posted or thru the url. Goes like this...

// put this somewhere in your form


// the function itself
function get_param_inputs() {
  global $HTTP_GET_VARS, $HTTP_POST_VARS;
  $ret_str = "";
  $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS);
  foreach ($params as $k=>$v) {
   if (is_array($v)) {
foreach($v as $kk=>$vv) {
 $ret_str .= '';
}
   }
   else {
$ret_str .= '';
   }
  }
  return $ret_str;
}

I also needed to append the variables to links on the same page (for page 1,
page 2, page 3... type thing) so did this:

link

function get_param_query() {
  global $HTTP_GET_VARS, $HTTP_POST_VARS;
  $ret_str = "";
  $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS);
  $j = "?";
  foreach ($params as $k=>$v) {
   if (is_array($v)) {
foreach($v as $kk=>$vv) {
 $ret_str .= $j.urlencode("$k[$kk]=$vv");
 $j = "&";
}
   }
   else {
$ret_str .= $j.urlencode("$k=$v");
$j = "&";
   }
  }
  return $ret_str;
}

Won't work if you're nesting arrays within arrays, but I'm not a recursive
type. Hope it helps,

Matt

"David Robley" <[EMAIL PROTECTED]> wrote in message
01071716134101.29979@www">news:01071716134101.29979@www...
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
> > People,
> > I have 4 forms in four seperate html pages included directly (no links
> > to includes) in the same .php file, i have it so all the form actions
> > is php.self, so when each form is submitted it goes on to display the
> > next form in line, using if and else statements, of course. I want to
> > be able to use variables created by the first form in the html part of
> > the last form. What is the best way to do this?
> >
> > So far, I can only use variables on the next page (form) that is
> > written out. After that those variables have no value.  Is there some
> > way to submit all variables present and assigned with the submission of
> > each form?  If I make the forms a seperate include file, instead of
> > having them in-line, how does this change the ways variables are passed
> > or submitted by each form? Thanks, - Tim
> > _
>
>
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
>
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
>
> 
>
> --
> David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA
>
>I always lie. In fact, I'm lying to you right now!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] edit xml with php?

2001-07-17 Thread Jan Grafstrom

Hi!
I am trying to edit this xml-file:
I want to change one of the li-nodes.


   
  per
  Bylund
  Semin
   
   
  Axel
  Timan
  Semina
   
   
  Lars
  Berg
  Seminar
   

-
I have tryed to read and explode on ""
$fd = fopen($filename, "r");
$string = fread($fd, filesize($filename));
$fru = explode ("", $string);
for ($i=0;$fru[$i];++$i) {
$newfru = ("$fru[$i]"."");
$newfru = str_replace(""."\r\n"."","",$newfru);
print $newfru;
}
How to replace one of the $fru[i], I have tryed inside the forloop but
than it replaces all.

Thanks in advance for any help.
Regards
Jan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Extracting from arrays - alphabetically

2001-07-17 Thread Kevin Price-Ward

Hi,

A simple problem for you guys (I think),

I have 2 arrays - firstname and lastname, both have the same associative
index - lastname, I have then performed asort on both to order them
alphabetically. Now I just need to extract and display the array elements
that have the associative index beginning with A or B or whatever is defined
by $query - thus displaying only names where the lastname begins with A etc.

How do I do this?

Thanks for any help you can offer.

Lar


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Output (Urgent!)

2001-07-17 Thread Brad Hubbard

This discussion reflects a surprisingly common misunderstanding of client v. 
server side scripting. PHP, all processing takes place on the server. 
Javascript, all processing takes place on the client. I've seen this 
misconception with ASP v. VBscript/javascript too.

Strange you would think this would be the most basic of fundamentals.

My 2c,
Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] edit xml with php?

2001-07-17 Thread Brad Hubbard

On Tue, 17 Jul 2001 20:27, Jan Grafstrom wrote:
> Hi!
> I am trying to edit this xml-file:
> I want to change one of the li-nodes.
> 


Your call, but I think you'd be better off using these functions to parse the 
original file and generate the modified version.

Cheers,
Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Output (Urgent!)

2001-07-17 Thread Fredrik A. Takle

Don't like it 'cause it is client-side, but it works fine!

...Fredrik:)

"Elias" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Well, Yes...
> you have to stick to JavaScript + JavaScript and not JavaScript + PHP!
> You can let PHP talk w/ JavaScript and not the reverse!
>
>  
>if (screen.width >= 1024) {
>  var resolution = "1024";
>} else {
>  var resolution = "800";
>}
>   document.write(resolution);
>  
>
> btw, why don't you like it?
> "Fredrik A. Takle" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > This fixed it, but I don't like it! If you have any other suggestions,
> feel
> > free to email me.
> >
> > 
> >   if (screen.width >= 1024) {
> > var resolution = ("1024")
> >   } else {
> > var resolution = ("800")
> >   }
> > 
> >
> > Best Regards
> > Fredrik A. Takle
> >
> > "Fredrik A
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] SQL in array() ?

2001-07-17 Thread James Holloway

Hey guys,

I saw a post in here the other day that's prompted me to ask this
question...  Because I can't seem to get the solution mentioned to work.
Maybe I'm missing something obvious...  Anyway, here goes.

I have a list of categories contained in one table, and a list of entries in
another.  So

categories:
id name
1 category1
2 category2
3 category3

At the moment, the entries table has a field which contains a field
mentioning the category by id, so:

entries
id cat_id name
1 1 name1
2 1 name2
3 1 name3

The problem is this:  I'd like to give some entries more than one category.
I attempted to put the category id's into an array.  So a row in the revised
entries table now looks like this:

entries
id cat_id name
1 2 name1
2 1,3 name2
3 1 name3

And I'm trying to list from that table with code similar to this:



I get no errors when executing that code, but I don't get any results back,
either.. even though I know there are entries in the table with the
category id listed as 1,3

Any ideas?  I'm having "one of those days" :)

Cheers,
James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] REPOST: converting multiple URL values for the same variable into an array

2001-07-17 Thread Garth Dahlstrom

Kurt,

You might have some luck with adding [], I seem
to remember that making arrays for form posts, 
so it might do gets too...

http://myhost/playlist.pls?song[]=100&song[]=101&song[]=102

and if you always end up with an array using [], 
you might change the condition to 
count($song) > 1 or something for:

>   if ( is_array( $song ) ) {

>   else {

>   }

Good Luck

-Garth

---
http://www.northern.ca

On Mon, 16 Jul 2001 20:03:50 -0700 "Kurt Lieber" wrote:

> I posted this late on Sunday afternoon, so it may have been overlooked.
> I haven't figured it out yet, so I'm reposting in the hopes someone can
> help. Thanks.
> 
> ---
> 
> I'm modifying some code for ampache (ampache.kveton.com) and have run
> into a snag that I'm not sure I understand completely.
> 
> Part of the code produces a URL similar to the following:
> 
> http://myhost/playlist.pls?song=100&song=101&song=102
> 
> and $song then gets passed to this function:
> 
> function get_song_path_from_id ( $song ) {
>   GLOBAL $dbh, $db_name;
> 
>   $songs = '';
>   $count = 0;
> 
>   if ( is_array( $song ) ) {
> while ( list($k,$v) = each($song) ) {
>   //does some cool stuff
> }
>   }
>   else {
> //does some other stuff
>   }
>   return ($songs);
> }
> 
> So, am I correct in assuming that $song will never be considered an
> array? (basically, given the above code and URL, $song will always equal
> 102)
> 
> I'm new to PHP, and since I didn't write the original code, I'm not sure
> if this is a bug, or something that I just don't fully understand.
> Assuming it is a bug, can anyone offer some suggestions on how to take
> the URL and parse it out and input the values into an array called
> $song?
> (get_song_path_from_id() is used by several other parts of the code, so
> any modifications to that code would need to leave the rest of the
> functionality
> intact)
> 
> Thanks.
> 
> --kurt
> 
> P.S.  If anyone is looking for a simple, easy-to-use (and set up) mp3
> manager, I highly recommend ampache.  It doesn't have a bunch of bells &
> whistles (which I don't want) -- it simply provides a simple, effective
> way to manage playlists and play your mp3 songs from anywhere.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To
> contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] edit xml with php?

2001-07-17 Thread Jens Wabnitz

> I am trying to edit this xml-file:

Have a look at: http://ww.phpxml.org/

Bye
Jens

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: REGEXP

2001-07-17 Thread Adrian D'Costa


> > 
> > This is wrong.  It should be 
> > Content-Type: multipart/mixed;
> >  boundary="B42DA66C4EC07C9B572A58FC"
> > 
> > I don't know why it is not reading the whole string.  It seems to treat
> > the *boundary* part as another line. 
> 
> It _is_ another line; it just happens to starts with whitespace. 
> check RFC822.

No doubt.

> 
> If you have the whole message in a string (psuedo-code):

Huh..  Then the below should work.  But the stupid header breaks :)


> 
> list ($h,$msg) =split("\n\n", $mailmsg);
> 
> $h=str_replace("\t", " ", $h);  //  -> 
> $h=str_replace("\n ", " ", $h); //   ->  
> // i.e. continuation of prior line 
> 
> $hdrs=split("\n", $h);
> 
>  ...
> 
> Regards,
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL in array() ?

2001-07-17 Thread Miles Thompson


I'm not going to comment on array processing techniques, but I suggest you 
are into a situation where you have to rethink your database design from 
the point of view of performance and normalization.

I don't know how many records you will eventually have, but the key to 
performance in SQL databases is the effective use of indexes, and queries 
which match. Even if you have an index on the cat_id field, a query like
SELECT * FROM entries WHERE cat_id IN($getcats)
forces the database engine into a sequential read of the cat_id field.

So you can drop the cat_id field from entries and create a new table 
entry_cat which has two fields
id
cat_id

Which gives you this query, although I'm a little uncertain about the 
bracketing of the condition.

select entries.id, entries.name, entry.cat_id from entries, entry_cat where 
(entry_cat.id = 1 || entry_cat.id = 3)

(And which, on reflection, may not yield better performance.)

All this brings me to the question I should have asked up front. How often 
will you want to select multiple categories, and will it be done by range 
(>2 , <=3) or individual items ( 1 and 5 and 7 )?

I don't think I've been terribly helpful - Miles

At 12:14 PM 7/17/01 +0100, James Holloway wrote:
>Hey guys,
>
>I saw a post in here the other day that's prompted me to ask this
>question...  Because I can't seem to get the solution mentioned to work.
>Maybe I'm missing something obvious...  Anyway, here goes.
>
>I have a list of categories contained in one table, and a list of entries in
>another.  So
>
>categories:
>id name
>1 category1
>2 category2
>3 category3
>
>At the moment, the entries table has a field which contains a field
>mentioning the category by id, so:
>
>entries
>id cat_id name
>1 1 name1
>2 1 name2
>3 1 name3
>
>The problem is this:  I'd like to give some entries more than one category.
>I attempted to put the category id's into an array.  So a row in the revised
>entries table now looks like this:
>
>entries
>id cat_id name
>1 2 name1
>2 1,3 name2
>3 1 name3
>
>And I'm trying to list from that table with code similar to this:
>
>
>$cat[0] = 1;
>$cat[1] = 3;
>
>$getcats = implode(",", $cat);
>
>$query = @mysql_query("SELECT * FROM entries WHERE cat_id IN($getcats)")
> or die (mysql_error());
>
>// Get the results
>
>?>
>
>I get no errors when executing that code, but I don't get any results back,
>either.. even though I know there are entries in the table with the
>category id listed as 1,3
>
>Any ideas?  I'm having "one of those days" :)
>
>Cheers,
>James.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Custom Headers?

2001-07-17 Thread Fredrik A. Takle

Can I send like custom headers?

header ("Resolution: 1024");
and echo it in the phpscript?

Can I do this or is it a silly question?

Best Regards
Fredrik A. Takle



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mail() help

2001-07-17 Thread Patrick W. Rateliff

I am getting this error when using the trying to use the mail function.  Any
insite will help, I have been up for too long working on a few projects and
my brain is damn near melted.


mail() is not supported in this PHP build in

so when I built PHP 4.06 I am assuming I missed a option, but just want to
make sure before i head back and re-do things.  Is there a simple option to
turn on the mail support.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SQL in array() ?

2001-07-17 Thread James Holloway

Thanks for your comments, Miles.  To answer your question(s), I'll not be
wanting to select multiple categories in anything other than the
administration section.  The main search form has the categories listed, and
the user only has the option to select from one category.

The reason I need to be able to give an entry multiple category listings is
this:
The Snail and Lettuce is a pub / restaurant.  The categories list contains a
listing, pub, restaurant.  So the user can choose from either pub or
restaurant when performing a search, but the entry must be displayed in
searches for both pub and restaurant Does that makes sense?

Perhaps I'm going about this the wrong way  Sleep deprivation does funny
things to the mind :)

James


> All this brings me to the question I should have asked up front. How often
> will you want to select multiple categories, and will it be done by range
> (>2 , <=3) or individual items ( 1 and 5 and 7 )?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Credit card number checker?

2001-07-17 Thread John Monfort


> What companies issue card numbers that are not 16 numbers?  Are
> they non-US cards?  I haven't ever seen a card that wasn't 16 numbers.

  A valid VISA  card has between 13-16 digits.

  I believe AMERICAN EXPRESS only has 15 digits.

  -john

__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___+-

On Mon, 16 Jul 2001, Christopher Ostmo wrote:

> Ashley M. Kirchner pressed the little lettered thingies in this order...
>
> > Christopher Ostmo wrote:
> >
> > > By law, the numbers are supposed to be
> > > generated at random and not generated by any kind of algorithm or
> > > formula.
> >
> > CC# must pass the Luhn MOD 10 formula, so the generated numbers can't
> > be
> > (totally) random - they have to conform to the formula.
> >
>
> I just responded to this separately... Basically, my earlier research on
> the issue must have been wrong.
>
> > Also, not all credit cards have 16 numbers.
> >
>
>
> Christopher Ostmo
> a.k.a. [EMAIL PROTECTED]
> AppIdeas.com
> Innovative Application Ideas
> Meeting cutting edge dynamic
> web site needs since the
> dawn of Internet time (1995)
>
> For a good time,
> http://www.AppIdeas.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] fill in inputs control (part II) PHP + JavaScript

2001-07-17 Thread Aniceto Lopez

Hello again:
some one told me to control the "input" and "text areas" right filling in
from a form using java script and this is what I'm trying but problems
appear.

Options:

the javascript is doing it's work but nothing is inserted in the db if using


the javascript checks (only) the filling in of the first input and after
this the form is
submited without more checking, empty fields are submited


some help please?
thanks in advance

Ani López
http://www.lamundial.net
Visit us, download and spread our music

-- opinion.php file ---


PHP + JavaScript fill in inputs control

function envia(){
 if (document.opina.name_in.value.length < 1){
 window.alert('Write your name');
 } else if (document.opina.email_in.value == "" ||
document.opina.email_in.value.indexOf('@', 0) == -1){
 window.alert('Write your email');
 } else if (document.opina.text_in.value.length < 1){
 window.alert('Your opinion please');
 } else {
 document.opina.submit();
 }
}










  

  name 
  email 
  text 
  
 
  






 
  $nombre_db
  $fecha_db
 
 
  $texto_db
 
 
 ");
 }
 $dbdecnx = mysql_close ($dbcnx);
?>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Installing CGI --disable-force-cgi-redirect

2001-07-17 Thread tau

Hi all,

I have installed PHP 4 pn Redhat 7.0 using an RPM: php-4.0.4pl1-3.i386.rpm

As well as making the apache stuff, it has installed a binary at
/usr/bin/php, but the binary has been installed with
--enable-force-cgi-redirect.

I want this binary but without this option... can somebody please give
me some instructions on how to do this... I've looked around for RPMs
that contain just /usr/bin/php and use --disable-for... but can't find
any...

What would I have to do to install this by hand ???

Thanks in advance for any help... really appreciated !

James
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mail() help

2001-07-17 Thread Steve Brett

as afr as i know it's a recompile with a path to sendmail ...
great when it works though !

Steve

"Patrick W. Rateliff" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am getting this error when using the trying to use the mail function.
Any
> insite will help, I have been up for too long working on a few projects
and
> my brain is damn near melted.
>
>
> mail() is not supported in this PHP build in
>
> so when I built PHP 4.06 I am assuming I missed a option, but just want to
> make sure before i head back and re-do things.  Is there a simple option
to
> turn on the mail support.
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] LDAP question PLEASE help me.

2001-07-17 Thread Johan Vikerskog (ECS)

People!

I am getting nuts here about this thing i am working on right now.
I am trying to get make a ldap php script that get information about a user.

I can connect to the ldap server and get response on how many entries that was found.
But how do i print out something of use.

I mean. How do i get all the information from the entrie?

I mean i do a ldap search and get the answer from my script that 1 entrie was found.
Now i want to print out that entry.
his email
first name, last name
department

etc etc

But how do i do that?
I am getting nuts.
If you dont know it perhaps you know a GOOD "how to" that i can use?
Please help me with this. Would be really usefull.

This script works and returns the amount of entries. Now i want to display the 
information.

echo "LDAP query test";
echo "Connecting ...";
$ds=ldap_connect("localhost");  // must be a valid LDAP server!
echo "connect result is ".$ds."";

if ($ds) { 
echo "Binding ..."; 
$r=ldap_bind($ds); // this is an "anonymous" bind, typically
   // read-only access
echo "Bind result is ".$r."";

echo "Searching for (sn=S*) ...";
// Search surname entry
$sr=ldap_search($ds,"o=My Company, c=US", "sn=S*");  
echo "Search result is ".$sr."";

//Johan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] running php scripts

2001-07-17 Thread Pétur Björn Thorsteinsson

hi, I was wondering if someone could help me with a small problem I'm
having.

I'm running a script that periodically dumps information from one server to
a database on another. We're running suse 7.1 and apache on the server
containing the information, and the problem is I don't know how to make
linux run the php script, or how to set up crobtab with the php script in
mind. anyone have any ideas?


-petur


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] LDAP question PLEASE help me.

2001-07-17 Thread Reuben D Budiardja

Use ldap_get_entries. See here:

http://www.php.net/manual/en/function.ldap-get-entries.php

Check the bottom of your code, I put something in there.

On Tuesday 17 July 2001 07:27 am, Johan Vikerskog (ECS) wrote:
> People!
>>echo "LDAP query test";
> echo "Connecting ...";
> $ds=ldap_connect("localhost");  // must be a valid LDAP server!
> echo "connect result is ".$ds."";
>
> if ($ds) {
> echo "Binding ...";
> $r=ldap_bind($ds); // this is an "anonymous" bind, typically
>// read-only access
> echo "Bind result is ".$r."";
>
> echo "Searching for (sn=S*) ...";
> // Search surname entry
> $sr=ldap_search($ds,"o=My Company, c=US", "sn=S*");
> echo "Search result is ".$sr."";

$result = ldap_get_entries($ds, $sr);
print_r($result);   // Let's just see what's in there.

Hope that helps.
Reuben D. Budiardja


> //Johan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] running php scripts

2001-07-17 Thread Johan Holst Nielsen

> hi, I was wondering if someone could help me with a small problem I'm
> having.
> 
> I'm running a script that periodically dumps information from one 
> server to
> a database on another. We're running suse 7.1 and apache on the server
> containing the information, and the problem is I don't know how to make
> linux run the php script, or how to set up crobtab with the php script in
> mind. anyone have any ideas?

You can use this Tutorial
http://www.faqts.com/knowledge_base/view.phtml/aid/1005

I think it can help you :o)

Regards

Johan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] running php scripts

2001-07-17 Thread Johan Holst Nielsen

> >We're running suse 7.1 and apache on the server
> > containing the information, and the problem is I don't know 
how to make
> > linux run the php script, or how to set up crobtab with the php
> script in
> > mind. anyone have any ideas?
>
> You can use this Tutorial
> http://www.faqts.com/knowledge_base/view.phtml/aid/1005
>
> I think it can help you :o)

If your problem was how to execute the script you can etc. use Lynx (or
wget)... if you use lynx use follow

/path-to-lynx/lynx http://www.domain.com/scriptname.php -source

Regards

Johan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo vs printf

2001-07-17 Thread hassan el forkani

"whereas to echo it you'd have to concatenate the string." false
you don't have to concat strings with echo you can print vars the same way as print

regards

16/07/01 17:48:43, "Steve Brett" <[EMAIL PROTECTED]> wrote:

>i seem to remember reading somewhere that print acts like (is) a function,
>presumably returning false if  it cannot print to screen, whereas echo just
>dumps it.
>
>also you can drop vars in print like
>
>print "you have $points points";
>
>whereas to echo it you'd have to concatenate the string.
>
>Steve
>
>
>"Don Read" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>
>> On 16-Jul-01 brother wrote:
>> > Why should I use printf instead of echo and vice versa?
>> >
>>
>> printf print-formated
>>
>> $a=12.3456;
>>
>> echo $a, '';
>> printf('%1.2f', $a);
>>
>> 12.3456
>> 12.34
>>
>> > As for today I use printf mostly but I don't know why.
>>
>> You prolly mean print; There may be some minor differences from echo,
>> but i've never seen 'em.
>> (i think they threw print in PHP to keep JAPHs happy).
>>
>> Regards,
>> --
>> Don Read   [EMAIL PROTECTED]
>> -- It's always darkest before the dawn. So if you are going to
>>steal the neighbor's newspaper, that's the time to do it.
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem about PHP

2001-07-17 Thread Mark Roedel

> -Original Message-
> From: ChengWen_Yu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 10:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem about PHP
> 
> 
> I want to write a library for the PHP on Solaris.  But I
> don't know how to do and where I should put this library
> than PHP could reach it.

That's going to depend on what you mean by a "library":

If you want to write some functions in PHP and make them available to
other scripts, then it's just a matter of placing that file somewhere in
your include_path and calling it into your other scripts with include(),
require(), auto_prepend_file, etc.  You can find some information in the
manual on defining functions in PHP at
http://php.net/manual/en/functions.php

If you want to actually extend the capabilities of PHP by adding new
functions to the language, you'll want to start by reading
README.EXT_SKEL in the directory where PHP is installed.  That should, I
think, give you most of the information you need to get started.


---
Mark Roedel ([EMAIL PROTECTED]) | "There cannot be a crisis next week.
Systems Programmer / WebMaster |  My schedule is already full."
 LeTourneau University |   -- Henry Kissinger 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] regexp. king needed (is it possible ???)

2001-07-17 Thread Jeroen Olthof

ereg_replace("$opentag([^*]*)$closetag",
$this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);

how do I get al hold on the "\\1" part of the replacement.
basicly I want to replace

opentag1 .any content in between .. closetag1

with

opentag2 onewordonly closetag2

but still need the

.any content in between ..

is this possible in some way ???

kind regards
Jeroen Olthof





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] error on mail.....cjk

2001-07-17 Thread Constantine Koulis

hello all.
i configured my php 4.0.5 with the following command on a REDHAT linux 7.0.
#./configure --with-apache=../apache_1.3.20 --with-mysql --enable-trackvar
--with-ftp.

Now i am trying to install/configure a NEWSLETTER php program and i have the
following message :

Warning: mail() is not supported in this PHP build in
/usr/local/htdocs/test/newsletter/phpmynewsletter/include/cls.php3 on line
141

I want to point out that in this SERVER i have the following programs:
php 4.0.5
qmail
vmailmgr
courier-imap
apache 1.3.20

and in another server i have the following programs and i have no error with
the same commands when i installed it:
php 4.0.2
sendmail
cyrus-imap
apache 1.3.17

Sincerely

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Get filename in php command line

2001-07-17 Thread Reuben D Budiardja


Hello,
How do I get the filename or script name if I run it in php comamnd line? For 
example, if I run this

bash$ php test.php

I want to get something inside test.php that tells me the filename is 
test.php, but *without* the actual path.

Thanks
Reuben D. Budiardja

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] regexp. king needed (is it possible ???)

2001-07-17 Thread Adrian Ciutureanu


$content = '';
$new_str = ''

> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: 17 iulie 2001 17:38
> To: [EMAIL PROTECTED]
> Subject: [PHP] regexp. king needed (is it possible ???)
> 
> 
> ereg_replace("$opentag([^*]*)$closetag",
> $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
> 
> how do I get al hold on the "\\1" part of the replacement.
> basicly I want to replace
> 
> opentag1 .any content in between .. closetag1
> 
> with
> 
> opentag2 onewordonly closetag2
> 
> but still need the
> 
> .any content in between ..
> 
> is this possible in some way ???
> 
> kind regards
> Jeroen Olthof
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] running php scripts

2001-07-17 Thread Pétur Björn Thorsteinsson


thanx for the help man, the script is running and I get to keep my job  ,)

-petur


   

"Johan Holst   

Nielsen" To: <[EMAIL PROTECTED]>   

 Subject: Re: [PHP] running php scripts

   

17.07.2001 

13:17  

   

   





> >We're running suse 7.1 and apache on the server
> > containing the information, and the problem is I don't know
how to make
> > linux run the php script, or how to set up crobtab with the php
> script in
> > mind. anyone have any ideas?
>
> You can use this Tutorial
> http://www.faqts.com/knowledge_base/view.phtml/aid/1005
>
> I think it can help you :o)

If your problem was how to execute the script you can etc. use Lynx (or
wget)... if you use lynx use follow

/path-to-lynx/lynx http://www.domain.com/scriptname.php -source

Regards

Johan



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Output (Urgent!)

2001-07-17 Thread Sheridan Saint-Michel

You aren't getting the value to the PHP script...  allow me to walk through
what is actually happening

$resolution = "document.write(screen.width)";
echo "--".$resolution."--";

You have just set a variable to "document.write(screen.width)" and then
echoed that string.  so it looks like you have

--1024--  or whatever your resolution is.  if you view source though you see
you really have

--document.write(screen.width)--

and the client browser is just interpreting that JavaScript statement

if (($resolution*1) >= 1024) {
  $resolution = "1024";
} else {
  $resolution = "800";
}
echo "**".$resolution."**";

The reason this isn't acting the way you expect is because you AREN'T saying
if ((1024*1) >= 1024 {
You are actually saying
if ((document.write(screen.width)*1) >= 1024) {

You are not actually passing anything from JavaScript to PHP... you are just
tricking yourself  =)

Sheridan

- Original Message -
From: Morten Winkler Jørgensen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 4:54 AM
Subject: Re: [PHP] Output (Urgent!)


>
> >> How you want to get a value from client side to php on the same page?
>
> Well. Actually I didn't invent the code. I just correcteded it so it
> worked on my installation. I must admit I was amazed that it somehow
> worked, but it did.
>
>
> Kind regards,
> Morten Winkler



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] regexp. king needed (is it possible ???)

2001-07-17 Thread Jeroen Olthof

thanks my king :)

it works !!!

"Adrian Ciutureanu" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

$content = '';
$new_str = ''

> -Original Message-
> From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
> Sent: 17 iulie 2001 17:38
> To: [EMAIL PROTECTED]
> Subject: [PHP] regexp. king needed (is it possible ???)
>
>
> ereg_replace("$opentag([^*]*)$closetag",
> $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template);
>
> how do I get al hold on the "\\1" part of the replacement.
> basicly I want to replace
>
> opentag1 .any content in between .. closetag1
>
> with
>
> opentag2 onewordonly closetag2
>
> but still need the
>
> .any content in between ..
>
> is this possible in some way ???
>
> kind regards
> Jeroen Olthof
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Need help. LDAP

2001-07-17 Thread Johan Vikerskog (ECS)

In the ldap script below i get the results when i use the decide function at the 
bottom.
Anyone have a tip on how i can change this so i can push the results into variables 
instead?

Thanks in advance

//Johan

", $info[$i]["$what"][$j]);
  echo "$display: " . $show . "";
}
}
function decide ($what, $display, $info, $i) {
if (gettype($info[$i]["$what"]) == "array") {
printarray("$what", "$display", $info, $i);
} else {
echo "$display: ". $info[$i]["$what"] . "";
}
}

echo "LDAP query test";
echo "Connecting ...";
$ds=ldap_connect("server");

$dn = "o=Name, c=SV";
$filter="(|(uid=$user))";
$justthese = array( "ou", "sn", "givenname", "mail" , "cn", "department", "uid");

$sr=ldap_search($ds, $dn, $filter, $justthese);

$info = ldap_get_entries($ds, $sr);

print $info["count"]." entries returned";


for ($i=0; $i<$info["count"]; $i++) {
decide("cn", "I am", $info, $i);
decide("mail", "Email address", $info, $i);
decide("uid", "Signum", $info, $i);
decide("department", "Avdelning", $info, $i);
}

?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] note to PHP developers

2001-07-17 Thread Michael Geier, CDM Systems Admin

I have noticed on the list over the past two months, an increasing number of
problems with the mail() function.

Mostly, people having this problem don't have sendmail installed.  It would
seem that PHP's mail() function was written around sendmail.  Is there a way
to resolve this, with either configuration flags or by re-writing the mail()
function install to look for alternative MTAs???

Just thought I would point it out.

My solution:

- OS RH 7.1 w/Sendmail install
- installed PHP 4.x
- removed Sendmail
- installed Qmail
- changed php.ini path -> qmail path

---
Michael Geier
CDM Sports, Inc. - Systems Administrator
email: [EMAIL PROTECTED]
phone: 314.991.1511 x 6505
pager: 314.318.9414


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] wordwrap()

2001-07-17 Thread Tyler Longren

Maybe I'm not using it right, but I'm using the sample in the manual.
Here's the code:


Here's the output:
A very long wooo ord.

Here's what the manual says the output should be:
A very
long
wooo
ord.

Has anyone else had troubles with the wordwrap() function?  Do I need to
compile php with another flag to get this to work properly?

Thanks,
Tyler



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] note to PHP developers

2001-07-17 Thread Nathan Cook

On a side note, qmail has a wrapper that pretends to be sendmail. You can
overwrite the /bin/mail with it and it will behave and accept mail just like
sendmail, but send it through qmail-smtp.

Nathan Cook
[EMAIL PROTECTED]

- Original Message -
From: "Michael Geier, CDM Systems Admin" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 9:20 AM
Subject: [PHP] note to PHP developers


> I have noticed on the list over the past two months, an increasing number of
> problems with the mail() function.
>
> Mostly, people having this problem don't have sendmail installed.  It would
> seem that PHP's mail() function was written around sendmail.  Is there a way
> to resolve this, with either configuration flags or by re-writing the mail()
> function install to look for alternative MTAs???
>
> Just thought I would point it out.
>
> My solution:
>
> - OS RH 7.1 w/Sendmail install
> - installed PHP 4.x
> - removed Sendmail
> - installed Qmail
> - changed php.ini path -> qmail path
>
> ---
> Michael Geier
> CDM Sports, Inc. - Systems Administrator
> email: [EMAIL PROTECTED]
> phone: 314.991.1511 x 6505
> pager: 314.318.9414
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] note to PHP developers

2001-07-17 Thread Christopher Allen

Also, postfix works fine for me...


> On a side note, qmail has a wrapper that pretends to be sendmail. You can
> overwrite the /bin/mail with it and it will behave and accept mail just
like
> sendmail, but send it through qmail-smtp.
>
> > - changed php.ini path -> qmail path



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Get filename in php command line

2001-07-17 Thread Jason Bell

$PHP_SELF returns the filename with the full path. from there, you can use
split to split the string wherever a / occurs, then call count, to get the
total number of values in the array, decrememnt the count by 1 (Arrays begin
at 0) then, set a variable to store just the filename, like so:

$fullpath = split('/',$PHP_SELF);
$c = count($fullpath);
$c--;
$filename = $fullpath[$c];

There may be a better way to do it, but this works for me, and it's only 4
lines. :)

JB


- Original Message -
From: "Reuben D Budiardja" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 7:48 AM
Subject: [PHP] Get filename in php command line



Hello,
How do I get the filename or script name if I run it in php comamnd line?
For
example, if I run this

bash$ php test.php

I want to get something inside test.php that tells me the filename is
test.php, but *without* the actual path.

Thanks
Reuben D. Budiardja

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] wordwrap()

2001-07-17 Thread scott [gts]

i know this is a silly question, but you're
not looking at it thru a web browser, are you?
browsers are for HTML and markup code.

the output on my computer is the same as
the manual output:
A very
long
wooo
ord.

> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] wordwrap()
> 
> Maybe I'm not using it right, but I'm using the sample in the manual.
> Here's the code:
>  $text = "A very long wrd.";
> $newtext = wordwrap( $text, 8, "\n", 1);
> echo "$newtext\n";
> ?>
> 
> Here's the output:
> A very long wooo ord.
> 
> Here's what the manual says the output should be:
> A very
> long
> wooo
> ord.
> 
> Has anyone else had troubles with the wordwrap() function?  Do I need to
> compile php with another flag to get this to work properly?
> 
> Thanks,
> Tyler
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Storing image/documents in database vs. filesystem

2001-07-17 Thread Bob

What's the pros and cons for storing uploaded  images or documents
(.doc, .pdf) in a database versus something like
http://www.company.com/files/pic.jpg?




_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] wordwrap()

2001-07-17 Thread Tyler Longren

Well, that was easy.  I never even thought to change the \n to .  Thanks
for helping me over my mental block...

Tyler

- Original Message -
From: "scott [gts]" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 10:25 AM
Subject: RE: [PHP] wordwrap()


> i know this is a silly question, but you're
> not looking at it thru a web browser, are you?
> browsers are for HTML and markup code.
>
> the output on my computer is the same as
> the manual output:
> A very
> long
> wooo
> ord.
>
> > -Original Message-
> > From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> > Subject: [PHP] wordwrap()
> >
> > Maybe I'm not using it right, but I'm using the sample in the manual.
> > Here's the code:
> >  > $text = "A very long wrd.";
> > $newtext = wordwrap( $text, 8, "\n", 1);
> > echo "$newtext\n";
> > ?>
> >
> > Here's the output:
> > A very long wooo ord.
> >
> > Here's what the manual says the output should be:
> > A very
> > long
> > wooo
> > ord.
> >
> > Has anyone else had troubles with the wordwrap() function?  Do I need to
> > compile php with another flag to get this to work properly?
> >
> > Thanks,
> > Tyler
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: wordwrap()

2001-07-17 Thread Henrik Hansen

[EMAIL PROTECTED] (Tyler Longren) wrote:

 > Maybe I'm not using it right, but I'm using the sample in the manual.
 > Here's the code:
 >  $text = "A very long wrd.";
 > $newtext = wordwrap( $text, 8, "\n", 1);
 > echo "$newtext\n";
 > ?>

you should use 
$newtext = wordwrap( $text, 8, "", 1);

instead of

$newtext = wordwrap( $text, 8, "\n", 1);

because \n is not visiable printed in a browser but  is

-- 
Henrik Hansen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Get filename in php command line

2001-07-17 Thread Reuben D Budiardja

Seems that $PHP_SELF is not defined when it's run from the command line.

Reuben D. Budiardja

On Tuesday 17 July 2001 10:29 am, Jason Bell wrote:
> $PHP_SELF returns the filename with the full path. from there, you can use
> split to split the string wherever a / occurs, then call count, to get the
> total number of values in the array, decrememnt the count by 1 (Arrays
> begin at 0) then, set a variable to store just the filename, like so:
>
> $fullpath = split('/',$PHP_SELF);
> $c = count($fullpath);
> $c--;
> $filename = $fullpath[$c];
>
> There may be a better way to do it, but this works for me, and it's only 4
> lines. :)
>
> JB
>
>
> - Original Message -
> From: "Reuben D Budiardja" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 17, 2001 7:48 AM
> Subject: [PHP] Get filename in php command line
>
>
>
> Hello,
> How do I get the filename or script name if I run it in php comamnd line?
> For
> example, if I run this
>
> bash$ php test.php
>
> I want to get something inside test.php that tells me the filename is
> test.php, but *without* the actual path.
>
> Thanks
> Reuben D. Budiardja
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Get filename in php command line

2001-07-17 Thread Boget, Chris

> Seems that $PHP_SELF is not defined when it's run from the 
> command line.

Try:

__FILE__

Chris



[PHP] Getting the current URL (with arguments) as a variable, then removing another variable from that ?

2001-07-17 Thread Justin Colson

Is there a way that I can get the current URL, like

myfile.php?sub=web?page=web1

And then remove the ?sub=web from it, even if the value of ?sub is different
? Someone said something about $PHP_SELF but I dont know where to go from
there.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Getting the current URL (with arguments) as a variable, then removing another variable from that ?

2001-07-17 Thread ReDucTor

myfile.php?sub=web&page=web1 shouldn't it be?!!?!?
- Original Message -
From: Justin Colson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 1:51 AM
Subject: [PHP] Getting the current URL (with arguments) as a variable, then
removing another variable from that ?


> Is there a way that I can get the current URL, like
>
> myfile.php?sub=web?page=web1
>
> And then remove the ?sub=web from it, even if the value of ?sub is
different
> ? Someone said something about $PHP_SELF but I dont know where to go from
> there.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Get filename in php command line

2001-07-17 Thread Reuben D Budiardja

I had that before. 
OK, seems that my problem is not that simple. The thing is , I have something 
like this in my file test.php:

require('my_api.inc');
echo "This is test.php3";

Now, in my_api.inc, I want to know that I run test.php3, when I do
bash$ php test.php3

and the filename is test.php3 .  __FILE__ will give my my_api.inc instead.  I 
need it because my_api.inc do all sort of authenticating, session, etc.

Any solutions?
Thanks.
Reuben D. Budiardja


On Tuesday 17 July 2001 10:52 am, Boget, Chris wrote:
> > Seems that $PHP_SELF is not defined when it's run from the
> > command line.
>
> Try:
>
> __FILE__
>
> Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Get filename in php command line

2001-07-17 Thread Boget, Chris

> I had that before. 
> OK, seems that my problem is not that simple. The thing is , 
> I have something 
> like this in my file test.php:
> require('my_api.inc');
> echo "This is test.php3";
> Now, in my_api.inc, I want to know that I run test.php3, when I do
> bash$ php test.php3
> and the filename is test.php3 .  __FILE__ will give my my_api.inc 
> instead.  I need it because my_api.inc do all sort of authenticating, 
> session, etc.

__FILE__ will give you the name of the file that uses that constant.
So, based on the above, I believe that you are using __FILE__ only
in my_api.inc (which is pretty much what you said, I'm just looking
for verification).

What you can do instead is this:

in "my_api.inc", have the following code:

echo "Currently Running file is: ";
echo ( $CurrentRunningFile ) ? $CurrentRunningFile : __FILE__;

in test.php

\n";
?>

Define "$CurrentRunningFile" on line one of all your files.  Or
something along those lines...

Chris



Re: [PHP] note to PHP developers

2001-07-17 Thread teo

Hi Michael!
On Tue, 17 Jul 2001, Michael Geier, CDM Systems Admin wrote:

> I have noticed on the list over the past two months, an increasing number of
> problems with the mail() function.
> 
> Mostly, people having this problem don't have sendmail installed.  It would
> seem that PHP's mail() function was written around sendmail.  Is there a way
> to resolve this, with either configuration flags or by re-writing the mail()
> function install to look for alternative MTAs???
> 
Install FreeBSD
it has mailwrapper ;)

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] md5 crypt question

2001-07-17 Thread Jeremy Hansen


I'd like to use php to do what I'm able to do in perl.

use String::Random;
use Crypt::PasswdMD5;

$foo = new String::Random;

$rand = $foo->randpattern("ss");

print "Type in your password: ";

$password = ;

$hash = unix_md5_crypt($password,$rand);

$salt = substr($hash,3,2);

print "SUBSTR: $salt\n";
print "HASH: $hash\n";
print "SALT: $rand\n";

print "Type in your password: ";
$password_verify = ;

$hash_verify = unix_md5_crypt($password_verify,$salt);

if ($hash eq $hash_verify) {
print "Good to go!\n";
print "HASH BEFORE: $hash\n";
print "HASH AFTER: $hash_verify\n";
} else {
print "You fuckered it up!\n";
print "HASH BEFORE: $hash\n";
print "HASH AFTER: $hash_verify\n";
}

srv1:~$ ./crypt.pl
Type in your password: password
SUBSTR: Kd
HASH: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
SALT: Kd
Type in your password: password
Good to go!
HASH BEFORE: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0
HASH AFTER: $1$Kd$T9I3jUnJvGy0Ekfg2VobM0

I've looked at crypt() in php and it claims that if you pass it a salt
that resembles $1$ format, it should generate an md5 type hash, but this
doesn't seem to be the case for me.  The crypt only looks at the first two
characters of the salt, no matter what, so my salt never changes because
it just seems $1.

Thanks for explaining what I'm doing wrong.

-jeremy

-- 
salad.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to add a new color to JPEG

2001-07-17 Thread Matthew Loff


I don't know a way around the problem you're describing with your
version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
ImageCreateTrueColor(), which eliminates the 256-color limitation with
JPEG files-- solved my problem right away.

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 5:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to add a new color to JPEG


> > > -Original Message-
> > > From: SED [mailto:[EMAIL PROTECTED]]
> > > According to the manual, you can only get closest value of your 
> > > desired color by letting the ImageColorClosest() find it. 
> > > Therefore, if the image is totally black, you can not get the 
> > > yellow color. I have not found a way to do this though I believe I

> > > have tried everything. And yet, I have not found any documents 
> > > covering this other than PHP-manual.

I didn't get this from reading the manual, but I struggled with this
problem for days and finally gave up.  I posted to some other forums
when this one was done and found no answers.

Now, I know it isn't just me and I know what the problem is, but I still
don't know a solution.

I am creating an image on the fly and I have no problem if I am just
using a background color and adding text to it or if I use
ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
on top of that or even a rectangle or anything on top, it seems to
ignore the color that I specify and always came out grey. (Of course now
if I use ImageColorClosest(), some colors work because they are in my
image.)

It doesn't matter what I output it as, only what I read it in as.

And if I read it in as a png, the image quality is horrible which I also
don't understand. It seems to have drastically reduced the number of
colors used.

My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
4.0.1pl2

Here is my test page.
http://216.122.251.174/test/test.php

Here is the source for the graphic
http://216.122.251.174/test/button.phps

Any idea on how solutions?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: wordwrap()

2001-07-17 Thread Rehuel Lobato de Mesquita

Hey Ty,

I had the same problem. I read somewhere that you can use "\r\n" instead. \r
returns home and \n adds a new line!
It works fine here!

Rehuël

"Tyler Longren" <[EMAIL PROTECTED]> wrote in message
00aa01c10ed3$a3253ee0$[EMAIL PROTECTED]">news:00aa01c10ed3$a3253ee0$[EMAIL PROTECTED]...
> Maybe I'm not using it right, but I'm using the sample in the manual.
> Here's the code:
>  $text = "A very long wrd.";
> $newtext = wordwrap( $text, 8, "\n", 1);
> echo "$newtext\n";
> ?>
>
> Here's the output:
> A very long wooo ord.
>
> Here's what the manual says the output should be:
> A very
> long
> wooo
> ord.
>
> Has anyone else had troubles with the wordwrap() function?  Do I need to
> compile php with another flag to get this to work properly?
>
> Thanks,
> Tyler
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How to add a new color to JPEG

2001-07-17 Thread Jon Yaggie

has this problem

check the annoted manual on php.net.  i believe there is a work arround
posted on imagecolorallocate() and i reposted the same thing under
imagecreatefromjpeg.  basically you create and image, allocate colors, and
then copy your jpeg on it.





Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -
From: "Matthew Loff" <[EMAIL PROTECTED]>
To: "'Jennifer'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:01 AM
Subject: RE: [PHP] How to add a new color to JPEG


>
> I don't know a way around the problem you're describing with your
> version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
> ImageCreateTrueColor(), which eliminates the 256-color limitation with
> JPEG files-- solved my problem right away.
>
> -Original Message-
> From: Jennifer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 17, 2001 5:55 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] How to add a new color to JPEG
>
>
> > > > -Original Message-
> > > > From: SED [mailto:[EMAIL PROTECTED]]
> > > > According to the manual, you can only get closest value of your
> > > > desired color by letting the ImageColorClosest() find it.
> > > > Therefore, if the image is totally black, you can not get the
> > > > yellow color. I have not found a way to do this though I believe I
>
> > > > have tried everything. And yet, I have not found any documents
> > > > covering this other than PHP-manual.
>
> I didn't get this from reading the manual, but I struggled with this
> problem for days and finally gave up.  I posted to some other forums
> when this one was done and found no answers.
>
> Now, I know it isn't just me and I know what the problem is, but I still
> don't know a solution.
>
> I am creating an image on the fly and I have no problem if I am just
> using a background color and adding text to it or if I use
> ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
> on top of that or even a rectangle or anything on top, it seems to
> ignore the color that I specify and always came out grey. (Of course now
> if I use ImageColorClosest(), some colors work because they are in my
> image.)
>
> It doesn't matter what I output it as, only what I read it in as.
>
> And if I read it in as a png, the image quality is horrible which I also
> don't understand. It seems to have drastically reduced the number of
> colors used.
>
> My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
> 4.0.1pl2
>
> Here is my test page.
> http://216.122.251.174/test/test.php
>
> Here is the source for the graphic
> http://216.122.251.174/test/button.phps
>
> Any idea on how solutions?
>
> Jennifer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Code running function

2001-07-17 Thread B R

I know there's a function that takes a string argument and runs it as PHP
code.
i.e. function_name('echo $variable;');

I just can't remember what it is.  Does any know?


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: wordwrap()

2001-07-17 Thread Henrik Hansen

[EMAIL PROTECTED] (Rehuel Lobato De Mesquita) wrote:

 > Hey Ty,
 > 
 > I had the same problem. I read somewhere that you can use "\r\n" instead. \r

it's windows that uses \r\n so if you run your scripts on a windows
machine it might be a good idea to split on them too.

-- 
Henrik Hansen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Code running function

2001-07-17 Thread Inércia Sensorial

eval(); ?

--

  Julio Nobrega.

Because happiness is a warm gun
Bang-bang shoot-shoot

"B R" <[EMAIL PROTECTED]> wrote in message
005501c10ee3$e82b4740$c6655ad1@Test4">news:005501c10ee3$e82b4740$c6655ad1@Test4...
> I know there's a function that takes a string argument and runs it as PHP
> code.
> i.e. function_name('echo $variable;');
>
> I just can't remember what it is.  Does any know?
>
>
> _
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] library GD

2001-07-17 Thread Luiz Fernando \(Tuca\)

I installed Apache 1.3 for windows and php4 (Easywindows).
I take a sample of functions GD, but when the program execute don't appear
nothing.

What's the problem?

Thanks

Luiz Fernnado



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ldap

2001-07-17 Thread Dan Lowe

Previously, Johan Vikerskog (ECS) said:
> 
> How do i list the email for that entry? Ill get one answer from this, now
> i want to print out the email adress for that entry.
> How do i do that?
> 
> $sr=ldap_search($ds, $dn, $filter, $justthese);
> $info = ldap_get_entries($ds, $sr);
> print $info["count"]." entries returned";

This should do what you want; just stick it at the end of the code
you already had in this email.

for ($i = 0; $i < $info['count']; $i++) {
print $info[$i]['mail'][0] . '';
}

That's assuming there is always only one value for "mail" in a given entry.

 -dan

-- 
The main reason Santa is so jolly is because he knows where all the bad
girls live.   -George Carlin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] library GD

2001-07-17 Thread Johan Holst Nielsen

> I installed Apache 1.3 for windows and php4 (Easywindows).
> I take a sample of functions GD, but when the program execute don't appear
> nothing.
>
> What's the problem?

hmm, did you install GD library?
http://www.boutell.com/gd

Regards,

Johan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Code running function

2001-07-17 Thread Christopher Ostmo

B R pressed the little lettered thingies in this order...

> I know there's a function that takes a string argument and runs it as PHP
> code. i.e. function_name('echo $variable;');
> 
> I just can't remember what it is.  Does any know?
> 

Are you thinking of eval() ?

http://www.php.net/manual/en/function.eval.php

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Send array from php to dll make in vb 6

2001-07-17 Thread Luiz Fernando \(Tuca\)

I make a dll in Vb6 and it have a funcition that have a variable of type
VARIANT like parameter.
In the program php I call this dll and your method and send a array make in
php.
Occurs a error : Invoke Failed : "Occured a exception", but if I pass a
variable of type integer or string to other method of dll, it's OK.

Thanks

Luiz Fernando



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread Tim Olsen

Yeah, I had thought about using hidden inputs, but hidden inputs are not 
really hidden. They still exist on the HTML page, and although not visible 
in the browser, are visible in the code. This may not be cool if you have 
sensitive information that is passed, also if you have a lot of variables to 
pass, thats just a lot of hidden inputs to pass.
Is there no other way to accomplish this? No built in function? I guess it 
makes sense that there is not, b/c the form submits the form and only the 
form variables. Thanks.
-Tim


Original Message Follows
From: David Robley <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "Tim Olsen" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: [PHP] passing variables from forms to the same page 
repetatively
Date: Tue, 17 Jul 2001 16:13:41 +0930

On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
 > People,
 > I have 4 forms in four seperate html pages included directly (no links
 > to includes) in the same .php file, i have it so all the form actions
 > is php.self, so when each form is submitted it goes on to display the
 > next form in line, using if and else statements, of course. I want to
 > be able to use variables created by the first form in the html part of
 > the last form. What is the best way to do this?
 >
 > So far, I can only use variables on the next page (form) that is
 > written out. After that those variables have no value.  Is there some
 > way to submit all variables present and assigned with the submission of
 > each form?  If I make the forms a seperate include file, instead of
 > having them in-line, how does this change the ways variables are passed
 > or submitted by each form? Thanks, - Tim
 > _


If I understand what you are saying: those variables don't exist until
you SUBMIT the form. You can demonstrate this by looping through and
displaying your POST or GET vars at the beginning of the form and see
what happens when you first open the page, and when it calls itself.

And re-reading, I think what you may want is hidden fields. You want part
one to call part 2, and retain values from part 1, etc? Echo the values
into hidden fields in each step of the process.



--
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA

I always lie. In fact, I'm lying to you right now!

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >