Re: [PHP] Using PHP in an HTTP 404 error document ($HTTP_REFERER is blank)

2001-12-17 Thread Bas van Rooijen


PHP 4.1.0 :

$_SERVER["REDIRECT_URL"] and
$_SERVER["REDIRECT_STATUS"]

PHP 4.0.6 and earlier:

$HTTP_SERVER_VARS["REDIRECT_URL"] and
$HTTP_SERVER_VARS["REDIRECT_STATUS"]


greets,
bvr. 


On Mon, 17 Dec 2001 14:27:45 GMT, [EMAIL PROTECTED] wrote:

>
>I have a php document which I direct my server to use as a 404 error
>doc.
>
>In it I write:
>
>print "$REQUEST_URI\n";
>print "$HTTP_REFERER\n";
>
>The thing is I get the the error page itself in place of $REQUEST_URI
>and $HTTP_REFERER is blank.
>
>any suggestions as to how I can get the URL which the user entered?
>I'm runnig Apache on RedHat 7.2
>
>Thanks!
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




-- 
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: another GD problem

2001-12-17 Thread Bas van Rooijen


Small comment:

No need to use urldecode() here, as the data is automatically decoded during submit.

greets,
bvr.


On Mon, 17 Dec 2001 17:11:33 +0100, Jan Maska wrote:

>I take it back.. after some time of tracing the error, I found out that I
>handed over the date as a string argument (img src="image.php?date=25. 01.
>2001"...)
>And the problem were the whitespaces..
>
>If you run into similiar trouble, just URLEncode the string, and before
>using it in imagePHP, simply URLDecode it. :-))
>Phewww... :-]
>
>J.M.
>
>
>
>-- 
>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] 'Select All'

2001-12-17 Thread Bas van Rooijen



I know *exactly* what you mean, the solution (took me at least an hour) is attached.

have fun,
bvr.

On Mon, 17 Dec 2001 17:54:42 +, Shane Wright wrote:

>Hi
>
>I'm having somewhat of a problem :(
>
>I have my banks of checkboxes, all named 'mycheckbox[]' with the values as 
>different IDs.  The user happily checks a few of them and my scripts happily 
>process the resulting arrays.
>
>But...  how do I get Javascript to do a 'select all' on them??  I cant access 
>them by name because of the square brackets, and I cant access them by going 
>through all form elements in case there are other checkboxes that dont want 
>to be included.
>
>Is there a tidy way around this, does any of the above make sense?
>
>Thanks
>
>--
>Shane
>
>-- 
>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] 'Select All'

2001-12-17 Thread Bas van Rooijen


Oh, one more thing.. The latest MSIE suddenly doesn't seem to support the function to 
be named 'selection' . change that and it'll work ;)

bvr.

>
>
>I know *exactly* what you mean, the solution (took me at least an hour) is attached.
>
>have fun,
>bvr.
>




-- 
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] telnet or ssh in PHP (Curl?)

2001-12-17 Thread Bas van Rooijen


Hi Bas!

SSH is possible but complicated.

For telnet, simply use fsockopen() (default telnet port is 23).

This returns a filepointer so you can read/write like as a regular file.

greets,
Bas van Rooijen


On Mon, 17 Dec 2001 17:28:04 +0100, Bas van Schaik wrote:

>Hello everybody!
>
>I need some help. I want to use a SSH (or, if SSH is impossible, telnet)
>connection in PHP. But I can't find anything about it. The only thing about
>telnet in the PHP manual (English), is that Curl supports it, but how? Tanks
>in advance for all replies!
>
>Bas
>
>
>
>-- 
>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] php dir listing

2001-12-17 Thread Bas van Rooijen



scripts like this are widely available.

check: sourceforge.net/projects/phpfilemanager/ 

bvr.

On Mon, 17 Dec 2001 14:55:48 -0800, Jeremiah Jester wrote:

>Anyone have a php directory listing script that creates clickable links for
>all items in folder list?
>
>JJ




