[PHP] Re: passing variable via url ( newbye question)

2002-08-01 Thread Lord Loh.

 http://myadress/php/mypage.php?modo=123color=redsize=3
and to get
echo $_GET['modo'].BR;
echo $_GET['color'].BR;
echo $_GET['size'].BR;
but does not work

How can i do that

===HERE===
import_request_variables(G, saci_);
echo $saci_modo.BR;
echo $saci_color.BR;
echo $saci_size.BR;
===
Tested it! It worked!
G stands for GET
You can use P or C for POST or COOKIE
The order of gpc is important the later overwites the former...see
docs(XCVIII. Variable Functions)



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




[PHP] Creating Image v2... storing thumblains...

2002-08-01 Thread mp

Thanks to those who helped me last time about creating image, but now there
is another problem...
I'm making a thumblain like this:

$base_size = 300;

$size = GetImageSize($image1);
$kof = ($size[0]  $size[1]) ? $size[0] : $size[1];
$koef = ($base_size / $kof);

$new_w = (int) $size[0] * $koef;
$new_h = (int) $size[1] * $koef;

$dst_img = ImageCreate($new_w, $new_h);
$src_img = ImageCreateFromJpeg($image1);
ImageCopyResized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
ImageSX($src_img), ImageSY($src_img));
imageJPEG($dst_img, $image2);

Andf I get $image2 with 0 bytes...
If i write
imageJPEG($src_img, $image2);
I get good image, so there is some problems with ImageCopyResized...
Does anybody have any ideas about this?






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




Re: [PHP] include()

2002-08-01 Thread Lord Loh.

Other users on the same server *shouldn't* be able to include() in this
way

How?

Would their $_SERVER['HTTP_HOST'] not be the same?



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




[PHP] calculating psysical path (a first try)

2002-08-01 Thread Lars Olsson

Hi list!

Something I use quite often when programming in ASP is the 
Server.MapPath method. This method expects a virtual path (on the web 
server) and returns the corresponding psysical path. I haven't seen this 
anywhere in PHP, so I've hacked my own little routine to do this (see 
below). But I still have two questions:

a) Is there perhaps a built-in function I can use instead? I browsed 
through the manual quite a lot, but I haven't found quite like this.

b) If there isn't a built-in function, perhaps you could help me make my 
function better? It seems I use a lot of code for this TINY problem...

Here's the function:
snip
// This function calculates the physical path for a given virtual path.
function map_path($virtual_path) {
   // Deklarera necessary variables as global
   global $HTTP_SERVER_VARS;

   // Find out where this file is located in the psysical file system
   $script_filename = $HTTP_SERVER_VARS[SCRIPT_FILENAME];

   // Find out where this file is located in the virtual file system
   $script_name = $HTTP_SERVER_VARS[SCRIPT_NAME];

   // Calculate which folder in the psysical filesystem that corresponds
   // to the root folder in the virtual filesystem
   $psychical_root = substr($script_filename, 0, strlen($script_filename)
 - strlen($script_name));

   // Calculate which folder in the psysical filesystem that corresponds
   // to the given folder in the virtual filesystem
   $psychical_path = $psychical_root . $virtual_path;

   return $psychical_path;
}
/snip

Kindly

/Lasso ([EMAIL PROTECTED])


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




Re: [PHP] Creating Image v2... storing thumblains...

2002-08-01 Thread mp

Oh don't worry about this... I've already found the mistake...



 Thanks to those who helped me last time about creating image, but now
there
 is another problem...
 I'm making a thumblain like this:

 $base_size = 300;

 $size = GetImageSize($image1);
 $kof = ($size[0]  $size[1]) ? $size[0] : $size[1];
 $koef = ($base_size / $kof);

 $new_w = (int) $size[0] * $koef;
 $new_h = (int) $size[1] * $koef;

 $dst_img = ImageCreate($new_w, $new_h);
 $src_img = ImageCreateFromJpeg($image1);
 ImageCopyResized($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
 ImageSX($src_img), ImageSY($src_img));
 imageJPEG($dst_img, $image2);

 Andf I get $image2 with 0 bytes...
 If i write
 imageJPEG($src_img, $image2);
 I get good image, so there is some problems with ImageCopyResized...
 Does anybody have any ideas about this?






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

2002-08-01 Thread Thomas Edison Jr.

hi!
i have a problem in my project.the problem is that
suppose we have the date for the whole of the month
and two different files r there.
i have to pick one file of the current date that is
say today and the other file of the yesterday.but the
problem is that if the current date is monday then the
in yesterday file i have to pick for saturday and not
the sunday.broadly speaking i mean to say that the
difference between the today's date and yesterday's is
not fixed as there can be a holiday for say 4 days
inbetween then in yesterday i need the date 4 days
before.
so i need some query to handle this as soon as
possible as its very urjent.the query should be in
MYSQL.that is the query should be such which can pick
today's date and the date of the working day before
the today's or the current date.

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

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP] RE: dir to array?

2002-08-01 Thread Tim Ward

 Not sure why this isn't working, any help is appreciated.  I 
 am trying to
 read the files in a directory and place them into an array.  
 Here is the
 code:
 
 /* Function to create array of directory contents */
 function dCNTS($files) {
  $dir = opendir(/path/to/directory/);
   while($imgs = readdir($dir)) {
if (($imgs != .)  ($imgs != ..)) {
 $cnt[count($imgs)] = $cnt;

is this typo in the original code? surely should be  = $imgs;

} else {
 print Cannot create array of files in directory!; }
}
   closedir($dir);
  }

Tim Ward
www.chessish.com

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




RE: [PHP] String Question

2002-08-01 Thread Tim Ward

or ...
while($new = substr($old, $i++ * $strlen, $strlen)) $array[] = $new;


Tim Ward
www.chessish.com 

 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: 31 July 2002 20:47
 To: Randy Johnson; PHP General
 Subject: Re: [PHP] String Question
 
 
 ?
 $string = 'abcdefghijklmnopqrstuvwxyz';
 $strNum = ceil(strlen($string)/8);
 
 for ($i=0; $i$strNum; $i++) $newString[] = substr($string, 
 ($i*8), 8);
 
 for ($j=0; $jcount($newString); $j++) echo string$j = 
 $newString[$j]br
 /;
 ?
 
 Rick
 
 A sense of humor can help you over look the unattractive, tolerate the
 unpleasant, cope with the unexpected, and smile through the 
 unbearable. -
 Moshe Waldoks
 
  From: Randy Johnson [EMAIL PROTECTED]
  Date: Wed, 31 Jul 2002 15:26:15 -0400
  To: [EMAIL PROTECTED]
  Subject: [PHP] String Question
  
  Hello,
  
  I would like to be able to do the following but have not 
 figured out a way to
  handle it
  
  $string=abcdefghijklmnopqrstuvwxz;
  
  I would like to divde the above string into separate 
 strings 8 charactes long
  , example
  
  $string1=abcdefgh
  $string2=ijklmnop
  $string3=qrstuvwx
  $string4=yz
  
  if the string were only 10 long
  
  $string=abcdefghij
  
  then
  
  $string1=abcdefgh
  $string2=ij
  
  any suggestions would be greatly appreciated.
  
  Thanks,
  
  
  Randy
  
 
 

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




Re: [PHP] PROBLEM

2002-08-01 Thread Justin French

I don't store anything in date format (eg -MM-DD)... I store them as a
unix time stamp -- see time() in the manual.

Then it would be pretty easy to get today's stamp using time(), then look
for the two files preceeding that stamp, (ORDER BY in SQL) which would
presumably be today's file/row, and the one preceeding it (usually
yesterday, but could be a few days before).

something like:
SELECT * FROM table WHERE stamp  $now ORDER BY stamp DESC LIMIT 2

should give you the two stamps you need... a simular thing could be done
with other date formats in MySQL, but I've never worked with them sorry,


justin french





on 01/08/02 5:43 PM, Thomas Edison Jr. ([EMAIL PROTECTED]) wrote:

 hi!
 i have a problem in my project.the problem is that
 suppose we have the date for the whole of the month
 and two different files r there.
 i have to pick one file of the current date that is
 say today and the other file of the yesterday.but the
 problem is that if the current date is monday then the
 in yesterday file i have to pick for saturday and not
 the sunday.broadly speaking i mean to say that the
 difference between the today's date and yesterday's is
 not fixed as there can be a holiday for say 4 days
 inbetween then in yesterday i need the date 4 days
 before.
 so i need some query to handle this as soon as
 possible as its very urjent.the query should be in
 MYSQL.that is the query should be such which can pick
 today's date and the date of the working day before
 the today's or the current date.
 
 =
 Rahul S. Johari (Director)
 **
 Abraxas Technologies Inc.
 Homepage : http://www.abraxastech.com
 Email : [EMAIL PROTECTED]
 Tel : 91-4546512/4522124
 ***
 
 __
 Do You Yahoo!?
 Yahoo! Health - Feel better, live better
 http://health.yahoo.com


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




Re: [PHP] PROBLEM

2002-08-01 Thread Markas

Yes I always arguing that its better to store date as an ordinary int

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I don't store anything in date format (eg -MM-DD)... I store them as a
 unix time stamp -- see time() in the manual.

 Then it would be pretty easy to get today's stamp using time(), then look
 for the two files preceeding that stamp, (ORDER BY in SQL) which would
 presumably be today's file/row, and the one preceeding it (usually
 yesterday, but could be a few days before).

 something like:
 SELECT * FROM table WHERE stamp  $now ORDER BY stamp DESC LIMIT 2

 should give you the two stamps you need... a simular thing could be done
 with other date formats in MySQL, but I've never worked with them sorry,


 justin french





 on 01/08/02 5:43 PM, Thomas Edison Jr. ([EMAIL PROTECTED]) wrote:

  hi!
  i have a problem in my project.the problem is that
  suppose we have the date for the whole of the month
  and two different files r there.
  i have to pick one file of the current date that is
  say today and the other file of the yesterday.but the
  problem is that if the current date is monday then the
  in yesterday file i have to pick for saturday and not
  the sunday.broadly speaking i mean to say that the
  difference between the today's date and yesterday's is
  not fixed as there can be a holiday for say 4 days
  inbetween then in yesterday i need the date 4 days
  before.
  so i need some query to handle this as soon as
  possible as its very urjent.the query should be in
  MYSQL.that is the query should be such which can pick
  today's date and the date of the working day before
  the today's or the current date.
 
  =
  Rahul S. Johari (Director)
  **
  Abraxas Technologies Inc.
  Homepage : http://www.abraxastech.com
  Email : [EMAIL PROTECTED]
  Tel : 91-4546512/4522124
  ***
 
  __
  Do You Yahoo!?
  Yahoo! Health - Feel better, live better
  http://health.yahoo.com




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




[PHP] Problems with PEAR

2002-08-01 Thread andy

