[PHP] asking about exe file

2002-04-08 Thread wong

Can php execute .exe file ( compile from BorlandC) and view result on the
browser ? PLease Help Me

Rizal


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




[PHP] Newbie Question

2002-04-08 Thread Hubert DAUL


Hi ,

Here's my problem :

I read a data file (no sql file) which contains 8 lines, and in each line, 8
datas

(ex: name1;picture1;title1;anything1;everything1;nothing1)

and when i run it I see only one picture(the second data) and not all of
them

If someone could help me

TYA

Here the code :

html
head
titleSolid/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#FF text=#00
table width=384 border=1

?php
 $row = 1;
 $fp = fopen (album.dat,r);
  while ($data = fgetcsv ($fp, 1000, ;))
  {
$num = count ($data);

$row++;

if (isset($vignette))
{
print(tr);
print(td$vignette/td);
   // I think it's wrong here but I dont know why
==   print(tdimg src=\images/$photo\a href =
\prod.php?file=lecteur.dat\/a/td);
print(td$marque/td);
print(td$nom/td);
print(td$pdfproduit/td);
print(td$commprod/td);
print(/tr);
}


for ($c=0; $c$num; $c++)
switch ($c)  {
case 0 :
{
$vignette = $data[$c];
break;
}

case 1 :
{
$photo= $data[$c];
break;
}

case 2 :
{
$marque= $data[$c];
break;
}

case 3 :
{
$nom = $data[$c];
break;
}

case 4 :
{
$pdfproduit= $data[$c];
break;
}

case 5 :
{
$commprod = $data[$c];
break;
}
}
 }
?
/table
/body
/html






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




Re: [PHP] Newbie Question

2002-04-08 Thread Miguel Cruz

$fp = fopen($filename, 'r');
while ($l = fgets($fp, 1000))
{
  list ($parts, $vignette, $marque, $nom, $pdfproduit, $commprod) = 
explode (';', $l);
  // now use the data
  print p$parts/p; // or whatever
}
fclose ($fp);

On Mon, 8 Apr 2002, Hubert DAUL wrote:

 
 Hi ,
 
 Here's my problem :
 
 I read a data file (no sql file) which contains 8 lines, and in each line, 8
 datas
 
 (ex: name1;picture1;title1;anything1;everything1;nothing1)
 
 and when i run it I see only one picture(the second data) and not all of
 them
 
 If someone could help me
 
 TYA
 
 Here the code :
 
 html
 head
 titleSolid/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head
 
 body bgcolor=#FF text=#00
 table width=384 border=1
 
 ?php
  $row = 1;
  $fp = fopen (album.dat,r);
   while ($data = fgetcsv ($fp, 1000, ;))
   {
 $num = count ($data);
 
 $row++;
 
 if (isset($vignette))
 {
 print(tr);
 print(td$vignette/td);
// I think it's wrong here but I dont know why
 ==   print(tdimg src=\images/$photo\a href =
 \prod.php?file=lecteur.dat\/a/td);
 print(td$marque/td);
 print(td$nom/td);
 print(td$pdfproduit/td);
 print(td$commprod/td);
 print(/tr);
 }
 
 
 for ($c=0; $c$num; $c++)
 switch ($c)  {
 case 0 :
 {
 $vignette = $data[$c];
 break;
 }
 
 case 1 :
 {
 $photo= $data[$c];
 break;
 }
 
 case 2 :
 {
 $marque= $data[$c];
 break;
 }
 
 case 3 :
 {
 $nom = $data[$c];
 break;
 }
 
 case 4 :
 {
 $pdfproduit= $data[$c];
 break;
 }
 
 case 5 :
 {
 $commprod = $data[$c];
 break;
 }
 }
  }
 ?
 /table
 /body
 /html
 
 
 
 
 
 
 


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




[PHP] Copying Directory

2002-04-08 Thread Hiroshi Ayukawa

Hello,

I guess anyone have made the function to coppy directories, not files.
I'd like to copy directory including sub directories to other place.
Doesn't anyone has mades that kind of function?And please telll me.

  Thamks in advance.
  HiroshiAyukawa
  http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top


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




[PHP] Adding a in try.jpg!

2002-04-08 Thread Thomas Edison Jr.

I have a new very intriguing problem at hand. 

I have the name of my Images stored in my mySQL
database in one column. Now when i pick the images,
they are displayed as it as. However, they are the big
images, and the thumbnails of those images are stored
with an a at the end of thier names. 
That is, 
If the image is try.jpg , the thumbnail of the image
is trya.jpg !!
Now i want to display the thumbnail and not the large
image. And unfortunately, my whole database contains
the name of Large images and NOt the Thumbnails.

How can i :
1. Insert a at the end of the name of the image,
before the .extension through PHP. 
The problems are that the names are stored in the
database WITH the extesion. And the extensions also
vary, some are JPG and some are GIF. So in my datase i
have images as try.jpg or something.gif! How can i
insert an a at the end of the name before the . ?

2. OR.. can i insert the a before the . in the
image name in my mySQL database itself. 

Either of the two solutions can work for me. 

Thanks,
T. Edison Jr.

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP] Adding a in try.jpg!

2002-04-08 Thread Miguel Cruz

(untested)

  $newname = eregi_replace('\.jpg$', 'a.jpg', $oldname);

No point messing up your database; just use something like the above when 
you're outputting the image tags for the thumbnails.

miguel

On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:

 I have a new very intriguing problem at hand. 
 
 I have the name of my Images stored in my mySQL
 database in one column. Now when i pick the images,
 they are displayed as it as. However, they are the big
 images, and the thumbnails of those images are stored
 with an a at the end of thier names. 
 That is, 
 If the image is try.jpg , the thumbnail of the image
 is trya.jpg !!
 Now i want to display the thumbnail and not the large
 image. And unfortunately, my whole database contains
 the name of Large images and NOt the Thumbnails.
 
 How can i :
 1. Insert a at the end of the name of the image,
 before the .extension through PHP. 
 The problems are that the names are stored in the
 database WITH the extesion. And the extensions also
 vary, some are JPG and some are GIF. So in my datase i
 have images as try.jpg or something.gif! How can i
 insert an a at the end of the name before the . ?
 
 2. OR.. can i insert the a before the . in the
 image name in my mySQL database itself. 
 
 Either of the two solutions can work for me. 
 
 Thanks,
 T. Edison Jr.
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 
 


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




Re: [PHP] Adding a in try.jpg!

2002-04-08 Thread Billy S Halsey

$parts = preg_split('/\./', $filename);
$new_filename = $parts[0] . a.jpg;

(Not tested, but _should_ work.)

/bsh/

Thomas Edison Jr. wrote:
 I have a new very intriguing problem at hand. 
 
 I have the name of my Images stored in my mySQL
 database in one column. Now when i pick the images,
 they are displayed as it as. However, they are the big
 images, and the thumbnails of those images are stored
 with an a at the end of thier names. 
 That is, 
 If the image is try.jpg , the thumbnail of the image
 is trya.jpg !!
 Now i want to display the thumbnail and not the large
 image. And unfortunately, my whole database contains
 the name of Large images and NOt the Thumbnails.
 
 How can i :
 1. Insert a at the end of the name of the image,
 before the .extension through PHP. 
 The problems are that the names are stored in the
 database WITH the extesion. And the extensions also
 vary, some are JPG and some are GIF. So in my datase i
 have images as try.jpg or something.gif! How can i
 insert an a at the end of the name before the . ?
 
 2. OR.. can i insert the a before the . in the
 image name in my mySQL database itself. 
 
 Either of the two solutions can work for me. 
 
 Thanks,
 T. Edison Jr.
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 


-- 


/-=[ BILLY S HALSEY ]=--\
| Member of Technical Staff, Sun Microsystems, Inc. ESP Solaris SW  |
| All opinions and technical advice offered in this message are my |
| own and not necessarily endorsed by my employer. |
\--=[ [EMAIL PROTECTED] ]=/


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




Re: [PHP] Adding a in try.jpg!

2002-04-08 Thread Jason Wong

On Monday 08 April 2002 15:41, Thomas Edison Jr. wrote:

 How can i :
 1. Insert a at the end of the name of the image,
 before the .extension through PHP.
 The problems are that the names are stored in the
 database WITH the extesion. And the extensions also
 vary, some are JPG and some are GIF. So in my datase i
 have images as try.jpg or something.gif! How can i
 insert an a at the end of the name before the . ?

 2. OR.. can i insert the a before the . in the
 image name in my mySQL database itself.

Loads of ways to do it. Here's one:

explode() the file name on . then concatenate an a onto the second from 
last element, then implode().


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Don't worry.  Life's too long.
-- Vincent Sardi, Jr.
*/

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




[PHP] Re: Copying Directory

2002-04-08 Thread Michael Virnstein

