Re: [PHP] OT- Private Registrations is bogus

2002-11-23 Thread a . h . s . boy
FOR THE RECORD:
I (spud who really is at nothingness.org) did NOT post this original 
message to the list, despite the apparent sender address (and the 
authentic signature at the bottom). Even the message-id header was 
forged to appear to have emanated from my server (whose logs I checked, 
to be sure it hadn't). Funny thing is, I haven't been subscribed to 
this list from that address in weeks, having moved all my subscriptions 
to spudlists(at)nothingness.org.

I'm not sure the original SMTP envelope is anywhere to be found, but 
I'd love to see it and find out who's been posing as me. In any case, I 
can spell something correctly, and in general I believe my grammar to 
be better than this...

So caveat lector...someone IS spamming this list, but it isn't me...

Cheers,
spud.

On Saturday, November 23, 2002, at 02:09  AM, Hugh Danaher wrote:

Did you register just to plug this?
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 22, 2002 9:02 PM
Subject: [PHP] OT- Private Registrations for Domains



Has anyone heard of or used somthing like this, just received this 
notice
from my registrar?


-

Dear Valued Customer,
Great news! We now offer Private Registrations.

What is a private registration? A private registration allows you to

shield your personal information from the WhoIs database when 
registering a
domain while retaining the full benefits of ownership. With a private 
domain
registration, you keep your personal information private.

This process is new and so unique that it is supported by two patent

applications.


The way it works is simple:
-Domains By Proxy(TM), a sister company of WORXdoamins, becomes the

registrant of record for any new, existing or transferred domain name 
you
designates.
-The WHOIS database is then populated with Domains By Proxy's 
contact
information, not yours!

-Domains By Proxy becomes the registrant of record for any domain 
name.
-Domains By Proxy's proprietary registration and e-mail handling 
systems
even let you elect whether or not to receive postal mail or email


Best of all, you still retain the full benefits of ownership! You can

cancel, sell, renew or transfer your domain names; set-up name servers 
for
the private domain name; resolve disputes involving the domain name; 
and
more.

Getting a Private Registration will:
+ Stop domain-related spam
+ End data mining
+ Deter identity theft
+ Prevent harassers  stalkers
+ Protect your family
+ And more!

To use this great new service just use this link:
http://private.worxdomains.com

-

spud.

---
a.h.s. boy
spud(at)nothingness.org as yes is to if,love is to yes
http://www.nothingness.org
---




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



---
a.h.s. boy
spud(at)nothingness.orgas yes is to if,love is to yes
http://www.nothingness.org/
---


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




Re: [PHP] php teleprogramming -- How to avoid being ripped off ?

2002-11-23 Thread Khalid El-Kary
hi,
don't be so unhappy withit, because you won however, money comes and goes 
knowledge stays, through this experience you learned much, right? so you 
didn't lost much! :-)





_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail


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



[PHP] How to obtain unique XML Elements

2002-11-23 Thread David Pratt
Anyone have a simple technique for obtaining a unique list of elements from
an XML file?

Am looking for something that will identify the first opening tag ie
thistag and the single tag anothertag/ so that I get an array of tags
that I can print out.  Having a bit of trouble with regex to get something
to work.

Basic idea I had is to open file, read through each line with regex, add
matches to array, and then do unique elements of array and write to another
file.

Is there a better way?

--
Regards,
Dave

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




Re: [PHP] How to obtain unique XML Elements

2002-11-23 Thread Khalid El-Kary
hi,
you can get this parser

http://creaturesx.ma.cx/kxparse/

if you want only this limited functionality (take an old version) 0.2 for 
example, you may also want to take only particular functions from it

this is valid in all cases (as i think), except that you are developing 
another parser :)

khalid








_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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



[PHP] Undefined Variable

2002-11-23 Thread Adriano Santos
Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?
thanks



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




[PHP] Re: Undefined Variable

2002-11-23 Thread Derick Rethans
Adriano Santos wrote:

Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?


at the top of your script:
error_reporting(E_ALL  ~E_NOTICE);

or initialize your variables likes:
$number = 0;
$string = foo;

Derick


--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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




[PHP] Re: extension can't be found

2002-11-23 Thread Derick Rethans
Liug wrote:

I just compiled/installed apache/php4.2.3 with postgres
support. the default php.ini-dist is used. I added
extension=pgsql.so
but when I start apache, error_log shows it can't find
pgsql.so.

after some trial and error, I found the following line in
the default php.ini causes the problem:
extension_dir = ./
if I comment this line out, apache can load pgsql.so fine.
I also tried to change to
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20020429
this also solves the problem.

My question is: is the default value in php.ini incorrect
or am I doing something wrong?


Nothing is wrong at all, the default setting in php.ini-dist is that you can 
load your modules from the current directory, this is needed for some users 
to provide them with loadable module support on ISPs; if you comment it out 
it uses the default in the code, which points to 
/usr/local/lib/php/extensions/no-debug-non-zts-20020429.

Derick

--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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



[PHP] Re: Post again. question about Animated GIF

2002-11-23 Thread Derick Rethans
Jungsu Heo wrote:

Hello~.

I made a PHP script which resize GIF Image.

But, Animated GIF don't Animate ;-(

Manual says 'use imagecolortransparent() to format GIF89'.


The library that PHP uses, libgd, can't handle multiple frames in a GIF. SO 
if you resize a GIF with it the result that comes out will only be the first 
frame in the original GIF file; there is nothing to do about this.


--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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



Re: [PHP] Re: put result of include into a variable

2002-11-23 Thread Derick Rethans
Ernest E Vogelsinger wrote:

One thing - be warned that some sites (esp. M$) send a redirect at the
index (or default) pages... the fopen() will not honor this redirect. Using
cUrl would be a better way to handle this, IMHO.


fopen() in the upcoming PHP 4.3.0 will support this though.

Derick


--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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




[PHP] Re: Undefined Variable

2002-11-23 Thread Adriano Santos
My php.ini:  error_reporting = E_ALL  ~E_NOTICE

I have a form to send of the variables, but my page do not receive values.

This my code:

?php
$nome = StrToLower($nome);
$senha = StrToLower($senha);
?

thanks


