Re: [PHP] Images don't save

2002-04-18 Thread Gunther E. Biernat

You can't. Period. Simple as that. 
Oh, and BTW, it's not even a PHP question...


On Thu, 18 Apr 2002 20:10:13 +0200, Manu Verhaegen wrote:

Hi,
You can right click on a image on your browser and choose save.
I want to disable this option, how can i do this




Greetings,
   Manu


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


Regards,

Gunther E. Biernat



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




[PHP] General

2002-03-08 Thread Gunther E. Biernat

Guys,

I want to randomly pick one of a number of values, with given probability for each 
item, e.g.

abc 50%
def 25%
ghi 25%

The obvious way is to take a list where the 50% item is given twice and then randomly 
pick one, but what if I want to use a probability of 51.3% (and don't tell me of a 
list with 1000 entries and 513 times the 'abc' item *g*).

This seems to be trivial, but I just can't think of a simple and proper way to do it.

Any ideas?

Regards,

Gunther E. Biernat



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




[PHP] html output done without result of exec_shell

2002-02-28 Thread Gunther E. Biernat

Guys,

I'm trying to output the result of a shell command within a page. Problem is, when 
it's a command with short execution time like 
   echo shell_exec(ls -la);
it works fine, but the command I'm really trying to execute takes 2-3 seconds before 
having calculated the response and by then, the page is already done and the output of 
the command isn't included. 

I played around with the settings in php.ini, but none of them changed the problem. 
Maybe an Apache problem? 

What am I missing? 

Thanks in advance.

Regards,

Gunther E. Biernat



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




Re: [PHP] html output done without result of exec_shell

2002-02-28 Thread Gunther E. Biernat

Hmm, yes, did so, even as the user that the webserver is running as. Switched to 
another webserver software (caudium) on the same machine and had the script running 
there, works fine, takes the 2-3 seconds and the output is included as intended. Huh?


On Thu, 28 Feb 2002 20:13:24 +0800, Jason Wong wrote:

On Thursday 28 February 2002 19:09, Gunther E. Biernat wrote:
 Guys,

 I'm trying to output the result of a shell command within a page. Problem
 is, when it's a command with short execution time like echo shell_exec(ls
 -la);
 it works fine, but the command I'm really trying to execute takes 2-3
 seconds before having calculated the response and by then, the page is
 already done and the output of the command isn't included.

 I played around with the settings in php.ini, but none of them changed the
 problem. Maybe an Apache problem?

 What am I missing?

The shell_exec() function *waits* for the output from the command. I tried:

  echo shell_exec(find / -name *.doc);

which takes nearly 2 minutes to complete and I still got the complete output.

Are you sure your command returns some output? Have you tried it within a
real shell?



--
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Desist from enumerating your fowl prior to their emergence from the shell.
*/

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



Regards

Gunther E. Biernat
Lead Program Manager
Consumer Systems, Europe
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.com
__



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




Re: [PHP] html output done without result of exec_shell

2002-02-28 Thread Gunther E. Biernat

Weird, built a newer apache version, and it runs like hell. Thanks for your help.


On Thu, 28 Feb 2002 22:45:52 +0800, Jason Wong wrote:

On Thursday 28 February 2002 20:30, Gunther E. Biernat wrote:
 Hmm, yes, did so, even as the user that the webserver is running as.
 Switched to another webserver software (caudium) on the same machine and
 had the script running there, works fine, takes the 2-3 seconds and the
 output is included as intended. Huh?

Can't think of anything else. Could you post your code? You never know, it
might be a silly little mistake you're overlooking.


--
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
More are taken in by hope than by cunning.
   -- Vauvenargues
*/

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



Regards

Gunther E. Biernat
Lead Program Manager
Consumer Systems, Europe
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.com
__



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




RE: [PHP] File Upload Size Limits

2001-07-27 Thread Gunther E. Biernat

I once had the same problem in a similar environment, but I never worked on it to fix 
it because it was sufficient for the given purpose. Later, I moved the script 1:1 
(including php.ini) to a server running caudium as web server software and the problem 
was gone...

Huh?


Did anyone have any thoughts on this?  I can upload an 8 MB file, but after
that the upload fails.


I am running PHP 4.0pl1 with Apache 1.3.14 on RedHat Linux 7.1.  I am trying
to do a file upload from the users PC to my web server.  If I do a small
file, the transfer goes fine.  If I do a large file ( 50 MB), the transfer
fails saying either the file was not available for reading or my script just
bombs out.  I need to be able to have people upload large files.  I have
changed the setting in php.ini to upload_max_filesize = 100M.

Do I also need to change the following entries in php.ini?
   max_execution_time = 60
   memory_limit = 8M

Is this an apache limit?  I'm not sure what to do with this as I really need
to be able to transfer large files.


mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] Opening another page in code

2001-07-25 Thread Gunther E. Biernat

