[PHP] fopen url problems

2002-10-16 Thread Karl Phillipson

Anyone know what the error means in this snippet?
 
I am attempting to check if a given .asf file exists on another server but get no 
further than this error. 
Not sure what 'message too long' refers to.
 
PHP version is 4.2.1/Apache 2/FreeBSD
 
Thanks.

Warning: fopen(http://bluestream/bband/testvideo-bband.asf;, r) - 
Message too long in /usr/local/www/livebrand.co.uk/www/builder/cstudies.php on line 32


-
Karl Phillipson
Tribal DDB - a BMP DDB Company
http://www. http://www.tribalddb.co.uk tribalddb.co.uk

-

The information given in the above email and / or attachment is provided without 
warranty of any kind, either expressed or implied on the part of the writer or the 
Agency.

 



RE: [PHP] looping through array with list()/each()

2002-09-25 Thread Karl Phillipson

while ( list($key, $val) = each($ser) ); --- ; should not be here

-Original Message-
From: Kevin Porter [mailto:[EMAIL PROTECTED]]
Sent: 25 September 2002 12:13
To: Kevin Porter; '[EMAIL PROTECTED]'
Subject: RE: [PHP] looping through array with list()/each()


I meant $key and $val of course :o)

- Kev

 -Original Message-
 From: Kevin Porter [SMTP:[EMAIL PROTECTED]]
 Sent: 25 September 2002 12:00
 To:   '[EMAIL PROTECTED]'
 Subject:  [PHP] looping through array with list()/each()
 
 OK so I've done this hundreds of times, but this time I cannot get it to
 work.
 
 Please cast an eye over the following code and output and tell me why $k
 and
 $v are not being set:
 
 
 Code:
 -
 
 $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' );
 
 reset($ser);
 while ( list($key, $val) = each($ser) );
 {
 echo \$key = $key, \$val = $valbr;
 }
 
 -
 
 
 Output:
 --
 
 $key = , $val =
 
 --
 
 I tried giving the $ser array numeric keys and string keys, both made no
 difference.
 
 
 thanks,
 
 - Kev
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 www.mimesweeper.com
 **
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**


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


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




RE: [PHP] code to see files in directories

2001-08-09 Thread Karl Phillipson


p.s this script came from:

// PHP Spider Trapper
// Copyright 2000 MassTraffic.com
// Unlimted Usage Granted By _Owner_
// You May Use the Program For Free
// Under the CAREWARE liceanse.
// Which states that you may use
// the product for free as long 
// as you are happy and take care
// of each other  This Script!!


==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
Sent: 08 August 2001 15:30
To: 'Eduardo Kokubo'; [EMAIL PROTECTED]
Subject: RE: [PHP] code to see files in directories


Try this

?php

$level1 = 0;
$baseurl = http://$HTTP_HOST;;
$base = './';
$basedir = opendir($base);