Hi there,
I am having trouble to install pear. This seems to be needed by a webmailer
called horde. somehow the pear comming with php4.2.2 does not contain a
certain log class. Here is what the faq says about this problem:
http://horde.org/faq/admin/trouble/index.php#t51
5.1.21 Fatal error: Undefined class name 'log' in ...
[Horde 2.x]: Your PHP PEAR implementation is missing the PEAR Log package.
This is a common problem with the PHP 4.2.1 PEAR for example. You can
install it via the network if you have a standalone php/pear command. See
the file horde/docs/INSTALL for more information on how to install the
required PEAR packages this way. Otherwise you can download the Log package
(e.g. from http://pear.php.net/get/Log) and manually install them inside
your PEAR directory. You may also need to install the modules Mail_Mime and
Net_Socket as well.

For more detailed instructions on install PEAR modules, see the PEAR
documentation at http://pear.php.net/manual/.

-
Ok... so far so good :-(
I did take a look at the pear php page and this takes me to another step to
install a webinstaller:

http://pear.php.net/manual/en/installation.web.php

So I did try this to :-(
But this results in following error msg:

capc11-35:/home/andy/sw/horde # lynx -source http://pear.php.net/go-pear |
sh
sh: ?php: No such file or directory

YOU NEED TO RUN THIS SCRIPT WITH PHP NOW!

Try this: lynx -source http://pear.php.net/go-pear | php -q

capc11-35:/home/andy/sw/horde # lynx -source http://pear.php.net/go-pear |
php -q
bash: php: command not found
capc11-35:/home/andy/sw/horde #


Has anybody an idea how to get this thing running? It just drives me cracy.

Thanx for any help,

andy




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




[PHP] Re: Printing a PHP Class

2002-08-01 Thread Markas

Its hard to imagine anything better and clear than what print_r() or even
var_dump() outputs...

Marty McGowan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 PHPers,
 In a genaology application, where I add individuals to
 an array:

  $everyone[] = new Individual($id);

 I'd like to print the indiviuals' attributes.  Some of these are
 in array's themselves: like a list of event's in one's life.

 My problem is:
 when printing the Class Variables using the standard approach:
 =
 function print_vars($obj) {
 $arr = get_object_vars($obj);
 while (list($prop, $val) = each($arr))
 {
echo $prop\t$val\n;
 }
 }
 =
 I see the message:

  Variables: Person: Added RELI attribute

 id I6
 last McGOWAN
 first Martin James
 suffix Sr.

 sex M

 lifeevent Array
 attribute Array
 

   My question is:
  How does one print out the Array?

   My attempt at testing .

(strcmp($val,Array) == 0)

   was fruitless, as the print value of
  $var is always a string, but not always
  in other contexts.

   What am I missing?

 Thanks,
  -- Marty McGowan






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




[PHP] Bug reporting site

2002-08-01 Thread Richard Black

Anyone else having trouble getting to http://bugs.php.net ???

==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED] 


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




RE: [PHP] Page title changes when call functions!!

2002-08-01 Thread Simon Ritchie

 I have a bad experience coding in PHP.  I create a home page in PHP,
 index.php.  Within this PHP code, it calls functions which are placed in
 other file.  I notice that the page title changes to something
 that I don't
 want it to be.

This is probably an HTML problem, not a PHP problem.  To see what is going
on, run your program, save the resulting HTML into a file (save as in the
edit menu on your browser) and look at it with a text editor.

It could be that you are confused about the way your browser displays the
title.  It should appear at the very top of your browser window, not in the
address line.

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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




[PHP] Storing script in database??

2002-08-01 Thread David Pratt

I am creating an application where it would be useful to write and store 
script in a field in a MySQL database and create a loop to process the array
of the code contained in the field. Conceptually, I think it sounds
reasonable but I am uncertain of what kind of process I could use to have
the code in the field variable read properly within the loop.  Somewhat
analogous to an include in HTML.
The file would be read as though a single script file though the included
material has come from a text field.

This would be really useful for me since the code could be modified in the
database outside a smaller application without changing the files.  Any
ideas here on how I might do this from anyone that has attempted anything
similar?  I have set everything up but just can't figure out how to bring
the script text in the field into the file properly. Help much appreciated.
--

Dave Pratt
[EMAIL PROTECTED]


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




RE: [PHP] include()

2002-08-01 Thread Simon Ritchie

 I suppose include() can be used to include files from remote
 systems(not on
 WINDOWS).

Only if the sysadmin running your web server allows it, which they should
not.


 A webmaster on the same server can always use a path like
 /home/htdocs/.../config.php and include my config .php which contains my
 database password !!

Not quite, but if you are on a shared server hosted by somebody else, there
is a potential problem.  If somebody can figure out the name of the function
that opens the database, they could call it, potemtially giving access to
the data.  You could use the solution posted by Justin French to make sure
that the function does nothing for them when they call it.

As other people have said, your hosting organisation should set the system
up so that nobody can read your PHP code, and that nobody outside the host
computer can include it.  However, I think it would be difficult for them to
stop another user on the same server including your code.

If you run your own server, you can set it up so that each webmaster is
locked into a private environment, but it's messy.  According to me, you
would need a separate copy of apache for each site, each running under a
different user, and they would need to run on separate ports, which is a
nuisance.

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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




Re: [PHP] include()

2002-08-01 Thread Andrey Hristov

  I suppose include() can be used to include files from remote
  systems(not on
  WINDOWS).

 Only if the sysadmin running your web server allows it, which they should
 not.


  A webmaster on the same server can always use a path like
  /home/htdocs/.../config.php and include my config .php which contains
my
  database password !!

 Not quite, but if you are on a shared server hosted by somebody else,
there
 is a potential problem.  If somebody can figure out the name of the
function
 that opens the database, they could call it, potemtially giving access to
 the data.  You could use the solution posted by Justin French to make sure
 that the function does nothing for them when they call it.
But probably the password is in variable so if you can include() the file
with the password and cored dump
the php you can view it. I've found a bug or two that core dump PHP and saw
my secrets there. Even
function or variables with mangled names will not help you.

 If you run your own server, you can set it up so that each webmaster is
 locked into a private environment, but it's messy.  According to me, you
 would need a separate copy of apache for each site, each running under a
 different user, and they would need to run on separate ports, which is a
 nuisance.

This is called SAFE mode (easy to be done) and the other restriction is
open_basedir directive in php.ini

Andrey


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




RE: [PHP] include()

2002-08-01 Thread Simon Ritchie

 Other users on the same server *shouldn't* be able to include() in this
way

 How?

 Would their $_SERVER['HTTP_HOST'] not be the same?


You did not specify your circumstances in your original posting, so there is
some confusion.

One web server can handle many domains.  An ISP offering shared hosting will
run their server this way, because it is cheap.

So, there are at least two cases:

(1) Several webmasters running the same domain.  They should be part of a
disciplined team, so this should not be a problem.

(2) Several domains, each run by one webmaster (or one team), possibly each
in a different organisation.  If you run the domain
www.somedomainorother.com, that will be in the HTTP_HOST entry.  If somebody
running another domain calls the function that opens your database, the
HTTP_HOST setting will be different.  The suggestion is to write your open
function to check for this.

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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




Re: [PHP] Storing script in database??

2002-08-01 Thread Justin French

I'm pretty sure you can use eval() on a string, but tread with caution, and
try to look around for security concerns.

I certainly wouldn't eval() anything supplied by a user... no way.


Justin French


on 01/08/02 7:53 PM, David Pratt ([EMAIL PROTECTED]) wrote:

 I am creating an application where it would be useful to write and store
 script in a field in a MySQL database and create a loop to process the array
 of the code contained in the field. Conceptually, I think it sounds
 reasonable but I am uncertain of what kind of process I could use to have
 the code in the field variable read properly within the loop.  Somewhat
 analogous to an include in HTML.
 The file would be read as though a single script file though the included
 material has come from a text field.
 
 This would be really useful for me since the code could be modified in the
 database outside a smaller application without changing the files.  Any
 ideas here on how I might do this from anyone that has attempted anything
 similar?  I have set everything up but just can't figure out how to bring
 the script text in the field into the file properly. Help much appreciated.
 --
 
 Dave Pratt
 [EMAIL PROTECTED]
 


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




Re: [PHP] Storing script in database??

2002-08-01 Thread lallous

I agree with Justin!

Probably your best solution is to write your own mini script and write an
interpreter for it!

Elias
Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm pretty sure you can use eval() on a string, but tread with caution,
and
 try to look around for security concerns.

 I certainly wouldn't eval() anything supplied by a user... no way.


 Justin French


 on 01/08/02 7:53 PM, David Pratt ([EMAIL PROTECTED]) wrote:

  I am creating an application where it would be useful to write and store
  script in a field in a MySQL database and create a loop to process the
array
  of the code contained in the field. Conceptually, I think it sounds
  reasonable but I am uncertain of what kind of process I could use to
have
  the code in the field variable read properly within the loop.  Somewhat
  analogous to an include in HTML.
  The file would be read as though a single script file though the
included
  material has come from a text field.
 
  This would be really useful for me since the code could be modified in
the
  database outside a smaller application without changing the files.  Any
  ideas here on how I might do this from anyone that has attempted
anything
  similar?  I have set everything up but just can't figure out how to
bring
  the script text in the field into the file properly. Help much
appreciated.
  --
 
  Dave Pratt
  [EMAIL PROTECTED]
 




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




RE: [PHP] calculating psysical path (a first try)

2002-08-01 Thread Simon Ritchie

I think that you have something like this:

$HTTP_SERVER_VARS['SCRIPT_NAME] == '\foo\bar.php'

$HTTP_SERVER_VARS[SCRIPT_FILENAME] ==
'c:\wwwroot\foo\bar.php'

and you want to use this to derive the root 'c:\wwwroot'.
You can use one of the standard string edit functions. Something like this:

$baseName = ereg_replace(
$HTTP_SERVER_VARS['SCRIPT_NAME' . '$',
'',
$HTTP_SERVER_VARS[SCRIPT_FILENAME]);

The first argument is regular expression.  This one matches the script name
as long as it appears at the end of the string.  The second argument is the
replacement string (nothing), the third is the string to search.

I cover regular expression pattern matching in my introduction to PHP (see
below).

However, the root directory is an Apache variable and these are passed to
PHP in another array.  I can't remember which right now!

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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




[PHP] Re: Disabling Browser BACK button

2002-08-01 Thread lallous

see: http://lgwm.org/trap.htm

try to use the same mechanism.

Elias
Petre [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HI
 Is there a way I can disable the client's browser back button, forcing
 them to use the navigation I built into the page?
 Ideally, when they try to press BACK on browser, a popup asking them
 to use the navigation instead would win first prize.

 The reason I'm asking is again to do with sessions, I have an app
 running 100% now without using cookies, but if the user hits BACK and
 ignores the expire warning, the app produces unwanted results ( adds
 form data again to the db etc.)
 Just want to patch the holes.

 Maybe write my own little browser that has no back button??





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




[PHP] Re: extracting variables from files

2002-08-01 Thread lallous

try str_replace()
or preg_replace()

Elias,

Nick Wilson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi everyone,

 I break out in a cold sweat just thinking about regex, so I thought I'd
 ask you if there was an easier way to do this:

 I want to look through all of the files in a directory and extract a
 certain variable from each.

 This is to create a dynamic menu of the directory: The files are php
 scripts that assign $title (among others) to Smarty templates.

 I need to get $title from each file

 I had a look through the docs and didn't see anything obvious, which is
 why I'm here :-)

 Many thanks...
 - --
 Nick Wilson // www.tioka.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE9SEtnHpvrrTa6L5oRAuVyAJ4j4jfC4nKKni3S6V5xsmZH2xhPDQCdF7wA
 Y0vShZPQ1n5qZE48LIhCVyA=
 =DLPZ
 -END PGP SIGNATURE-



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




[PHP] News to toolbar (ticker)

2002-08-01 Thread Jeff Lewis

vBulletin has a file called ticker.php that allows users to have latest
posts sent to their toolbar in Windows. An example can be found on this
site: http://www.whitesoxinteractive.com/Ticker.htm

How exactly do they do this? I can't manage to get my hands on the file to
take a look but it's something I'd like to look at.

Jeff



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




Re: [PHP] More ???s on passing variables

2002-08-01 Thread Paul Dionne

Jason Wong wrote:

 On Wednesday 31 July 2002 22:40, Paul Dionne wrote:

 I have a class in my script which has information on specific tables such
 as standard queries, tablenames, Index field...

 Then there is a function called StandardDropDown($ItemNum, $Name) which
 gets the info from the appropriate table you want and displays a dropdown
 menu based on the table.

 $ItemNum referrs to the table I want to output, $Name is what I want to
 call the dropdown in the HTML output.

 When I call the function directly from a page it works great.

 When I call it from another function I get an error:
 Fatal error: Call to a member function on a non-object in
 /var/www/html/COMESA/theme/functions.inc on line 61

 This is line 61: $TableName= $ItemNum-get_TableName();

 As I said, I only get this error when I call from a function, not if I
 call
 directly from a page.  I don't see why that should make any difference
 though.
 
 In your function declare your object as global.
 

I will do that and see if it helps, but why should that make a difference?  
I would like to know what I am doing wrong in general.

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




Re: [PHP] News to toolbar (ticker)

2002-08-01 Thread 1LT John W. Holmes

It just pulls up a PHP page...what's the big deal? Make up a PHP page that
pulls the newest post out, displays it, and refreshes itself ever minute or
so... It looks extremely annoying to me. Why would to want that on your
toolbar? Just open up IE with the same page.

---John  Holmes...

- Original Message -
From: Jeff Lewis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 7:27 AM
Subject: [PHP] News to toolbar (ticker)


 vBulletin has a file called ticker.php that allows users to have latest
 posts sent to their toolbar in Windows. An example can be found on this
 site: http://www.whitesoxinteractive.com/Ticker.htm

 How exactly do they do this? I can't manage to get my hands on the file to
 take a look but it's something I'd like to look at.

 Jeff



 --
 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: More ???s on passing variables

2002-08-01 Thread Paul Dionne

Help still needed.

I just went back to the code and looked.  Making $ItemNum does not make a 
difference.  And the object which is passed to it is part of the class 
which is global anyway.

Paul

Paul Dionne wrote:

 Hello everyone,
 
 I have a class in my script which has information on specific tables such
 as standard queries, tablenames, Index field...
 
 Then there is a function called StandardDropDown($ItemNum, $Name) which
 gets the info from the appropriate table you want and displays a dropdown
 menu based on the table.
 
 $ItemNum referrs to the table I want to output, $Name is what I want to
 call the dropdown in the HTML output.
 
 When I call the function directly from a page it works great.
 
 When I call it from another function I get an error:
 Fatal error: Call to a member function on a non-object in
 /var/www/html/COMESA/theme/functions.inc on line 61
 
 This is line 61: $TableName= $ItemNum-get_TableName();
 
 As I said, I only get this error when I call from a function, not if I
 call
 directly from a page.  I don't see why that should make any difference
 though.
 
 Paul


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




[PHP] Url of frame in php variable

2002-08-01 Thread patrick anderson

Hi,

does anyone know of an elegant way to get the Url of the current frame
in a php variable.

Thanks for any suggestions.

Patrick

PS I know that PHP_SELF will provide the url of the main frame


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




Re: [PHP] News to toolbar (ticker)

2002-08-01 Thread 1LT John W. Holmes

Well, Just make a PHP page that shows what you want. Use a META-REFRESH tag
to have it refresh itself every 60 seconds (I'm assuming that'll work in the
toolbar). I'm not sure of the specifics for vBulletin, but the database
structure isn't that difficult. Just pull use LIMIT to pull out the latest
post, format it, and display it on the page...

Do you still need help? Maybe you should get more specific as to what you
want...

---John Holmes...

- Original Message -
From: Jeff Lewis [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 8:34 AM
Subject: Re: [PHP] News to toolbar (ticker)


 I was being sarcastic. Trust me, you won't see me running the thing on my
 computer but for the open source project I run, users like all kinds of
 weird things :)


 - Original Message -
 From: 1LT John W. Holmes [EMAIL PROTECTED]
 To: Jeff Lewis [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 8:26 AM
 Subject: Re: [PHP] News to toolbar (ticker)


  I don't know if you're being sarcastic or not. It's hard to tell over
 email.
  I didn't mean to discourage you, I was just giving my personal opinion.
 
  ---John Holmes...
 
  - Original Message -
  From: Jeff Lewis [EMAIL PROTECTED]
  To: 1LT John W. Holmes [EMAIL PROTECTED]
  Sent: Thursday, August 01, 2002 8:13 AM
  Subject: Re: [PHP] News to toolbar (ticker)
 
 
   You're right, it's a stupid idea, I don't know why I ever thought of
  posting
   it on the list.
  
   I don't know what I was thinking, I'll crawl back under my rock now.
   - Original Message -
   From: 1LT John W. Holmes [EMAIL PROTECTED]
   To: Jeff Lewis [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Thursday, August 01, 2002 8:06 AM
   Subject: Re: [PHP] News to toolbar (ticker)
  
  
It just pulls up a PHP page...what's the big deal? Make up a PHP
page
  that
pulls the newest post out, displays it, and refreshes itself ever
 minute
   or
so... It looks extremely annoying to me. Why would to want that on
 your
toolbar? Just open up IE with the same page.
   
---John  Holmes...
   
- Original Message -
From: Jeff Lewis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 7:27 AM
Subject: [PHP] News to toolbar (ticker)
   
   
 vBulletin has a file called ticker.php that allows users to have
  latest
 posts sent to their toolbar in Windows. An example can be found on
  this
 site: http://www.whitesoxinteractive.com/Ticker.htm

 How exactly do they do this? I can't manage to get my hands on the
  file
   to
 take a look but it's something I'd like to look at.

 Jeff



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

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



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




Re: [PHP] Url of frame in php variable

2002-08-01 Thread Justin French

the only way would be with javascript, but remember, this would be done
AFTER the page leaves the server (client side), so it will be quite messy.

or you could try keeping track of what the sub-frame is doing with
sessions... each time you change it's URL, update the session variable.

or you could re-think your code design so you don't have to rely on
something so complicated :)

I guess knowing the reason why you need to do this might enable us to give
you more help.


Justin French


on 01/08/02 10:32 PM, patrick anderson ([EMAIL PROTECTED]) wrote:

 Hi,
 
 does anyone know of an elegant way to get the Url of the current frame
 in a php variable.
 
 Thanks for any suggestions.
 
 Patrick
 
 PS I know that PHP_SELF will provide the url of the main frame
 


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




Re: [PHP] Url of frame in php variable

2002-08-01 Thread patrick anderson

I would like to include a style sheet  based on the url;
the references to the style sheet are stored in MySQL.

I guess the way to code this would be to use php to create
the javascript code with the list of style sheets.

thanks,

patrick


Justin French wrote:

 the only way would be with javascript, but remember, this would be done
 AFTER the page leaves the server (client side), so it will be quite messy.

 or you could try keeping track of what the sub-frame is doing with
 sessions... each time you change it's URL, update the session variable.

 or you could re-think your code design so you don't have to rely on
 something so complicated :)

 I guess knowing the reason why you need to do this might enable us to give
 you more help.

 Justin French

 on 01/08/02 10:32 PM, patrick anderson ([EMAIL PROTECTED]) wrote:

  Hi,
 
  does anyone know of an elegant way to get the Url of the current frame
  in a php variable.
 
  Thanks for any suggestions.
 
  Patrick
 
  PS I know that PHP_SELF will provide the url of the main frame
 


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




[PHP] ldap_modify parameters?

2002-08-01 Thread Chad Day

I think something is wrong with the way I am calling ldap_modify, but I'm
not sure exactly what, from the scripts and tutorials I've been looking
at/experimenting with:

$ds=ldap_connect(online-leagues.com);
if ($ds) {
$r=ldap_bind($ds, 'username', 'password');
// Search surname entry
$sr=ldap_search($ds, 'cn=online-leagues.com', 'uid=testing');
echo Search result is .$sr.p;
$info = ldap_get_entries($ds, $sr);
   echo dn is: . $info[0][dn] .br;
echo first cn entry is: . $info[0][cn][0] .br;
echo first email entry is: . $info[0][mail][0] .p;
echo st = . $info[0][st][0] .p;

$info[0][st][0]=stchanged!;

ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
echo Closing connection;
ldap_close($ds);

} else {
echo h4Unable to connect to LDAP server/h4;
}

The error returned is:

Fatal error: LDAP: Unknown Attribute in the data in
/usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

I looked up the error on google but didn't find anything..


Running ldapsearch from the command line on my box, the record looks like:


#
# filter: (objectclass=*)
# requesting: ALL
#

# online-leagues.com
dn: cn=online-leagues.com
objectclass: top
objectclass: organization
objectclass: CommuniGateDomain
cn: online-leagues.com
o: www.online-leagues.com


# testing, online-leagues.com
dn: uid=testing,cn=online-leagues.com
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: CommuniGateAccount
cn: rn
hostServer: online-leagues.com
sn:
st: st
street: str
telephoneNumber: tn
uid: testing
mail: [EMAIL PROTECTED]


so I think the dn is right, but I'm not 100% sure now.  Any ideas?

Thanks,
Chad


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




Re: [PHP] ldap_modify parameters?

2002-08-01 Thread Rasmus Lerdorf

I think your problem is that you are passing the output of
ldap_get_entries() directly back into ldap_modify().  ldap_get_entries()
returns an array of result elements whereas ldap_modify() is expecting a
single element.

So, to change the 'st' attribute for the uid=testing record, you should
simply do:

$data['st'] = 'stchanged';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

If st takes multiple values, use:

$data['st'][0] = 'stchanged';
$data['st'][1] = '2nd value';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

-Rasmus

On Thu, 1 Aug 2002, Chad Day wrote:

 I think something is wrong with the way I am calling ldap_modify, but I'm
 not sure exactly what, from the scripts and tutorials I've been looking
 at/experimenting with:

   $ds=ldap_connect(online-leagues.com);
   if ($ds) {
   $r=ldap_bind($ds, 'username', 'password');
   // Search surname entry
   $sr=ldap_search($ds, 'cn=online-leagues.com', 'uid=testing');
   echo Search result is .$sr.p;
   $info = ldap_get_entries($ds, $sr);
echo dn is: . $info[0][dn] .br;
 echo first cn entry is: . $info[0][cn][0] .br;
 echo first email entry is: . $info[0][mail][0] .p;
   echo st = . $info[0][st][0] .p;

   $info[0][st][0]=stchanged!;

   ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
   echo Closing connection;
   ldap_close($ds);

   } else {
   echo h4Unable to connect to LDAP server/h4;
   }

 The error returned is:

 Fatal error: LDAP: Unknown Attribute in the data in
 /usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

 I looked up the error on google but didn't find anything..


 Running ldapsearch from the command line on my box, the record looks like:


 #
 # filter: (objectclass=*)
 # requesting: ALL
 #

 # online-leagues.com
 dn: cn=online-leagues.com
 objectclass: top
 objectclass: organization
 objectclass: CommuniGateDomain
 cn: online-leagues.com
 o: www.online-leagues.com


 # testing, online-leagues.com
 dn: uid=testing,cn=online-leagues.com
 objectclass: top
 objectclass: person
 objectclass: organizationalPerson
 objectclass: inetOrgPerson
 objectclass: CommuniGateAccount
 cn: rn
 hostServer: online-leagues.com
 sn:
 st: st
 street: str
 telephoneNumber: tn
 uid: testing
 mail: [EMAIL PROTECTED]


 so I think the dn is right, but I'm not 100% sure now.  Any ideas?

 Thanks,
 Chad


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



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




Re: [PHP] Re: More ???s on passing variables

2002-08-01 Thread Jason Wong

On Thursday 01 August 2002 20:21, Paul Dionne wrote:
 Help still needed.

 I just went back to the code and looked.  Making $ItemNum does not make a
 difference.  And the object which is passed to it is part of the class
 which is global anyway.

Use print_r() or var_dump() on $ItemNum outside and inside of the function and 
compare.

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

/*
What we wish, that we readily believe.
-- Demosthenes
*/


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




[PHP] use of COM object

2002-08-01 Thread Christophe PIN

Hello,

I have to use a COM object with following properties:

...
Property StationsX(lIndex As Long) As Long
Property StationsY(lIndex As Long) As Long
...

I didn't manage to initialize these properties.
I create a new COM object with:
$obj = new COM();

If I try
$obj-StationX(0)=$val;

I get an error message ( StationX(0) is then known as a function. So, I
can't put a value in it)

So, I want to use com_propput but it doesn't work.

Can any one help me, giving me the good syntax for com_propput, or giving me
advices...

I'm using PHP 4.2.2

Thank u very much



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




RE: [PHP] ldap_modify parameters?

2002-08-01 Thread Chad Day

Also tried that, no success, unless I am missing something.

...
$info[st]=stchanged!;
...

ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);

Fatal error: LDAP: Unknown Attribute in the data in
/usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

Chad

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 01, 2002 9:41 AM
To: Chad Day
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] ldap_modify parameters?


I think your problem is that you are passing the output of
ldap_get_entries() directly back into ldap_modify().  ldap_get_entries()
returns an array of result elements whereas ldap_modify() is expecting a
single element.

So, to change the 'st' attribute for the uid=testing record, you should
simply do:

$data['st'] = 'stchanged';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

If st takes multiple values, use:

$data['st'][0] = 'stchanged';
$data['st'][1] = '2nd value';
ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $data);

-Rasmus

On Thu, 1 Aug 2002, Chad Day wrote:

 I think something is wrong with the way I am calling ldap_modify, but I'm
 not sure exactly what, from the scripts and tutorials I've been looking
 at/experimenting with:

   $ds=ldap_connect(online-leagues.com);
   if ($ds) {
   $r=ldap_bind($ds, 'username', 'password');
   // Search surname entry
   $sr=ldap_search($ds, 'cn=online-leagues.com', 'uid=testing');
   echo Search result is .$sr.p;
   $info = ldap_get_entries($ds, $sr);
echo dn is: . $info[0][dn] .br;
 echo first cn entry is: . $info[0][cn][0] .br;
 echo first email entry is: . $info[0][mail][0] .p;
   echo st = . $info[0][st][0] .p;

   $info[0][st][0]=stchanged!;

   ldap_modify($ds, 'uid=testing,cn=online-leagues.com', $info);
   echo Closing connection;
   ldap_close($ds);

   } else {
   echo h4Unable to connect to LDAP server/h4;
   }

 The error returned is:

 Fatal error: LDAP: Unknown Attribute in the data in
 /usr/local/www/sites/online-leagues.com/htdocs/ldapform.php on line 31

 I looked up the error on google but didn't find anything..


 Running ldapsearch from the command line on my box, the record looks like:


 #
 # filter: (objectclass=*)
 # requesting: ALL
 #

 # online-leagues.com
 dn: cn=online-leagues.com
 objectclass: top
 objectclass: organization
 objectclass: CommuniGateDomain
 cn: online-leagues.com
 o: www.online-leagues.com


 # testing, online-leagues.com
 dn: uid=testing,cn=online-leagues.com
 objectclass: top
 objectclass: person
 objectclass: organizationalPerson
 objectclass: inetOrgPerson
 objectclass: CommuniGateAccount
 cn: rn
 hostServer: online-leagues.com
 sn:
 st: st
 street: str
 telephoneNumber: tn
 uid: testing
 mail: [EMAIL PROTECTED]


 so I think the dn is right, but I'm not 100% sure now.  Any ideas?

 Thanks,
 Chad


 --
 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: Logging out with authentication

2002-08-01 Thread Pete James

?php
  if(!isset($PHP_AUTH_USER) || (isset($logout))) {
header(WWW-Authenticate: Basic realm=\Your Realm\);
header(HTTP/1.0 401 Unauthorized);
echo Your custom 401 message here\n;
exit;
  } else {
echo pHello $PHP_AUTH_USER./p;
echo pYour password is $PHP_AUTH_PW./p;
echo forminput type=submit name=logout value=Logout/form;
  }
?

Ray Todd Stevens wrote:
 
 I am working on a web site that is using php controled www-
 authenticate authentication.  User ids are specific to users and
 different pages and different levels of information for a given page
 will be displayed based on the user id used.  The problem is how do
 you log out without having to quit all browser sessions.  Anyone
 doing this?  Care to share code that makes it work?
 
 --
 Ray Todd Stevens Specialists in Network and Security
 Consulting
 Senior ConsultantSoftware audit service available
 Stevens Services
 Suite 21
 3754 Old State Rd 37 N
 Bedford, IN 47421
 (812) 279-9394
 [EMAIL PROTECTED]
 
 Thought for the day:
 Concerto (n): a fight between a piano and a pianist.
 
 For PGP public key send message with subject
 please send PGP key
 
 If this message refers to an attachment the attachment
 may arrive as a seperate mail message depending on the
 type of mail client and gateway software you are using.


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


[PHP] PEAR with lots of trouble

2002-08-01 Thread Andy

Hi there,

I am trying to install PEAR. Horde - a webmailer - requires a certain log
modul which seams not to come with the recent php installation. I installed
a second php version as standalone php version to be able to install the
pear class like stated on the php.net site. However I do still get this
message:

a.. Log - No
a.. Make sure you're using a recent version of PEAR which includes the Log
class

Can anybody give me a hint on how to install this PEAR successfully on my
php version (I guess now it is installed inside the other php standalone
version)

Thanx for any help

Andy







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




[PHP] sort results into two columns

2002-08-01 Thread kompresor

hi,

how can i sort data from mysql into two columns. Thanks.

eg:

link1linka
link linke



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




[PHP] Sablotron error

2002-08-01 Thread ctan

Hi...

I'm working on XML files where are stored in a MySQL database. With PHP I
intend to transform these XML with XSLT. After much difficulty, I managed to
sort out everything until the portion about xslt_process. The browser
returns:

Warning: Sablotron error on line 2: 'arg:/argument.dtd' not found in
/home/httpd/html/ctan/resultworkingcopy2.php on line 91
XSLT processing error: 'arg:/argument.dtd' not found

Anyone have any idea what's going on? I'd appreciate any help I can get on
this. Thanks in advance.

Chia

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




[PHP] Re: [imp] New version of apache and php are good for work with IMP 3.x ?

2002-08-01 Thread EdwardSPL

Hello,

I have just finished re-compile and re-install apache 1.3.26, php 4.2.2,
openssl 0.9.6d and mod_ssl...
But when I start the apache by running :
apachectl startssl

php and https can't for work with apache, then I check the file httpd.conf :
I found :
IfDefine SSL
LoadModule ssl_module libexec/libssl.so
LoadModule php4_modulelibexec/libphp4.so
/IfDefine

IfDefine SSL
AddModule mod_ssl.c
AddModule mod_php4.c
/IfDefine

IfDefine SSL
Listen 80
Listen 443
/IfDefine

And there are no the following lines into httpd.conf :

AddType application/x-httpd-php .php .php
AddType application/x-httpd-php-source .phps

So, I try to modify the setting by these :

#IfDefine SSL
LoadModule ssl_module libexec/libssl.so
LoadModule php4_modulelibexec/libphp4.so
#/IfDefine

#IfDefine SSL
AddModule mod_ssl.c
AddModule mod_php4.c
#/IfDefine

IfDefine SSL
#Listen 80
Listen 443
/IfDefine
Listen 80

And then add these lines into httpd.conf also :

AddType application/x-httpd-php .php .php
AddType application/x-httpd-php-source .phps

After that, I try to restart the apache by : apachectl startssl...

OH...php is ok for work with apache, but https can't for work with apache again
!

So, can you help me more ?

Thanks.

Cristel Iofciu wrote:

 I know Apache 1.3.26, PHP 4.2.2 on Slack 8.0 work with IMP.
 I suggest you upgrade to Apache 1.3.26 too (take a look at CERT.org for the
 reason :)), and don't think RH6.2 will matter in this case...

 Cristel Iofciu
 NetAdmin
 ---
 eXonsite srl
 Constanta, 8700
 Soveja 19, Bl. V3 ap.24
 --
 [T] +40-0241-638300
 [M] +40-0722-924541
 [E] [EMAIL PROTECTED]
 [W] www.exonsite.ro
 

 Quoting [EMAIL PROTECTED]:

  Hello,
 
  Do you know apache 1.3.22 and php 4.2.2 are good for work with IMP 3.x
  under RH 6.2 system ?
 
  Thank for your help !
 
  Edward.
 
 
 
 
  --
  IMP mailing list
  Frequently Asked Questions: http://horde.org/faq/
  To unsubscribe, mail: [EMAIL PROTECTED]
 

 --
 Acest mesaj a fost trimis prin  http://webmail.exonsite.ro



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




[PHP] Form asking to refresh when I hit the back button

2002-08-01 Thread DonPro

Not sure if this is a PHP question but I've traced the problem to a PHP
statement.

I have a form that when submitted, displays a PDF document in the browser
(using a PDF library).  When I click on the back button, it should redisplay
my form but instead, displays a warning that data has expired and I need to
refresh.  Now this never happened until recently so I look at recent changes
and traced the problem to one single PHP statement at the top of my file:

session_start();

I am using sessions to pass values between pages and so added the statement
to my page so that I could check the value of a variable.  When I comment
out the above statement, I am no longer prompted to refresh.

Question: How can I have my cake and eat it to?

Thanks,
Don



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




Re: [PHP] Form asking to refresh when I hit the back button

2002-08-01 Thread Danny Shepherd

This is generally caused by using POST as the form's methods. Try using GET
instead.

Danny.

- Original Message -
From: DonPro [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 3:57 PM
Subject: [PHP] Form asking to refresh when I hit the back button


 Not sure if this is a PHP question but I've traced the problem to a PHP
 statement.

 I have a form that when submitted, displays a PDF document in the browser
 (using a PDF library).  When I click on the back button, it should
redisplay
 my form but instead, displays a warning that data has expired and I need
to
 refresh.  Now this never happened until recently so I look at recent
changes
 and traced the problem to one single PHP statement at the top of my file:

 session_start();

 I am using sessions to pass values between pages and so added the
statement
 to my page so that I could check the value of a variable.  When I comment
 out the above statement, I am no longer prompted to refresh.

 Question: How can I have my cake and eat it to?

 Thanks,
 Don



 --
 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] Session Problems

2002-08-01 Thread eat pasta type fasta

What does it mean when PHP forces the session ID into the URL, the host 
changed something in the configuration without informing me it would 
seem, (it dind't happen before now does)

R

--__-__-__
eat pasta
type fasta


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




[PHP] Getting user's local TZ

2002-08-01 Thread Chris Boget

I looked in the predefined variable section of the manual and
couldn't find that there was a way to get this information from
that.  If there was another way you could get this via PHP, I
couldn't find it anywhere else in the docs.
So, does anyone know of a good method to get the Time Zone 
local to the end user?

Chris



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




Re: [PHP] web services and PHP

2002-08-01 Thread Bob Lockie


A'la ASP WebServices perhaps?

Bob Lockie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I'd like to know if it's possible to use PHP to develop and implement
 Web Services. If so, please point me to sites, articles, or tutorials
 that discuss this topic in more detail. Thanks.

 How do you define web services?

I know nothing about ASP.







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




[PHP] mysql_field_flags() problems

2002-08-01 Thread Mathieu Dumoulin

This is a part of my code for my data interfacer class which takes an SQL
RESULT RESOURCE and gets the field from it. Problem is, i can't get the
primary key out nor the auto-increment flag out. Before, the same script (or
so, it was modified but not that part) was working fine. I tried it on
several tables and on several database servers and i still can't get the
PRIMARY or AUTO_INCREMENT flag out. In fact the only flag that is returned
is: NOT_NULL. (When i ECHO the mysql_field_flags(...) i get only notnull).

Furthermore, i can't seem to get the data, that i will check more in detail,
my most important part IS the primary and auto-increment flags.

Thanks in advance if you can find something.

Here is the complete code that you need:

//Execute the query twice to get the fields and a result for the values
$result =
$this-mysql_server-send_result_sql($this-query_builder-generate_select()
, 1);
$fieldlist =
$this-mysql_server-send_result_sql($this-query_builder-generate_select()
, 1);

//get the first row to insert values in the interface
$data = mysql_fetch_array($result);

//Used for the field flag fetching
$curfield = -1;
$fieldcount = mysql_num_fields($fieldlist);

//Loop the data field definition and add the field in the end
for($curfield = 0; $curfield  $fieldcount; $curfield++){
   //Get the current field
   $datadef = mysql_fetch_field($fieldlist, $curfield);

   //Reset the data
   $primary_key = 0;
   $auto_increment = 0;

   //Get all the other params from the field definition
   $fieldname = $datadef-name;
   $sourcetable  = $datadef-table;
   $datatype = constant(MYSQL_NDT_ . strtoupper($datadef-type));
   $fieldvalue = $data[$datadef-name];
   $datasize = $datadef-max_length;

   //Get the field flags and explode them immediatly
   $fieldflags = explode( , mysql_field_flags($fieldlist, $curfield));

   //Check all the field flags
   foreach($fieldflags as $key = $value){
if($value == primary_key){
 $primary_key = 1;
}elseif($value == auto_increment){
 $auto_increment = 1;
}
   }

   //Add the field to the data_interface
   $newint-add_field($fieldname, $fieldvalue, $datatype, $datasize,
$primary, $autoinc, $sourcetable);
}



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




[PHP] Re: Dynamically check radio buttons

2002-08-01 Thread Shew

OK, changed the subject to what I think it should be about.

Anybody?

Shew [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi - I'm a TOTAL php NEWBIE - my 1st bit of code!!!.

 Basically the input form page has 17 sets of radio buttons, each
 representing one game with 2 options - team 1 and team 2. What I want to
do
 is a better way of checking each radio button value instead of using an if
 statement for each. This code doesn't really work - it finds that vars
 ALWAYS exist.

 IE:

 INPUT NAME=Game1 VALUE=1Chicago
 INPUT NAME=Game1 VALUE=2whatever

 INPUT NAME=Game2 VALUE=3Minny
 INPUT NAME=Game2 VALUE=1Nobody

 Code above is processed by the following code:

 for ($GameIdx = 1; $GameIdx = 17; $GameIdx++) {
  /* instead hardcoding each radio button name - just do it
programmatically
 by concatenating / creating the name */
  $frmGame = Game + $GameIdx;
  if ($frmGame) {
   /* U want to check if the length is 5 or 6 bytes because it could be
 game1 or game14 */
   $Length = strlen($frmGame);
   if ($Length == 5) {
$GetNumber = 1;
   }
   else {
$GetNumber = 2;
   }

   $GameID = intval(substr($frmGame, $Length - $GetNumber, $GetNumber));
   print Game --- $GameIdx - $frmGame - $GetNumber - $GameID BR;
 if ($GameID == $GameIdx) {
print Yeah Match - $GameID = $GameIdx BR;
/* OK, here is where U want to do the actual insert */
   }
  } /* $frmGame endif */
 }

 ?


 Thanks






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




[PHP] mcrypt

2002-08-01 Thread Randy Johnson

I am looking into different password encryption solutions.

i started using crypt()

then changed to mcrypt()

which was not any good cause of the high ascii characters

then i read about converting the high ascii characters to hex .

Is this the ideal way to encrypt passwords or is their something better.

Thanks 

Randy



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




Re: [PHP] web services and PHP

2002-08-01 Thread Danny Shepherd

I think he means XML WebServices (probably using SOAP)

It's not too difficult, there are a few SOAP classes for PHP now, simply
send your SOAP encoded request to the server, via HTTP, and decode the SOAP
response that you get back.

There's also a SOAP module for PHP (alpha release atm) at
http://phpsoaptoolkit.sourceforge.net/phpsoap/

If you're after an all in 1 solution you might want to look at nusoap - but
it was really buggy the last time I used it, so I don't recommend it at this
time.

I've heard something about another all in 1 solution that's quite
promising - but it's behind closed doors atm.

Danny.

- Original Message -
From: Bob Lockie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:09 PM
Subject: Re: [PHP] web services and PHP



 A'la ASP WebServices perhaps?
 
 Bob Lockie [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  I'd like to know if it's possible to use PHP to develop and implement
  Web Services. If so, please point me to sites, articles, or tutorials
  that discuss this topic in more detail. Thanks.
 
  How do you define web services?

 I know nothing about ASP.







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

2002-08-01 Thread Danny Shepherd

Just base64 encode the mcrypt output if the non printable chars bother you,
though I don't really see what the problem is, unless you're pushing the
output to a web page.

Danny.


- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:24 PM
Subject: [PHP] mcrypt


 I am looking into different password encryption solutions.

 i started using crypt()

 then changed to mcrypt()

 which was not any good cause of the high ascii characters

 then i read about converting the high ascii characters to hex .

 Is this the ideal way to encrypt passwords or is their something better.

 Thanks

 Randy



 --
 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: Problems with PEAR

2002-08-01 Thread electroteque

read this site

http://vulcanonet.com/soft/index.php?pack=pear_tut#ss2

the best pear tutorial to get me going

prob try and install via cvs , thats the whole lot though, but it works ,
also search http://pear.php.net for the package and then copy it to that dir

also make sure the include dir to pear is setup in php.ini

usually /usr/local/lib/php or whereever pear is sitting

there is a whole list regards to pear php.pear
Andy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,
 I am having trouble to install pear. This seems to be needed by a
webmailer
 called horde. somehow the pear comming with php4.2.2 does not contain a
 certain log class. Here is what the faq says about this problem:
 http://horde.org/faq/admin/trouble/index.php#t51
 5.1.21 Fatal error: Undefined class name 'log' in ...
 [Horde 2.x]: Your PHP PEAR implementation is missing the PEAR Log package.
 This is a common problem with the PHP 4.2.1 PEAR for example. You can
 install it via the network if you have a standalone php/pear command. See
 the file horde/docs/INSTALL for more information on how to install the
 required PEAR packages this way. Otherwise you can download the Log
package
 (e.g. from http://pear.php.net/get/Log) and manually install them inside
 your PEAR directory. You may also need to install the modules Mail_Mime
and
 Net_Socket as well.

 For more detailed instructions on install PEAR modules, see the PEAR
 documentation at http://pear.php.net/manual/.

 -
 Ok... so far so good :-(
 I did take a look at the pear php page and this takes me to another step
to
 install a webinstaller:

 http://pear.php.net/manual/en/installation.web.php

 So I did try this to :-(
 But this results in following error msg:

 capc11-35:/home/andy/sw/horde # lynx -source http://pear.php.net/go-pear |
 sh
 sh: ?php: No such file or directory

 YOU NEED TO RUN THIS SCRIPT WITH PHP NOW!

 Try this: lynx -source http://pear.php.net/go-pear | php -q

 capc11-35:/home/andy/sw/horde # lynx -source http://pear.php.net/go-pear |
 php -q
 bash: php: command not found
 capc11-35:/home/andy/sw/horde #

 
 Has anybody an idea how to get this thing running? It just drives me
cracy.

 Thanx for any help,

 andy






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




RE: [PHP] mcrypt

2002-08-01 Thread Darren Gamble

Good day,

 i started using crypt()
 
 then changed to mcrypt()
 
 which was not any good cause of the high ascii characters
 
 then i read about converting the high ascii characters to hex .
 
 Is this the ideal way to encrypt passwords or is their 
 something better.

The crypt() function will generate a standard UNIX crypt password that other
programs can understand.  UNIX crypt has some limitations (only using the
first 8 characters is the major one) but it's good enough for most people
and is probably the most widely supported.

If you want something stronger, you can use md5().  The examples on php's
documentation for this function should help you if you're interested in
having other programs use it (to have it the right format and length).


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948

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




RE: [PHP] Re: Dynamically check radio buttons

2002-08-01 Thread Mark Middleton

It looks like your code could use variable variables to help you out.

::: OLD CODE 

  for ($GameIdx = 1; $GameIdx = 17; $GameIdx++) {
   /* instead hardcoding each radio button name - just do it
 programmatically
  by concatenating / creating the name */
   $frmGame = Game + $GameIdx;
   if ($frmGame) {

::: END OF OLD CODE :

** this check will always be true - because you just set $frmGame equal to a
value... ***
What you want to do at this point is use variable variables (where the
variable name is actually
a variable itself.

: NEW CODE :::

   $var_frmGame = Game + $GameIdx;
   $frmGame = $$var_frmGame;   // The $$ is used for variable variables
   if ($frmGame) {

:: END OF NEW CODE :::

** the above snippett is was I wrote to show the results of the dynamic
(looped-through) variable $Game1, $Game2, ...

I use this method when the number of form elements is variable.  Instead of
hardcoding the number 17 you might make a variable in the incoming form
with the count of form elements (simply increment a variable with each
printing of the form variable... then at the end of the form make input
type=hidden name=elementcount value=$count)

Then you can make the above for-statement look like this:

  for ($GameIdx = 1; $GameIdx = $elementcount; $GameIdx++) {

Does any of this make sense or help in any way?

-Mark



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




RE: [PHP] Re: Dynamically check radio buttons

2002-08-01 Thread Johnson, Kirk

If you made an array for your buttons, then you could use PHP's looping
constructs to process the array. Write the input tag like this:

INPUT NAME=Game[1] VALUE=1Chicago

The processing code will then have access to the array $Game indexed by the
game number, e.g., $Game[1].

Good luck!

Kirk


 -Original Message-
 From: Shew [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 9:19 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Dynamically check radio buttons
 
 
 OK, changed the subject to what I think it should be about.
 
 Anybody?
 
 Shew [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi - I'm a TOTAL php NEWBIE - my 1st bit of code!!!.
 
  Basically the input form page has 17 sets of radio buttons, each
  representing one game with 2 options - team 1 and team 2. 
 What I want to
 do
  is a better way of checking each radio button value instead 
 of using an if
  statement for each. This code doesn't really work - it 
 finds that vars
  ALWAYS exist.
 
  IE:
 
  INPUT NAME=Game1 VALUE=1Chicago
  INPUT NAME=Game1 VALUE=2whatever
 
  INPUT NAME=Game2 VALUE=3Minny
  INPUT NAME=Game2 VALUE=1Nobody
 
  Code above is processed by the following code:
 
  for ($GameIdx = 1; $GameIdx = 17; $GameIdx++) {
   /* instead hardcoding each radio button name - just do it
 programmatically
  by concatenating / creating the name */
   $frmGame = Game + $GameIdx;
   if ($frmGame) {
/* U want to check if the length is 5 or 6 bytes because 
 it could be
  game1 or game14 */
$Length = strlen($frmGame);
if ($Length == 5) {
 $GetNumber = 1;
}
else {
 $GetNumber = 2;
}
 
$GameID = intval(substr($frmGame, $Length - $GetNumber, 
 $GetNumber));
print Game --- $GameIdx - $frmGame - $GetNumber - $GameID BR;
  if ($GameID == $GameIdx) {
 print Yeah Match - $GameID = $GameIdx BR;
 /* OK, here is where U want to do the actual insert */
}
   } /* $frmGame endif */
  }
 
  ?
 
 
  Thanks
 
 
 
 
 
 
 -- 
 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] mcrypt

2002-08-01 Thread Randy Johnson

I found that the some of the high ascii characters would not store right in
the database or something cause when i went to compare them, the comparison
would fail.


Randy

- Original Message -
From: Danny Shepherd [EMAIL PROTECTED]
To: Randy Johnson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 11:31 AM
Subject: Re: [PHP] mcrypt


 Just base64 encode the mcrypt output if the non printable chars bother
you,
 though I don't really see what the problem is, unless you're pushing the
 output to a web page.

 Danny.


 - Original Message -
 From: Randy Johnson [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 4:24 PM
 Subject: [PHP] mcrypt


  I am looking into different password encryption solutions.
 
  i started using crypt()
 
  then changed to mcrypt()
 
  which was not any good cause of the high ascii characters
 
  then i read about converting the high ascii characters to hex .
 
  Is this the ideal way to encrypt passwords or is their something better.
 
  Thanks
 
  Randy
 
 
 
  --
  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] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Scott Fletcher

Anyone know the workaround with the situation here?  Here is the sample
script.  The problem is I include the XML tag into the PHP variable and it
messed up everything.  It all had to do with ? here since PHP use it also.

--clip--
?php
$XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
echo $XML;
?

Thanks,
 FletchSOD



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




Re: [PHP] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Danny Shepherd

Try:

?php
$XML = .?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
echo $XML;
?

HTH

Danny.

- Original Message -
From: Scott Fletcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 5:03 PM
Subject: [PHP] Problem with ?xml  inside the PHP code, due to ?


 Anyone know the workaround with the situation here?  Here is the sample
 script.  The problem is I include the XML tag into the PHP variable and it
 messed up everything.  It all had to do with ? here since PHP use it
also.

 --clip--
 ?php
 $XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
 echo $XML;
 ?

 Thanks,
  FletchSOD



 --
 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] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Matt Babineau

?php
$XML = \?xml version='1.0'
encoding='UTF-8'\?ProductApple/Product;
echo $XML;
?

Try this?

Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 01, 2002 12:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with ?xml  inside the PHP code, due to
?


Anyone know the workaround with the situation here?  Here is the sample
script.  The problem is I include the XML tag into the PHP variable and
it messed up everything.  It all had to do with ? here since PHP use
it also.

--clip--
?php
$XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
echo $XML;
?

Thanks,
 FletchSOD



-- 
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] sort results into two columns

2002-08-01 Thread Simon Ritchie

 how can i sort data from mysql into two columns. Thanks.

 eg:

 link1linka
 link linke

Do you mean how can you get MySQL to present the data in sorted order or how
can you get the browser to display the results in neat columns?

Depending upon the question, you either want to use a SELECT query with an
ORDER BY clause or you want to output the result  within HTML table tags.

Simon Ritchie

Download my introduction to PHP for $25:
http://merrowinternet.com/downloads?source=ml


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




RE: [PHP] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Mark Middleton



 ?php
 $XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
 echo $XML;
 ?


Not sure if this is the best way, but it worked for me:

$XML = .?xml version='1.0'
encoding='UTF-8'?.ProductApple/Product;

Hope this helps,
Mark


Mark Middleton
Whirled Web


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




Re: [PHP] mcrypt

2002-08-01 Thread Danny Shepherd

Try setting the database field type to 'BLOB'

Danny.

- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:51 PM
Subject: Re: [PHP] mcrypt


 I found that the some of the high ascii characters would not store right
in
 the database or something cause when i went to compare them, the
comparison
 would fail.


 Randy

 - Original Message -
 From: Danny Shepherd [EMAIL PROTECTED]
 To: Randy Johnson [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 11:31 AM
 Subject: Re: [PHP] mcrypt


  Just base64 encode the mcrypt output if the non printable chars bother
 you,
  though I don't really see what the problem is, unless you're pushing the
  output to a web page.
 
  Danny.
 
 
  - Original Message -
  From: Randy Johnson [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Thursday, August 01, 2002 4:24 PM
  Subject: [PHP] mcrypt
 
 
   I am looking into different password encryption solutions.
  
   i started using crypt()
  
   then changed to mcrypt()
  
   which was not any good cause of the high ascii characters
  
   then i read about converting the high ascii characters to hex .
  
   Is this the ideal way to encrypt passwords or is their something
better.
  
   Thanks
  
   Randy
  
  
  
   --
   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] .htaccess file

2002-08-01 Thread B i g D o g

Is it possible to set register_globals to off in the .htaccess file.  If so
how do I do that?


.: B i g D o g :.




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




Re: [PHP] include()

2002-08-01 Thread Lee

--snip--
 If you run your own server, you can set it up so that each webmaster is
 locked into a private environment, but it's messy.  According to me, you
 would need a separate copy of apache for each site, each running under a
 different user, and they would need to run on separate ports, which is a
 nuisance.
--snip--

Though I would add my 2 pennies worh on this but it is probably more on an
Apache list answer but,  I recently asked a question about something
similair myself on the Apache mailing list.

You can have mutiple apache servers running on the same machine as long as
you have used the Listen IP:Port Directive on each Apache server Instance
to limit the IP it listens to.  Therefore as long as each site has its own
IP address you would not need to use different ports.  I am not aware of any
ISP/web host that runs like this though, due to the extract resources (e.g.
memory  CPU time) required to run the muliple instances.

Cheers

Lee

- Original Message -
From: Simon Ritchie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 11:30 AM
Subject: RE: [PHP] include()


  I suppose include() can be used to include files from remote
  systems(not on
  WINDOWS).

 Only if the sysadmin running your web server allows it, which they should
 not.


  A webmaster on the same server can always use a path like
  /home/htdocs/.../config.php and include my config .php which contains
my
  database password !!

 Not quite, but if you are on a shared server hosted by somebody else,
there
 is a potential problem.  If somebody can figure out the name of the
function
 that opens the database, they could call it, potemtially giving access to
 the data.  You could use the solution posted by Justin French to make sure
 that the function does nothing for them when they call it.

 As other people have said, your hosting organisation should set the system
 up so that nobody can read your PHP code, and that nobody outside the host
 computer can include it.  However, I think it would be difficult for them
to
 stop another user on the same server including your code.

 If you run your own server, you can set it up so that each webmaster is
 locked into a private environment, but it's messy.  According to me, you
 would need a separate copy of apache for each site, each running under a
 different user, and they would need to run on separate ports, which is a
 nuisance.

 Simon Ritchie

 Download my introduction to PHP for $25:
 http://merrowinternet.com/downloads?source=ml


 --
 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] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Tom Rogers

Hi,

Friday, August 2, 2002, 2:03:18 AM, you wrote:
SF Anyone know the workaround with the situation here?  Here is the sample
SF script.  The problem is I include the XML tag into the PHP variable and it
SF messed up everything.  It all had to do with ? here since PHP use it also.

SF --clip--
SF ?php
SF $XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
SF echo $XML;
?

SF Thanks,
SF  FletchSOD

Another variation with single quotes :)

echo '?xml version=1.0?';

-- 
regards,
Tom


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




Re: [PHP] .htaccess file

2002-08-01 Thread Nicole Lallande

I think it is something like - can't remember if it's an underscore or 
dash between the 'php' and 'flag'

php-flag register_globals off

HTH,

Nicole

B i g D o g wrote:

Is it possible to set register_globals to off in the .htaccess file.  If so
how do I do that?


.: B i g D o g :.





-- 

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766





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




Re: [PHP] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread electroteque

heres how i do it
 $xml .= ?xml version=\1.0\?\n;
Tom Rogers [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Friday, August 2, 2002, 2:03:18 AM, you wrote:
 SF Anyone know the workaround with the situation here?  Here is the
sample
 SF script.  The problem is I include the XML tag into the PHP variable
and it
 SF messed up everything.  It all had to do with ? here since PHP use it
also.

 SF --clip--
 SF ?php
 SF $XML = ?xml version='1.0'
encoding='UTF-8'?ProductApple/Product;
 SF echo $XML;
 ?

 SF Thanks,
 SF  FletchSOD

 Another variation with single quotes :)

 echo '?xml version=1.0?';

 --
 regards,
 Tom




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




[PHP] sessions

2002-08-01 Thread Tyler Durdin

I have a login page using sessions the old way. I have switched it to using 
$_SESSION['valid_user']and was wondering how to switch this (below) part of 
my code. In the if statement I am checking to see if the session is 
registered, but using $_SESSION[''] I do not understand how to do this or 
the isset statement. As of now my login page will login anyone and log them 
in as whatever they type in the username and password fields even if the are 
not in the DB.

if (session_is_registered(valid_user))
{
   blah blah...
}
else
{
  if (isset($userid))
   {
 echo Could not log you on;
   }
  else
   {
 echo You are not logged in;
   }

   //this is where I created my login form that submits to itself and runs 
through the code




_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] .htaccess file

2002-08-01 Thread Nicole Lallande

it's php_flag register_globals off -- you can either place this within 
your Directory tags in your httpd .conf file or in an htaccess file -- 
for more info see http://www.php.net/manual/en/configuration.php#AEN2390

best,

Nicole

Nicole Lallande wrote:

 I think it is something like - can't remember if it's an underscore or 
 dash between the 'php' and 'flag'

 php-flag register_globals off

 HTH,

 Nicole

 B i g D o g wrote:

 Is it possible to set register_globals to off in the .htaccess file.  
 If so
 how do I do that?


 .: B i g D o g :.






-- 

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766





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




Re: [PHP] .htaccess file

2002-08-01 Thread Neil Freeman

php_value register_globals 0

B i g D o g wrote:
 **
 This Message Was Virus Checked With : SAVI 3.59 May 2002 
 Last Updated 8th July 2002
 **
 
 Is it possible to set register_globals to off in the .htaccess file.  If so
 how do I do that?
 
 
 .: B i g D o g :.
 
 
 
 


-- 
--
  www.curvedvision.com
--


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




[PHP] Php Dynamic Pages Apache Server

2002-08-01 Thread msmecca

I am trying to create a php page that will show the files on an apache server.
Each file will show up as a link on the page.  When clicked, the user will be
able to download the file. Is there anyone out there that can lead me in the
right direction.

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




Re: [PHP] Problem with ?xml .... inside the PHP code, due to ?

2002-08-01 Thread Scott Fletcher

Thank you all for the feedback!  I was trying to say the problem lie with
the ?, not with the quote or double quote.  Because PHP use ? also, so
when php read this ?xml, it think the ? is intended for PHP.  So,
using the escape character does the trick, \ but now I get the invalid
format as a response from the other side that read in the XML codes I send.

Thanks,
 FletchSOD
Matt Babineau [EMAIL PROTECTED] wrote in message
019701c23974$f29b78a0$0100a8c0@developerx">news:019701c23974$f29b78a0$0100a8c0@developerx...
 ?php
 $XML = \?xml version='1.0'
 encoding='UTF-8'\?ProductApple/Product;
 echo $XML;
 ?

 Try this?

 Matt Babineau
 MCWD / CCFD
 -
 e: [EMAIL PROTECTED]
 p: 603.943.4237
 w: http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105


 -Original Message-
 From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 12:03 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem with ?xml  inside the PHP code, due to
 ?


 Anyone know the workaround with the situation here?  Here is the sample
 script.  The problem is I include the XML tag into the PHP variable and
 it messed up everything.  It all had to do with ? here since PHP use
 it also.

 --clip--
 ?php
 $XML = ?xml version='1.0' encoding='UTF-8'?ProductApple/Product;
 echo $XML;
 ?

 Thanks,
  FletchSOD



 --
 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: ARRRRGGGGHHHH! Weird Problems!

2002-08-01 Thread Tony Harrison

Thanx, I havent tried the loop yet, but the color will work im sure .

Aaron Ott [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 tony,

 regarding problem one, it looks like there is a problem in the code near:
 for ($g = 0; $g  $num_lyrics; $g ++) {

 try doing:
 for ($g = 0; $g = $num_lyrics; $g ++) {

 As for problem two, it looks like you have your color variable set in the
 for loop thereby resetting the color variable to 1 with each pass:
 for ($g = 0; $g  $num_lyrics; $g ++) {
 $color = 1;
 if ($color == 1) { $rowcolor = #DFDFDF; $color ++; } else { $rowcolor=
 #FF; $color --; }
 ...
 }


 Tony Harrison [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  OK, im having some minor problems with my site.
  In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at:
  http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you
 view
  lyrics by Weird Al Yankovic
  (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the
  bottom lyric (The Sage Begins) does not display. Now when you sort them
by
  views (http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views)
you
  will see that err, The Sage Begins is there, and the other one can no
 longer
  be seen. PLease examine my source and tell me whats wrong. And another
 thing
  about that page. The rows are meant to be alternating between #DFDFDF
 (grey)
  and #FF (white) - why the hell are they all grey?!?!?!!? It worked
 fine
  in index.php - source at
 http://members.lycos.co.uk/ajohnh/source/index.txt
 
 
  Please help !!
 
 





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




Re: [PHP] Php Dynamic Pages Apache Server

2002-08-01 Thread Lee

You could try using the readdir function to read a list of files (full docs
available from http://www.php.net/manual/en/function.readdir.php)

Here is an expanded version of the example give on the above link.

html
body
File List
?php
if ($handle = opendir('./)) {
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir($handle))) {
echo a href='$file'$file/abr;
}
closedir($handle);
}
?
/body
/html

This example assumes that the PHP script and files are in the same directory
and are all publically accessible (i.e. a user could simple type
http://www.example.com/filename)

Hope this helps

Regards

Lee

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 5:57 PM
Subject: [PHP] Php Dynamic Pages  Apache Server


 I am trying to create a php page that will show the files on an apache
server.
 Each file will show up as a link on the page.  When clicked, the user will
be
 able to download the file. Is there anyone out there that can lead me in
the
 right direction.

 --
 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] Php Dynamic Pages Apache Server

2002-08-01 Thread Nicole Lallande

This will read all '.pdf' files in a sub-directory and put them in a link -

HTH,

Nicole


?php // read the contents of this directory
$dir = ('./accessories/');

$dir_stream = @ opendir($dir)
or die (Could not open a directory stream for 
i$dir/i.);

while($entry = readdir($dir_stream)) {

  // get the file extention
  $ext = substr($entry, strrpos($entry,'.'));

  // print the link to the file
  if ($ext == '.pdf') {
echo a href='$entry'$entry/abr /;
  }
}
 ?

[EMAIL PROTECTED] wrote:

I am trying to create a php page that will show the files on an apache server.
Each file will show up as a link on the page.  When clicked, the user will be
able to download the file. Is there anyone out there that can lead me in the
right direction.


-- 

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766





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




[PHP] Re: PHP mail() problems FIXED

2002-08-01 Thread John Williams

John Williams wrote:

I'm having a problem getting the mail() function working on php 4.2.2.

I get the error message:
Warning: mail() is not supported in this PHP build

I'm running Solaris 8 and have set the symlink for sendmail.  I have
recompiled PHP, set the php.ini to point to sendmail and restarted the
web server.

; For Unix only.
;You may supply arguments as well (default: 'sendmail -t -i').
sendmail_path = /usr/sbin/sendmail -t -i

(I've tried it with and without quotes)


Still no luck...

Any ideas?

Thanks!

John


Solved it by removing the PHP directory and untarring it again.
When I rebuilt it the 1st time there was no config.cache so I assumed
there was no cache from the previous configure.  I think this was 
because I had to rm configure and do a ./buildconf and it named the 
cache file something else.  Oh well, long story short.  Make a symlink
so sendmail is in the path (otherwise PHP will disable sendmail
support), and with the cache removed recompile PHP.

After that it works fine.  Tks to all who sent advice!

John


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




[PHP] DPHPEdit - PHP IDE - New version (0.9.2.4) available

2002-08-01 Thread Davor Pleskina

For all those interested - http://www.pleskina.com/dphped

In newest version (0.9.2.4):

a. You can now add multiple files to projects using DragDrop!
b. Internal previewer enhanced
c. BUG corrected on previewing single files

Thanks everybody for suggestions and support!

__
Davor Pleskina - [EMAIL PROTECTED]
http://www.pleskina.com
ICQ#: 38632789
Programmers don't die; they just GOSUB without RETURN...
__



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




RE: [PHP] sort results into two columns

2002-08-01 Thread Brian V Bonini

!-- begin Wise crack --
table
tr
tdlink1/tdtdlinka/td
/tr
tr
tdlink/tdtdlinke/td
/tr
/table
!-- end wise crack --

I suppose an example of the sql query you attempting to use and perhaps an
idea of how your db is structured would help a little.. ;-)

 -Original Message-
 From: kompresor [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 10:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] sort results into two columns


 hi,

 how can i sort data from mysql into two columns. Thanks.

 eg:

 link1linka
 link linke



 --
 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] SOAP client class that supports https????

2002-08-01 Thread Anson Smith

I am working on a project that requires me to access a web service over
https.
I was wondering if anyone has any luck getting this class to work over https
 or if anyone knows of a soap client class that supports https??

thanks, 
  Anson Smith


Re: [PHP] SOAP client class that supports https????

2002-08-01 Thread Anson Smith

The class I am referring to in the original message is nuSphere's nuSoap
class which works great over http by the way.

---Original Message---

From: Anson Smith
Date: Thursday, August 01, 2002 12:38:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] SOAP client class that supports https

I am working on a project that requires me to access a web service over
https.
I was wondering if anyone has any luck getting this class to work over https
or if anyone knows of a soap client class that supports https??

thanks, 
Anson Smith


Re: [PHP] Getting user's local TZ

2002-08-01 Thread Jason Wong

On Thursday 01 August 2002 23:10, Chris Boget wrote:
 I looked in the predefined variable section of the manual and
 couldn't find that there was a way to get this information from
 that.  If there was another way you could get this via PHP, I
 couldn't find it anywhere else in the docs.
 So, does anyone know of a good method to get the Time Zone
 local to the end user?

Not with PHP, try javascript.

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

/*
Bell Labs Unix -- Reach out and grep someone.
*/


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




[PHP] Re: [PHP-WIN] php cookie question

2002-08-01 Thread Damian Harouff


http://www.php.net/manual/en/ref.session.php

php.net is rather interesting, in which you can do something like type
in php.net/idea or php.net/function and get the manual page
for it...

C I want to ask user to login, and use cookie to save their userid and
C password
C what should i do?


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




Re: [PHP] Help with fopen please.

2002-08-01 Thread Michael Sweeney

Shane,
You haven't told us what the problem is, only that you're having trouble
making it work. How is it not working? One other question: I have to
assume that the script is running on a different server than the one
your are trying to write to (otherwise, why use ftp?) - are you sure
that the ftp server on that system supports passive ftp? In any case,
fopen may not be the best approach to meet your needs, but you need to
tell us more about what the actual problem is.

..michael..

On Wed, 2002-07-31 at 16:26, Shane wrote:
 Looked in the archive and manual and came up with no luck, so here it goes.
 
 My end result is to save the output of a PHP script as an HTML file in a specified 
directory on a WIN2K server.
 
 my script is such...
 ? PHP
 function save_archive(){
 $filename = http://myserver.net/extranet/archive.php?jobid=1;;  
 $fd = fopen( $filename, r ); 
 $fd2 = fopen(ftp://me:[EMAIL PROTECTED]/extranet/test2.html;, w);
 
 while (!feof($fd)) { 
 $line = fgets($fd, 1024); 
 fputs($fd2,$line); 
   } 
 
 fclose($fd); 
 fclose($fd2); 
 }
 ?
 
 I'm having a terrible time getting this to work. Is there a better way? Or can 
someone point me toward or post an example of some working function I could study???
 



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




[PHP] attachements in mail()

2002-08-01 Thread Danny wall

I've looked, and can not find out how you send attachments using the mail() 
function.  I find it difficult to believe that this was left out, so 
obviously I'm missing something right in front of my face.

So my question is, how do you send attachments using the mail() fucntion?

-Danny
You are stupid.
Dexter of Dexter's labratory

Yes, I watch Dexter ... you got a problem with that! :-)


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




[PHP] Re: attachements in mail()

2002-08-01 Thread Philip Hallstrom

You can't (in the sense that there's an $attachment argument), but I've
seen several classes that will let you do it.  Check zend.com and
php.resourceindex.com for the classes.

On Thu, 1 Aug 2002, Danny wall wrote:

 I've looked, and can not find out how you send attachments using the mail()
 function.  I find it difficult to believe that this was left out, so
 obviously I'm missing something right in front of my face.

 So my question is, how do you send attachments using the mail() fucntion?

 -Danny
 You are stupid.
 Dexter of Dexter's labratory

 Yes, I watch Dexter ... you got a problem with that! :-)


 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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] randomize etc?

2002-08-01 Thread Hawk

I'm trying to make a small script that I can use for randomizing teams and
stuff, I have one field where I enter how many teams, one for how many in
each team, and a textarea to write down all the players in. This is where
my brain stopped working, first I was thinking about using split, but I
don't know how when there isn't a predefined number of variables to split it
into, how do I do this?

and when I have separated them into variables, how do I put them into
arrays?
or maybe that's not a good way to do it? I don't know, and the heat in my
room is killing me, can't think clearly :)

Håkan





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




Re: [PHP] Help with fopen please.

2002-08-01 Thread eat pasta type fasta

check chmods, if the directory where you're saving the $fd2 is not 777 
then it wont write, keep in mind it's a security issue however, use /tmp 
or instead of indicating paths in the file itself have include(file with 
the path to the dir) instead and put that .inc file off the reach of 
apache and ftp access,

R 

Shane,
You haven't told us what the problem is, only that you're having trouble
making it work. How is it not working? One other question: I have to
assume that the script is running on a different server than the one
your are trying to write to (otherwise, why use ftp?) - are you sure
that the ftp server on that system supports passive ftp? In any case,
fopen may not be the best approach to meet your needs, but you need to
tell us more about what the actual problem is.

..michael..

On Wed, 2002-07-31 at 16:26, Shane wrote:
 Looked in the archive and manual and came up with no luck, so here it goes.
 
 My end result is to save the output of a PHP script as an HTML file in a 
specified directory on a WIN2K server.
 
 my script is such...
 ? PHP
 function save_archive(){
 $filename = http://myserver.net/extranet/archive.php?jobid=1;;  
 $fd = fopen( $filename, r ); 
 $fd2 = fopen(ftp://me:[EMAIL PROTECTED]/extranet/test2.html;, w);
 
 while (!feof($fd)) { 
 $line = fgets($fd, 1024); 
 fputs($fd2,$line); 
  } 
 
 fclose($fd); 
 fclose($fd2); 
 }
 ?
 
 I'm having a terrible time getting this to work. Is there a better way? Or 
can someone point me toward or post an example of some working function I 
could study???
 



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



--__-__-__
eat pasta
type fasta


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




[PHP] Re: randomize etc?

2002-08-01 Thread Philip Hallstrom

split should work fine... Just do something like:

$teamMembersArray = split( ,;, $textarea);

That will give you an array of the team members.  Of course I'm assuming
that their names don't include spaces and that you'll separate them with
either a space, comma, or semi-colon.  And you'll want to get rid of any
newlines in $textarea as well.

-philip

On Thu, 1 Aug 2002, Hawk wrote:

 I'm trying to make a small script that I can use for randomizing teams and
 stuff, I have one field where I enter how many teams, one for how many in
 each team, and a textarea to write down all the players in. This is where
 my brain stopped working, first I was thinking about using split, but I
 don't know how when there isn't a predefined number of variables to split it
 into, how do I do this?

 and when I have separated them into variables, how do I put them into
 arrays?
 or maybe that's not a good way to do it? I don't know, and the heat in my
 room is killing me, can't think clearly :)

 Håkan





 --
 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] randomize etc?

2002-08-01 Thread Kurth Bemis (List Monkey)

At 08:19 PM 8/1/2002 +0200, Hawk wrote:

try using explode
then walk through the array that explode makes :-)

does that help?

~kurth

I'm trying to make a small script that I can use for randomizing teams and
stuff, I have one field where I enter how many teams, one for how many in
each team, and a textarea to write down all the players in. This is where
my brain stopped working, first I was thinking about using split, but I
don't know how when there isn't a predefined number of variables to split it
into, how do I do this?

and when I have separated them into variables, how do I put them into
arrays?
or maybe that's not a good way to do it? I don't know, and the heat in my
room is killing me, can't think clearly :)

Håkan





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


Kurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer

Jedi business, Go back to your drinks - Anakin Skywalker, AOTC

[EMAIL PROTECTED] | http://kurth.hardcrypto.com
PGP key available - http://kurth.hardcrypto.com/pgp



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




[PHP] Readdir

2002-08-01 Thread msmecca

New To Php so please bear with me... :)

I used the readdir function to read the files listed on a Apache server. And
it worked fine. Now I would like to be able to get the files the php code
returns, to be links. Where the user can click the file and download it. Also
for the files to sit within a table or at least look neat on the page.
http://www.optimus7.com/findme.php is the result I get from the php code
below. Help!

?php
if ($handle = opendir('/my/directory')) {
echo Directory handle: $handle\n;
echo Files:\n;



while (false !== ($file = readdir($handle))) { 
echo $file\n;
}

  
closedir($handle); 
}
?

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




RE: [PHP] Readdir

2002-08-01 Thread Matt Schroebel

 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 01, 2002 2:54 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Readdir
 
 New To Php so please bear with me... :)
 
 I used the readdir function to read the files listed on a 
 Apache server. And
 it worked fine. Now I would like to be able to get the files 
 the php code
 returns, to be links. Where the user can click the file and 
 download it. Also
 for the files to sit within a table or at least look neat on the page.
 http://www.optimus7.com/findme.php is the result I get from 
 the php code
 below. Help!
 
 ?php
 if ($handle = opendir('/my/directory')) {
 echo Directory handle: $handle\n;
 echo Files:\n;
 
 
 
 while (false !== ($file = readdir($handle))) { 
 echo $file\n;
 }
 
   
 closedir($handle); 
 }
 ?

Change your echo stmt to something like:

echo a href=\$file\$file/abr\n;

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




Re: [PHP] Readdir

2002-08-01 Thread Nicole Lallande

Change:

echo $file\n;

to:

echo a href='$file'$file/a\n;
Note the nested quotes -- outer quotes - , inner quotes (around $file) 
single - '

Best,

Nicole

[EMAIL PROTECTED] wrote:

New To Php so please bear with me... :)

I used the readdir function to read the files listed on a Apache server. And
it worked fine. Now I would like to be able to get the files the php code
returns, to be links. Where the user can click the file and download it. Also
for the files to sit within a table or at least look neat on the page.
http://www.optimus7.com/findme.php is the result I get from the php code
below. Help!

?php
if ($handle = opendir('/my/directory')) {
echo Directory handle: $handle\n;
echo Files:\n;



while (false !== ($file = readdir($handle))) { 
echo $file\n;
}

  
closedir($handle); 
}
?


-- 

Nicole Lallande
[EMAIL PROTECTED]
760.753.6766





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




[PHP] problems with random again

2002-08-01 Thread Hawk

Is there some easy way to make rand() only use each number once in a loop,
to avoid getting the same values more than once?

Håkan



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




Re: [PHP] Readdir

2002-08-01 Thread Jason Wong

On Friday 02 August 2002 02:53, [EMAIL PROTECTED] wrote:
 New To Php so please bear with me... :)

 I used the readdir function to read the files listed on a Apache server.
 And it worked fine. 

 http://www.optimus7.com/findme.php is the result I get from the php
 code below. Help!

 ?php
 if ($handle = opendir('/my/directory')) {
 echo Directory handle: $handle\n;
 echo Files:\n;



 while (false !== ($file = readdir($handle))) {
 echo $file\n;
 }


 closedir($handle);
 }
 ?

1) If you don't want the parent directory (..) and current directory (.) to 
appear you should follow the example(s) in the manual.

2) In your while loop you can do something like:

   while (false !== ($file = readdir($handle))) {
 $file_array[] = $file;
   }

This will put all your files into an array $file_array, which you can then use 
foreach() to loop through each item and display neatly.

 Now I would like to be able to get the files the php
 code returns, to be links. Where the user can click the file and download
 it. Also for the files to sit within a table or at least look neat on the
 page.

These are basic HTML issues which presumably you should know the answer to.

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

/*
Alimony is the high cost of leaving.
*/


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




[PHP] Re: ARRRRGGGGHHHH! Weird Problems!

2002-08-01 Thread Tony Harrison

OK, the color works, but now I have 2 empty lines

Tony Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanx, I havent tried the loop yet, but the color will work im sure .

 Aaron Ott [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  tony,
 
  regarding problem one, it looks like there is a problem in the code
near:
  for ($g = 0; $g  $num_lyrics; $g ++) {
 
  try doing:
  for ($g = 0; $g = $num_lyrics; $g ++) {
 
  As for problem two, it looks like you have your color variable set in
the
  for loop thereby resetting the color variable to 1 with each pass:
  for ($g = 0; $g  $num_lyrics; $g ++) {
  $color = 1;
  if ($color == 1) { $rowcolor = #DFDFDF; $color ++; } else { $rowcolor=
  #FF; $color --; }
  ...
  }
 
 
  Tony Harrison [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   OK, im having some minor problems with my site.
   In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source
at:
   http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example
you
  view
   lyrics by Weird Al Yankovic
   (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that
the
   bottom lyric (The Sage Begins) does not display. Now when you sort
them
 by
   views (http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views)
 you
   will see that err, The Sage Begins is there, and the other one can no
  longer
   be seen. PLease examine my source and tell me whats wrong. And another
  thing
   about that page. The rows are meant to be alternating between #DFDFDF
  (grey)
   and #FF (white) - why the hell are they all grey?!?!?!!? It worked
  fine
   in index.php - source at
  http://members.lycos.co.uk/ajohnh/source/index.txt
  
  
   Please help !!
  
  
 
 





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




[PHP] Re: attachements in mail()

2002-08-01 Thread Tony Harrison

Shouldnt there be some sort of MIME header for it?

Philip Hallstrom [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You can't (in the sense that there's an $attachment argument), but I've
 seen several classes that will let you do it.  Check zend.com and
 php.resourceindex.com for the classes.

 On Thu, 1 Aug 2002, Danny wall wrote:

  I've looked, and can not find out how you send attachments using the
mail()
  function.  I find it difficult to believe that this was left out, so
  obviously I'm missing something right in front of my face.
 
  So my question is, how do you send attachments using the mail()
fucntion?
 
  -Danny
  You are stupid.
  Dexter of Dexter's labratory
 
  Yes, I watch Dexter ... you got a problem with that! :-)
 
 
  _
  Chat with friends online, try MSN Messenger: http://messenger.msn.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: problems with random again

2002-08-01 Thread Philip Hallstrom

No... that wouldn't really be random then would it? :)  But you could
always keep track of the previous random numbers and if you've seen it ask
for another one.

On Thu, 1 Aug 2002, Hawk wrote:

 Is there some easy way to make rand() only use each number once in a loop,
 to avoid getting the same values more than once?

 Håkan



 --
 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] Example safe use of eval()

2002-08-01 Thread David Pratt

I am trying to get code that I have saved as a string in a database to 
evaluate as code within a larger script with a loop. There are  obvious
security concerns with allowing users to input code into the field if it is
not preprocessed before it is evaluated. The eval function appears to be the
ticket with PHP 4 since it will return the results as well. Has anyone got
an example of an appropriate preprocessing strategy and/or example of eval()
being used this way?  Thanks to those that replied to my original post.

--

Dave Pratt

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




[PHP] Can several different sessions coexist?

2002-08-01 Thread DonPro

Hi,

I'd like to register a session and create several session variables.  In
another part of my site, I'd like to register another session again creating
session variables.  After a bit, I'd like to destroy this second registered
session keeping the first intact.  Thus far, whenever I issue:

session_unset();
session_destroy();

both sessions are obliterated.  Is there a method of managing different
sessions where I can create additional sessions and destroy them without
losing my initial session?

Thanks,
Don



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




[PHP] Re: ARRRRGGGGHHHH! Weird Problems!

2002-08-01 Thread Aaron

What is the purpose of using the for loop?  if I may make a suggestion for
using the while loop.  The code would look something like this:

?php
$color=1;
while ($lyric_array = mysql_fetch_array($lyrics)) {
$comments = mysql_query(SELECT * FROM `comments` WHERE `resource_id` =
$lyric_array[0]);
$num_comments = mysql_num_rows($comments);

if ($color == 1) {
$rowcolor = #DFDFDF;
$color ++;
} else {
$rowcolor = #FF;
$color --;
}

echo tr bgcolor=\;
echo \tda
href=\view.php?id=$lyric_array[0]\$lyric_array[1]/a/td;
echo td$lyric_array[3]/td;
echo td$num_comments/td;
echo td$lyric_array[2]/td;
echo tda href=\$lyric_array[4]\Buy at Amazon.com/td/tr;

$ltotalv = $ltotalv + $lyric_array[3];
}
?

I was looking at the current code and wasn't seeing the purpose for the for
loop.  If I'm incorrect and you are using it for a specific purpose, please
let me know.

-aaron

Tony Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 OK, the color works, but now I have 2 empty lines

 Tony Harrison [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Thanx, I havent tried the loop yet, but the color will work im sure .
 
  Aaron Ott [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   tony,
  
   regarding problem one, it looks like there is a problem in the code
 near:
   for ($g = 0; $g  $num_lyrics; $g ++) {
  
   try doing:
   for ($g = 0; $g = $num_lyrics; $g ++) {
  
   As for problem two, it looks like you have your color variable set in
 the
   for loop thereby resetting the color variable to 1 with each pass:
   for ($g = 0; $g  $num_lyrics; $g ++) {
   $color = 1;
   if ($color == 1) { $rowcolor = #DFDFDF; $color ++; } else {
$rowcolor=
   #FF; $color --; }
   ...
   }
  
  
   Tony Harrison [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
OK, im having some minor problems with my site.
In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source
 at:
http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example
 you
   view
lyrics by Weird Al Yankovic
(http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that
 the
bottom lyric (The Sage Begins) does not display. Now when you sort
 them
  by
views
(http://members.lycos.co.uk/ajohnh/artist.php?id=1sortby=views)
  you
will see that err, The Sage Begins is there, and the other one can
no
   longer
be seen. PLease examine my source and tell me whats wrong. And
another
   thing
about that page. The rows are meant to be alternating between
#DFDFDF
   (grey)
and #FF (white) - why the hell are they all grey?!?!?!!? It
worked
   fine
in index.php - source at
   http://members.lycos.co.uk/ajohnh/source/index.txt
   
   
Please help !!
   
   
  
  
 
 





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




  1   2   >