#
#
# boolean copy_dirs ( string src_dir, string target_dir )
#
#
#  copy  shopdirectories into a new shop
#
# Function Parameters:
#   string src_dir: source directory
#   string target_dir: target directory
#
# Return Values:
#   0 - error while copying
#   1 - files copied successfully
#
function copy_dirs ( $src_dir, $target_dir ) {

$src_dir = ereg_replace ( /$, , $src_dir );
$target_dir = ereg_replace ( /$, , $target_dir );

if ( filetype ( $src_dir ) != dir ):
return (0);
endif;

if ( !file_exists ( $target_dir ) ):
mkdir ( $target_dir, 0777 );
endif;

$hdl = opendir ( $src_dir );

while ( ( $file = readdir ( $hdl ) ) !== false ):

if ( $file != .  $file != ..  $file !=  ):

if ( filetype ( $src_dir./.$file) == dir ):
if ( filetype ( $src_dir./.$file) == dir ):

if ( !copy_dirs ( $src_dir./.$file,
$target_dir./.$file ) ):
return (0);
endif;
else:

if ( !copy ( $src_dir./.$file, $target_dir./.$file ) ):
return (0);
endif;
endif;

endwhile;

return (1);

}
Hiroshi Ayukawa [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I guess anyone have made the function to coppy directories, not files.
 I'd like to copy directory including sub directories to other place.
 Doesn't anyone has mades that kind of function?And please telll me.

   Thamks in advance.
   HiroshiAyukawa
   http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top




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




[PHP] Re: Copying Directory

2002-04-08 Thread Michael Virnstein

there was a typo...this one should work

#
#
# boolean copy_dirs ( string src_dir, string target_dir )
#
#
#  copy  a directory with subdirectories to a target directory
#
# Function Parameters:
#   string src_dir: source directory
#   string target_dir: target directory
#
# Return Values:
#   0 - error while copying
#   1 - files copied successfully
#
function copy_dirs ( $src_dir, $target_dir ) {

$src_dir = ereg_replace ( /$, , $src_dir );
$target_dir = ereg_replace ( /$, , $target_dir );

if ( filetype ( $src_dir ) != dir ):
return (0);
endif;

if ( !file_exists ( $target_dir ) ):
mkdir ( $target_dir, 0777 );
endif;

$hdl = opendir ( $src_dir );

while ( ( $file = readdir ( $hdl ) ) !== false ):

if ( $file != .  $file != ..  $file !=  ):

if ( filetype ( $src_dir./.$file) == dir ):

if ( !copy_dirs ( $src_dir./.$file,
$target_dir./.$file ) ):
return (0);
endif;
else:

if ( !copy ( $src_dir./.$file, $target_dir./.$file ) ):
return (0);
endif;
endif;

endwhile;

return (1);

}
 Hiroshi Ayukawa [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  I guess anyone have made the function to coppy directories, not files.
  I'd like to copy directory including sub directories to other place.
  Doesn't anyone has mades that kind of function?And please telll me.
 
Thamks in advance.
HiroshiAyukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top
 





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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Thomas Edison Jr.

Hi,

Thanks for your relies. There are a couple of
problems. Firstly, i'm picking the filename from the
database, so my code is something like this :

if ($myrow = mysql_fetch_array($result)) {
  do {
  echo(
img src=\images\\$myrow[ilmage]\
   );
  } while ($myrow = mysql_fetch_array($result));
} 


Now the filename is actually stored in $myrow[ilmage]
How do i perform the spliting  adding functions on
$myrow[ilmage] ??
Secondly, all images are not .JPG, some are jpg 
others are gif !!!

Thank you.. 
T. Edison Jr.  
--- Miguel Cruz [EMAIL PROTECTED] wrote:
 (untested)
 
   $newname = eregi_replace('\.jpg$', 'a.jpg',
 $oldname);
 
 No point messing up your database; just use
 something like the above when 
 you're outputting the image tags for the thumbnails.
 
 miguel
 
 On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
 
  I have a new very intriguing problem at hand. 
  
  I have the name of my Images stored in my mySQL
  database in one column. Now when i pick the
 images,
  they are displayed as it as. However, they are the
 big
  images, and the thumbnails of those images are
 stored
  with an a at the end of thier names. 
  That is, 
  If the image is try.jpg , the thumbnail of the
 image
  is trya.jpg !!
  Now i want to display the thumbnail and not the
 large
  image. And unfortunately, my whole database
 contains
  the name of Large images and NOt the Thumbnails.
  
  How can i :
  1. Insert a at the end of the name of the image,
  before the .extension through PHP. 
  The problems are that the names are stored in the
  database WITH the extesion. And the extensions
 also
  vary, some are JPG and some are GIF. So in my
 datase i
  have images as try.jpg or something.gif! How
 can i
  insert an a at the end of the name before the
 . ?
  
  2. OR.. can i insert the a before the . in the
  image name in my mySQL database itself. 
  
  Either of the two solutions can work for me. 
  
  Thanks,
  T. Edison Jr.
  
  __
  Do You Yahoo!?
  Yahoo! Tax Center - online filing with TurboTax
  http://taxes.yahoo.com/
  
  
 


=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




[PHP] Re: PHP from HTML

2002-04-08 Thread Matjaz Prtenjak

THANKS!

That works!!

Except on PHP side I have to produce javascript code without script tag,
like

xTest.php - SERVER1 with PHP
document.write(?php echo(\This WORKS!!!\); ?);

on server 2 I just have to write this inside script tag, like

HTML file on SERVER2 WITHOUT PHP
html
body
script src=...server1.../test.php/script
/body
/html

Thanks again!
Have a nice day
Matjaz Prtenjak

 One more compatible workaround would be to have your PHP return
 JavaScript:

 script lang=javascript1.1
 document.write(Hello from Server1);
 /script

 In the HTML page on server2:

 script src=http://server1/xTest.php;/script

 Chris



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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Miguel Cruz

$thumbnail = eregi_replace('\.jpg$', 'a.jpg', $myrow['ilmage']);
$thumbnail = eregi_replace('\.gif$', 'a.gif', $thumbnail);

It's no problem to do it twice in a row; it'll pick up one or the other.

miguel



On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:

 Hi,
 
 Thanks for your relies. There are a couple of
 problems. Firstly, i'm picking the filename from the
 database, so my code is something like this :
 
 if ($myrow = mysql_fetch_array($result)) {
   do {
   echo(
 img src=\images\\$myrow[ilmage]\
);
   } while ($myrow = mysql_fetch_array($result));
 } 
 
 
 Now the filename is actually stored in $myrow[ilmage]
 How do i perform the spliting  adding functions on
 $myrow[ilmage] ??
 Secondly, all images are not .JPG, some are jpg 
 others are gif !!!
 
 Thank you.. 
 T. Edison Jr.  
 --- Miguel Cruz [EMAIL PROTECTED] wrote:
  (untested)
  
$newname = eregi_replace('\.jpg$', 'a.jpg',
  $oldname);
  
  No point messing up your database; just use
  something like the above when 
  you're outputting the image tags for the thumbnails.
  
  miguel
  
  On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
  
   I have a new very intriguing problem at hand. 
   
   I have the name of my Images stored in my mySQL
   database in one column. Now when i pick the
  images,
   they are displayed as it as. However, they are the
  big
   images, and the thumbnails of those images are
  stored
   with an a at the end of thier names. 
   That is, 
   If the image is try.jpg , the thumbnail of the
  image
   is trya.jpg !!
   Now i want to display the thumbnail and not the
  large
   image. And unfortunately, my whole database
  contains
   the name of Large images and NOt the Thumbnails.
   
   How can i :
   1. Insert a at the end of the name of the image,
   before the .extension through PHP. 
   The problems are that the names are stored in the
   database WITH the extesion. And the extensions
  also
   vary, some are JPG and some are GIF. So in my
  datase i
   have images as try.jpg or something.gif! How
  can i
   insert an a at the end of the name before the
  . ?
   
   2. OR.. can i insert the a before the . in the
   image name in my mySQL database itself. 
   
   Either of the two solutions can work for me. 
   
   Thanks,
   T. Edison Jr.
   
   __
   Do You Yahoo!?
   Yahoo! Tax Center - online filing with TurboTax
   http://taxes.yahoo.com/
   
   
  
 
 
 =
 Rahul S. Johari (Director)
 **
 Abraxas Technologies Inc.
 Homepage : http://www.abraxastech.com
 Email : [EMAIL PROTECTED]
 Tel : 91-4546512/4522124
 ***
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 
 


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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Richard Baskett

Do the explode and implodes like that one fellow mentioned.

So basically:

while ($myrow = mysql_fetch_array($result)) {
  $img = explode('.',$myrow[ilmage]);
  echo img src=\images/{$img[0]}a$img[1]\br /
}

What this will do is take your image split the image at the '.' then echo it
with the 'a'.. Hope it helps!

Rick

Be kind. Everyone you meet is fighting a hard battle - John Watson

 From: Thomas Edison Jr. [EMAIL PROTECTED]
 Date: Mon, 8 Apr 2002 01:17:51 -0700 (PDT)
 To: Miguel Cruz [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Adding a in try.jpg! Problems!
 
 Hi,
 
 Thanks for your relies. There are a couple of
 problems. Firstly, i'm picking the filename from the
 database, so my code is something like this :
 
 if ($myrow = mysql_fetch_array($result)) {
 do {
 echo(
 img src=\images\\$myrow[ilmage]\
  );
 } while ($myrow = mysql_fetch_array($result));
 } 
 
 
 Now the filename is actually stored in $myrow[ilmage]
 How do i perform the spliting  adding functions on
 $myrow[ilmage] ??
 Secondly, all images are not .JPG, some are jpg 
 others are gif !!!
 
 Thank you.. 
 T. Edison Jr.  
 --- Miguel Cruz [EMAIL PROTECTED] wrote:
 (untested)
 
   $newname = eregi_replace('\.jpg$', 'a.jpg',
 $oldname);
 
 No point messing up your database; just use
 something like the above when
 you're outputting the image tags for the thumbnails.
 
 miguel
 
 On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
 
 I have a new very intriguing problem at hand.
 
 I have the name of my Images stored in my mySQL
 database in one column. Now when i pick the
 images,
 they are displayed as it as. However, they are the
 big
 images, and the thumbnails of those images are
 stored
 with an a at the end of thier names.
 That is, 
 If the image is try.jpg , the thumbnail of the
 image
 is trya.jpg !!
 Now i want to display the thumbnail and not the
 large
 image. And unfortunately, my whole database
 contains
 the name of Large images and NOt the Thumbnails.
 
 How can i :
 1. Insert a at the end of the name of the image,
 before the .extension through PHP.
 The problems are that the names are stored in the
 database WITH the extesion. And the extensions
 also
 vary, some are JPG and some are GIF. So in my
 datase i
 have images as try.jpg or something.gif! How
 can i
 insert an a at the end of the name before the
 . ?
 
 2. OR.. can i insert the a before the . in the
 image name in my mySQL database itself.
 
 Either of the two solutions can work for me.
 
 Thanks,
 T. Edison Jr.
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/
 
 
 
 
 
 =
 Rahul S. Johari (Director)
 **
 Abraxas Technologies Inc.
 Homepage : http://www.abraxastech.com
 Email : [EMAIL PROTECTED]
 Tel : 91-4546512/4522124
 ***
 
 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.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] Adding a in try.jpg! SOLVED!!

2002-04-08 Thread Thomas Edison Jr.

Hi,

Thanks.. actually that problem is solved, this is what
i used :

$myrow[ilmage] = eregi_replace('\.jpg$', 'a.jpg',
$myrow[ilmage]);
  $myrow[ilmage] = eregi_replace('\.gif$', 'a.gif',
$myrow[ilmage]);

and it's now showing the small images with the a!! 

Thanks AGAIN!
T. Edison Jr.



--- Miguel Cruz [EMAIL PROTECTED] wrote:
 (untested)
 
   $newname = eregi_replace('\.jpg$', 'a.jpg',
 $oldname);
 
 No point messing up your database; just use
 something like the above when 
 you're outputting the image tags for the thumbnails.
 
 miguel
 
 On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
 
  I have a new very intriguing problem at hand. 
  
  I have the name of my Images stored in my mySQL
  database in one column. Now when i pick the
 images,
  they are displayed as it as. However, they are the
 big
  images, and the thumbnails of those images are
 stored
  with an a at the end of thier names. 
  That is, 
  If the image is try.jpg , the thumbnail of the
 image
  is trya.jpg !!
  Now i want to display the thumbnail and not the
 large
  image. And unfortunately, my whole database
 contains
  the name of Large images and NOt the Thumbnails.
  
  How can i :
  1. Insert a at the end of the name of the image,
  before the .extension through PHP. 
  The problems are that the names are stored in the
  database WITH the extesion. And the extensions
 also
  vary, some are JPG and some are GIF. So in my
 datase i
  have images as try.jpg or something.gif! How
 can i
  insert an a at the end of the name before the
 . ?
  
  2. OR.. can i insert the a before the . in the
  image name in my mySQL database itself. 
  
  Either of the two solutions can work for me. 
  
  Thanks,
  T. Edison Jr.
  
  __
  Do You Yahoo!?
  Yahoo! Tax Center - online filing with TurboTax
  http://taxes.yahoo.com/
  
  
 


=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




[PHP] difficulty in solving the unknown warning

2002-04-08 Thread erich

 i am a php programmer whose learning expr. is about 2 months. whatever
 running script of php that written by other php programmer or me, i
 always see the warning below shown, why this occurs? how to avoid?

 Warning: Undefined variable: HTTP_VIA in
 g:\wwwroot\phpformmail\formmail.php on line 111




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




[PHP] Sendmail 8.10.2 headers

2002-04-08 Thread Anthony Rodriguez

As you may know, headers included in the 4th argument of PHP's mail() are 
sent to the outgoing mail server.

What header(s) can I send to sendmail 8.10.2 (running under Linux Redhat 
6.2) in order for invalid e-mails be returned to my e-mail address rather 
than my hosting provider's default address?

Thank you!

Tony Rodriguez
([EMAIL PROTECTED])



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




[PHP] sessions and passing variables

2002-04-08 Thread rarmin

Is there a way to pass variables (objects) across the different 
sessions. I thought of sharing one object for all users that access my 
web site (it's an object that does some operations with files common to 
all users, like reading and writing). Any ideas?

Tnx in advance.
Armin


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




Re: [PHP] Re: Copying Directory

2002-04-08 Thread Hiroshi Ayukawa

Sorry,
It didn't work.Mine too.
ALL of the files inside the deeoer directory come to top of the 
directory.
I'll go on trying .
Thanks.

By the way , your script looks like Python script , dont'you?

Hiroshi AYukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top

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




Re: [PHP] Sendmail 8.10.2 headers

2002-04-08 Thread Jason Wong

On Monday 08 April 2002 15:44, Anthony Rodriguez wrote:
 As you may know, headers included in the 4th argument of PHP's mail() are
 sent to the outgoing mail server.

 What header(s) can I send to sendmail 8.10.2 (running under Linux Redhat
 6.2) in order for invalid e-mails be returned to my e-mail address rather
 than my hosting provider's default address?

Return-Path: [EMAIL PROTECTED]\r\n;


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Pound for pound, the amoeba is the most vicious animal on earth.
*/

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




Re: [PHP] Re: Copying Directory

2002-04-08 Thread Jason Wong

On Monday 08 April 2002 17:04, Hiroshi Ayukawa wrote:
 Sorry,
 It didn't work.Mine too.
 ALL of the files inside the deeoer directory come to top of the
 directory.
 I'll go on trying .
 Thanks.

 By the way , your script looks like Python script , dont'you?

Probably the easiest way is to some system functions. If you're on some *nix 
system use cp, if on windows use xcopy.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Think sideways!
-- Ed De Bono
*/

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




Re: [PHP] Emulating a browser, parse cookies with PHP

2002-04-08 Thread heinisch

At 07.04.2002  16:22, you wrote:

Hi, I'm trying to make a PHP script that would go in a website and log in. 
The website uses cookie to authenticate with its services. I made HTTP GET 
requests using fsockopen and parsed the results back into a variable. 
However I cannot find the cookie info(Set-cookie) in the returned content. 
Is there special commands I have to send with the GET request in order for 
the server to send back cookies? Or am I just doing this all wrong?

Any help will be appreciated!
Lokk at sourceforge.net, look for 'snoopy', that´s what makes everything 
you need
Oliver


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




Re: [PHP] Re: Copying Directory

2002-04-08 Thread Hiroshi Ayukawa

Thanks,
 But I can  try it ,cause I like PHP and I want to write a code tahat 
runs anyware.
 Actually, we use both *nix  windows.
 
I will announce if I could madde it.

Regards,
Hiroshi
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top

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




Re: [PHP] Workaround for no cron?

2002-04-08 Thread gaouzief


hi

you should try this free service http://www.webcron.org it is really great (supports 
authentication, stores resulting file...) and free, 
the site is in french though !


Regards
_
Hassan El Forkani
http://WarmAfrica.com EveryOne's Africa
_


08/04/2002 04:15:01, Steve Werby [EMAIL PROTECTED] a écrit:

Leif K-Brooks [EMAIL PROTECTED] wrote:
 I have to wait for my host to compile php as binary for cron to work with
 php, and a lot of things on my site depend on cron.

It's not my favorite solution from a security standpoint, but you could call
the PHP scripts from cron using wget or lynx.  wget even supports HTTP
authentication and I *think* lynx does as well so you can password protect
the scripts using .htaccess.  And I'm assuming you have cron access since if
you don't, having your host install PHP as a CGI won't cure that.  g

 Does anyone have some
 sort of code that I could put at the top of all my pages so when they get
 visited, it checks to see if a script has been executed yet this time
 petiod, and if not yet, it does?

Better to teach a man to fish...?  Either create a db entry or text file
entry with the timestamp of the last run of the scheduled script and have
your calling scripts check the timestamp to see if it's time to run.

 Or any type of workaround for not having
 cron?  Thanks!

You just need access to a machine (can even be a Windows desktop) which can
launch a URL at a specified time or you just need someone who can do the
same via a cron job on one of their boxes.  Hope that helps.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.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




[PHP] Re: Newbie Question

2002-04-08 Thread Michael Virnstein

try this:

html
head
titleSolid/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body bgcolor=#FF text=#00
table width=384 border=1

?php
 $fp = fopen (album.dat,r);
 while ($data = fgetcsv ($fp, 1000, ;))
 {
if (isset($data[0]))
{
print(tr);
print(td.$data[0]./td);
print(tdimg src=\images/.$data[1].\a href
=\prod.php?file=lecteur.dat\/a/td);
print(td.$data[2]./td);
print(td.$data[3]./td);
print(td.$data[4]./td);
print(td.$data[5]./td);
print(/tr);
}
 }
?
/table
/body
/html


Hubert Daul [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


 Hi ,

 Here's my problem :

 I read a data file (no sql file) which contains 8 lines, and in each line,
8
 datas

 (ex: name1;picture1;title1;anything1;everything1;nothing1)

 and when i run it I see only one picture(the second data) and not all of
 them

 If someone could help me

 TYA

 Here the code :

 html
 head
 titleSolid/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head

 body bgcolor=#FF text=#00
 table width=384 border=1

 ?php
  $row = 1;
  $fp = fopen (album.dat,r);
   while ($data = fgetcsv ($fp, 1000, ;))
   {
 $num = count ($data);

 $row++;

 if (isset($vignette))
 {
 print(tr);
 print(td$vignette/td);
// I think it's wrong here but I dont know why
 ==   print(tdimg src=\images/$photo\a href =
 \prod.php?file=lecteur.dat\/a/td);
 print(td$marque/td);
 print(td$nom/td);
 print(td$pdfproduit/td);
 print(td$commprod/td);
 print(/tr);
 }


 for ($c=0; $c$num; $c++)
 switch ($c)  {
 case 0 :
 {
 $vignette = $data[$c];
 break;
 }

 case 1 :
 {
 $photo= $data[$c];
 break;
 }

 case 2 :
 {
 $marque= $data[$c];
 break;
 }

 case 3 :
 {
 $nom = $data[$c];
 break;
 }

 case 4 :
 {
 $pdfproduit= $data[$c];
 break;
 }

 case 5 :
 {
 $commprod = $data[$c];
 break;
 }
 }
  }
 ?
 /table
 /body
 /html








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




php-general Digest 8 Apr 2002 09:42:24 -0000 Issue 1274

2002-04-08 Thread php-general-digest-help


php-general Digest 8 Apr 2002 09:42:24 - Issue 1274

Topics (messages 91954 through 92015):

Re: Test for one bit set?
91954 by: bvr
91955 by: Lars Torben Wilson
91956 by: Charlie Killian

Disabling bars on Browser
91957 by: David Johansen
91958 by: phplists.woodenpickle.com
91960 by: David Johansen
91962 by: phplists.woodenpickle.com
91973 by: Justin French
91976 by: Leif K-Brooks
91980 by: phplists.woodenpickle.com
91983 by: Justin French
91984 by: Justin French
91988 by: Jason Wong

Re: how to sort by value in associative array
91959 by: Chris Adams

Test for whole number.
91961 by: Charlie Killian
91963 by: Charlie Killian
91970 by: Tom Rogers
91971 by: Miguel Cruz

Function that escapes special caracters from regular expressions
91964 by: Leif K-Brooks
91965 by: Charlie Killian
91966 by: Matt Friedman
91968 by: CC Zona

Emulating a browser, parse cookies with PHP
91967 by: DRaGoNLz
92012 by: heinisch.creaction.de

Re: - REPOST - Flock manual clarification please  ;-)
91969 by: Matt Friedman
91972 by: Jim Winstead
91982 by: Matt Friedman

xml-rpc for windows?
91974 by: dietrich
91977 by: Tyler Longren
91981 by: dietrich

Workaround for no cron?
91975 by: Leif K-Brooks
91986 by: Steve Werby
92014 by: gaouzief

asking about .exe file
91978 by: wong
91979 by: Martin Towell

Re: Phone number validation
91985 by: Timothy J. Luoma

Re: PHP from HTML
91987 by: Matja¾ Prtenjak
91989 by: Chris Adams
92002 by: Matja¾ Prtenjak

mod_php4
91990 by: javier

asking about exe file
91991 by: wong

Newbie Question
91992 by: Hubert DAUL
91993 by: Miguel Cruz
92015 by: Michael Virnstein

Copying Directory
91994 by: Hiroshi Ayukawa
91999 by: Michael Virnstein
92000 by: Michael Virnstein
92009 by: Hiroshi Ayukawa
92011 by: Jason Wong
92013 by: Hiroshi Ayukawa

Adding a in try.jpg!
91995 by: Thomas Edison Jr.
91996 by: Miguel Cruz
91997 by: Billy S Halsey
91998 by: Jason Wong

Re: Adding a in try.jpg! Problems!
92001 by: Thomas Edison Jr.
92003 by: Miguel Cruz
92004 by: Richard Baskett

Re: Adding a in try.jpg! SOLVED!!
92005 by: Thomas Edison Jr.

difficulty in solving the unknown warning
92006 by: erich

Sendmail 8.10.2 headers
92007 by: Anthony Rodriguez
92010 by: Jason Wong

sessions and passing variables
92008 by: rarmin

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


This shows all integers from 1 to 10 that have the 2 least significant 
bits set:

?php

   for ($i = 1; $i = 10; $i++) 
   {
  if ($i  3)
  {
 echo($i . \n);
  }
   }
?

bvr.

Charlie Killian wrote:

How can I test if a number only has on bit set?

So testing different numbers will return TRUE or FALSE:

testing 0001 would return TRUE.
testing 0011 would return FALSE.

TIA

Charlie








---End Message---
---BeginMessage---

On Sun, 2002-04-07 at 13:38, Charlie Killian wrote:
 How can I test if a number only has on bit set?
 
 So testing different numbers will return TRUE or FALSE:
 
 testing 0001 would return TRUE.
 testing 0011 would return FALSE.
 
 TIA
 
 Charlie

AND them bitwise:

?php
error_reporting(E_ALL);

$bit = 16;

$foo = bindec('0001');
$bar = bindec('0011');

echo $foo; $bar\n;

if ($foo  $bit)
{
echo Bit 5 is set.\n;
}
else 
{
echo Bit 5 is not set.\n;
}

if ($bar  $bit)
{
echo Bit 5 is set.\n;
}
else 
{
echo Bit 5 is not set.\n;
}

?


Torben

-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


---End Message---
---BeginMessage---

Thanks to all those that replied. Especially Torben. (What have you been up
to?)

Miguel's solution works great.

Check out the example below:

?php
function isOneBitSet($n)
{
$x = log($n)/log(2);
return ($x == intval($x));
}

for ($i = 0; $i  32769; ++$i) {
  if(isOneBitSet($i)) {
  print($i, );
  }
}

?

Prints out:
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768,

Just what I wanted.

Thanks again,

Charlie


  How can I test if a number only has on bit set?
 
  So testing different numbers will return TRUE or FALSE:
 
  testing 0001 would return TRUE.
  testing 0011 would return FALSE.

 Think back to math class when you were 14!

   function isOneBitSet($n)
  

[PHP] $php_self doesnt work in netscape like it should!

2002-04-08 Thread Maris Kalnins

Hi guys!

$php_self and $php_referrer doesnt work the same in IE and Netscape

When opening a page with
IE they return for example http://localhost/directroy/index.php
but in Netscape Navigator - http://localhost/directory/

Why?
And how to solve this problem?

Thanks




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




[PHP] Expire Session Date Older than Me!

2002-04-08 Thread Anatole

I'm having trouble with the Expire date - It's being set at sometime before
I was born. Any idea on how to fix this?

HTTP/1.1 200 OK
Date: Mon, 08 Apr 2002 10:07:31 GMT
Server: Apache/1.3.22 (Unix) PHP/4.1.2
X-Powered-By: PHP/4.1.2
Set-Cookie: sess=6fc0c08e2030124a8518aa5eeff034d3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Fri, 30 Nov 2001 04:33:06 GMT
Connection: close
Content-Type: text/html




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




[PHP] Question

2002-04-08 Thread Roman Duriancik

How to convert or discover from IPadress country visitors on my web ?

roman


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




[PHP] Re: some kind of library loader

2002-04-08 Thread Arpad Tamas

Hi Eric (and others who might help),

Actually I haven't tried the custom error handler for function or 
class definiton not found errors because I read in the manual that 
the processing is continued after the statement where the error 
raised. I also thought of a little hacking in php's source, but I 
haven't got too much experience in c.
Your idea looks fine to me, but I have one question. How do you 
determine in the precompiler that which functions or classes are 
really needed?
On our system it highly depends on the actual run. The template 
parser parses the template file, finds our special tags, and creates 
the appropriate objects to get the data for the tags from them. These 
tags and classes are nested in each other. Now while I'm writing this 
I have a new idea. I don't know if it will suit your needs (nor mine 
yet), just a quick thought.
Each template classes (which gives about 50% of the whole code) are 
derived from one main template class (it does the hard work).
The main problem is that there are many object creations in all over 
the code, and they depend on the actual class or template tag.
So I'm trying to find a common part of the code, where I can handle 
the missing class definition errors, or just start over some part of 
the processing when an error occurs.
a template example might help to understand it better:
table ...
xarticle
  trtd ...