while ($file = readdir($basedir)){
if ($file != '.'  $file != '..'  eregi(.htm,$file))
{ print(a href=$baseurl/$file$baseurl/$file/aBR\n); 
flush(); 
}
if ($file != '.'  $file != '..'  is_dir($base/$file)
 $file != _data)
{
$level1 = $base/$file;
print(a
href=$baseurl/$file$baseurl/$file/aBR\n); flush();

$seconddir = opendir($level1);
while ($folder = readdir($seconddir))
{
if ($folder != '.'  $folder != '..' 
eregi(.htm,$folder)){ print(a
href=$baseurl/$file/$folder$baseurl/$file/$folder/aBR\n); 
flush(); 
}

if ($folder != '.'  $folder != '..' 
is_dir($base/$file/$folder)  $folder != _data)
{
$level2 = $level1/$folder;
print(a
href=$baseurl/$file/$folder$baseurl/$file/$folder/aBR\n); 
flush();


$thirddir = opendir($level2);
while ($this = readdir($thirddir)){
if ($this != '.'  $this != '..' 
eregi(.htm,$this))
{ 
print(a
href=$baseurl/$file/$folder/$thibaseurl/$file/$folder/$this$baseurl/$file/$
folder/$this/aBR\n); 
flush(); 
}
if ($this != '.'  $this != '..' 
is_dir($base/$file/$folder/$this)  $this != _data)
{
$level3 = $level2/$this;
print(a
href=$baseurl/$file/$folder/$this$baseurl/$file/$folder/$this/aBR\n); 
flush();

$forthdir = opendir($level3);
while ($that = readdir($forthdir))
{
if ($that != '.'  $that != '..' 
eregi(.htm,$that))
{ 
print(a
href=$baseurl/$file/$folder/$this/$that$baseurl/$file/$folder/$this/$that/
aBR\n); 
flush(); 
}
if ($that != '.'  $that != '..' 
is_dir($base/$file/$folder/$this/$that)  $that != _data)
{
$level4 = $level3/$that;
print(a
href=$baseurl/$file/$folder/$this/$that$baseurl/$file/$folder/$this/$that/
aBR\n); 
flush();

$fithdir = opendir($level4);
while ($some = readdir($fithdir)){
if ($some != '.'  $some != '..' 
eregi(.htm,$some))
{ 
print(a
href=$baseurl/$file/$folder/$this/$that/$some$baseurl/$file/$folder/$this/$
that/$some/aBR\n); 
flush(); 
}
if ($some != '.'  $some != '..' 
is_dir($base/$file/$folder/$this/$that/$some)  $some != _data)
{
$level5 = $level4/$some;
print(a
href=$baseurl/$file/$folder/$this/$that/$some$baseurl/$file/$folder/$this/$
that/$some/aBR\n); 
flush();

$sixthdir = opendir($level5);
while ($the = readdir($sixthdir))
{
if ($the != '.'  $the != '..' 
eregi(.htm,$the)){ print(a
href=$baseurl/$file/$folder/$this/$that/$some/$this/$that/$some/$the$baseur
l/$file/$folder/$this/$that/$some/$the/aBR\n); 
flush

[PHP] caching and IE 5

2001-08-09 Thread Karl Phillipson

Is anyone else having fun and games with IE 5.0 and caching?

I have the no-cache code (below) before anything else in my index file. 
Following that an include file is pulled in that has a form with a text
input field that echos the date and time.

Whenever I refresh the page the time does not update to reflect the current
time, it sticks with the time that was displayed when the page was first
loaded.
Even when I close the browser and reopen it the time remains the same. Any
pointers on this issue?

?php
header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
modified
header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header (Pragma: no-cache);
?


input type=text name=search_name value=?php echo SEARCH
.date(F jS Y G:m A) ?

Thx in advance.

Karl





RE: [PHP] caching and IE 5

2001-08-09 Thread Karl Phillipson

Hmmm, I substituted the date(F jS Y G:m A) function for a time() function
and this works fine, on refresh the updated timestamp is visible. 

(btw system is apache 1.20 running on Hed Rat 7.1 - php 4.05)

Can anyone explain why the time() function refreshes and returns the correct
value but the date(F jS Y G:m A) does not??

Seems the problem might not be an IE5 caching issue at all ??

Regs,

Karl



==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 10:37
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] caching and IE 5


Try this

head
META Http-Equiv=Cache-Control Content=no-cache
META Http-Equiv=Pragma Content=no-cache
META Http-Equiv=Expires Content=0 
/head

works for me  - try loading www.shanghaiguide.com/main/index.php3 - should
do time, and display a different image every time.

cheers,

lawrence.
-Original Message-
From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
Sent: August 9, 2001 5:21 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] caching and IE 5


Is anyone else having fun and games with IE 5.0 and caching?

I have the no-cache code (below) before anything else in my index file. 
Following that an include file is pulled in that has a form with a text
input field that echos the date and time.

Whenever I refresh the page the time does not update to reflect the current
time, it sticks with the time that was displayed when the page was first
loaded.
Even when I close the browser and reopen it the time remains the same. Any
pointers on this issue?

?php
header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
modified
header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header (Pragma: no-cache);
?


input type=text name=search_name value=?php echo SEARCH
.date(F jS Y G:m A) ?

Thx in advance.

Karl



-- 
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] MySQL: Select ALL

2001-08-09 Thread Karl Phillipson

if(!($result=mysql_db_query(SELECT username FROM users $db)))
{
print Error getting rows;
exit();
}

while($row=mysql_fetch_array($result))
{
$username=$row[username];
print $usernamebr;
}

mysql_free_result($result);

kp

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 12:14
To: '[EMAIL PROTECTED]'
Subject: [PHP] MySQL: Select ALL


When saying; mysql_query(SELECT username FROM users,$db); it only show's
one of the first users in the column users.
Could someone please tell me how to make it print out the complete column
list of usernames. I have tried mysql_query(SELECT username(*) FROM
users,$db); - but no luck.

Thanks
Taz

-- 
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] code to see files in directories

2001-08-08 Thread Karl Phillipson
/$this/$that/$some/$the/$it$baseurl/$file/$folde
r/$this/$that/$some/$the/$it/aBR\n); 
flush(); 
}
if ($it != '.'  $it != '..' 
is_dir($base/$file/$folder/$this/$that/$some/$the/$it)  $it != _data)
{


$level7 = $level6/$it;
print(a
href=$baseurl/$file/$folder/$this/$that/$some/$the/$it$baseurl/$file/$folde
r/$this/$that/$some/$the/$it/aBR\n); flush();

$eighthdir = opendir($level7);
while ($deep =
readdir($eighthdir)){
if ($deep1 != '.'  $deep1 != '..'
 eregi(.htm,$deep1)){ print(a
href=$baseurl/$file/$folder/$this/$that/$some/$the/$it/$deep1$baseurl/$file
/$folder/$this/$that/$some/$the/$it/$deep1/aBR\n); flush(); }
if ($deep1 != '.'  $deep1 != '..'
 is_dir($base/$file/$folder/$this/$that/$some/$the/$it/$deep1)  $deep1
!= _data)
{
$level8 = $level7/$deep1;
print(a
href=$baseurl/$file/$folder/$this/$that/$some/$the/$it/$deep1$baseurl/$file
/$folder/$this/$that/$some/$the/$it/$some/$the/$it/$deep1/aBR\n); 
flush();
}}
}}
}}
}}
}}
}}
}}
}}
?

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Eduardo Kokubo [mailto:[EMAIL PROTECTED]]
Sent: 08 August 2001 13:52
To: [EMAIL PROTECTED]
Cc: Eduardo Kokubo
Subject: [PHP] code to see files in directories