-- 
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] Cookie Name=Value Pairs

2001-12-17 Thread Bas van Rooijen


I don't know!

But if you're only accesing the cookie from PHP you could use 
serialize()/unserialize() 
or *sessions*, they both work even on full objects.

bvr.


On Mon, 17 Dec 2001 16:30:28 -0700, Zach Curtis wrote:

>What is the syntax to set multiple name=value pairs in a cookie?
>
>Thanks.
>
>
>Zach Curtis
>POPULUS



-- 
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] Slash problem

2001-12-19 Thread Bas van Rooijen



set_magic_quotes_runtime (false)

bvr.

On Thu, 20 Dec 2001 09:43:28 +1100, Martin Towell wrote:

>either set "magic_quotes_gpc" to "off" in you .ini file - or use
>stripslashes() on the variable







-- 
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] Book.

2001-12-19 Thread Bas van Rooijen



No not CGI, binary (instead of apache module).

- Just leave out the --with-apache part when you do configure.

by default 'make install' will put the php binary in /usr/local/bin

- On top of your PHP script add the following line:
#!/usr/local/bin/php

- Make sure you don't use MS-DOS (but UNIX) style text files,
PHP doesn't care but for that first line it may be important.

- PHP open/close tags  still apply


bvr.

On Wed, 19 Dec 2001 15:07:21 -0800 (PST), Mehmet Kamil ERISEN wrote:

>Hi,
>I think I'm misunderstood.  I do not want to run in cgi
>mode.
>Thanks,
>Mehmet.
>--- Mart¡n Marqu‚s <[EMAIL PROTECTED]> wrote:
>> > information on how to run PHP from Unix, as a cron job,
>> how
>> > can PHP scripts be called from Shell Scripts etc...
>>
>> You need to compile PHP without web-server support, for
>> cgi. In that case you
>> will get a binary file, and you can use just like you use
>> perl or bash for
>> making scripts.




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

2001-12-19 Thread Bas van Rooijen


For XML use parser: http://www.php.net/manual/en/ref.xml.php

PHP in .xsl file is possible, edit your httpd.conf

find this line:
AddType application/x-httpd-php .phtml .php .php3

and add extensions that should be parsed by PHP, like so:

AddType application/x-httpd-php .phtml .php .php3 .xsl

be carefull, anything between  will be executed by
default. if this may conflict with the nature of the output (like .xml files)
you can edit your php.ini to force long open tags Heya,
>
>Is it possible to integrate XML with PHP - ie get data out of an XML file
>and format it in html using php? Or alternatively, use php within an XSL
>file...?
>
>Cheers
>
>Mart




-- 
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 & XML (2)

2001-12-19 Thread Bas van Rooijen

and restart ofcourse ;)

bvr.



-- 
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] faxing in PHP

2001-12-24 Thread Bas van Rooijen



Or use a commercial fax service, this may even be cheaper!

http://www.jfax.com/ offers email to fax.

bvr.

On Mon, 24 Dec 2001 12:26:54 -0800, Jim Lucas [php] wrote:

>hylafax
>I am working on a project right now to set this up on a linux box.  Should
>work great.
>
>Jim




-- 
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] Cookies In Images...

2002-01-02 Thread Bas van Rooijen

On Wed, 2 Jan 2002 14:11:39 -0700, Matthew Walker wrote:

>Can anyone give me a pointer on where to go to find out how to send
>cookies through images, preferably in PHP?



To do this you will have to point the HREF in your IMG tag to a PHP script.

>From that script you should do this:

- Pass the correct content-type header (default for PHP is text/html) for example:


- Set the cookie as usual

- Then send the contents of the image you would like to display, for example:





bvr.



-- 
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] Forking in PHP

2002-01-02 Thread Bas van Rooijen


Hi,


You could use register_shutdown_function() which should be called before the script 
ends (duh!).

Define a function for your process and pass it's name to register_shutdown_function() .