xtitleb{xtext}b/xtitle
  /tr/td
/xarticle
/table
The tags starting with x are our template tags (x... and {x...}), 
and each container tag (x./x..) has it's own handler class. 
In xarticle's handler object xtitle's handler is created, which 
will raise an error if there's no class definition yet.
If catching the class not found errors would work I could set a 
class not found error signal in a global variable, load the needed 
class in the error handler. After the error handler finished, I could 
check if the error signal is set in the mentioned common code and if 
it is I could roll back all the processing of xtitle and start it 
over this time with the already included class definition.
I can relatively easily find this common code, because of the 
ancestor main template class, what all other template classes extend.

Because of the many roll backs this most likely wouldn't be faster 
than the original code was. To make things faster I could store some 
kind of cache for all the template files with the previously needed 
classes (I can get it with get_defined_classes()). This would work 
because the needed classes are mainly depend on the template in our 
system (especialy the template classes). Next time when a page is 
requested with the same template, I could just read the cache and 
include all the previously needed classes.

So the sollution in general: find a common code where you can roll 
back to some point where the line that caused the error can be 
executed again.
I know my example was a little complicated, but I hope you can 
understand it. Let me know if something isn't clear.

But now I checked if I can catch the Cannot instantiate non-existent 
class error, and unfortunatelly not :((

For the developers of php: Is it hard to make this feature to work? I 
would really appreciate it, and would be very very happy :))

