[PHP] ascii of euro

2001-07-27 Thread Karl Phillipson

 
Does anyone know what the ascii version of a euro symbol is?

== 
Karl Phillipson 
PHP SQL Programmer 

Saffron Hill Ventures 
67 Clerkenwell Road 
London   
EC1R 5BL




[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
==




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



RE: [PHP] code to see files in directories

2001-08-08 Thread Karl Phillipson
; $the != "_data")
{



$level6 = "$level5/$the";
print("$baseurl/$file/$folder/$t
his/$that/$some/$the\n"); 
flush();


$seventhdir = opendir("$level6");
while ($it = readdir($seventhdir))
{
if ($it != '.' && $it != '..' &&
eregi(".htm","$it")){ print("$baseurl/$file/$folde
r/$this/$that/$some/$the/$it\n"); 
flush(); 
}
if ($it != '.' && $it != '..' &&
is_dir("$base/$file/$folder/$this/$that/$some/$the/$it") && $it != "_data")
{


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

$eighthdir = opendir("$level7");
while ($deep =
readdir($eighthdir)){
if ($deep1 != '.' && $deep1 != '..'
&& eregi(".htm","$deep1")){ print("$baseurl/$file
/$folder/$this/$that/$some/$the/$it/$deep1\n"); flush(); }
if ($deep1 != '.' && $deep1 != '..'
&& is_dir("$base/$file/$folder/$this/$that/$some/$the/$it/$deep1") && $deep1
!= "_data")
{
$level8 = "$level7/$deep1";
print("$baseurl/$file
/$folder/$this/$that/$some/$the/$it/$some/$the/$it/$deep1\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]";
 $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 :)




RE: [PHP] code to see files in directories

2001-08-08 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

http://$HTTP_HOST";;
$base = './';
$basedir = opendir("$base");

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

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

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


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

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

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

[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?




">

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




 


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?




">

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 "$username";
}

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]