Re: [PHP] Finding out which file is retrieved over HTTP

2003-03-25 Thread Jens Lehmann
Ernest E Vogelsinger wrote: At 20:48 25.03.2003, Jens Lehmann spoke out and said: [snip] To actually check on the HTTP status codes you need to run your own, either using cURL, or by doing your own stuff using fsockopen(). I tried using fsockopen(), but

Re: [PHP] Finding out which file is retrieved over HTTP

2003-03-25 Thread Jens Lehmann
David Otton wrote: On Sun, 23 Mar 2003 21:21:39 +0100, you wrote: The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.

[PHP] Finding out which file is retrieved over HTTP

2003-03-23 Thread Jens Lehmann
The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.com/index.html. Is this possible and how? Background: I need to wr

[PHP] Re: [RegExp] extracting anchors

2003-03-13 Thread Jens Lehmann
Jome wrote: Jens Lehmann wrote: Hello, I want to extract the "name"-attribute of all anchors out of an HTML-source-code which don't have the "href"-attribute. I can use this code to get the "name"-attribute: preg_match_all('/]*?)name=[ \'\"](.*

[PHP] [RegExp] extracting anchors

2003-03-12 Thread Jens Lehmann
Hello, I want to extract the "name"-attribute of all anchors out of an HTML-source-code which don't have the "href"-attribute. I can use this code to get the "name"-attribute: preg_match_all('/]*?)name=[ \'\"](.*?)[ \'\"](.*?)>/is',$src,$ar); The name-attributes are now in $ar[2]. How can I ex

Re: [PHP] Cleaning up HTML table structure

2003-03-10 Thread Jens Lehmann
Beau Hartshorne wrote: Jens, I would suggest that you try writing a script that keeps track of how many tags have been opened (look for "<"), versus how many tags have been closed ("[^>]*/>") on a line-by-line basis. Using that number, you should be able to indent the code properly. I need to coun

[PHP] Cleaning up HTML table structure

2003-03-09 Thread Jens Lehmann
The following problem seems to be hard to solve: A PHP-Script reads in an HTML-File and removes linebreaks, tabs and not needed spaces. After that the script should reconstruct the table-structure this way (example): ...

[PHP] google-apis (was: error while reading google-search-results)

2003-03-09 Thread Jens Lehmann
James wrote: LWP is a perl thing. Curl is probably the best thing to use. Have you tried using googles php api which they provide free? http://www.google.com/apis/ I had a look at the API, but I'm not sure if it's appropriate and easy to use with PHP. It's still beta and might change again (or ma

Re: [Fwd: Re: [PHP] error while reading google-search-results]

2003-03-08 Thread Jens Lehmann
James Holden wrote: Welcome to a mine field of problems :-) 1. The url you have entered is invalid. Thats a good first check to make usually. Try /search?q=test to get that bit sorted. Ok, this was just a typo. :) 2. Google prevents known useragents from accessing it's content as it believe

[PHP] error while reading google-search-results

2003-03-07 Thread Jens Lehmann
For reading in and displaying a file $uri I use this short script: http://www.google.de?q=test'; echo implode('',file($uri)); ?> Of course this works well for almost every website, but I have problems reading in the results of google (for instance the URI above). The error message I get is: [07

Re: [PHP] RegExp for Forum-List-Code

2002-11-09 Thread Jens Lehmann
I tested some different things, which didn't work. Any more ideas are appreciated. Jens > untested: > > preq_replace('/\[\*\]([^(\[\*\])(<\/ul>)]*)/i','$1',$text); > > > > Jens Lehmann wrote: > > >Hi out there, > > > >I enc

Re: [PHP] W3C and PHP

2002-11-09 Thread Jens Lehmann
>> ... If this is really what the W3C validator tells you you should file a bug > report, IMHO. Passing GET variables should be valid HTML ;-) Usually entities start with "&" and end with ";". The "entity" §ion doesn't end with ";" and is not defined, that's why it's not valid. Jens PS: Be awa

[PHP] RegExp for Forum-List-Code

2002-11-09 Thread Jens Lehmann
Hi out there, I encountered a lot of problems while trying to convert a list in Forum-Code (like UBB-Code). [list] [*] item 1 [*] item 2 [*] item 3 [/list] should be converted to item 1 item 2 item 3 I converted the first one to [*] item 1 [*] item 2 [*] item 3 Now I need a Regexp for co

[PHP] variable declaration in class

2002-06-18 Thread Jens Lehmann
Can anyone explain me why the following code causes the parse error "... unexpected * ... " ? class test { var $a = 2*10; } Of course I know why there's a parse error, but I don't know the reason why PHP doesn't allow this multiplication, although it allows a statement like e.g. var $a = 20.

Re: [PHP] gmtime?

