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
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
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
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('/a([^]*?)name=[ \'\](.*?)[
\'\](.*?)/is',$src,$ar);
The name-attributes
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('/a([^]*?)name=[ \'\](.*?)[ \'\](.*?)/is',$src,$ar);
The name-attributes are now in $ar[2]. How can I
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 count how
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
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):
table ...
tr ...
td ...
table ...
tr ...
td
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
For reading in and displaying a file $uri I use this short script:
?php
$uri = '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
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
ul
liitem 1/li
liitem 2/li
liitem 3/li
/ul
I converted the first one to
ul
[*] item 1
[*] item 2
[*] item 3
/ul
... a href=nav.php?page=aboutsection=Linuxfont color=#256 ...
^
Error: unknown entity section
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
different things, which didn't work. Any more ideas
are appreciated.
Jens
untested:
preq_replace('/\[\*\]([^(\[\*\])(\/ul)]*)/i','li$1/li',$text);
Jens Lehmann wrote:
Hi out there,
I encountered a lot of problems while trying to convert a list
in Forum-Code (like UBB-Code).
[list
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.
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('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
-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 the number of seconds since the Unix
Epoch to the
current GM-time
-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
time() returns the number of seconds since the Unix Epoch
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:
?php
ini_set('register_globals',0);
if(isset($test))
echo h2$test/h2;
?
form
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 loading
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.
This
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 case 1.
Jens
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 same question
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
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
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
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 you.
Jens Lehmann
PS: date(U
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
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,
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: Thursday, March 28, 2002 8:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re
29 matches
Mail list logo