Derick Rethans [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Adriano Santos wrote:
  Hi,
 
  I'm with problem: Undefined Variable.
  I'm using :
  PHP 4.2.3
  MySql 3.2.39
  Windows 2000
 
  How do I make to soluction my problem ?

 at the top of your script:
 error_reporting(E_ALL  ~E_NOTICE);

 or initialize your variables likes:
 $number = 0;
 $string = foo;

 Derick


 --

 -
   Derick Rethans http://derickrethans.nl/
   PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
 -




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




[PHP] Re: Undefined Variable

2002-11-23 Thread Derick Rethans
Adriano Santos wrote:

My php.ini:  error_reporting = E_ALL  ~E_NOTICE

I have a form to send of the variables, but my page do not receive values.

This my code:

?php
$nome = StrToLower($nome);
$senha = StrToLower($senha);
?


I guess you use PHP 4.2.0+; since this version the register_globals setting 
defaults to off. See http://www.php.net/release_4_2_0.php for more info.
This change was necessary as part of our efforts to make PHP scripting more 
secure and portable.

--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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



[PHP] Some error in file upload.

2002-11-23 Thread Naif Al-Otaibi

I copy a complete example from a book to upload file and I got this 
message error when I browse the file:

Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' 
in c:\inetpub\wwwroot\php5\file_upload.php on line 32

Here is the content of the file (file_upload.php):

?
// file_upload.php
  $archive_dir = ./docs;
  function upload_form() {
global $PHP_SELF;
?

FORM METHOD=POST ENCTYPE=MULTIPART/FORM-DATA
  ACTION=? echo $PHP_SELF ?
  INPUT TYPE=HIDDEN NAME=action VALUE=upload
  Upload file!
  INPUT TYPE=FILE NAME=userfile
  INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=upload
/FORM
 
?
  }
  
  function upload_file() {
global $userfile, $userfile_name, $userfile_size,
   $userfile_type, $archive_dir, $WINDIR;

if(isset($WINDIR)) $userfile = str_replace
(,\\,$userfile);

$filename = basename($userfile_name);

if($userfile_size = 0) die ($filename is empty.);

if(!@copy($userfile, $archive_dir/$filename))
  die (Can't copy $userfile_name to $filename.);

error- if(isset(!$WINDIR)  !@unlink($userfile))
  die (Can't delete the file $userfile_name.);
  
echo $filename has been successfully uploaded.BR;
echo Filesize:  . number_format($userfile_size) . BR;
echo Filetype: $userfile_typeBR;

}
?
HTML
HEADTITLEFILE UPLOAD/TITLE/HEAD
BODY
?
if($action == 'upload') upload_file();
else upload_form();
?
/BODY
/HTML


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




[PHP] Re: Some error in file upload.

2002-11-23 Thread Derick Rethans
Naif Al-Otaibi wrote:

I copy a complete example from a book to upload file and I got this 
message error when I browse the file:

Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' 
in c:\inetpub\wwwroot\php5\file_upload.php on line 32

Change
if(isset(!$WINDIR)
to
if(!isset($WINDIR)

and it should work. I wonder, which book is this?

--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


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




[Fwd: Re: [PHP] Some error in file upload.]

2002-11-23 Thread Marco Tabini
-Forwarded Message-

 From: Marco Tabini [EMAIL PROTECTED]
 To: Naif Al-Otaibi [EMAIL PROTECTED]
 Subject: Re: [PHP] Some error in file upload.
 Date: 23 Nov 2002 07:56:06 -0500
 
 I think this needs changing:
 
 error- if(isset(!$WINDIR)  !@unlink($userfile))
 
 into
 
 if(!isset($WINDIR)  !@unlink($userfile))
 
 Also, this would only work if you had register_globals on.
 
 Mind if I ask which book did you copy the example from?
 
 
 Marco
 -- 
 
 php|architect - The magazine for PHP Professionals
 The monthly worldwide magazine dedicated to PHP programmers
 Check us out on the web at http://www.phparch.com
 
 
 On Sat, 2002-11-23 at 07:41, Naif Al-Otaibi wrote:
  
  I copy a complete example from a book to upload file and I got this 
  message error when I browse the file:
  
  Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' 
  in c:\inetpub\wwwroot\php5\file_upload.php on line 32
  
  Here is the content of the file (file_upload.php):
  
  ?
  // file_upload.php
$archive_dir = ./docs;
function upload_form() {
  global $PHP_SELF;
  ?
  
  FORM METHOD=POST ENCTYPE=MULTIPART/FORM-DATA
ACTION=? echo $PHP_SELF ?
INPUT TYPE=HIDDEN NAME=action VALUE=upload
Upload file!
INPUT TYPE=FILE NAME=userfile
INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=upload
  /FORM
   
  ?
}

function upload_file() {
  global $userfile, $userfile_name, $userfile_size,
 $userfile_type, $archive_dir, $WINDIR;
  
  if(isset($WINDIR)) $userfile = str_replace
  (,\\,$userfile);
  
  $filename = basename($userfile_name);
  
  if($userfile_size = 0) die ($filename is empty.);
  
  if(!@copy($userfile, $archive_dir/$filename))
die (Can't copy $userfile_name to $filename.);
  
  error- if(isset(!$WINDIR)  !@unlink($userfile))
die (Can't delete the file $userfile_name.);

  echo $filename has been successfully uploaded.BR;
  echo Filesize:  . number_format($userfile_size) . BR;
  echo Filetype: $userfile_typeBR;
  
  }
  ?
  HTML
  HEADTITLEFILE UPLOAD/TITLE/HEAD
  BODY
  ?
  if($action == 'upload') upload_file();
  else upload_form();
  ?
  /BODY
  /HTML
  
  
  -- 
  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] OT- Private Registrations for Domains

2002-11-23 Thread Ernest E Vogelsinger
At 22:02 22.11.2002, [EMAIL PROTECTED] said:
[snip]
Has anyone heard of or used somthing like this, just received this notice 
from my registrar?
[snip] 

This simply means:

Buy this domain, pay for this domain, so it will be ours.
_YOU_ have to pay, _WE_ own the domain.

Wonder who would patent this.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [Fwd: Re: [PHP] Some error in file upload.]

2002-11-23 Thread Marco Tabini
Naif,

I think your problem is related to register_globals. The authors of the
book probably based their scripts on a version of PHP that had that
option turned on by default, but as 4.2.0, it's been turned off as it is
usually considered a security risk. So, either use the superglobal
arrays (like $_POST) to access your HTML form variables or turn
register_globals on in your php.ini file.

Cheers,


Marco

Marco
-- 

php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Sat, 2002-11-23 at 08:16, Naif Al-Otaibi wrote:
 Thanks, I fix this error but now I have another one:
 Notice: Undefined variable: action in c:\inetpub\wwwroot\php5
 \file_upload.php on line 45
 
 I have register_globals on
 
  -Forwarded Message-
  
   From: Marco Tabini [EMAIL PROTECTED]
   To: Naif Al-Otaibi [EMAIL PROTECTED]
   Subject: Re: [PHP] Some error in file upload.
   Date: 23 Nov 2002 07:56:06 -0500
   
   I think this needs changing:
   
   error- if(isset(!$WINDIR)  !@unlink($userfile))
   
   into
   
   if(!isset($WINDIR)  !@unlink($userfile))
   
   Also, this would only work if you had register_globals on.
   
   Mind if I ask which book did you copy the example from?
   
   
   Marco
   -- 
   
   php|architect - The magazine for PHP Professionals
   The monthly worldwide magazine dedicated to PHP programmers
   Check us out on the web at http://www.phparch.com
   
   
   On Sat, 2002-11-23 at 07:41, Naif Al-Otaibi wrote:

I copy a complete example from a book to upload file and I got 
 this 
message error when I browse the file:

Parse error: parse error, unexpected '!', expecting T_VARIABLE 
 or '$' 
in c:\inetpub\wwwroot\php5\file_upload.php on line 32

Here is the content of the file (file_upload.php):

?
// file_upload.php
  $archive_dir = ./docs;
  function upload_form() {
global $PHP_SELF;
?

FORM METHOD=POST ENCTYPE=MULTIPART/FORM-DATA
  ACTION=? echo $PHP_SELF ?
  INPUT TYPE=HIDDEN NAME=action VALUE=upload
  Upload file!
  INPUT TYPE=FILE NAME=userfile
  INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=upload
/FORM
 
?
  }
  
  function upload_file() {
global $userfile, $userfile_name, $userfile_size,
   $userfile_type, $archive_dir, $WINDIR;

if(isset($WINDIR)) $userfile = str_replace
(,\\,$userfile);

$filename = basename($userfile_name);

if($userfile_size = 0) die ($filename is empty.);

if(!@copy($userfile, $archive_dir/$filename))
  die (Can't copy $userfile_name to $filename.);

error- if(isset(!$WINDIR)  !@unlink($userfile))
  die (Can't delete the file $userfile_name.);
  
echo $filename has been successfully uploaded.BR;
echo Filesize:  . number_format($userfile_size) . BR;
echo Filetype: $userfile_typeBR;

}
?
HTML
HEADTITLEFILE UPLOAD/TITLE/HEAD
BODY
?
if($action == 'upload') upload_file();
else upload_form();
?
/BODY
/HTML


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



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




Re: [PHP] echo'ing array contents through reference variable ... why doesn't this work???

2002-11-23 Thread -[ Rene Brehmer ]-
Hi @ Edwin,

On Fri, 22 Nov 2002 12:34:35 +0900, you wrote about Re: [PHP] echo'ing
array contents through reference variable ... why doesn't this work???
something that looked like this:

 This is my test code:
 
   $premieredag =
 array(2002-11-22,2002-11-29,2002-12-06,2002-12-18);
   $d20021122 = array(001);
   $d20021129 = array(002,003,004);
   $d20021206 = array(005,006,007);
   $d20021218 = array(008,009);
 
   for ($i = 0; $i  count($premieredag); $i++) {
 echo(td class=\date\ width=\15%\);
 echo date(j. F Y,strtotime($premieredag[$i]));
 echo (/tdtdnbsp;/td\n);
 echo(/trtr\n);
 $pdag = d.str_replace(-,,$premieredag[$i]);
 for ($n = 0; $i  count($$pdag); $n++) {

It seems like $i would always be TRUE here, no?

Just guessing...

DOH! Of course ... totally missed that ... thx

But then ... why doesn't it pull the data correctly from the array???
Now I just get this:

td class=date width=15%22. November 2002/tdtdnbsp;/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td class=date width=15%29. November 2002/tdtdnbsp;/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td class=date width=15%6. December 2002/tdtdnbsp;/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td class=date width=15%18. December 2002/tdtdnbsp;/td
/trtr
td colspan=2 class=filmtxt/td
/trtr
td colspan=2 class=filmtxt/td
/trtr

Shouldn't 
  echo($$pdag[$n]);
be able to pull the string contents of the array? Or is there some extra
needed when using referenced variable?

The manual, atleast haven't found it, doesn't say anything about using
referenced variables at all, and definetely not with arrays...



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




RE: [PHP] dynamic arraynames

2002-11-23 Thread John W. Holmes
 I am trying to generate arrays to hold inputs to columns.  Column
 titles are input to a table as needed.  They are read by the program
 and placed across the page.  Then an array goes under each column name
 to collect the inputs to the various rows.  Everything works except to
 dynamically change the name of the array.
 
 
 while($foo=mysql_fetch_array($mysql_result)){
 print INPUT TYPE=text NAME=correspondingfoo[];}

Do you want this??

print INPUT TYPE=text NAME= . $foo['something'] . [];

---John Holmes...



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




Re: [PHP] echo'ing array contents through reference variable ... why doesn't this work???

2002-11-23 Thread Ernest E Vogelsinger
At 16:50 23.11.2002, -[ Rene Brehmer ]- said:
[snip]
Shouldn't 
  echo($$pdag[$n]);
be able to pull the string contents of the array? Or is there some extra
needed when using referenced variable?
[snip] 

This is ambiguous: is it $$pdag indexed by [$n], or is it $pdag[$n]
dereferenced? If you're using an interim variable you'll get what you need
- either use (depends on your data layout which I don't know)
$temp = $pdag[$n];
echo $$temp;
or
$temp = $$pdag;
echo $temp[$n];


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] Re: Undefined Variable

2002-11-23 Thread Adriano Santos
Thanks.



Re: [PHP] echo'ing array contents through reference variable

2002-11-23 Thread Tularis
echo ${$pdag[$n]}; // is also possible in case the [$n] is the index to 
pdag. Otherwise use this:
echo ${$pdag}[$n];

- Tularis

PS. This is basicly the same thing as Ernest said, but shorter...

Ernest E Vogelsinger wrote:

At 16:50 23.11.2002, -[ Rene Brehmer ]- said:
[snip]

Shouldn't
 echo($$pdag[$n]);
be able to pull the string contents of the array? Or is there some extra
needed when using referenced variable?

[snip]

This is ambiguous: is it $$pdag indexed by [$n], or is it $pdag[$n]
dereferenced? If you're using an interim variable you'll get what you need
- either use (depends on your data layout which I don't know)
$temp = $pdag[$n];
echo $$temp;
or
$temp = $$pdag;
echo $temp[$n];





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




[PHP] Insert file into sql server binary field.

2002-11-23 Thread Naif Al-Otaibi

How can I insert a file into a binary field in sql server 2000. Do I 
need some function in the query like upload or just read the file and 
insert it.

Thanks,

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




[PHP] using cookies

2002-11-23 Thread Ken Nagorski
Hi there,

I have never used cookies before, however I am trying to implement them to
make things a little more secure. Rather than passing a sql statement via a
hidden input tag I am setting a cookie. This works fine except that when I
look at the sql after it is pulled from the cookie everything is escaped,
for instance.

SELECT * FROM inventory WHERE name='Watches'
  would become
SELECT manufacturer FROM inventory WHERE name=\'Watches\'

This is a problem cause trying to use preg_replace doesn't seem to work. I
get an error saying that the delimeter must not be a \. What a bummer. I am
a little stuck. I will take any suggestions. Maybe I am just going about
things the wrong way. *** Shrug ***

Thanks
Ken




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




RE: [PHP] using cookies

2002-11-23 Thread Rich Gray
Ken

Do *not* use hidden form statements or cookies to store any SQL this is
extremely dangerous and a relatively simple hack could destroy your database
completely!

By all means use hidden form fields to store row ID values but your PHP
scripts should treat all user input data via $_GET/$_POST/$_COOKIE/$_FILES
as hostile and you should be rigorous in validating that data coming into
your script is as you would expect...

Having said that it seems your server has magic_quotes_gpc() switched on -
this automatically escapes all incoming data that could upset a SQL query
i.e. the quotes - you can remove them by using stripslashes() or switch off
magic quotes in your php.ini file. But I would repeat *don't* continue down
the path you are going unless you like being hacked!

HTH
Rich
-Original Message-
From: Ken Nagorski [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2002 11:52
To: [EMAIL PROTECTED]
Subject: [PHP] using cookies


Hi there,

I have never used cookies before, however I am trying to implement them to
make things a little more secure. Rather than passing a sql statement via a
hidden input tag I am setting a cookie. This works fine except that when I
look at the sql after it is pulled from the cookie everything is escaped,
for instance.

SELECT * FROM inventory WHERE name='Watches'
  would become
SELECT manufacturer FROM inventory WHERE name=\'Watches\'

This is a problem cause trying to use preg_replace doesn't seem to work. I
get an error saying that the delimeter must not be a \. What a bummer. I am
a little stuck. I will take any suggestions. Maybe I am just going about
things the wrong way. *** Shrug ***

Thanks
Ken




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




php-general Digest 23 Nov 2002 20:55:04 -0000 Issue 1722

2002-11-23 Thread php-general-digest-help

php-general Digest 23 Nov 2002 20:55:04 - Issue 1722

Topics (messages 125716 through 125738):

Re: php teleprogramming -- How to avoid being ripped off ?
125716 by: Khalid El-Kary

How to obtain unique XML Elements
125717 by: David Pratt
125718 by: Khalid El-Kary

Undefined Variable
125719 by: Adriano Santos
125720 by: Derick Rethans
125724 by: Adriano Santos
125725 by: Derick Rethans
125734 by: Adriano Santos

Re: extension can't be found
125721 by: Derick Rethans

Re: Post again. question about Animated GIF
125722 by: Derick Rethans

Re: put result of include into a variable
125723 by: Derick Rethans

Some error in file upload.
125726 by: Naif Al-Otaibi
125727 by: Derick Rethans

Re: Some error in file upload.]
125728 by: Marco Tabini
125730 by: Marco Tabini

Re: OT- Private Registrations for Domains
125729 by: Ernest E Vogelsinger

Re: echo'ing array contents through reference variable ... why doesn't this work???
125731 by: -[ Rene Brehmer ]-
125733 by: Ernest E Vogelsinger

Re: dynamic arraynames
125732 by: John W. Holmes

Re: echo'ing array contents through reference variable
125735 by: Tularis

Insert file into sql server binary field.
125736 by: Naif Al-Otaibi

using cookies
125737 by: Ken Nagorski
125738 by: Rich Gray

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
hi,
don't be so unhappy withit, because you won however, money comes and goes 
knowledge stays, through this experience you learned much, right? so you 
didn't lost much! :-)





_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

---End Message---
---BeginMessage---
Anyone have a simple technique for obtaining a unique list of elements from
an XML file?

Am looking for something that will identify the first opening tag ie
thistag and the single tag anothertag/ so that I get an array of tags
that I can print out.  Having a bit of trouble with regex to get something
to work.

Basic idea I had is to open file, read through each line with regex, add
matches to array, and then do unique elements of array and write to another
file.

Is there a better way?

--
Regards,
Dave

---End Message---
---BeginMessage---
hi,
you can get this parser

http://creaturesx.ma.cx/kxparse/

if you want only this limited functionality (take an old version) 0.2 for 
example, you may also want to take only particular functions from it

this is valid in all cases (as i think), except that you are developing 
another parser :)

khalid








_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

---End Message---
---BeginMessage---
Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?
thanks



---End Message---
---BeginMessage---
Adriano Santos wrote:

Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?


at the top of your script:
error_reporting(E_ALL  ~E_NOTICE);

or initialize your variables likes:
$number = 0;
$string = foo;

Derick


--

-
 Derick Rethans http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-


---End Message---
---BeginMessage---
My php.ini:  error_reporting = E_ALL  ~E_NOTICE

I have a form to send of the variables, but my page do not receive values.

This my code:

?php
$nome = StrToLower($nome);
$senha = StrToLower($senha);
?

thanks


Derick Rethans [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Adriano Santos wrote:
  Hi,
 
  I'm with problem: Undefined Variable.
  I'm using :
  PHP 4.2.3
  MySql 3.2.39
  Windows 2000
 
  How do I make to soluction my problem ?

 at the top of your script:
 error_reporting(E_ALL  ~E_NOTICE);

 or initialize your variables likes:
 $number = 0;
 $string = foo;

 Derick


 --

 -
   Derick Rethans http://derickrethans.nl/
   PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
 -




---End Message---
---BeginMessage---
Adriano Santos wrote:

My 

RE: [PHP] using cookies

2002-11-23 Thread Paul Marinas

dose anyone how to send a ping in local network

thanks

Paul Marinas
Technical Support
RDS Craiova


Phone:  +402-51-410-194
Mobile: +407-22-451-439
Fax:+402-51-416-579
www.rdsnet.ro
.

Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this
message (or responsible for delivery of the message to such person), you may
not copy or deliver this message to
anyone. In such a case, you should destroy this message and kindly notify
the sender by reply e-mail.



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




RE: [PHP] Using Ping (was: using cookies)

2002-11-23 Thread Marco Tabini
I took the liberty of changing the subject of your e-mail because this
way everyone can follow it better.

Well, you can execute the ping command directly from within PHP and then
parse its input. For example:

?php

preg_match (/([0-1]) received/, shell_exec (ping -c 1 -w 2
www.phparch.com 2/dev/null), $a);

if (count ($a)  $a[1])
echo success;
else
echo failure;
?

This will work only under Unix, but you can very easily adapt it to
whatever os you need, as long as it supports pinging from the command
line.

Marco


php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Sat, 2002-11-23 at 16:08, Paul Marinas wrote:
 
 dose anyone how to send a ping in local network
 
 thanks
 
 Paul Marinas
 Technical Support
 RDS Craiova
 
 
 Phone:  +402-51-410-194
 Mobile: +407-22-451-439
 Fax:+402-51-416-579
 www.rdsnet.ro
 .
 
 Privileged/Confidential Information may be contained in this message. If you
 are not the addressee indicated in this
 message (or responsible for delivery of the message to such person), you may
 not copy or deliver this message to
 anyone. In such a case, you should destroy this message and kindly notify
 the sender by reply e-mail.
 
 
 
 -- 
 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




[PHP] Passing Variables

2002-11-23 Thread Craig Edgmon
I am sure this question has been answered, but there is a ton of data to
sift through on this. I am running Apache 1.3 and the latest PHP 4.2.3. .
I am just working with variables and I cannot seem to get them to pass from
my html file to the php call. I will get the html portion fine, but not the
variable. I have checked my language and have compared my files with
supposed good code from a reliable source with the same results. Any idea on
this. It happens on multiple systems.



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




RE: [PHP] using cookies

2002-11-23 Thread Rich Gray
Try the system() or passthru() functions...

Rich
-Original Message-
From: Paul Marinas [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2002 13:09
To: Rich Gray
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] using cookies



dose anyone how to send a ping in local network

thanks

Paul Marinas
Technical Support
RDS Craiova


Phone:  +402-51-410-194
Mobile: +407-22-451-439
Fax:+402-51-416-579
www.rdsnet.ro
.

Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this
message (or responsible for delivery of the message to such person), you may
not copy or deliver this message to
anyone. In such a case, you should destroy this message and kindly notify
the sender by reply e-mail.



--
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] Passing Variables

2002-11-23 Thread Marco Tabini
Try looking into the manual for register_globals

Marco


php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Sat, 2002-11-23 at 14:42, Craig Edgmon wrote:
 I am sure this question has been answered, but there is a ton of data to
 sift through on this. I am running Apache 1.3 and the latest PHP 4.2.3. .
 I am just working with variables and I cannot seem to get them to pass from
 my html file to the php call. I will get the html portion fine, but not the
 variable. I have checked my language and have compared my files with
 supposed good code from a reliable source with the same results. Any idea on
 this. It happens on multiple systems.
 
 
 
 -- 
 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] Re: Php search results]

2002-11-23 Thread Tom Culpepper
I wrote this function to fetch a news item off another web page but with
a little modification it should work for you.  To use it you needed to
identify a set of of strings in the source to use as anchors ($start,
$end) and then it pulls that section and crops off the anchor text so
you are left with just what you wanted.

?
function get_item($url, $start, $end) {
	global $item;
	if(!($fp=fopen($url,r))) {
		echo $url. is not accessable;
		exit;
	}
	while(!feof($fp)) {
		$item.=fgets($fp,255);
	}
	
	fclose($fp);
	$start_position=strpos($item, $start)+strlen($start);
	$end_position=strpos($item, $end);
	$length=$end_position-$start_position;
	$item=substr($item, $start_position, $length);	
}
echo $item;
?

Soemthing like this might work for you:
?
$results=search results;
$keyword=search string;
$startposition=strpos($results, $keyword)-200;
$endposition=strpos($results, $keyword)+200;
$length=$endposition-$startposition;
$item=substr($item, $startposition, $length;
echo $item
?

Tom Culpepper
www.multicasttech.com
[EMAIL PROTECTED]


Alex wrote:
 you could also use regular expressions, but php isn't perl, so good 
luck on
 that one :p.


 Philip Hallstrom [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

You could use strstr() to find the index location of the
string searched for in FIELD.  Then use substr() to return say 50
characters on either side...

-philip

On Thu, 21 Nov 2002, Daniel Masson wrote:


Hello everyone ...

Im working on some kind of search engine for two little tables on text
fields on mssql, and the text fields can be very large fields, im doing
the search with SELECT FIELD FROM TABLE WHERE FIELD LIKE '%SOMTHING%' ..
My question is:

When displaying the search results i dont want to display the entire
field, only the specific parts where the keyword was found , and bold
for the keyword and i just dony know  how to to do that, i mean
displaying the keyword in bold is no problem .. I need to know how to
display only the parts where this keyword is.

Any help will be very helpful

Thanks every1



--
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] Passing Variables

2002-11-23 Thread Rich Gray
Is your register_globals setting set to Off? This is the default setting in
v4.2.x upwards.

Rich
-Original Message-
From: Craig Edgmon [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2002 11:43
To: [EMAIL PROTECTED]
Subject: [PHP] Passing Variables


I am sure this question has been answered, but there is a ton of data to
sift through on this. I am running Apache 1.3 and the latest PHP 4.2.3. .
I am just working with variables and I cannot seem to get them to pass from
my html file to the php call. I will get the html portion fine, but not the
variable. I have checked my language and have compared my files with
supposed good code from a reliable source with the same results. Any idea on
this. It happens on multiple systems.



--
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] grabbing data from a site

2002-11-23 Thread Tom Culpepper
Try this function, Ijust wrote it for the same purpose.  You just need a 
 unique string in front of the stuff you want, and one after it.  You 
can usually get a string of code on either end that will do this.  The 
function will open the URL, find the anchor strings you told it, then 
strip them away leaving only the text/code that was in between them

?
function get_item($url, $start, $end) {
global $item;
if(!($fp=fopen($url,r))) {
echo $url. is not accessable;
exit;
}
while(!feof($fp)) {
$item.=fgets($fp,255);
}

fclose($fp);
$start_position=strpos($item, $start)+strlen($start);
$end_position=strpos($item, $end);
$length=$end_position-$start_position;
$item=substr($item, $start_position, $length);
}
echo $item;
?

Tom Culpepper
Multicast Technologies

Adam wrote:
someone gave me the following expression which uses another program and it
works fine for them... is there something similar with php?

wget --timeout=90 -q -O- http://www.BoM.GOV.AU/products/IDO30V01.shtml | sed
'1,/Melbourne sup/d' | sed '1d;3,$d;s/.*//;s/.*//'

thanks,
adam.

Evan Nemerson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

If the target is in well-formed XML (XHTML is an example), you could use


XSLT


to say 'i want the third column of a particular row - in this instance,
Melbourne'. However, since few people actually adhere to standards, you're
probably going to need a regex... if you're not comfortable with them,
explode() could be useful (although it is slower)

Somebody posted an extremely helpfull little quick reference at


php.net/ereg,


i think... that might help you.


On Friday 22 November 2002 01:40 pm, Adam wrote:


I have the following website that i want to grab info from:

http://www.bom.gov.au/products/IDV60034.shtml

Say I wanted the current temperature for Melbourne from this table, what
line of code would I need to tell it to get that info - ie, an ereg()
expression...

i'm wondering whether there are ways of saying i want the third column



of


a particular row - in this instance, Melbourne?

Thanks for any help.
Adam.


- --
I pledge allegiance to the flag, of the United States of America, and to


the


republic for which it stands, one nation indivisible, with liberty, and
justice for all.

- -Pledge of Allegiance
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE93qVm/rncFku1MdIRAshSAJ9phj0DqR3seanlzKXhdnKj8cvI8QCfW7kM
tfUfUEF4yVJSRnm0GCkIeaM=
=AyI1
-END PGP SIGNATURE-










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




Re: [PHP] put result of include into a variable

2002-11-23 Thread Tom Culpepper
Try using fopen() to open the file and then fread() to read it into the 
buffer and set that equal to the variable.

Tom Culpepper
Multicast Technologies

Patrick Anderson at TUE wrote:
Hi,

For some (strange, I know) reason I would like to copy the content of a
webpage into a database.

I would like to have code like

$whocares = include (http://www.microsoft.nl;);
$query = insert into html values ($whocares,...);
..

However, include can not copy the content to a variable. Does anyone
have an idea how to circumvent this problem?

Thanks,
Patrick







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




Re: [PHP] dynamic arraynames

2002-11-23 Thread Floyd Baker
On Sat, 23 Nov 2002 10:58:02 -0500, you wrote:

 I am trying to generate arrays to hold inputs to columns.  Column
 titles are input to a table as needed.  They are read by the program
 and placed across the page.  Then an array goes under each column name
 to collect the inputs to the various rows.  Everything works except to
 dynamically change the name of the array.
 
 
 while($foo=mysql_fetch_array($mysql_result)){
 print INPUT TYPE=text NAME=correspondingfoo[];}

Do you want this??

print INPUT TYPE=text NAME= . $foo['something'] . [];

---John Holmes...


No John.  I'm ok with simply inputting a value and otherwise using
arrays that are hard coded and previously named but my problem is in
creating different arrays on the fly to represent each column that
there is a name for.  I want to end up with something like $meat[] and
$potatoes[] and whatever else is needed from a list...  The list of
meat, potatoes, etc determines how many arrays and their names.
  
I'm not to swift when it comes to arrays and think I'm probably stuck
on some simple misconception.  I'm trying to convert $meat to $meat[],
on the fly, to have something to input to...  I read today maybe I
don't need the brackets?  

Floyd


--


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




[PHP] Re: Passing Variables

2002-11-23 Thread Stephan Seidt
if you mean something like bla.php?foo=bar, etc and you have register_globas enabled
it'll be stored as $_GET['foo'] ($_REQUEST['foo'])

On Sat, 23 Nov 2002 11:42:49 -0800
[EMAIL PROTECTED] (Craig Edgmon) wrote:

 I am sure this question has been answered, but there is a ton of data to
 sift through on this. I am running Apache 1.3 and the latest PHP 4.2.3. .
 I am just working with variables and I cannot seem to get them to pass from
 my html file to the php call. I will get the html portion fine, but not the
 variable. I have checked my language and have compared my files with
 supposed good code from a reliable source with the same results. Any idea on
 this. It happens on multiple systems.
 
 

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




[PHP] logs(querystring) in php4 or apache?

2002-11-23 Thread Frank Wang
Hi,

In a html i use a form to post data to a php file in a Apache server. I'd
like to take a look at the raw data submitted from the web browser to the
php, where can i find this info? the access.log in Apache does not contain
this info. thanks.

Frank



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




[PHP] PHP Syntax - mail statement

2002-11-23 Thread Michael Sharp
I have a html form that has just 3 fields and each are defined as
name=firstname, name=lastname, and name=email . The action is
calling a sendmail.php file and the method is POST. Here is the contents
of sendmail.php:

?php
$to = [EMAIL PROTECTED];
$subject = Form Submission;
$contents = $firstname, $lastname, $email;
mail ($to, $subject, $contents);
header (Location: http://probsd.org/rlewis/thankyou.txt;);
?

When submitting the form, mail gets sent to [EMAIL PROTECTED] with the
subject defined in sendmail.php, but the contents simply displayes both of
the commas from $contents =  and not $firstname, $lastname, and $email.

Syntax error or what?

Michael




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




Re: [PHP] PHP Syntax - mail statement

2002-11-23 Thread Marco Tabini
Probably just a problem with register_globals

Try:

$contents = {$_REQUEST['firstname']}, {$_REQUEST['lastname']}, {$_REQUEST['email']};

Marco


php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Sat, 2002-11-23 at 18:13, Michael Sharp wrote:
 I have a html form that has just 3 fields and each are defined as
 name=firstname, name=lastname, and name=email . The action is
 calling a sendmail.php file and the method is POST. Here is the contents
 of sendmail.php:
 
 ?php
 $to = [EMAIL PROTECTED];
 $subject = Form Submission;
 $contents = $firstname, $lastname, $email;
 mail ($to, $subject, $contents);
 header (Location: http://probsd.org/rlewis/thankyou.txt;);
 ?
 
 When submitting the form, mail gets sent to [EMAIL PROTECTED] with the
 subject defined in sendmail.php, but the contents simply displayes both of
 the commas from $contents =  and not $firstname, $lastname, and $email.
 
 Syntax error or what?
 
 Michael
 
 
 
 
 -- 
 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] dynamic arraynames

2002-11-23 Thread Hugh Danaher
Floyd,
if you are using mysql then you can use the mysql_list_fields to get the
names of the mysql table's column (field) names, then do mysql_num_fields to
get the number of columns (fields), then fill the columns with whatever
using a while loop.
I've attached a php page that fetches this info from any size table then
displays the table.  You can extract the info you need and extend it with
check boxes etc.
Hope this helps.
Hugh


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
meta http-equiv=Content-Type content=text/html; charset=utf-8
titleInput Data Page/title
?php include (css.txt); ?
/head
body bgcolor=#1D3E81 
h1font color=#33DATABASE TABLES/font/h1

form action=?php print $php_self? method=post
?php

print table cellpadding=7 border=1 bgcolor=#d5d5d5trtd;
print h6Database name:/h6input type=text name=db
STYLE=width:140px/tdtd;
print h6Username:/h6input type=text name=user STYLE=width:140px;
print h6Password:/h6input type=text name=pass STYLE=width:140px;
print /tdtd valign=middle align=centerinput type=submit value=\ go
\;
print input type=hidden name=start value=1;
print /td/tr/table/formbr;
if ($start==1)
 {
 $link=mysql_connect(localhost,$user,$pass);
 if (! $link) die(couldn't connect mysql);
 mysql_select_db($db,$link) or die (couldn't open $db .mysql_error());
 $tables=mysql_list_tables($db,$link);
 $num=mysql_num_rows($tables)-1;
 mysql_close($link);
 ?
 form action=?php print $php_self? method=post
 ?php
 print table cellpadding=7 border=1 bgcolor=#d5d5d5trtd;
 print h6Table Name: /h6select type=text name=table
STYLE=width:140pxoption;

 for ($i=0;$i=$num;$i++)
  {
  print option.mysql_tablename($tables,$i);
  }
 print /select;

 print /tdtdinput type=submit value=\ go  \;
 print input type=hidden name=start value=2;

 print input type=hidden name=db value=$db;
 print input type=hidden name=user value=$user;
 print input type=hidden name=pass value=$pass;
 print /td/tr/table/formbr;
 }

if ($start==2)
 {
 $link=mysql_connect(localhost,$user,$pass);
 if (! $link) die(couldn't connect mysql);
 mysql_select_db($db,$link) or die (couldn't open $db .mysql_error());

 $results=mysql_query(select * from $table);
 $fields = mysql_list_fields($db, $table, $link);
 $columns = mysql_num_fields($fields);
 mysql_close($link);
 print table width=95% bgcolor=#d5d5d5 border=1 cellspacing=0
cellpadding=0trtd align=centerh3$table/h3;
 print table width=100% bgcolor=#d5d5d5 border=1 cellspacing=0
cellpadding=4;
 print tr;
 for ($i = 0; $i  $columns; $i++)
  {
  print td align=center bgcolor=#6c6c6ch5font
color=white.mysql_field_name($fields, $i)./font/h5/td;
  }
 print /tr;
 print tr;
 for ($i = 0; $i  $columns; $i++)
  {
  print td align=center bgcolor=#fbfbfbh5.mysql_field_type($results,
$i)./h5/td;
  }
 print /tr;
 while ($a_row=mysql_fetch_row($results))
  {
  print tr;
  foreach($a_row as $field)
   {
   if ($field==)
{
$field=nbsp;;
}
   print td align=centerh5.$field./h5/td;
   }
  print /tr;
  }
 print /table/td/tr/table;
 }
?
/body
/html



- Original Message -
From: Floyd Baker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 2:07 PM
Subject: Re: [PHP] dynamic arraynames


 On Sat, 23 Nov 2002 10:58:02 -0500, you wrote:

  I am trying to generate arrays to hold inputs to columns.  Column
  titles are input to a table as needed.  They are read by the program
  and placed across the page.  Then an array goes under each column name
  to collect the inputs to the various rows.  Everything works except to
  dynamically change the name of the array.
 
 
  while($foo=mysql_fetch_array($mysql_result)){
  print INPUT TYPE=text NAME=correspondingfoo[];}
 
 Do you want this??
 
 print INPUT TYPE=text NAME= . $foo['something'] . [];
 
 ---John Holmes...


 No John.  I'm ok with simply inputting a value and otherwise using
 arrays that are hard coded and previously named but my problem is in
 creating different arrays on the fly to represent each column that
 there is a name for.  I want to end up with something like $meat[] and
 $potatoes[] and whatever else is needed from a list...  The list of
 meat, potatoes, etc determines how many arrays and their names.

 I'm not to swift when it comes to arrays and think I'm probably stuck
 on some simple misconception.  I'm trying to convert $meat to $meat[],
 on the fly, to have something to input to...  I read today maybe I
 don't need the brackets?

 Floyd


 --


 --
 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] using cookies

2002-11-23 Thread Chris Shiflett
--- Ken Nagorski [EMAIL PROTECTED] wrote:

 I have never used cookies before, however I am trying to
 implement them to make things a little more secure. Rather
 than passing a sql statement via a hidden input tag I am
 setting a cookie.

I think someone else already mentioned this, but let me emphasize
that this is a terrible idea and definitely does not make things a
little more secure.

The best analogy I can think of for a cookie would be handing out
name tags to people who visit your site. Imagine that you write the
following SQL on someone's name tag:

select * from foo where unique_id='12345'

This helps you distinguish them from the next person who may have a
unique identifier of 23456. While this might work for those who play
by the rules, you are placing a tremendous amount of trust in these
people. What if someone erased what you wrote on their name tag,
replacing it with this:

delete from foo

If you were to trust this person's name tag the next time you saw
them, you would delete all of the data from that table.

In addition to this, hidden form variables are just as bad. It is a
different method, but you are still basically sending something to
the client and just trusting the client to return exactly what you
sent. Placing so much trust in the client is never a good idea.

I would recommend abandoning these methods for anything that you, as
you say, are wanting to make more secure. Look into using sessions
instead. When you use sessions, the only sensitive data you trust the
client to return to you is PHPSESSID. While there are some dangers
associated with this trust, it is a more tolerable risk. When you set
a session variable, it is kept safely on the server, so it is at
least much less convenient for an attacker to alter this data,
because only you can do that.

I hope this helps you get started down the right path. There are
methods you can use to further mitigate the risk of trusting the
client's PHPSESSID, but that can be discussed later.

Chris

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




[PHP] strings and vars

2002-11-23 Thread empty
Hi;

i have a string and I want to set it as a variable name.

like tahat

i have string like: string;

how can i get variable $string;


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




[PHP] Re: strings and vars

2002-11-23 Thread Kyle Gibson
Hi;

i have a string and I want to set it as a variable name.

like tahat

i have string like: string;

how can i get variable $string;



I suppose you are trying to do the following:

$variable = some value;

So if you wish to assign string as $string, simply do the following:

$string = string;


--
Kyle Gibson
admin(at)frozenonline.com
http://www.frozenonline.com/


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




Re: [PHP] strings and vars

2002-11-23 Thread Ernest E Vogelsinger
At 02:05 24.11.2002, empty said:
[snip]
i have string like: string;

how can i get variable $string;
[snip] 

$var = 'string';
$$var will resolve as $string


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re[2]: [PHP] strings and vars

2002-11-23 Thread empty
yiihhuuuvvv

it works;

I heard it, i remember variable variables I guess

Thanks all

EEV $var = 'string';
EEV $$var will resolve as $string


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




[PHP] Parse URLs

2002-11-23 Thread Stephen



I have a simple post script and I want to make it so if a user 
types in a URL of some sort, to change it to make it clickable. How could I do 
that?
Thanks,Stephen Cratonhttp://www.melchior.us

"Life is a gift from God. Wasting it is like destroying a gift you got from 
the person you love most." -- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Parse URLs

2002-11-23 Thread Tom Culpepper
not entirely sure what is going on there, but if the user is entering 
the url in a html form.  Then just grab the variable on the next page 
and run this

$url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your 
form method)
$url=a href=.$url..$url./a;
echo $url;

the only way to change it dynamically on the same page would be javascript.

-tom culpepper

Stephen wrote:
I have a simple post script and I want to make it so if a user types in 
a URL of some sort, to change it to make it clickable. How could I do that?

Thanks,
Stephen Craton
http://www.melchior.us
 
Life is a gift from God. Wasting it is like destroying a gift you got 
from the person you love most. -- http://www.melchior.us




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




Re: [PHP] Parse URLs

2002-11-23 Thread Stephen
They are entering in a whole paragraph or two of text and I want to search
the paragraph for URLs then make it a clickable URL and then store it in a
MySQL database.


- Original Message -
From: Tom Culpepper [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 9:05 PM
Subject: Re: [PHP] Parse URLs


 not entirely sure what is going on there, but if the user is entering
 the url in a html form.  Then just grab the variable on the next page
 and run this

 $url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your
 form method)
 $url=a href=.$url..$url./a;
 echo $url;

 the only way to change it dynamically on the same page would be
javascript.

 -tom culpepper

 Stephen wrote:
  I have a simple post script and I want to make it so if a user types in
  a URL of some sort, to change it to make it clickable. How could I do
that?
 
  Thanks,
  Stephen Craton
  http://www.melchior.us
 
  Life is a gift from God. Wasting it is like destroying a gift you got
  from the person you love most. -- http://www.melchior.us
 



 --
 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] Parse URLs

2002-11-23 Thread Tom Culpepper
from the archives of the list
http://www.phpbuilder.com/mail/php-windows/2001042/0222.php

-tom culpepper


Stephen wrote:

They are entering in a whole paragraph or two of text and I want to search
the paragraph for URLs then make it a clickable URL and then store it in a
MySQL database.


- Original Message -
From: Tom Culpepper [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, November 23, 2002 9:05 PM
Subject: Re: [PHP] Parse URLs




not entirely sure what is going on there, but if the user is entering
the url in a html form.  Then just grab the variable on the next page
and run this

$url=user $HTTP_GET_VARS[url]; (or $HTTP_POST_VARS depending on your
form method)
$url=a href=.$url..$url./a;
echo $url;

the only way to change it dynamically on the same page would be


javascript.


-tom culpepper

Stephen wrote:


I have a simple post script and I want to make it so if a user types in
a URL of some sort, to change it to make it clickable. How could I do



that?


Thanks,
Stephen Craton
http://www.melchior.us

Life is a gift from God. Wasting it is like destroying a gift you got
from the person you love most. -- http://www.melchior.us





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




[PHP] getting mysql dump using php

2002-11-23 Thread See Kok Boon
hi,

can anyone tell me how to make auto backups of mysql databases?

i have a particular database that i want to backup everyday. what i can
think of now is to use crontab to execute a .php that will do the work, then
send the db schema (dump) via email every midnight.

however, i do not know the code to GET THE DUMP of the mysql db.

i know that i can be done because phpAdmin from sourceforge.net has the
export feature, which does what i want, except that i cannot execute the
hyperlink there using crontab.

can someone tell me:
1. what is the php code for getting the schema?
2. what is an alternatively BETTER way to backup?

thanks in advance

Yours sincerely,
See Kok Boon
-
looking for - jobs? career? customer?
look in realPortal!
http://realportal.realizecreations.com


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




RE: [PHP] getting mysql dump using php

2002-11-23 Thread Rich Gray
Answer is No. 2)

Use cron to run the mysqldump utility instead of a php script.
Let me know if you need more info.

Cheers
Rich

-Original Message-
From: See Kok Boon [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2002 07:35
To: PHP
Subject: [PHP] getting mysql dump using php


hi,

can anyone tell me how to make auto backups of mysql databases?

i have a particular database that i want to backup everyday. what i can
think of now is to use crontab to execute a .php that will do the work, then
send the db schema (dump) via email every midnight.

however, i do not know the code to GET THE DUMP of the mysql db.

i know that i can be done because phpAdmin from sourceforge.net has the
export feature, which does what i want, except that i cannot execute the
hyperlink there using crontab.

can someone tell me:
1. what is the php code for getting the schema?
2. what is an alternatively BETTER way to backup?

thanks in advance

Yours sincerely,
See Kok Boon
-
looking for - jobs? career? customer?
look in realPortal!
http://realportal.realizecreations.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] getting mysql dump using php

2002-11-23 Thread Morgan Hughes
On Sun, 24 Nov 2002, Rich Gray wrote:

 Answer is No. 2)
 Use cron to run the mysqldump utility instead of a php script.
 Let me know if you need more info.

  I use this one with crontab, it works pretty well, if your email program
  can handle uuencode:


#!/bin/sh
# File: db_backup.sh
# Descript: Runs a ful mysqldump of one or more MySQL databases, uuencodes
#   and compresses them, and mails them to a specified address.
#   Requires mysqldump, gzip, uuencode, mail or mailx, and crontab.
#
#   Normally this run from crontab, with an entry like:
# 0 3 * * * sh ~/db_backup
#
# Version : 1.00
# Author  : Morgan Hughes ([EMAIL PROTECTED])
# License : Copyright (C) 2002, Morgan Hughes.  Use freely.


# Account/password/email info
db_list=your_database
db_user=your_username
db_pass=your_password
email=your_email_addy

# program locations
mysqldump=mysqldump
dump_opts=
uuencode=uuencode
gzip=gzip
mail=mail

# Actual code
for db_name in $db_list ; do

date=`date '+%Y%m%d-%H%M%S'`
$mysqldump $dump_opts -u $db_user --password=$db_pass $db_name | \
$gzip -c9 | $uuencode $db_name-$date.sql.gz | \
$mail -s DB backup, $db_name, $date $email

done

# Ends: db_backup.sh



  At home I have a script plugged into .procmailrc with an entry like:

# First off, catch inbound automated backups.
:0
* ^Subject: DB backup, kyhm
| ~/bin/catch_backup ~/kyhm.com/backups/db



  The ~/bin/catch_backup script is as follows:

#!/bin/sh
if [ $1 !=  -a -d $1 ] ; then
cd $1
else
cd ~
fi
cat | uudecode



  Hope this is useful...

-- 
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356



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




[PHP] Secureing PHP.

2002-11-23 Thread Steven Adams
Hi,
I am looking to secure my php install, like the settings in php.ini etc.

I am using apache 1.3.27 and running latest php.

Is there like a tut or something that can take u thought the php.ini and
explain ina little more detail?

safe_mode = Off

is that a bad idea or should i leave it on..

/Steve


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




[PHP] Re: Secureing PHP.

2002-11-23 Thread Stephan Seidt
hi,

you should try to take the php.ini-recommended and edit it a little bit so that it 
fits your needs.
the settings there are very secure but also increase php's performance and coding 
standard.
if some settings won't fit to a single script, you can use ini_set(..., ...).
so you'll have to disable the output_buffer if you need implicit_flush.

and you safe_mode question.. sorry  i never played around with it ;)

bye

On Sun, 24 Nov 2002 17:41:20 +1100
[EMAIL PROTECTED] (Steven Adams) wrote:

 Hi,
 I am looking to secure my php install, like the settings in php.ini etc.
 
 I am using apache 1.3.27 and running latest php.
 
 Is there like a tut or something that can take u thought the php.ini and
 explain ina little more detail?
 
 safe_mode = Off
 
 is that a bad idea or should i leave it on..
 
 /Steve
 

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




Re: [PHP] sessions and trans-sid problem/question

2002-11-23 Thread Jean-Christian Imbeault
Ernest E Vogelsinger wrote:


if ($_COOKIE[$_SESSION['cookie_name']] == $_SESSION['cookie_token']) {


Ok, please forgive my ignorance, but in PHP isn't $_COOKIES the same as 
$_SESSION?. I thought it was if the user had cookies turned off (and 
even if the user had cookies turned on come to think of it) ... If not 
I'm in trouble.

I was always under the impression that $_SESSION vars were passed as 
cookies ...

Hc


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