I just want to open another page, sending some parameters, at a point
in a script - without the user clicking on anything (I can do this in
a form - I want to do it WITHOUT the form).

Like:if($test) {
   GO_TO_PAGE (http://www.site.dom/page.php?id=838383);
  }

Except with code that actually works, of course.

I tried header (Location:...) but got an error message that I can't
add to the headers.

If you HAVE to output other stuff first, you can't send a header because as the name 
implies, a header should be at the top :-)


You can either include something like the following in the HTML page
META HTTP-EQUIV=Refresh CONTENT=10; 
URL=http://www.htmlhelp.com/reference/html40/head/meta.html;

or do
some weird javascript stuff with an OnLoad event

or simply send
header(Location: http://www.php.net/manual/en/function.header.php;);
as the FIRST output of that page.


mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] php stand alone

2001-07-24 Thread Gunther E. Biernat

How do I compile php to work as a stand alone.  Right now it is working
thru the web but need to run it from a cron job.

Have a look at http://www.php.net/manual/en/install.commandline.php

The easiest thing of course would be to just call lynx (or any other command line 
browser taht is able to do a HTTP request and exit (that's why the -dump)) within 
your cron table, e.g.:

0 23 * * * lynx -dump localhost/path/to/some/php/robot.php  /dev/null



mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] set var in PHP clarified

2001-07-19 Thread Gunther E. Biernat

Jessica,

I used that technique before PHP was available (for all readers, the key term here is 
Server Side Includes, e.g. http://httpd.apache.org/docs/howto/ssi.html.html). With PHP 
you're a lot more flexible so that you should get rid of your shtml structure, 
especially as PHP is much faster what really makes a difference if you've got many 
includes.

For this simple example, the syntax is quite similar. In your main document, simply 
type:

?PHP
   $title=some title;
   include(/include/header.html);
?

and in the header.html:

title?PHP echo $title; ?/title

That's it. But remember to either set *.html files to be parsed through PHP in your 
web server configuration or rename the main document to .php (or .php3 or .php4 or 
whatever your web server needs).




Thanks for the prompt replies...but I think I should clarify...

In regular html, I would do this:

!--#set var=TITLE value=some title here--
!--#include virtual=/include/header.html --

and header.html would have in it (among other things):

title!--#echo var=TITLE --/title

So, the title of the webpage would be some title here...

How can I accomplish the same thing in PHP?



mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] Batch job in UNIX.

2001-07-05 Thread Gunther E. Biernat

But i want dont want to type in the password. I want to have
the password in the command file.

echo insert into... | ./mysql -p -u root test
or
cat filename | ...

Perfectly right. And a mysql --help would have told you that you can call it 
(combined with the above) like this:

echo insert into... | mysql -uroot -pwhitehat test

or if you just don't want to type the mysql command parameters all the time, make 
yourself a shell script:

#!/bin/bash
mysql -uroot -pwhitehat test

name it e.g. mymysql, make it executable and call

echo insert into... | mymysql

Have I missed the problem?


mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] Using PHP to test if server is online

2001-07-03 Thread Gunther E. Biernat

I am writing a PHP script to test if the server on which it is running is
currently connected to the Internet. If so, the main page will display a
notice saying We are now online, else it will say Not connected

Any ideas on how to do this with PHP? I'm guessing it would involve some
kind of socket connection...

Yep. Simply open a socket connection as described in:
http://www.php.net/manual/en/function.fsockopen.php

I once wrote an RTSP (Real Time Streaming Protocol) link checker using that, works 
flawlessly.

$sockethandle = fsockopen($host, $port);

if ($sockethandle) {
# Lets query document root
$query = GET / HTTP/1.0\n\n;
# Send the query
fputs($sockethandle, $query);
# Receive first line of response
$response = trim(fgets($sockethandle, 1024));
}

Remember, using fsockopen is more or less like telnet-ing to the server, standard HTTP 
port is 80. But querying a web server can easier be done by doing a 
file($url_of_server).

If it's just to tell if a server is online, nearly any method will do, including DNS 
lookups or a simple system call with ping... :-)


mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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] Expand/parse variables in file

2001-06-25 Thread Gunther E. Biernat

All,

This ought to be simple, but I can't crack it...

I'm trying to read a plain text file where I embedded some variables. E.g.

abc $a def

Sucking this file in a string and setting $a to whatever results in abc $a def 
rather than abc whatever def. Where's the difference to directly doing the following:

$a = whatever;
$b = abc $a def;
echo $b;

which results in abc whatever def ???

What am I missing?

Thanks in advance.



mit freundlichen Gruessen / yours sincerely


Gunther E. Biernat
Web Application Engineer
__

RealNetworks GmbH   Tel.: +49-40-415204-24
Weidestraße 128 Fax.: +49-40-415204-11
22083 Hamburg   Mail: [EMAIL PROTECTED]
Germany URL : http://de.real.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]