Thanks and greetings,
Arpi

 I have had a similar idea.  I also tried the custom error handler
 aproach and it didn't work here either.  I have set the project
 aside that I was thinking about it for but I do have some ideas
 that would help and may be able to contribute.  I wasn't even able
 to get php to call my custom error handler for function not found
 errors.  How did you do that?  Was there anything useful in the
 context argument?  My guess is that to get this aproach to work
 would require hacking the code to php itself but the hack wouldn't
 be very major.  However I do have an alternate plan that has been
 waiting for me to get around to building it is a simple parser that
 will read a php file and get the required functions and classes and
 then pre build a library file for just that page.  The parsing
 shouldn't be that dificult as all function calls begin with 'func('
 and for classes checking for 'new classname' or 'classname::' would
 give me a list of all items that need to be checked for.  Then
 simply build (from the source) a list of all builtin php functions
 and allow those and check for declarations of inline functions and
 classes while parsing and remove those.  That would leave a list of
 functions and classes that are external.  Then build a database of
 classes and functions either as a real database or simple an index
 of the files that contain each resource.  I don't think it would be
 too hard.  The next step would be to make a publicly available
 archive of functions and classes that fit into this index.  Or to
 build it into pear.

 Please keep in touch with me on this issue.  Feel free to email me
 off list if you want.

 Eric

-- 
PHP General Mailing List 

[PHP] Transfer Session Vars to different server

2002-04-08 Thread Chris

Hi,

I have two servers with Apache PHP - carrying out different tasks.

However, I have got a task that requires one application to use both
servers. One of the units holds a bunch of session vars - which I would like
to transfer to the other unit, when scripts on this second unit are called.

What is the best way to do this?

Clearly, I don't want to do this as a list of vars in the URL - some of the
vars are sensitive.

I would appreciate any comments.
Chris



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




[PHP] SELECT + PARSE ERROR

2002-04-08 Thread Jérome Moisy



Hy,

I try to do a SELECT but when I test my code I 
Have a parse error.
If someone can explain to me why.

Code:

$db = mysql_connect(newsmanga_db);$req = 
"SELECT * FROM dvds WHERE nomdvd='".$nom."".$i"' "; /// PARSE ERROR IN 
THIS LINE$res=mysql_query($req, $db);while ($ligne = mysql_fetch_object 
($res)) {print "font size='2' 
color='#FF'p align='center'";print 
"$ligne-resume/p/font/td/tr";}mysql_free_result 
($res);

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


[PHP] Re: Transfer Session Vars to different server

2002-04-08 Thread Markas

If you store your session vars in database, there will be no problem with
retrieving sessions vars...
You even can use native php4 functions for handling sessions, storing them
in DB...
Look in php manual for session_set_save_handler() function, or write your
completely own code for db sessions.


P.S. By the way, anyone knows, is there possible to get access to other
sessions' session variables, I mean to the variables, which are stored
during other sessions, for instance, in order to find out, how many user are
currently browsing my site. If I stored my sesss vars in DB, there wouldn't
be any problem with this, but I  store them using default php4 functions (in
tmp dir in files and so on)...








Chris [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have two servers with Apache PHP - carrying out different tasks.

 However, I have got a task that requires one application to use both
 servers. One of the units holds a bunch of session vars - which I would
like
 to transfer to the other unit, when scripts on this second unit are
called.

 What is the best way to do this?

 Clearly, I don't want to do this as a list of vars in the URL - some of
the
 vars are sensitive.

 I would appreciate any comments.
 Chris





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




Re: [PHP] SELECT + PARSE ERROR

2002-04-08 Thread Chris Kwasneski

At 02:23 PM 4/8/2002 +0200, you wrote:
Hy,

I try to do a SELECT but when I test my code I Have a parse error.
If someone can explain to me why.

Code:

$db = mysql_connect(newsmanga_db);
$req = SELECT * FROM dvds WHERE nomdvd='.$nom..$i' ;  /// PARSE 
ERROR IN THIS LINE

Your missing a '.' after the $i .

-Chris


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




Re: [PHP] SELECT + PARSE ERROR

2002-04-08 Thread RIVES Sergio

Hi

the error appears because of the comas erroned syntaxis.
why don't u try something easire as that :
$varalacon = $nom..$i; (i don't know if there is a space or not...in
bold)
$req = SELECT * FROM dvds WHERE nomdvd='$varalacon' ;

Hope it helps

SR


Jérome Moisy a écrit :

 Hy, I try to do a SELECT but when I test my code I Have a parse
 error.If someone can explain to me why. Code: $db =
 mysql_connect(newsmanga_db);
 $req = SELECT * FROM dvds WHERE nomdvd='.$nom..$i' ;  /// PARSE
 ERROR IN THIS LINE
 $res=mysql_query($req, $db);
 while ($ligne = mysql_fetch_object ($res)) {
 print font size='2' color='#FF'p align='center';
 print $ligne-resume/p/font/td/tr;
 }
 mysql_free_result ($res);


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




Re: [PHP] SELECT + PARSE ERROR

2002-04-08 Thread Nick Winfield

On Mon, 8 Apr 2002, [iso-8859-1] Jérome Moisy wrote:

 Hy,

 I try to do a SELECT but when I test my code I Have a parse error.
 If someone can explain to me why.

 Code:

 $db = mysql_connect(newsmanga_db);
 $req = SELECT * FROM dvds WHERE nomdvd='.$nom..$i' ;  /// PARSE ERROR IN THIS 
LINE
 $res=mysql_query($req, $db);
 while ($ligne = mysql_fetch_object ($res)) {
 print font size='2' color='#FF'p align='center';
 print $ligne-resume/p/font/td/tr;
 }
 mysql_free_result ($res);


First glance, put quotes around newsmanga_db.

$db = mysql_connect(newsmanga_db);

However, it doesn't look like you would establish a connection to the
database even if you fixed the syntax error.  Have a look at the PHP
manual in order to see the correct usage of this function.  The
username/password parameters are optional, but I have a feeling that
newsmanga_db is the name of your database, not the database server
(usually localhost).  You also need to select the database that you intend
to query.

http://www.php.net/manual/en/function.mysql-connect.php
http://www.php.net/manual/en/function.mysql-select-db.php

Personally, I'd use this code (going on what you have supplied and what I
believe to be true):

//---

mysql_connect(localhost, username, password);
mysql_select_db(newsmanga_db);

$req = SELECT * FROM dvds WHERE nomdvd = ' . $nom . $i . ';
$res = mysql_query($req);

while ($ligne = mysql_fetch_object($res))
{
  print trtd;
  print font size=\2\ color=\#FF\p align=\center\;
  print $ligne-resume . /p/font/td/tr;
}
mysql_free_result($res);

//---

Cheers,

Nick Winfield.


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




[PHP] Problems with libgd.so under linux

2002-04-08 Thread M Green

Php works in general (phpinfo()).
The gd-lib however will not work for some reason.
I tried
extension=libgd.so
in php.ini without any result.

Anyone familiar with this problem?

/M Green



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




Re: [PHP] Question

2002-04-08 Thread heinisch

At 08.04.2002  13:00, you wrote:

How to convert or discover from IPadress country visitors on my web ?

roman
You have to make a DNSLOOKUP
If you have a linux box (server setup) you can use
system(nslookup -timeout=3 -retry=1 .$value)
where $value is the IP-Number. This gives you the
real name of the server your client asked from.
the you have to extract the national-code, and got your
country, or org, mil, com

HTH Oliver


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




Re: [PHP] SELECT + PARSE ERROR

2002-04-08 Thread heinisch

At 08.04.2002  14:23, you wrote:
Hy,

I try to do a SELECT but when I test my code I Have a parse error.
If someone can explain to me why.

Code:

$db = mysql_connect(newsmanga_db);
$req = SELECT * FROM dvds WHERE nomdvd='.$nom..$i' ;  /// PARSE 
ERROR IN THIS LINE
Try this :
$req = SELECT * FROM dvds WHERE nomdvd='.$nom.$i.' ;
or if you want a space between $nom and $i, put it between the Quotes

$res=mysql_query($req, $db);
while ($ligne = mysql_fetch_object ($res)) {
 print font size='2' color='#FF'p align='center';
 print $ligne-resume/p/font/td/tr;
}
mysql_free_result ($res);
--
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] SELECT + PARSE ERROR

2002-04-08 Thread Jérome Moisy



Thanks at All


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


Re: [PHP] Transfer Session Vars to different server

2002-04-08 Thread heinisch

At 08.04.2002  13:12, you wrote:
Hi,

I have two servers with Apache PHP - carrying out different tasks.

However, I have got a task that requires one application to use both
servers. One of the units holds a bunch of session vars - which I would like
to transfer to the other unit, when scripts on this second unit are called.

What is the best way to do this?

Clearly, I don't want to do this as a list of vars in the URL - some of the
vars are sensitive.

I would appreciate any comments.
Chris
I hope both machines are linux, unix
the scp-command (secure copy) will be your friend. So you save your vars in 
a file,
scp this file from server1 to server2 and read the file, if it appears and
is the correct one, read it in your script on the server2.
To learn more about scp, see man scp
HTH Oliver


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




Re: [PHP] Question

2002-04-08 Thread Miguel Cruz

On Mon, 8 Apr 2002, Roman Duriancik wrote:
 How to convert or discover from IPadress country visitors on my web ?

You need to use the 'whois' protocol. I am sure you can find sample code
snippets around. First, look up the address at whois.arin.net. Then, if 
delegated to one of the regional registries (like RIPE or APNIC), look it 
up again there.

While this is the most effective way, keep in mind that you still can't 
determine with 100% certainty what country an IP address is in. 
Multinational corporations, large ISPs with their own international 
backbones, etc., will in many cases give you false results.

miguel


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




[PHP] Re: sessions and passing variables

2002-04-08 Thread Michael Virnstein

sure. if all users should have access to this instance of your object, then
you could store the serialized object in a file,
everyone has access to and unserialize it if needed.But don't forget to
include your object-surcecode
before unserializing the object, or you'll lose your methods. If users
should also have write access to the object,
you also have to make sure, that only one user can access the file for
writing at one time, or your data gets probably
screwed. The easiest way would be storing the object not in a file but in a
database, so you don't have to care about locking.

But do you really need the same instance of the object? why not simply
perform a $obj = new Class();


--
Code for Storing:
?php

$strData = serialize($data);

$fp = fopen(globalObjectData.inc, w);
fwrite($fp, $strData);
fclose($fp);

?

Code for accessing:

?php

// include object source before unserializing
include myObjectSrc.php;

$fp = fopen(globalObjectData.inc, w);
$strData = fread($fp, filesize(globalObjectData.inc));
fclose($fp);

// so we have our object back
$obj = unserialize($strData);







Rarmin [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a way to pass variables (objects) across the different
 sessions. I thought of sharing one object for all users that access my
 web site (it's an object that does some operations with files common to
 all users, like reading and writing). Any ideas?

 Tnx in advance.
 Armin




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




Re: [PHP] Problems with libgd.so under linux

2002-04-08 Thread heinisch

At 08.04.2002  14:56, you wrote:
Php works in general (phpinfo()).
The gd-lib however will not work for some reason.
I tried
extension=libgd.so
in php.ini without any result.

Anyone familiar with this problem?

/M Green
Too few arguments ;-)
Did you already compiled GD ?
Did you compile php with gd support?
Oliver


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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Michael Virnstein

$myrow[ilmage] = eregi_replace((\.[^\.]+)$, a\\1, $myrow[ilmage]);

and if ilmage isn't a constant use $myrow[ilmage].