2002-05-27 Thread Jens Lehmann
> > -Original Message- > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > Sent: 27 May 2002 12:48 > > > > > > -Original Message- > > > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > > > Sent: 24 May 2002 20:31 &g

Re: [PHP] gmtime?

2002-05-27 Thread Jens Lehmann
> > -Original Message- > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > > Sent: 24 May 2002 20:31 > > > > time() returns the number of seconds since the Unix Epoch to > > the current > > local time > > > > gmtime() should return

Re: [PHP] ini_set('register_globals',0) doesn't work

2002-05-27 Thread Jens Lehmann
time you get to your ini_set() it is too late. So no, that won't > work. You need to set it in your php.ini, httpd.conf or .htaccess. > > -Rasmus > > On Sun, 26 May 2002, Jens Lehmann wrote: > > > I tested ini_set('register_globals',0) and ini_set('

[PHP] ini_set('register_globals',0) doesn't work

2002-05-26 Thread Jens Lehmann
I tested ini_set('register_globals',0) and ini_set('register_globals','Off') for turning register_globals off. It doesn't work and it doesn't produce any notice, warning or error. Here's a quick example: $test"; ?> This prints out $test, what it shouldn't do with register_globals turned

[PHP] Re: Can't get Apache and PHP to run together -each seems to work OK WinME

2002-05-25 Thread Jens Lehmann
Maybe Apache and PHP have problems with the 2MHz-CPU. :-) I can only guess what may be the problem: 1. You didn't write phpinfo.php correctly. 2. phpinfo.php is in the wrong directory. I suggest this because if the apache-site comes up correctly and phpinfo.php does not it _might_ be a director

Re: [PHP] gmtime?

2002-05-25 Thread Jens Lehmann
> I don't know what gmtime() is supposed to do. But is gmmktime() similar? > http://www.php.net/manual/en/function.gmmktime.php > -Kevin Sorry, my first answer was incorrect. gmmktime() does not do what I want. Do you have any other suggestion why we need/don't need gmtime()? Jens -- PHP G

[PHP] Re: Function Switch($pid) - NEED HELP

2002-05-25 Thread Jens Lehmann
> I have a script that switches. > switch($pid) > { > case 1: > break; > > case 2: > break; > } > > Now I'm doing a check in case 1 and if everything goes well, i want to > switch directly to case 2 while the script is runny. > > How would i do that ??? > Please don't post the sam

[PHP] Re: Switch() ?????

2002-05-25 Thread Jens Lehmann
> I have a script that switches. > switch($pid) > { > case 1: > break; > > case 2: > break; > } > > Now I'm doing a check in case 1 and if everything goes well, i want to > switch directly to case 2 while the script is runny. > > How would i do that ??? > Don't write "break;" in

Re: [PHP] Session question

2002-05-25 Thread Jens Lehmann
> > Just be sure you call session_start() on any page you want to access > > session variables. > > > > I have to call this function on each page I use session variable or juste > once ? The statement is pretty clear. You've to call it once on each page you want to access session variables. > >

[PHP] Re: displaying an image with header(... does not work

2002-05-25 Thread Jens Lehmann
> Hi there, > > I am pulling out an image out of a mysql blob field. The image is there, I > can see it in mysqlfront. So I pull it out of the db store it into a > variable and then do a: > > header("Content-type: image/pjpeg"); > echo $picture; > > I do get a white screen and the browser is lo

Re: [PHP] gmtime?

2002-05-24 Thread Jens Lehmann
e() does exactly what I want if I don't pass arguments but since this behaviour is not documented it's probably confusing to a lot of people, isn't it? Jens Lehmann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] gmtime?

2002-05-24 Thread Jens Lehmann
> Did you see gmdate()? > http://www.php.net/manual/en/function.gmdate.php Yes, of course. I can do time()-date("Z") to have gmtime (or maybe) something better, but wouldn't it be better to have gmtime() implemented anyways? Please tell me if I missed something. Thank y

[PHP] gmtime?

2002-05-24 Thread Jens Lehmann
Any reasons why there's no gmtime()-function in PHP? I'd like to hear your thoughts. Jens Lehmann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: accessing a mysql column by number

2002-03-28 Thread Jens Lehmann
structure. The order in which the columns/fields are > defined is their numeric order. > Second, mysql_fetch_row() will accomplish what he needs. > Third, we answered this yesterday. > > -Original Message- > From: Jens Lehmann [mailto:[EMAIL PROTECTED]] > Sent:

[PHP] Re: accessing a mysql column by number

2002-03-28 Thread Jens Lehmann
> Is there a way to access a column in Mysql just by using a number? Please refer to the MySQL-Documentation. A database doesn't have any predefined structure, so you're responsible for doing this. Can you explain why you need this "feature"? > Like if you had three columns called "column1", "c