[PHP] Sending session ID without cookie

2004-01-13 Thread Børge Strand
Hi, I'm trying to send my session ID using POST/GET auto-inserted by PHP. This works like a charm in a .php file. But in a .cgi file, a new PHPSSID appears in the Address field of my browser every time I follow the link from the file to itself. What may be causing this? I have had some big

[PHP] Accessing a website from within a php script

2004-01-13 Thread Børge Strand
Hi, In my php code, how can I fetch the input from another website and parse its output without sending it to the client? What I want to do is this: My php program uses sends send some information to a .cgi file possibly on a different site. That file uses GET to fetch the information and

Re: [PHP] Accessing a website from within a php script

2004-01-13 Thread Børge Strand
Thanks Richard, BS My php program uses sends send some information to a .cgi file BS possibly on a different site. That file uses GET to fetch the BS information and prints it out as it would if accessed through a BS browser. But instead I want my php program to intercept this and parse BS

Re: [PHP] Accessing a website from within a php script

2004-01-13 Thread Børge Strand
Hi Richard, thaks for clarifying that to me. The only problem now is that I get a timeout in my script because fopen() failed to open the stream. I have checked that the address is okay. I manage to open another site, but not this file which is on my ISP. Actually, manual telnet to port 80 of

[PHP] Headers and sessions in php .cgi

2004-01-10 Thread Børge Strand
Hi there, I have a problem setting my headers right with php running as .cgi. I have to specify a Content-type for the cgi file to work. But how should I do both that and start a session? I have a few options: #! /usr/local/bin/php ?php session_start(); print 'Content-type: text/html'

Re: [PHP] Headers and sessions in php .cgi

2004-01-10 Thread Børge Strand
I have a problem setting my headers right with php running as .cgi. I have to specify a Content-type for the cgi file to work. But how should I do both that and start a session? I have a few options: #! /usr/local/bin/php ?php session_start(); print 'Content-type: text/html' .

Re: [PHP] Headers and sessions in php .cgi

2004-01-10 Thread Børge Strand
I have a problem setting my headers right with php running as .cgi. I have to specify a Content-type for the cgi file to work. But how should I do both that and start a session? Try using header() instead of print to set Content-Type. Hope that helps. Thanks Chris. I tried that (see

Re: [PHP] Content-type vs session_start()

2004-01-09 Thread Børge Strand
Do you have any ideas what I should do to make both .php and .cgi versions work? Here's test3.cgi: == #! /usr/local/bin/php ?php print 'Content-type: text/html' . \n\n; session_start(); Have you tried putting

Re: [PHP] Content-type vs session_start()

2004-01-09 Thread Børge Strand
Cheers Chris I will try to explain using your code: Here's test3.cgi: == #! /usr/local/bin/php ?php print 'Content-type: text/html' . \n\n; When you are running as a CGI, you can set the Content-Type header in this way.

[PHP] Content-type vs session_start()

2004-01-08 Thread Børge Strand
I have a problem with html headers using sessions. I guess it has to do with the Content-type line. My ISP uses PHP 4.3.4 with register_globals = On (although I want this to work with Off too). My program (test3.cgi, test3.php) simply logs the number of times I have accessed a web site. As a php

[PHP] coding special characters in html

2002-11-17 Thread Børge Strand
Hi all, I'm cooking tothether a tiny php html editor right now, (textarea kind of thing). To treat the text properly I need to encode characters like '', '', '', and friends into something that doesn't confuse the browser. I got it to work with regexps, you can see a part of the decoder below.

[PHP] Modulo eleven function?

2002-10-16 Thread Børge Strand
Is anyone of you aware of a modulo eleven function that is used to calculate the checksum of a creditcard number? I have a pretty crude code listing from a book, but what I look for is a function that can append the checksum digit to a number. I have the spec for the algorithm behind the

[PHP] calling session_start()

2002-09-29 Thread Børge Strand
Hi All, When does session_start() have to be called? I have the following setting: A bunch of php pages are placed in a frameset. If someone tries to access one of these pages without the session-id cookie being set, the page calls a reloading of the frameset. The frameset page itself is the

[PHP] Regular expressions test code

2002-08-02 Thread Børge Strand
I'm starting work on regular expressions in PHP these days. Just thought I'd share my test code for others out there who are fresh starters with the language and regular expressions. file parser.php: ?php // copyright Børge Strand // use this code as you feel like! print html\n