Thomas Edison Jr. [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Thanks for your relies. There are a couple of
 problems. Firstly, i'm picking the filename from the
 database, so my code is something like this :

 if ($myrow = mysql_fetch_array($result)) {
   do {
   echo(
 img src=\images\\$myrow[ilmage]\
);
   } while ($myrow = mysql_fetch_array($result));
 }


 Now the filename is actually stored in $myrow[ilmage]
 How do i perform the spliting  adding functions on
 $myrow[ilmage] ??
 Secondly, all images are not .JPG, some are jpg 
 others are gif !!!

 Thank you..
 T. Edison Jr.
 --- Miguel Cruz [EMAIL PROTECTED] wrote:
  (untested)
 
$newname = eregi_replace('\.jpg$', 'a.jpg',
  $oldname);
 
  No point messing up your database; just use
  something like the above when
  you're outputting the image tags for the thumbnails.
 
  miguel
 
  On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
 
   I have a new very intriguing problem at hand.
  
   I have the name of my Images stored in my mySQL
   database in one column. Now when i pick the
  images,
   they are displayed as it as. However, they are the
  big
   images, and the thumbnails of those images are
  stored
   with an a at the end of thier names.
   That is,
   If the image is try.jpg , the thumbnail of the
  image
   is trya.jpg !!
   Now i want to display the thumbnail and not the
  large
   image. And unfortunately, my whole database
  contains
   the name of Large images and NOt the Thumbnails.
  
   How can i :
   1. Insert a at the end of the name of the image,
   before the .extension through PHP.
   The problems are that the names are stored in the
   database WITH the extesion. And the extensions
  also
   vary, some are JPG and some are GIF. So in my
  datase i
   have images as try.jpg or something.gif! How
  can i
   insert an a at the end of the name before the
  . ?
  
   2. OR.. can i insert the a before the . in the
   image name in my mySQL database itself.
  
   Either of the two solutions can work for me.
  
   Thanks,
   T. Edison Jr.
  
   __
   Do You Yahoo!?
   Yahoo! Tax Center - online filing with TurboTax
   http://taxes.yahoo.com/
  
  
 


 =
 Rahul S. Johari (Director)
 **
 Abraxas Technologies Inc.
 Homepage : http://www.abraxastech.com
 Email : [EMAIL PROTECTED]
 Tel : 91-4546512/4522124
 ***

 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/



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




Re: [PHP] MAC file upload

2002-04-08 Thread Erik Price


On Saturday, April 6, 2002, at 11:44  AM, Shane McBride wrote:

 Hello,

 I am able to upload and download Macintosh files but they seem to lose 
 their
 MIME type or extensions. I'm not sure what it is. I'm not a Mac dude.

 When you download the file It loses the file association. It's for a 
 company
 I do work for that uses a lot of .ai and .psd files.


 Any ideas on this?

You're possibly losing the resource fork of the files you are uploading, 
because the server is not an HFS+ filesystem.  To the best of my 
knowledge there is nothing you can do about this via PHP, but there are 
probably tricks (like AppleScript) that you could use as a workaround, 
such as encoding the files in some transport-friendly format before 
uploading and decoding them upon download.

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Michael Virnstein

but if
$myrow[ilmage] = hallo.hmm.gif; your code won't work.

so better:

while ($myrow = mysql_fetch_array($result)) {
  $img = explode('.',$myrow[ilmage]);
  $img[count($img) - 1] .= a;
  echo img src=\images/.implode('.', $img).\br /;
}



Richard Baskett [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Do the explode and implodes like that one fellow mentioned.

 So basically:

 while ($myrow = mysql_fetch_array($result)) {
   $img = explode('.',$myrow[ilmage]);
   echo img src=\images/{$img[0]}a$img[1]\br /
 }

 What this will do is take your image split the image at the '.' then echo
it
 with the 'a'.. Hope it helps!

 Rick

 Be kind. Everyone you meet is fighting a hard battle - John Watson

  From: Thomas Edison Jr. [EMAIL PROTECTED]
  Date: Mon, 8 Apr 2002 01:17:51 -0700 (PDT)
  To: Miguel Cruz [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Adding a in try.jpg! Problems!
 
  Hi,
 
  Thanks for your relies. There are a couple of
  problems. Firstly, i'm picking the filename from the
  database, so my code is something like this :
 
  if ($myrow = mysql_fetch_array($result)) {
  do {
  echo(
  img src=\images\\$myrow[ilmage]\
   );
  } while ($myrow = mysql_fetch_array($result));
  }
 
 
  Now the filename is actually stored in $myrow[ilmage]
  How do i perform the spliting  adding functions on
  $myrow[ilmage] ??
  Secondly, all images are not .JPG, some are jpg 
  others are gif !!!
 
  Thank you..
  T. Edison Jr.
  --- Miguel Cruz [EMAIL PROTECTED] wrote:
  (untested)
 
$newname = eregi_replace('\.jpg$', 'a.jpg',
  $oldname);
 
  No point messing up your database; just use
  something like the above when
  you're outputting the image tags for the thumbnails.
 
  miguel
 
  On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
 
  I have a new very intriguing problem at hand.
 
  I have the name of my Images stored in my mySQL
  database in one column. Now when i pick the
  images,
  they are displayed as it as. However, they are the
  big
  images, and the thumbnails of those images are
  stored
  with an a at the end of thier names.
  That is,
  If the image is try.jpg , the thumbnail of the
  image
  is trya.jpg !!
  Now i want to display the thumbnail and not the
  large
  image. And unfortunately, my whole database
  contains
  the name of Large images and NOt the Thumbnails.
 
  How can i :
  1. Insert a at the end of the name of the image,
  before the .extension through PHP.
  The problems are that the names are stored in the
  database WITH the extesion. And the extensions
  also
  vary, some are JPG and some are GIF. So in my
  datase i
  have images as try.jpg or something.gif! How
  can i
  insert an a at the end of the name before the
  . ?
 
  2. OR.. can i insert the a before the . in the
  image name in my mySQL database itself.
 
  Either of the two solutions can work for me.
 
  Thanks,
  T. Edison Jr.
 
  __
  Do You Yahoo!?
  Yahoo! Tax Center - online filing with TurboTax
  http://taxes.yahoo.com/
 
 
 
 
 
  =
  Rahul S. Johari (Director)
  **
  Abraxas Technologies Inc.
  Homepage : http://www.abraxastech.com
  Email : [EMAIL PROTECTED]
  Tel : 91-4546512/4522124
  ***
 
  __
  Do You Yahoo!?
  Yahoo! Tax Center - online filing with TurboTax
  http://taxes.yahoo.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] Question

2002-04-08 Thread gaouzief

this class does just that:
http://phpclasses.warmafrica.com/browse.html/package/514.html


08/04/2002 13:49:44, [EMAIL PROTECTED] a écrit:

At 08.04.2002  13:00, you wrote:

How to convert or discover from IPadress country visitors on my web ?

roman
You have to make a DNSLOOKUP
If you have a linux box (server setup) you can use
system(nslookup -timeout=3 -retry=1 .$value)
where $value is the IP-Number. This gives you the
real name of the server your client asked from.
the you have to extract the national-code, and got your
country, or org, mil, com

HTH Oliver


-- 
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] what's the best way to do redirect within PHP

2002-04-08 Thread Wo Chang

Dear All,

Another simple question:

What is the best way to do redirect after a
php file did some processing?

Any helps would be greatly appreciated!

--Wo


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




Re: [PHP] Adding a in try.jpg! Problems!

2002-04-08 Thread Michael Virnstein

typo..this one's right :)

while ($myrow = mysql_fetch_array($result)) {
   $img = explode('.',$myrow[ilmage]);
   $img[count($img) - 2] .= a;
   echo img src=\images/.implode('.', $img).\br /;
}

Michael Virnstein [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 but if
 $myrow[ilmage] = hallo.hmm.gif; your code won't work.

 so better:

 while ($myrow = mysql_fetch_array($result)) {
   $img = explode('.',$myrow[ilmage]);
   $img[count($img) - 1] .= a;
   echo img src=\images/.implode('.', $img).\br /;
 }



 Richard Baskett [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Do the explode and implodes like that one fellow mentioned.
 
  So basically:
 
  while ($myrow = mysql_fetch_array($result)) {
$img = explode('.',$myrow[ilmage]);
echo img src=\images/{$img[0]}a$img[1]\br /
  }
 
  What this will do is take your image split the image at the '.' then
echo
 it
  with the 'a'.. Hope it helps!
 
  Rick
 
  Be kind. Everyone you meet is fighting a hard battle - John Watson
 
   From: Thomas Edison Jr. [EMAIL PROTECTED]
   Date: Mon, 8 Apr 2002 01:17:51 -0700 (PDT)
   To: Miguel Cruz [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Subject: Re: [PHP] Adding a in try.jpg! Problems!
  
   Hi,
  
   Thanks for your relies. There are a couple of
   problems. Firstly, i'm picking the filename from the
   database, so my code is something like this :
  
   if ($myrow = mysql_fetch_array($result)) {
   do {
   echo(
   img src=\images\\$myrow[ilmage]\
);
   } while ($myrow = mysql_fetch_array($result));
   }
  
  
   Now the filename is actually stored in $myrow[ilmage]
   How do i perform the spliting  adding functions on
   $myrow[ilmage] ??
   Secondly, all images are not .JPG, some are jpg 
   others are gif !!!
  
   Thank you..
   T. Edison Jr.
   --- Miguel Cruz [EMAIL PROTECTED] wrote:
   (untested)
  
 $newname = eregi_replace('\.jpg$', 'a.jpg',
   $oldname);
  
   No point messing up your database; just use
   something like the above when
   you're outputting the image tags for the thumbnails.
  
   miguel
  
   On Mon, 8 Apr 2002, Thomas Edison Jr. wrote:
  
   I have a new very intriguing problem at hand.
  
   I have the name of my Images stored in my mySQL
   database in one column. Now when i pick the
   images,
   they are displayed as it as. However, they are the
   big
   images, and the thumbnails of those images are
   stored
   with an a at the end of thier names.
   That is,
   If the image is try.jpg , the thumbnail of the
   image
   is trya.jpg !!
   Now i want to display the thumbnail and not the
   large
   image. And unfortunately, my whole database
   contains
   the name of Large images and NOt the Thumbnails.
  
   How can i :
   1. Insert a at the end of the name of the image,
   before the .extension through PHP.
   The problems are that the names are stored in the
   database WITH the extesion. And the extensions
   also
   vary, some are JPG and some are GIF. So in my
   datase i
   have images as try.jpg or something.gif! How
   can i
   insert an a at the end of the name before the
   . ?
  
   2. OR.. can i insert the a before the . in the
   image name in my mySQL database itself.
  
   Either of the two solutions can work for me.
  
   Thanks,
   T. Edison Jr.
  
   __
   Do You Yahoo!?
   Yahoo! Tax Center - online filing with TurboTax
   http://taxes.yahoo.com/
  
  
  
  
  
   =
   Rahul S. Johari (Director)
   **
   Abraxas Technologies Inc.
   Homepage : http://www.abraxastech.com
   Email : [EMAIL PROTECTED]
   Tel : 91-4546512/4522124
   ***
  
   __
   Do You Yahoo!?
   Yahoo! Tax Center - online filing with TurboTax
   http://taxes.yahoo.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




[PHP] php and html image tag...

2002-04-08 Thread Jas

Ok here is my problem, I have a piece of code that queries the database
pulls the results of a table into an array, on another file the results of
that array are used with a require function and then each variable is echoed
to the screen where I need it, I have a piece of javascript to open a pop up
window and the code is as such...
a href='javascript:openPopWin(?php echo $ad01; ?, 420,545, , 0,
0)'onmouseover=window.status='This weeks full page ad';return true
As you can see I have placed the results of the array within my a href=
tag and it works fine.. however the second part img src=?php echo
$ad01_t; ? width=200 height=100 vspace=0 hspace=0 border=0/a
Will not pull the results of the array into the page, I don't know if this
is a valid piece or not, any help would be great.  Thanks in advance.
Jas



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




Re: [PHP] what's the best way to do redirect within PHP

2002-04-08 Thread Jason Wong

On Monday 08 April 2002 22:00, Wo Chang wrote:
 Dear All,

 Another simple question:

 What is the best way to do redirect after a
 php file did some processing?

 Any helps would be greatly appreciated!

Use header() to set a location.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
A diplomatic husband said to his wife, How do you expect me to remember
your birthday when you never look any older?
*/

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




RE: [PHP] what's the best way to do redirect within PHP

2002-04-08 Thread Patrick Lynch

This is really simple:
header(Location: .php);

/Patrick
www.optip.com

-Original Message-
From: Wo Chang [mailto:[EMAIL PROTECTED]] 
Sent: 08 April 2002 15:00
To: [EMAIL PROTECTED]
Subject: [PHP] what's the best way to do redirect within PHP


Dear All,

Another simple question:

What is the best way to do redirect after a
php file did some processing?

Any helps would be greatly appreciated!

--Wo


-- 
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] what's the best way to do redirect within PHP

2002-04-08 Thread Rénald CASAGRAUDE


Le lundi 8 avril 2002, à 04:00 PM, Wo Chang a écrit :

 What is the best way to do redirect after a
 php file did some processing?

Function header() ???

R.


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




[PHP] Directory check

2002-04-08 Thread Hiroshi Ayukawa

Does anyone know how to check a directory exiasts?

Thanks in advance,
Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top


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




Re: [PHP] Disabling bars on Browser

2002-04-08 Thread Erik Price

Bob/pickle,

I disagree -- Justin French has contributed a large number of helpful 
posts to this list.  Just the other day, he responded to my query for 
advice -- http://marc.theaimsgroup.com/?l=php-
generalm=101779873317529w=2
It is foolish to look the gift horse of free coding advice in the mouth 
(something that many companies will be happy to charge you for).

I'm guilty too of making offtopic posts, but when someone reminds me of 
this I try not to take it personally, even when it makes me feel like an 
idiot in this public forum.  I try to remember that a friendly tone of 
voice doesn't carry very well via email.

There's plenty of other groups which will answer JavaScript-related 
questions, but it is your responsibility to find them.


Erik




On Sunday, April 7, 2002, at 10:09  PM, [EMAIL PROTECTED] 
wrote:

 Wow, you really feel like your better than everyone here don't you.. You
 rarely even give an answer that isn't blatent criticism of what someone
 posted or their ability to find information. You really need to stop.

 Bob

 Justin French [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This is the wrong group/list for this post.

 The disabling of bars, or any sort of browser feature/appearance is NOT
 PHP.

 PHP is a server side langauge.  Commonly, you would use JavaScript for
 such
 stuff, so I recommend you check out the millions of JavaScript sites 
 and
 newsgroups on the web.








Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] site map function..

2002-04-08 Thread Kelly Meeks

I'm trying to write some code that will look at a table of records, and output a 
'tree' of those records, based on a parent/child relationship betweent their 
respective record id numbers.

Anyone written anything like this they would be willing to share?  I'm up against a 
deadline, and I'm having a brain cramp trying to get my brain around the recursive 
aspect of doing it.

Thanks in advance,

Kelly

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




Re: [PHP] MAC file upload

2002-04-08 Thread Rénald CASAGRAUDE


Le lundi 8 avril 2002, à 03:45 PM, Erik Price a écrit :

 When you download the file It loses the file association. It's for a 
 company
 I do work for that uses a lot of .ai and .psd files.

Hi !

Have you tried with :

$filesize = filesize($your_file);

header(Content-type: .$your_mime_type);
fread($your_file, $filesize);

exit();


R.


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




[PHP] Re: php and html image tag...

2002-04-08 Thread Michael Virnstein

Please post more code. Can't help any further in the moment.
Jas [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Ok here is my problem, I have a piece of code that queries the database
 pulls the results of a table into an array, on another file the results of
 that array are used with a require function and then each variable is
echoed
 to the screen where I need it, I have a piece of javascript to open a pop
up
 window and the code is as such...
 a href='javascript:openPopWin(?php echo $ad01; ?, 420,545, , 0,
 0)'onmouseover=window.status='This weeks full page ad';return true
 As you can see I have placed the results of the array within my a href=
 tag and it works fine.. however the second part img src=?php echo
 $ad01_t; ? width=200 height=100 vspace=0 hspace=0
border=0/a
 Will not pull the results of the array into the page, I don't know if this
 is a valid piece or not, any help would be great.  Thanks in advance.
 Jas





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




Re: [PHP] newbie configuration question

2002-04-08 Thread Erik Price


On Friday, April 5, 2002, at 10:12  PM, Eric Kilgore wrote:

 I'm a newbie to Linux and Apache, not so new to php itself. I'm using 
 Red
 Hat 7.2. The RPM installs apache with php, etc. as part of the standard
 install but --without-mysql in the configuration. I've read quit a bit 
 on
 how you are supposed to be able to update the configuration etc.
 ./configure --with-mysql=/usr/bin/mysql etc. The trouble is I have no 
 clue
 as to what directory I'm suppose to be running this in. I'm tempted to
 install a newer version of PHP (Red Hat 7.2 comes with 4.0.6) as the
 documentation on installing from source code seems to be a bit clearer. 
 Can
 I install over the top of the existing module or would I have to 
 uninstall
 that package first?

If you are still having trouble with this, I have a log of a PHP upgrade 
that will show you how I went about it.  But you've probably solved your 
problem by now.

Needless to say, the source install is highly configurable and not very 
difficult, I recommend it over the RPM in almost any situation.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Re: Directory check

2002-04-08 Thread Michael Virnstein

file_exists will perform a check if the file, no matter if it's a directory,
a regular file or a symlink.
if you want to know if it is a directory use
is_dir($file)

or refer to the php manualHiroshi Ayukawa [EMAIL PROTECTED] schrieb im
Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Does anyone know how to check a directory exiasts?

 Thanks in advance,
 Hiroshi Ayukawa
 http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top




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




[PHP] Re: sessions and passing variables

2002-04-08 Thread rarmin

Michael Virnstein wrote:
 you also have to make sure, that only one user can access the file for
 writing at one time, or your data gets probably
 screwed. The easiest way would be storing the object not in a file but in a
 database, so you don't have to care about locking.

Tnx for the help, and one more question. If I would serialize object and 
store it in a file, I would need some way to implement object waiting at 
the locked file untill it's unlocked (some kind of semaphore or 
monitor). I can lock the file with flock, but I don't know how to put 
object on hold while the file it's requesting is locked. As for the 
database, I don't use database (it's an assignment that needs to be done 
using XML, so all data is in XML files) and I don't see much sence in 
using db for storing only one serialized object.

 
 But do you really need the same instance of the object? why not simply
 perform a $obj = new Class();

If I figure out how to put on hold object while some other object 
performs it's operations on locked file, I wouldn't need to use the same 
instance.

 
 
 --
 Code for Storing:
 ?php
 
 $strData = serialize($data);
 
 $fp = fopen(globalObjectData.inc, w);
 fwrite($fp, $strData);
 fclose($fp);
 
 ?
 
 Code for accessing:
 
 ?php
 
 // include object source before unserializing
 include myObjectSrc.php;
 
 $fp = fopen(globalObjectData.inc, w);
 $strData = fread($fp, filesize(globalObjectData.inc));
 fclose($fp);
 
 // so we have our object back
 $obj = unserialize($strData);
 
 
 

Does anyone know how to implement monitor or semaphore or waiting queue 
on file resource? I'm using PHP 4.1.2 and Apache 1.2.23 on Windows platform.

Armin




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




[PHP] Re: php and html image tag...

2002-04-08 Thread Jas

Nevermind I got it fixed... I forgot to include a couple of fields from my
database into my array.  =).  If you would like to use the code I am putting
it here...
?php
$table = cm_dev_ads;
$dbh = mysql_connect('localhost','user_name','password') or die('Could not
connect to database, please try again later');
mysql_select_db('bignicke') or die('Could not select database, please try
again later');
$record = mysql_query(SELECT wel_area, ad01, ad02, ad03, ad04, ad05, ad06,
ad01_t, ad02_t, ad03_t, ad04_t, ad05_t, ad06_t FROM $table,$dbh);
while ($row = mysql_fetch_array($record)) {
  $wel_area = $row['wel_area'];
  $ad01 = $row['ad01'];
  $ad02 = $row['ad02'];
  $ad03 = $row['ad03'];
  $ad04 = $row['ad04'];
  $ad05 = $row['ad05'];
  $ad06 = $row['ad06'];
  $ad01_t = $row['ad01_t'];
  $ad02_t = $row['ad02_t'];
  $ad03_t = $row['ad03_t'];
  $ad04_t = $row['ad04_t'];
  $ad05_t = $row['ad05_t'];
  $ad05_t = $row['ad05_t'];
  $ad06_t = $row['ad06_t'];
  }
?
That is the db connection and the results put into an array...
?php
require 'db_index.php';
?
This calls to the array script, now to echo them into my java-script it is
as follows...
a href='javascript:openPopWin(?php echo $ad01; ?, 420,545, , 0,
0)'onmouseover=window.status='This weeks full page ad';return trueimg
src=?php echo $ad01_t; ? width=200 height=100 vspace=0 hspace=0
border=0/a
Hope this helps some other people that might want to do the same type of
thing...
Jas



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




RE: [PHP] nl2br returns BR /? normality or a bug?

2002-04-08 Thread Brinkman, Theodore

For the record br/ (which would be the 'normal' xhtml style) is
unrecognized (and therefor ignored) by Netscape 4.x.  However, it recognizes
and properly handles br /, which I'm sure is why it is output in that
format.  If anybody has seen br/ misbehave, try going back and testing
with br /.

- Theo

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 06, 2002 1:57 AM
To: Justin French
Cc: php
Subject: Re: [PHP] nl2br returns BR /? normality or a bug?


On Sat, 6 Apr 2002, Justin French wrote:
 on 06/04/02 11:05 AM, Maxim Maletsky ([EMAIL PROTECTED])
wrote:
 It DOES NOT work fine in every browser. I'd love to give you a prov, but
 because I am lazy I will just tell you this formula:
 
 Again.  I was only stating MY experience.  Every browser I can get my
hands
 on.  I do extensive testing, and have never seen a BR or BR/ or BR
/
 misbehave.
 
 If you have seen it perform unexpectedly, I'm keen to hear about.

For what it's worth, I just tried on the following browsers (all I have at
my disposal at home) and it works fine:

links 0.96
lynx 2.8.3
Opera 5.0.498 (Mac)
IE 5.1.3 (Mac)
Mozilla 0.9.9 (Mac)
Netscape 6.1 (Mac)

miguel


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




Re: [PHP] Directory check

2002-04-08 Thread Rénald CASAGRAUDE

Le lundi 8 avril 2002, à 04:15 PM, Hiroshi Ayukawa a écrit :

 Does anyone know how to check a directory exiasts?

RTFM !!

try this :

if (file_exists($dir)  is_dir($dir)) {
echo $dir.' is a directory !';
}


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




RE: [PHP] Test for one bit set?

2002-04-08 Thread Brinkman, Theodore

Try a bitwise and (I think the operator is '')...
?php
$bitMask = 16;
$value1 = 24;
$value2 = 36;

?$value1 has bit 5 set? ?php
if($bitMask  $value1)
{
//should get here
echo 'true\r\n';
}
else
{
echo 'false\r\n';
}

?$value2 has bit 5 set? ?php
if($bitMask  $value1)
{
echo 'true\r\n';
}
else
{
//should get here
echo 'false\r\n';
}
?
- Theo
-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 07, 2002 5:04 PM
To: Charlie Killian
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Test for one bit set?


On Sun, 7 Apr 2002, Charlie Killian wrote:
 How can I test if a number only has on bit set?
 
 So testing different numbers will return TRUE or FALSE:
 
 testing 0001 would return TRUE.
 testing 0011 would return FALSE.

Think back to math class when you were 14!

  function isOneBitSet($n)
  {
$x = log($n)/log(2);
return ($x == intval($x));
  }

Cheesy alternative:

  function isOneBitSet($n)
  {
return (1 == substr_count(base_convert($n, 10, 2), '1'));
  }

miguel


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




RE: [PHP] MAC file upload

2002-04-08 Thread Rance Hall

Shane,

Eric is absolutely right, you are losing the resource fork of your mac binaries when 
you upload them.

(If you don't know, on a Mac, the binary file has to parts, the data, and the 
association with an application (or resource) that created the file.  This is done so 
that Mac file names don't need an extension)

Most server systems (except Mac of course) don't know how to handle a resource fork, 
so they drop it.  The standard Mac work around is to convert the binary file to a text 
format called binhex (.hqx filename extension) upload the .hqx file to the server and 
then reconvert it back once downloaded to a Mac that knows what to do with the 
resource fork information.

This process can be automated with apple script if you like,  but, if you ever want 
another machead to help you diagnose problems, stick to this layout, that way they 
know what you are doing.

Rance

Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
[EMAIL PROTECTED]


-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 8:46 AM
To: Shane McBride
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MAC file upload



On Saturday, April 6, 2002, at 11:44  AM, Shane McBride wrote:

 Hello,

 I am able to upload and download Macintosh files but they seem to lose 
 their
 MIME type or extensions. I'm not sure what it is. I'm not a Mac dude.

 When you download the file It loses the file association. It's for a 
 company
 I do work for that uses a lot of .ai and .psd files.


 Any ideas on this?

You're possibly losing the resource fork of the files you are uploading, 
because the server is not an HFS+ filesystem.  To the best of my 
knowledge there is nothing you can do about this via PHP, but there are 
probably tricks (like AppleScript) that you could use as a workaround, 
such as encoding the files in some transport-friendly format before 
uploading and decoding them upon download.

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
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] Array elements missing

2002-04-08 Thread Joshua E Minnie

Can anyone tell me why when the first element in my array would disappear
with the following code:

?
  //remove the unwanted item from the array
  for($i=0;$icount($stores);$i++) {
$delete=0;
//checking to see if it has been requested for delete
foreach($HTTP_POST_VARS as $val) {
  if(is_numeric($val)) {
if($val==$i) $delete = 1;
else continue;
  }
  else continue;
}
//if not requested for delete, push on to temp array
if($delete == 0) {
  array_push($temp, $stores[$i]);
}
  }
  $stores = $temp;
  print_r($stores);
  print_r($HTTP_POST_VARS);
?

Here is the output of the print_r's:

Array
(
[0] =
[1] = Array
(
[0] = AR
[1] = 1
[2] = 1059 11th St.
[3] = Grand Rapids
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[2] = Array
(
[0] = AR
[1] = 2
[2] = 1059 11th St.
[3] = Grand Rapids
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[3] = Array
(
[0] = LA
[1] = 3
[2] = 1174 Gernaat Ct.
[3] = Delton
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[4] = Array
(
[0] = ME
[1] = 4
[2] = 1059 11th St.
[3] = Delton
[4] = (233) 457-2394
[5] = (233) 457-4982
[6] =
[7] =
[8] =
)

[5] = Array
(
[0] = MI
[1] = 6
[2] = 437 4th Ave.
[3] = Yet Another City
[4] = (123) 283-4839
[5] = (123) 458-4843
[6] =
[7] =
[8] =
)

)
Array
(
[chk5] = 5
[Submit] = Delete Store(s)
)


The script deletes the element that was requested deleted, but for some
reason the first element in the array never gets copied.  Any help that you
can provide would be greatly appreciated.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] mod_php4

2002-04-08 Thread The Doctor

Here is what I get when I try to make a DSO
with apache 2.0.35 and php 4.1.2:


Script started on Sun Apr  7 13:39:30 2002
doctor.nl2k.ab.ca//usr/source/php-4.1.2$ make 
Making all in Zend
Making all in main
Making all in ext
Making all in zlib
Making all in ftp
Making all in gd
Making all in mysql
Making all in openssl
Making all in pcre
Making all in pcrelib
Making all in posix
Making all in session
Making all in standard
Making all in xml
Making all in expat
Making all in sapi
Making all in apache2filter
/bin/sh /usr2/source/php-4.1.2/libtool --silent --mode=compile gcc  -I. 
-I/usr2/source/php-4.1.2/sapi/apache2filter -I/usr2/source/php-4.1.2/main 
-I/usr2/source/php-4.1.2 -I/var/www/include/ -I/usr2/source/php-4.1.2/Zend 
-I/usr/contrib/include -I/usr2/source/gd-1.8.3 -I/usr/contrib/include/mysql 
-I/usr2/source/php-4.1.2/ext/xml/expat  -I/usr2/source/php-4.1.2/TSRM -g -O2 -DZTS 
-prefer-pic  -c sapi_apache2.c
sapi_apache2.c: In function `php_apache_sapi_ub_write':
sapi_apache2.c:58: too few arguments to function `apr_brigade_create'
sapi_apache2.c:61: too few arguments to function `apr_bucket_transient_create'
sapi_apache2.c: In function `php_apache_sapi_register_variables':
sapi_apache2.c:148: warning: initialization discards qualifiers from pointer target 
type
sapi_apache2.c: In function `php_apache_sapi_flush':
sapi_apache2.c:171: too few arguments to function `apr_brigade_create'
sapi_apache2.c:172: too few arguments to function `apr_bucket_flush_create'
sapi_apache2.c: In function `php_input_filter':
sapi_apache2.c:245: too few arguments to function `apr_brigade_create'
sapi_apache2.c:247: incompatible type for argument 4 of `ap_get_brigade'
sapi_apache2.c:247: too few arguments to function `ap_get_brigade'
sapi_apache2.c: In function `php_output_filter':
sapi_apache2.c:311: too few arguments to function `apr_brigade_create'
sapi_apache2.c:366: too few arguments to function `apr_bucket_transient_create'
sapi_apache2.c:375: too few arguments to function `apr_bucket_eos_create'
sapi_apache2.c: In function `php_register_hook':
sapi_apache2.c:407: `AP_FTYPE_CONTENT' undeclared (first use in this function)
sapi_apache2.c:407: (Each undeclared identifier is reported only once
sapi_apache2.c:407: for each function it appears in.)
sapi_apache2.c:408: warning: passing arg 2 of `ap_register_input_filter' from 
incompatible pointer type
*** Error code 1

Stop.
*** Error code 1

Stop.
*** Error code 1

Stop.
*** Error code 1

Stop.
doctor.nl2k.ab.ca//usr/source/php-4.1.2$ exit
exit

Script done on Sun Apr  7 13:39:58 2002
-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Beware of defining as intelligent only those who share your opinions

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




[PHP] Appending url to file name...

2002-04-08 Thread Jas

Ok this is an unusual problem, at least to a newbie like myself... I am
trying to develop a user form to select an image from a directory by use of
a select box that once the item is selected it will put that selection into
a db field and this part I have working fine, however now I will need to be
able to do something which I am not entirely clear on where to start...
1- I need to have the selection append the file path to the selected file...
i.e. http://localhost/images/file_name.jpg, so far it only puts
file_name.jpg into the database table.
My code is as follows:
Page 1- index.php (queries database to display current db contents and also
queries directory and places results into an array that is displayed in a
select box)

?php
$dir_name = /path/to/images/directory/on/server/;
$dir = opendir($dir_name);
$file_list .= pFORM METHOD=\post\ ACTION=\index_done.php3\
SELECT NAME=\files\;
 while ($file_name = readdir($dir)) {
  if (($file_name != .)  ($file_name !=..)) {
  $file_list .= OPTION VALUE=\$file_name\
NAME=\$file_name\$file_name/OPTION;
  }
 }
 $file_list .= /SELECTbrbrINPUT TYPE=\submit\ NAME=\submit\
VALUE=\select\/FORM/p;
 closedir($dir);
$table = table_nae;
$dbh = mysql_connect('localhost','user_name','password') or die('Could not
connect to database, please try again later');
mysql_select_db('db_name') or die('Could not select database, please try
again later');
$record = mysql_query(SELECT wel_area, ad01_t, ad01, ad02_t, ad02, ad03_t,
ad03, ad04_t, ad04, ad05_t, ad05, ad06_t, ad06 FROM $table,$dbh);
while ($row = mysql_fetch_array($record)) {
 list($wel_area, $ad01_t, $ad01, $ad02_t, $ad02, $ad03_t, $ad03, $ad04_t,
$ad04, $ad05_t, $ad05, $ad06_t, $ad06) = $row;
}?

This echoes the resulting directory into my select box...
? echo $file_list; ?

And this will echo the existing db entry...
img src=?php echo $ad01_t; ? width=200 height=100 vspace=0
hspace=0 border=0

Ok so far so good, now the items that are selected from the drop box need to
somehow (this is where I am stuck append the file path, i.e. the complete
url to the db entry and I am not quite sure how to accomplish this, if
anyone has a tutorial or even an example to show me I can figure it out from
there... this is the piece of code I am using on the index_done.php3 file.

?php
$db_name = db_name;
$table_name = table_name;
$connection = mysql_connect(localhost, user_name, password) or die
(Could not connect to database.  Please try again later.);
$db = mysql_select_db($db_name,$connection) or die (Could not select
database table. Please try again later.);
$sql = UPDATE $table_name SET ad01_t=\$files;
print $sql;
$result = mysql_query($sql, $connection) or die (Could not execute query.
Please try again later.);
?
Any help would be great...
Jas





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




[PHP] Re: what's the best way to do redirect within PHP

2002-04-08 Thread Wo Chang

Dear All,

Thanks for all the response, they all work!

--Wo

- Original Message - 
From: Wo Chang [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 08, 2002 10:00 AM
Subject: what's the best way to do redirect within PHP


 Dear All,
 
 Another simple question:
 
 What is the best way to do redirect after a
 php file did some processing?
 
 Any helps would be greatly appreciated!
 
 --Wo


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




[PHP] Adding Querystrings to links

2002-04-08 Thread mail

Hi all!

I have a problem with the querystring.I want to add to every Link on my Homepage a 
querystring, but i should have the possibility to change some details in the 
Querystring.
How should i solve this problem ?

Example :

http://domain.com/index.php?dest=12item=2
The variables ?dest= and item= should be in every Link on my site.But only the 
values 12 and 2 should be alterable.

Thank you,and sorry for my bad english
Chris



Re: [PHP] Re: php and html image tag...

2002-04-08 Thread JSheble


I don't know if anybody else sent you an email about this or not, but 
there's a much easier way to do what you're doing in this snippet of code...

$record = mysql_query(SELECT wel_area, ad01, ad02, ad03, ad04, ad05, 
ad06, ad01_t, ad02_t, ad03_t, ad04_t, ad05_t, ad06_t FROM $table,$dbh);

while ($row = mysql_fetch_array($record)) {
 // this should print no
 print( wel_areas set:  . ( isset( $wel_areas ) ? Yes : No ));
 extract( $row );
 // this should print yes
 print( wel_areas set:  . ( isset( $wel_areas ) ? Yes : No ));
}


this will create variables into the local scope of each element in this 
associative array.  It's a lot easier than typing each assignment out, and 
it also means if you include a new field in your query, your code will not 
have to create a new variable, it'll be automatic...

At 08:29 AM 4/8/2002 -0600, Jas wrote:
Nevermind I got it fixed... I forgot to include a couple of fields from my
database into my array.  =).  If you would like to use the code I am putting
it here...
?php
$table = cm_dev_ads;
$dbh = mysql_connect('localhost','user_name','password') or die('Could not
connect to database, please try again later');
mysql_select_db('bignicke') or die('Could not select database, please try
again later');
$record = mysql_query(SELECT wel_area, ad01, ad02, ad03, ad04, ad05, ad06,
ad01_t, ad02_t, ad03_t, ad04_t, ad05_t, ad06_t FROM $table,$dbh);
while ($row = mysql_fetch_array($record)) {
   $wel_area = $row['wel_area'];
   $ad01 = $row['ad01'];
   $ad02 = $row['ad02'];
   $ad03 = $row['ad03'];
   $ad04 = $row['ad04'];
   $ad05 = $row['ad05'];
   $ad06 = $row['ad06'];
   $ad01_t = $row['ad01_t'];
   $ad02_t = $row['ad02_t'];
   $ad03_t = $row['ad03_t'];
   $ad04_t = $row['ad04_t'];
   $ad05_t = $row['ad05_t'];
   $ad05_t = $row['ad05_t'];
   $ad06_t = $row['ad06_t'];
   }
?
That is the db connection and the results put into an array...
?php
require 'db_index.php';
?
This calls to the array script, now to echo them into my java-script it is
as follows...
a href='javascript:openPopWin(?php echo $ad01; ?, 420,545, , 0,
0)'onmouseover=window.status='This weeks full page ad';return trueimg
src=?php echo $ad01_t; ? width=200 height=100 vspace=0 hspace=0
border=0/a
Hope this helps some other people that might want to do the same type of
thing...
Jas



--
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] Appending url to file name...

2002-04-08 Thread Erik Price


On Monday, April 8, 2002, at 11:09  AM, Jas wrote:

 Ok this is an unusual problem, at least to a newbie like myself... I am
 trying to develop a user form to select an image from a directory by 
 use of
 a select box that once the item is selected it will put that selection 
 into
 a db field and this part I have working fine, however now I will need 
 to be
 able to do something which I am not entirely clear on where to start...
 1- I need to have the selection append the file path to the selected 
 file...
 i.e. http://localhost/images/file_name.jpg, so far it only puts
 file_name.jpg into the database table.

If you already know that the file will always be in the same directory, 
you could just prepend the string http://localhost/images/; to the 
query result in your query --

SELECT CONCAT('http://localhost/images/', tablename.image_name) AS 
image_name FROM tablename

Or, if each file may have a different path, check out the dirname() 
function -- http://www.php.net/manual/en/function.dirname.php

I think that you will have to add http://virtualhost; in any case, as 
this is a component of a URI and not a part of the file's path (and will 
not be automatically generated by dirname() or any other function that I 
know of).


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Re: Directory check

2002-04-08 Thread Maxim Maletsky


try: 


if(is_dir($dir)) {
 echo 'directory was found';
} 

 

Yoroshiku, 

Maxim Maletsky
PHPBeginner.com 

 


Hiroshi Ayukawa writes: 

 Does anyone know how to check a directory exiasts? 
 
 Thanks in advance,
 Hiroshi Ayukawa
 http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] Adding Querystrings to links

2002-04-08 Thread Rance Hall

you want to try a code line like this

print a 
href=\yourpagehere.phtml?dest=$line[index]item=$line[index2]\LinkName/a;

it will only work of course if you are in the middle of a loop that processes the 
results of an appropriate select statement that pulls the needed values for your dest 
and item variables.

for a similar project I wrote this:

for ($i=0; $i  $rowcount; $i++) {
$line = mysql_fetch_array($results);
if ($i % 2) {
 print tr bgcolor=\white\\n;
}
else {
 print tr bgcolor=\#e0e0e0\\n;
}
 print tda 
href=\project_details.phtml?project=$line[pk]\$line[projectname]/a/td\n;
 print td$line[projectcustomer]/td\n;
 print td$line[projectstatus]/td\n;
 print td$line[projectcompletion]%/td\n;
 print /tr\n;
 }


Hope it helps


Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Adding Querystrings to links


Hi all!

I have a problem with the querystring.I want to add to every Link on my Homepage a 
querystring, but i should have the possibility to change some details in the 
Querystring.
How should i solve this problem ?

Example :

http://domain.com/index.php?dest=12item=2
The variables ?dest= and item= should be in every Link on my site.But only the 
values 12 and 2 should be alterable.

Thank you,and sorry for my bad english
Chris

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




[PHP] Besy way to ban a user?

2002-04-08 Thread Jeff Lewis

We've used email ban and IP ban but there are easy ways around this as you
all know.  I am wondering if there is anything a little more hardcore to do
as far as banning goes.  I had read somewhere about grabbing a MAC address
or something similar from a network card.  Has anyone heard of this method
or does anyone already use a pretty solid method?

Jeff


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




[PHP] SSL needed for socket communication?

2002-04-08 Thread Erik Price

My Apache server is currently not configured to use SSL, and I do not 
have a certificate.  There is a possibility that I will be creating a 
script to send POST data to another company's web service, and that 
company requires the connection to be via SSL.  The logical way for me 
to do this seems to be to use a socket to fire off the POST data at the 
other server, but I am not sure what is required to connect via SSL. 
Since browsers can do it without certificates, I would assume that I 
don't need a certificate to do this (only for if I want to use SSL with 
clients connecting to my server), but if someone could confirm this 
and/or point me in the direction of the functions that allow me to use 
SSL that would be greatly appreciated.


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Appending url to file name...

2002-04-08 Thread Jas

So putting it into an UPDATE statement it would be something like this
right?
UPDATE CONCAT $table_name SET ('http://localhost/images') ad01=\$ad01\;




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




Re: [PHP] Problems with libgd.so under linux

2002-04-08 Thread M Green


[EMAIL PROTECTED] skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 08.04.2002  14:56, you wrote:
 Php works in general (phpinfo()).
 The gd-lib however will not work for some reason.
 I tried
 extension=libgd.so
 in php.ini without any result.
 
 Anyone familiar with this problem?
 
 /M Green
 Too few arguments ;-)
 Did you already compiled GD ?
 Did you compile php with gd support?
 Oliver


I just followed the instructions on php.net for apache servers and changed
php.ini.
http://www.php.net/manual/en/html/install.apache.html
Is there any way to check php.ini for errors?

Yeah, one more thing, i moved libphp.so to /etc/httpd/modules to get it to
work.
So phpinfo(); works fine.



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




RE: [PHP] difficulty in solving the unknown warning

2002-04-08 Thread Rick Emery

so what does line 111 look like?

we can't read your mind...

-Original Message-
From: erich [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 3:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] difficulty in solving the unknown warning


 i am a php programmer whose learning expr. is about 2 months. whatever
 running script of php that written by other php programmer or me, i
 always see the warning below shown, why this occurs? how to avoid?

 Warning: Undefined variable: HTTP_VIA in
 g:\wwwroot\phpformmail\formmail.php on line 111




-- 
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] Custom Error Handling

2002-04-08 Thread Adam Voigt

Is there any reason the following code should not work?
I define the error function, then tell PHP to use it, then call
a function which doesn't exist (test), and it will print the error
on screen that that function doesn't exist, but it won't alert me,
so it's obviously not entering the catchError function, why?

?php

function catchError($num, $string, $file, $line)
{
echo script language=\javascript\alert('$num:$string:$file:$line');/script;
}

set_error_handler(catchError);

test();

?

Thanks for your help,

Adam Voigt
[EMAIL PROTECTED]

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




Re: [PHP] SSL needed for socket communication?

2002-04-08 Thread Miguel Cruz

On Mon, 8 Apr 2002, Erik Price wrote:
 My Apache server is currently not configured to use SSL, and I do not 
 have a certificate.  There is a possibility that I will be creating a 
 script to send POST data to another company's web service, and that 
 company requires the connection to be via SSL.  The logical way for me 
 to do this seems to be to use a socket to fire off the POST data at the 
 other server, but I am not sure what is required to connect via SSL. 
 Since browsers can do it without certificates, I would assume that I 
 don't need a certificate to do this (only for if I want to use SSL with 
 clients connecting to my server), but if someone could confirm this 
 and/or point me in the direction of the functions that allow me to use 
 SSL that would be greatly appreciated.