I think I saw a code to list the files, subdirectories and the files in the
subdirectories of a simple directory in this list some time ago, but I
didn't save it. Considering the quantitie of messages in this list, It's
quite dificult to find this specific code, so ask the person who did it or
someone else to write this code again.

I'm using this one:

$publico = ftp_nlist ($servidor, public_html/publico);
$cont = 0;
while ($publico[$cont]){
 print $publico[$cont]br;
 $cont++;}

This code doesn't show the files in the subdirectories and it requires ftp
connection. Not very efficient. 

Thanks in advance. 

Is there a problem if I just write thanks in advance??? It's easier then
writting back to thanks everybody :)




[PHP] text imports

2001-08-07 Thread Karl Phillipson

Hi,

I have been given a (notepad generated) text file which contains a list of
countries in a format such as:

United Kingdom,
United States,
Blah,
Blah,
Blah,

 I have imported the data into a countries table in a mySQL database using
the excellent 'mysqlfront' prog. No probs on the import itself except for
some pesky pipes that I believe to be carriage returns. 

Anyone know a way I can strip these out so I have nice clean data.

Ta in adavance.

Karl



Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300



RE: [PHP] text imports

2001-08-07 Thread Karl Phillipson

Yup, thanks Wagner.

I can do this within PHP itself using trim or chop, I was hoping for a
snippet of SQL code that would do it from the command line.

This is what  have done:

LOAD DATA LOCAL INFILE 'C:\MYDIR\countries.txt' INTO TABLE DBNAME.COUNTRY
LINES TERMINATED BY ',' (COUNTRY_NAME)

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Wagner Tomy [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 12:00
To: Karl Phillipson; 'Alexander Wagner'; MindHunter;
[EMAIL PROTECTED]
Subject: Re: [PHP] text imports


http://www.php.net/manual/en/function.chop.php

Returns the argument string without trailing whitespace, including newlines

Wagner Tomy
Web Developer
Editus S.A.
- Original Message -
From: Karl Phillipson [EMAIL PROTECTED]
To: 'Alexander Wagner' [EMAIL PROTECTED]; MindHunter
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 12:53 PM
Subject: [PHP] text imports


 Hi,

 I have been given a (notepad generated) text file which contains a list of
 countries in a format such as:

 United Kingdom,
 United States,
 Blah,
 Blah,
 Blah,

  I have imported the data into a countries table in a mySQL database using
 the excellent 'mysqlfront' prog. No probs on the import itself except for
 some pesky pipes that I believe to be carriage returns.

 Anyone know a way I can strip these out so I have nice clean data.

 Ta in adavance.

 Karl



 Saffron Hill Ventures
 67 Clerkenwell Road
 London
 EC1R 5BL

 Saffron Hill: 0207 693 8300



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

2001-08-07 Thread Karl Phillipson

So if this is the way to do it in SQL, is there a way to get rid of the pipe
linefeeds using SQL too?

If not I s'pose the solution is to run a php 'trim' script, grab the data,
perform the modifications and then re-insert the data back into the
table

Bit long winded but if that's the only way?

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Wagner Tomy [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 12:06
To: Karl Phillipson; [EMAIL PROTECTED]
Subject: Re: [PHP] text imports


ah k,

yes that's the way to do it in SQL ;p

Tomy Wagner
Web Developer
Editus S.A.

- Original Message -
From: Karl Phillipson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 1:08 PM
Subject: RE: [PHP] text imports


 Yup, thanks Wagner.

 I can do this within PHP itself using trim or chop, I was hoping for a
 snippet of SQL code that would do it from the command line.

 This is what  have done:

 LOAD DATA LOCAL INFILE 'C:\MYDIR\countries.txt' INTO TABLE DBNAME.COUNTRY
 LINES TERMINATED BY ',' (COUNTRY_NAME)

 ==
 Karl Phillipson
 PHP SQL Programmer

 Saffron Hill Ventures
 67 Clerkenwell Road
 London
 EC1R 5BL

 Saffron Hill: 0207 693 8300
 Direct Line: 0207 693 8318


 -Original Message-
 From: Wagner Tomy [mailto:[EMAIL PROTECTED]]
 Sent: 07 August 2001 12:00
 To: Karl Phillipson; 'Alexander Wagner'; MindHunter;
 [EMAIL PROTECTED]
 Subject: Re: [PHP] text imports


 http://www.php.net/manual/en/function.chop.php

 Returns the argument string without trailing whitespace, including
newlines

 Wagner Tomy
 Web Developer
 Editus S.A.
 - Original Message -
 From: Karl Phillipson [EMAIL PROTECTED]
 To: 'Alexander Wagner' [EMAIL PROTECTED]; MindHunter
 [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, August 07, 2001 12:53 PM
 Subject: [PHP] text imports


  Hi,
 
  I have been given a (notepad generated) text file which contains a list
of
  countries in a format such as:
 
  United Kingdom,
  United States,
  Blah,
  Blah,
  Blah,
 
   I have imported the data into a countries table in a mySQL database
using
  the excellent 'mysqlfront' prog. No probs on the import itself except
for
  some pesky pipes that I believe to be carriage returns.
 
  Anyone know a way I can strip these out so I have nice clean data.
 
  Ta in adavance.
 
  Karl
 
 
 
  Saffron Hill Ventures
  67 Clerkenwell Road
  London
  EC1R 5BL
 
  Saffron Hill: 0207 693 8300
 


 --
 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] user's ip

2001-08-07 Thread Karl Phillipson

Read this:

http://www.php.net/manual/en/function.getenv.php

$ip = getenv (REMOTE_ADDR); 

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Adrian D'Costa [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 11:25
To: php general list
Subject: [PHP] user's ip


Hi,

I am trying to get the ip address of any user browsing a particular page.

I tried $REMOTE_ADDR but that give me only the remote address.  What would
be the best way?

Adrian


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

2001-08-07 Thread Karl Phillipson

you could use implode

http://www.php.net/manual/en/function.implode.php

==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: Veniamin Goldin [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 13:02
To: [EMAIL PROTECTED]
Subject: [PHP] Split array


hello !

Please help me.

How do I split array so, that I'll get string variable with , delimeter of
each array value ?


Thank you!


-- 
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] Best way to take a copy of a Database from Server to server

2001-08-07 Thread Karl Phillipson

This might be of some use?


http://www.mysql.com/doc/m/y/mysqlhotcopy.html 




==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: elias [mailto:[EMAIL PROTECTED]]
Sent: 07 August 2001 14:53
To: [EMAIL PROTECTED]
Subject: [PHP] Best way to take a copy of a Database from Server to
server


Hello.

I have two MySql databases running on different servers. I have no root
access and only PHP + Mysql and MysqlAdmin.

How can i take a dump of first database (which is about 1MB) and restore
that dump on the second one?

Actually, I'm doing a structure dump, but the outputed SQL text is very
big!..I'm not able to paste it all in the second server's sql query textbox.

Any ideas?




-- 
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] php and javascript

2001-07-27 Thread Karl Phillipson


Does anyone know how to pass php variables to a javascript for processing.

I have a DHTML menu system that requires variables be attached to the url
contained within it. Using echo does not print the variable to the url.

Is there another way?

Thx in advance.

Karl
==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL
==