bvr.

On Wed,  2 Jan 2002 15:14:59 -0600, charlesk  wrote:

>This works almost.  Instead of having echo "hello"; you have a huge process that 
>takes a while, the browser wont redirect until the script is finished.  This seems to 
>be a "feature" of IIS.  Has anyone found a way to do something similar in PHP 4.1.0, 
IIS 5.0, Windows 2000 Server?
>
>I basically want a way for the user to see a different page than have them waiting 
>for the script to finish.
>
>if ($process)
>{
>   echo "cool";
>} else
>{
>   header("Location: test2.php4?process=true");
>   error_log("this means it works\r\n",3,"c:\errors\errors.txt");
>   echo "hello";
>}
>?>
>
>Charles Killmer
>NetgainTechnology.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]




Re: [PHP] Forking in PHP

2002-01-02 Thread Bas van Rooijen

>Thanks for the reply but leave the "duh's!" out of comments please.

I'll think about it ;)

bvr.



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

2002-01-04 Thread Bas van Rooijen



anyway, if you would really like to do this you could use output buffering function to 
send
headers from anywhere in your script, ofcourse delaying output.

check the manual part LXXII. Output Control Functions ..

bvr.


On Fri, 4 Jan 2002 22:37:13 -0500, Brian Clark wrote:

>* harry ([EMAIL PROTECTED]) [Jan 04. 2002 10:44]:
>
>> Hi all
>
>Hi Harry
>
>> I have been trying to use PEAR and have come to a standstill.
>
>> The following:
>
>> 
>> require_once ("HTML/Page.php");
>
>
>
>> /* PAGE SETUP */
>>   $p = new HTML_Page();
>>   $p->setCache("true");
>>   echo "TEST 1";
>
>Try commenting the above line out.
>
>>   //$p->toHtml();
>>   echo "TEST 2";
>
>Try commenting the above line out also.
>
>>  // $p->setTitle("Jobsite Page");
>
>>   $p->display();
>
>because in the display() method, it's sending header()s:
>
>
>function display() 
>{   
>  if(! $this->_cache) {
>header("Expires: Tue, 1 Jan 1980 12:00:00 GMT");
>header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
>header("Cache-Control: no-cache");
>header("Pragma: no-cache");
>  }
>  $strHtml = $this->toHtml();
>  print $strHtml;
>} // end func display
>
>
>> Produces the following error:
>
>Which is why you are getting this error about header information:
>
>>  TEST 1TEST 2
>> Warning: Cannot add header information - headers already sent by (output 
>> started at /var/www/html/website/jobix/php_test/test_form.php:4) in 
>> /usr/share/php/HTML/Page.php on line 136
>
>-- 
>Brian Clark | Avoiding the general public since 1805!
>Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
>A day without sunshine is like, night.
>
>
>-- 
>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] echo "" problem NEW

2002-01-09 Thread Bas van Rooijen


Hello,

In addition to Henning Sprang's fine solutions, you can also do the following (given 
you use PHP 4);



$xmp_text


EOF;
   
?>

Note that the {} around your variables are optional, they will not be included in the 
output but can be used to avoid confusion.

greets,

bvr.


On Wed, 9 Jan 2002 15:00:55 +0700, universal2001 wrote:

>Hi again!
>
>Thanks for the reply!
>
>I still have another question:
>
>I want to create a recycleable code by printing a set of html code which I
>copied and paste from my html edittor.
>
>however because there are lots of quotation marks on the html code it result
>an error page.





-- 
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] Including files & variables ...

2002-01-09 Thread Bas van Rooijen


There's no need to 'pass' any variables.

HINT: pretend the include() command is being replaced with the code in your include 
file,
this means that whatever variables are set/available at that point will also be 
available in the include.

On Mon, 28 Jan 2002 18:54:02 -0800, Evansville Scene wrote:

>I'm having problems passing variables into included PHP files.  How can I do this?
>




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