While it's possible that the HTTPS server is configured to require client 
certificates, generally that's not the case.

Configuring Apache for SSL has nothing to do with the ability of PHP on 
that server to make outgoing HTTPS connections to other servers.

In my experience the best way to make HTTPS connections from PHP is using 
cURL.

miguel


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




Re: [PHP] Besy way to ban a user?

2002-04-08 Thread Miguel Cruz

On Mon, 8 Apr 2002, Jeff Lewis wrote:
 We've used email ban and IP ban but there are easy ways around this as
 you all know.  I am wondering if there is anything a little more
 hardcore to do as far as banning goes.  I had read somewhere about
 grabbing a MAC address or something similar from a network card.  Has
 anyone heard of this method or does anyone already use a pretty solid
 method?

You shouldn't be able to get the MAC address off someone's card via their
web browser (maybe if they allow ActiveX and use Windows then there's some
security hole you could exploit). In any case, MACs can be changed, and
they still identify a piece of hardware rather than a human.

It is a fact of life that things uniquely identifying humans are fairly
difficult to validate on the internet. The easier it is to verify, the
easier it is to fake. This sometimes-annoying reality is what preserves
whatever lingering privacy we still enjoy.

Maybe you can cook up a cocktail of cookies, IP, $HTTP_USER_AGENT, and
JavaScript-reported browser characteristics. But ultimately you're not
going to keep out the determined prankster unless you rely on something
that has significance in the Real World, such as credit cards, phone
numbers, personal referrals, reputation-based credentials, and so on.

miguel


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




Re: [PHP] Directory check

2002-04-08 Thread Jason Wong

On Monday 08 April 2002 22:15, Hiroshi Ayukawa wrote:
 Does anyone know how to check a directory exiasts?

 Thanks in advance,
 Hiroshi Ayukawa
 http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top

Manual  Filesystem functions


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
When the revolution comes, count your change.
*/

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




Re: [PHP] Appending url to file name...

2002-04-08 Thread Erik Price


On Monday, April 8, 2002, at 11:35  AM, Jas wrote:

 So putting it into an UPDATE statement it would be something like this
 right?
 UPDATE CONCAT $table_name SET ('http://localhost/images') 
 ad01=\$ad01\;

No, like this:

The table is named test_table
The column you want to add this to is named test_column

You are taking the data that test_column contains, and prepending 
http://localhost/images; to the beginning of that data:

UPDATE test_table SET test_column = CONCAT('http://localhost/images', 
test_table.test_column)

Warning: This command will change every single row in your table so that 
'http://localhost/images' will be prepended before whatever data is 
already in that row.  You probably want to make ABSOLUTELY SURE that 
this is what you want (are you sure you don't want a trailing slash in 
that CONCAT function?).  If you want to just test this out, or don't 
want to apply this change to EVERY row, you can add a WHERE clause to 
choose certain rows to update.

Keep in mind that test_column must be able to accommodate the new string 
(so you might need to make it a bigger VARCHAR or something).

Good luck,

Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] how to check if e- mail sending did succeed?

2002-04-08 Thread andy

Hi there,

I use the function mail to e-mail . This workes fine with most adresses.
Unfortunatelly there is one e-mail provider (gmx.de) which does not get anny
of those e-mails. Workes fine with all other services. I doubble checked it
with 2 other gmx accounts.

How can I find out what went wrong?

Thanx for any help,

Andy



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




Re: [PHP] how to check if e- mail sending did succeed?

2002-04-08 Thread Miguel Cruz

On Mon, 8 Apr 2002, andy wrote:
 I use the function mail to e-mail . This workes fine with most adresses.
 Unfortunatelly there is one e-mail provider (gmx.de) which does not get anny
 of those e-mails. Workes fine with all other services. I doubble checked it
 with 2 other gmx accounts.
 
 How can I find out what went wrong?

Check /var/log/maillog on the server?

miguel


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




Re: [PHP] Adding Querystrings to links

2002-04-08 Thread Erik Price


On Monday, April 8, 2002, at 11:12  AM, [EMAIL PROTECTED] wrote:

 I have a problem with the querystring.I want to add to every Link on my
 Homepage a querystring, but i should have the possibility to change some
 details in the Querystring.
 How should i solve this problem ?

 Example :

 http://domain.com/index.php?dest=12item=2
 The variables ?dest= and item= should be in every Link on my
 site.But only the values 12 and 2 should be alterable.

Here is an example:

$destination = 12;
$item = 12;

// later in the script

print(a 
href=\http://domain.com/index.php?dest=$destinationitem=$item\;Link/a
);




Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Appending url to file name...

2002-04-08 Thread Jas

Actually, I tried it a different way and I got the results I needed... this
is what I did,
$file_var = http://www.bignickel.net/full_ad/;;
$db_name = db_name;
$table_name = table_name;
$connection = mysql_connect(localhost, user_name, password) or die
(Could not connect to database.  Please try again later.);
$db = mysql_select_db($db_name,$connection) or die (Could not select
database table. Please try again later.);
$sql = UPDATE $table_name SET ad01_t=\$file_var$files\; //this gave me
the results, as you can see I just created a new variable with the path in
it
print $sql;
$result = mysql_query($sql, $connection) or die (Could not execute query.
Please try again later.);
?



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




Re: [PHP] Appending url to file name...

2002-04-08 Thread Miguel Cruz

On Mon, 8 Apr 2002, Jas wrote:
 $sql = UPDATE $table_name SET ad01_t=\$file_var$files\;

Is this really what you wanted? It would set ad01_t to the same thing for 
every single row in your table.

If that is what you wanted, then I think your database design is a little 
weird.

miguel


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




RE: [PHP] Question

2002-04-08 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Rather than executing a system utility you can just use the built in PHP
functions.

gethostbyaddr() - resolves an IP address into a hostname
gethostbyname() - resolves hostname into an IP address

More information is available in the PHP manual, you can access it online at
http://www.php.net/manual

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 6:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Question


At 08.04.2002  13:00, you wrote:

How to convert or discover from IPadress country visitors on my web ?

roman
You have to make a DNSLOOKUP
If you have a linux box (server setup) you can use
system(nslookup -timeout=3 -retry=1 .$value)
where $value is the IP-Number. This gives you the
real name of the server your client asked from.
the you have to extract the national-code, and got your
country, or org, mil, com

HTH Oliver


-- 
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] Re: Adding Querystrings to links

2002-04-08 Thread Jordan K. Martin

Chris,

What really matters is where the variables are coming from.

print (http://domain.com/index.php?dest=; . $var1 . item= . $var2
.br\n);

that's how I usually do it.  I'm assuming that both dest and item are
variables on the referring page.  Reply and let me know if this is what
you're looking for.

-Jordan K. Martin
--New Image Design
---http://www.newimagedesign.com




[EMAIL PROTECTED] wrote in message
002f01c1df0f$cb2ef400$0100a8c0@pent333">news:002f01c1df0f$cb2ef400$0100a8c0@pent333...
Hi all!

I have a problem with the querystring.I want to add to every Link on my
Homepage a querystring, but i should have the possibility to change some
details in the Querystring.
How should i solve this problem ?

Example :

http://domain.com/index.php?dest=12item=2
The variables ?dest= and item= should be in every Link on my site.But
only the values 12 and 2 should be alterable.

Thank you,and sorry for my bad english
Chris




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




RE: [PHP] Question

2002-04-08 Thread Miguel Cruz

How does that tell you where something is?

Quick quiz, some obvious high-profile examples off the top of my head:

   netvigator.com
   ntlworld.com
   bigpond.net
   chello.com
   unicc.org

miguel   

On Mon, 8 Apr 2002, SHEETS,JASON (Non-HP-Boise,ex1) wrote:
 Rather than executing a system utility you can just use the built in PHP
 functions.
 
 gethostbyaddr() - resolves an IP address into a hostname
 gethostbyname() - resolves hostname into an IP address
 
 More information is available in the PHP manual, you can access it online at
 http://www.php.net/manual
 
 Jason
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 08, 2002 6:50 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Question
 
 
 At 08.04.2002  13:00, you wrote:
 
 How to convert or discover from IPadress country visitors on my web ?
 
 roman
 You have to make a DNSLOOKUP
 If you have a linux box (server setup) you can use
 system(nslookup -timeout=3 -retry=1 .$value)
 where $value is the IP-Number. This gives you the
 real name of the server your client asked from.
 the you have to extract the national-code, and got your
 country, or org, mil, com
 
 HTH Oliver
 
 
 


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




Re: [PHP] Phone number validation

2002-04-08 Thread Jim Lucas [php]

try this

preg_match(/[a-zA-Z]+/i, $str);

and if you want to go the other route.

do this

preg_match(/[^0-9\(\)\-\.\ ]+/i, $str);
this will return true if it is anything other then what is listed.
numbers 0-9
(
)
-
.
 

Jim Lucas

- Original Message - 
From: Gary [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 06, 2002 6:52 PM
Subject: [PHP] Phone number validation


 Hi All,
   I tried to cut a corner and use an  alphabetic validation I am using 
 elsewhere
   $stuff = /^[a-zA-Z]+$/;
 if(preg_match($stuff, $value))
 
 looks like I forgot about +( )- being in phone number. What is the 
 easiest way to allow these 4  characters? Are there any other characters 
 that people use?
 
 TIA
 Gary
 
 
 -- 
 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] counter for HIGH traffic site

2002-04-08 Thread Jim Lucas [php]

as long as you are only inserting information into the mysql db on each page
load, then you shouldn't have a problem.  make sure you keep you indecies
down to a minimum.

Jim Lucas

- Original Message -
From: Craig Westerman [EMAIL PROTECTED]
To: php-general-list [EMAIL PROTECTED]
Sent: Saturday, April 06, 2002 11:57 PM
Subject: [PHP] counter for HIGH traffic site


 I'm needing counter for site that receives 60 to 80 hits a minute. Many I
 have tried cause excessive server load and need to be deactivated or they
 lose data and return to zero without warning. All tried so far have been
 written in Perl.

 Anyone here know of a PHP counter that would handle HIGH traffic with
little
 added server load? Would using MySQL to store count be of any benifit?

 Thanks

 Craig 
 [EMAIL PROTECTED]



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




[PHP] Object Confusion

2002-04-08 Thread Robert J. Cissell

If object of type A ($A) contains a variable $B which is an object of
type B, how does a function within $B reference another variable in $A?
Thanks.



[PHP] Assigning unique form names...

2002-04-08 Thread Jas

Here is what I need some information about, the script below opens a
directory on the server, reads the files and places them into select boxes
within a form, now I have this echoed multiple times on the page like
so...? echo $file_list; ? Now I have tried to assign a form name based
on the $file_name varibable but because the $file_name variable is created
after the form has been created I cannot assign a unique form name each time
I call ? echo $file_list; ?.  If someone could point out another way to
do this or point out a good function for this I would greatly appreciate it.
?php
$dir_name = /path/to/images/directory/;
$dir = opendir($dir_name);
$file_list .= pFORM METHOD=\post\ ACTION=\index_done.php3\
SELECT NAME=\files\;
 while ($file_name = readdir($dir)) {
  if (($file_name != .)  ($file_name !=..)) {
  $file_list .= OPTION VALUE=\$file_name\
NAME=\$file_name\$file_name/OPTION;
  }
 }
 $file_list .= /SELECTbrbrINPUT TYPE=\submit\ NAME=\submit\
VALUE=\select\/FORM/p;
 closedir($dir);
?
Thanks in advance,
Jas



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




RE: [PHP] Assigning unique form names...

2002-04-08 Thread Kevin Stone

Try select name=files[]  The square brackets will allow you to
capture selections from multiple lists in an indexed array, $files.
Hope that does what you need.
-Kevin

The square brackets will allow you to capture the variable $file_name

-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 08, 2002 10:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Assigning unique form names...

Here is what I need some information about, the script below opens a
directory on the server, reads the files and places them into select
boxes
within a form, now I have this echoed multiple times on the page like
so...? echo $file_list; ? Now I have tried to assign a form name
based
on the $file_name varibable but because the $file_name variable is
created
after the form has been created I cannot assign a unique form name each
time
I call ? echo $file_list; ?.  If someone could point out another way
to
do this or point out a good function for this I would greatly appreciate
it.
?php
$dir_name = /path/to/images/directory/;
$dir = opendir($dir_name);
$file_list .= pFORM METHOD=\post\ ACTION=\index_done.php3\
SELECT NAME=\files\;
 while ($file_name = readdir($dir)) {
  if (($file_name != .)  ($file_name !=..)) {
  $file_list .= OPTION VALUE=\$file_name\
NAME=\$file_name\$file_name/OPTION;
  }
 }
 $file_list .= /SELECTbrbrINPUT TYPE=\submit\ NAME=\submit\
VALUE=\select\/FORM/p;
 closedir($dir);
?
Thanks in advance,
Jas



-- 
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] Upload alert

2002-04-08 Thread Rodolfo Silva

Hi! 

I need a  php script to alert me (with a pop up window or something like that) when a 
certain web page is modified. Is it possible? Where can I find that? 

Tks in advance, 
Rodolfo Silva

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




  1   2   >