[PHP] Re: and ' giving problems

2003-02-11 Thread Michiel van Heusden
you could use stripslashes or stripcslashes to remove the '\'-s, otherwise i
wouldn't know..

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

 Hi,

 When a user wants to add a comment on my site and uses either  or  ', and
 when it gets printed out,  comes out as / or /', either to the web page
or
 on a form to alter.

 The only treatment i give it after its submitted on the form is:

 $comentarioc = str_replace(\r\n, \n, $comentarioc);
 $comentarioc = str_replace(\r, \n, $comentarioc);

 Is there a way to solve this? So it can accept both  and ', and be able
 to alter/print it with no problem?
 Thanks.

 Pag





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




Re: [PHP] How to use fopen() with protected directory (i.e .htaccess)

2003-02-11 Thread Ernest E Vogelsinger
At 06:22 11.02.2003, Daevid Vincent said:
[snip]
How can I pass in a user/pw to an fopen() (or something similar)?

You don't. fopen() doesn't access the server via HTTP. It's PHP that
executes this call, sitting at the server, using the servers file system
(except when opening a remote site, but that's a different story). If you
are allowed (by means of opsys rights and PHP admin limits, such as
safe_mode) to open the file it will be opened for you, even if it is not
within the virtual web server directory tree.

I am trying to render a dynamic db/php page into a static .html page --
or more specifically, I'm trying to email me back an html version of a
report page on remote servers. The reports are located behind an
https:// Apache user/pass authenticated directory.

I tried:
$file =
fopen(https://username:[EMAIL PROTECTED]/admin/report.php,r;); 

You can't open a remote SSL location using fopen(). Have a look at cUrl to
accomplish this.

If I try to do something like:
$file = fopen(/www/htdocs/admin/report.php,r); 

But then the PHP isn't executed, it just dumps me the straight source
code.

If you can open and read the report, there's only one more step to execute
it: use eval():

$fname = /www/htdocs/admin/report.php
$file = fopen($fname,r); 
if ($file) {
$code = fread($file, filesize($fname));
fclose($file);
@eval($code);
}
else
die Can't open file $fname\n;


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



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




Re: [PHP] Regex Help

2003-02-11 Thread Ernest E Vogelsinger
At 07:47 11.02.2003, Lord Loh. said:
[snip]
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?

http://www.php.net/manual/en/ref.pcre.php
http://www.perldoc.com/perl5.6/pod/perlre.html


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



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




Re: [PHP] Newbie recursive directory

2003-02-11 Thread Chris Hayes
At 23:28 10-2-2003, you wrote:

G'day all

I've been trying for a day or so to get a script to traverse all the levels
of a directory.


did you see the first user comment on 
http://nl.php.net/manual/nl/ref.dir.php ? may help!

With help from list archives and web sites I've come up
with this:

?php

$the_array = Array();
$thedir = /Users/kim/test/;
$handle = opendir($thedir);

while (false !== ($file = readdir($handle))) {
if ($file != .  $file != ..  $file != .DS_Store)
{
$the_array[] =  $thedir . $file;
}
}
closedir($handle);

foreach ($the_array as $i)
{
$fileinfo = fopen(($i), r) OR die(Failed to open file $i);
$thedata = fread($fileinfo, filesize($i));
fclose($fileinfo);

echo $i $thedatabr;
}

?

I've read lots f stuff about if (is_dir($blah) but I get a bit lost with
the navigation after that (I'm _real_ new to *nix as well).  Could someone
please help as to how it would fit into my script?

Cheers and thanks

kim


--
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] Objects: Cant set object variables with refrences ...

2003-02-11 Thread James

My problem is illistrated by the following test code:

class test {

var $flag = 0;
function getFlag() { return $this-flag; }

var $t;

function Init() {
$c = new test;
$this-t = $c;
$c-flag = 1000;
}

function EchoFunc() { echo(= . $this-t-getFlag()); }

}

$test = new test;
$test-Init();
$test-EchoFunc();

When run, the number 0 is returned. Given copying symantecs, this is what
you would expect. $c is initilized with flag=0, the next line takes a copy
of $c and puts it in $t, the next line sets flag=1000 on $c, but not on $t.

However I would like refernce semantics and the final output of this script
to be 1000. So I changed the line to $this-t = $c; and suddenly I get
the error: Fatal error: Call to a member function on a non-object in
/user/sh/jmb/Project/Wiki/Public_html/test.php on line 25

Anyone have any help on what is happening?

Thanks,
James.





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




[PHP] File upload???

2003-02-11 Thread Kenneth Suralta
Hello everyone! =)

Can anybody help me with file uploading with PHP???
i tried uploading a file through...

form action=save_upload.php method=post
input type=file name=userfile
input type=submit
/form

but, in save_upload.php, there is no $HTTP_POST_VARS['userfile'], or 
$HTTP_POST_VARS['userfile_name'], etc...

Can anybody help me with this...




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



Re: [PHP] File upload???

2003-02-11 Thread Francesco Leonetti
You need to check the following variables:

$_FILES[userfile][tmp_name];
$_FILES[userfile][size];
$_FILES[userfile][name];
$_FILES[userfile][type];

Ciao
Francesco

- Original Message - 
From: Kenneth Suralta [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 11, 2003 10:49 AM
Subject: [PHP] File upload???


 Hello everyone! =)
 
 Can anybody help me with file uploading with PHP???
 i tried uploading a file through...
 
 form action=save_upload.php method=post
 input type=file name=userfile
 input type=submit
 /form
 
 but, in save_upload.php, there is no $HTTP_POST_VARS['userfile'], or 
 $HTTP_POST_VARS['userfile_name'], etc...
 
 Can anybody help me with 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] Q: File not rewritable - why? Help needed.

2003-02-11 Thread user

Newbie question:

I try to modify a txt-file but get not writable error.
(just like in http://www.php.net/manual/en/function.fwrite.php )

I've tried to change the chmode but now I need some help.

All info welcome! Thanks in advance!

Paul Dunkel
--
[EMAIL PROTECTED]


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




[PHP] How to check acces to modeuls files and dirs

2003-02-11 Thread Konference
Good morning,

I have got an anrray:

$access[][id];
$access[][name];

and then I browse a mode dirs and I need to check if md5(directory_name)
exists in access array. I don't want to browse all dirs a list all subdirs
files and chech with access array like this:

// check where login user has access
while($temp = $db - db_Fetch_Array($check)){
$access[$count][name] = $temp[name]; //mode name, eg. backup
$access[$count][id] = $temp[id_mod]; //id dir
$count++;
}

$handle=opendir($ADMIN_DIR);
$allow = Array();

while (($mod_name = readdir($handle))!==false) {
   if(eregi(^(mod.),$mod_name)){
  $mod_id = md5(strtolower($mod_name));
  $f_h=opendir($ADMIN_DIR.$mod_name);
  while (($file_name = readdir($f_h))!==false) {
 if ($file_name != .  $file_name != ..  
!in_array($file_name,$non_files)) {
foreach($access as $value){
   if($value[id]==$file_name){
  $allow[] = $file_name;
   }
}
 }
  }
   }
}

Have you got some ideas how to solve this problem with lower system
requirements? Thank you for your answers.

jiri.nemec at menea.cz
http://www.menea.cz
ICQ: 114651500


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




[PHP] Re: several buttons in form - which one was clicked

2003-02-11 Thread James
Your way does strike me as a strange way to do things: I would favour many
forms with hidden values myself to but ...


html
headtitletitle/head
body

form action=test2.php method=get
Press the red submit button!br
input type=submit name=red value=Go!P

Press the Blue submit button!br
input type=submit name=blue value=Go!P

But enter your name first!br
input type=text name=namep

/formhr

Your name is ?php echo($_GET[name]); ?!P

?php

if ($_GET[red] == Go!) { echo(You pressed the red button!); }
if ($_GET[blue] == Go!) { echo(You pressed the blue button!); }

?

/body/html







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




[PHP] Session into class

2003-02-11 Thread ZioBudda
Hi, I want to write a session-class that use MySQL. I have write the
body of the class. The class open and close session,  write the data
from session to DB, but the function session_decode() does not want to
decode my data.

Here the session_set_save_handler:

session_set_save_handler(array($hnd, open_session),
   array($hnd, close_session),
   array($hnd, read_session),
   array($hnd, write_session),
   array($hnd, destroy_session),
   array($hnd, gc_session)
  );

and this is the read_session:

   function read_session($sessionid)
{
global $_SESSION;
zb_debug(Dentro read_session);
zb_debug(Mi connetto al DB e prelevo la sessione);
$query = select value,last from session where id =
'.session_id().';
$this-dbms-Exec_Query($query);
if ($this-dbms-ReturnNum() == 0) {
$session_exist = false;
} else {
  zb_debug(la sessione esiste);
  $session_exist = true;
  $session = $this-dbms-ReturnNextObject();
  zb_debug(il valore nella sessione è .$session-value);

  $expire = session_cache_expire();
  zb_debug(La sessione vale $expire secondi, restano
.(($session-last + $expire) - time()). secondi);
  if ( ($session-last + $expire)  time() ) {
  zb_debug(La sessione è scaduta : );
  zb_debug(La cancello dal DBMS);
  $query = delete from session where id =
'.session_id().';
  $this-dbms-Exec_Query($query);
  zb_debug(Sessione cancellata);
  //La sessione è scaduta.
  $this-session_exist = false;
  } else {
session_decode($session-value);
//session_decode('id|i:0');
var_dump($_SESSION);
zb_debug(  );
}

  }

return true;
}


Plz help me.

PHP5-dev with Apache 1.3.27

bye


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




[PHP] Q. on ereg_replace

2003-02-11 Thread Michiel van Heusden
i'm creating sort of a very simple css-alike-thing for outputting html to
flash actionscript.
the php gets a string ($text) from the database, which look something like:
h1header 1 /h1 etc...

then, from a 'css' file it reads the strings $replace and $replacement

it looks something like:

   $number = count($arr_replace);
   $i = 0;

   do {

   $replace = stripcslashes($arr_replace[$i]);
   $replacement = stripcslashes($arr_replace[$i]);

   $text = ereg_replace($replace, $replacement, $text);

   $i++;

   } while ($i  $number);

this works fine, except that after the ereg_replace some newlines are
inserted. I could strip them, but then i'm also stripping the original
newlines (which were in the string already) so, i'd be happier finding a way
of using this script without ereg_replace inserting newline (i don't
understand why it does anyway)

any suggestions?



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




[PHP] If no record in MySQL how to?

2003-02-11 Thread Steve Jackson
I have a problem whereby I need to show links based on an ID which is in
a MySQL DB.
So if ID 1 exists I pull an array of links which are defined as
belonging to ID1. This works OK.
How though can I distinguish between ID's which are not in the DB. I
want to display something if there are no links also and don't know what
I'm doing wrong. I try to display table 1 listed below but just get
nothing returned with this command.
What am I doing wrong?

print td valign='top' align='right'img
src='pictures/document_heading_blue.gif' border='0';
// link to documents
$link_sql = select * from documents 
where id = '$id';
$link_result = mysql_query($link_sql);
while ($documents = mysql_fetch_array($link_result)) 
{
if (!$documents[id])
//If no ID in DB display table 1...
{
print table cellpadding='4'trtd
width='10'img src='../images/nuoli_right_pieni.gif'
border='0'/tdtd width='166'a
href='mailto:[EMAIL PROTECTED]'No supporting documents with this
article mail us for more information/a/td/tr/table;
}
else
//Display table with array of linked files.
{
print table cellpadding='4'trtd
width='40'img src='../images/adobepdf.gif' border='0'/tdtd
width='136'a href='$documents[url]'
class='greenlinks'$documents[name]/a/td/tr/table;
}
}

// end check for documents

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




Re: [PHP] Regex Help

2003-02-11 Thread Kevin Waterson
This one time, at band camp,
Lord Loh. [EMAIL PROTECTED] wrote:

 I am trying to make a link collector.
 
 after opening the desired page, I want to get all the hyperlinks on it...

OK, this is quick and nasty, but you can add sanity/error checking etc
as you please, but it shows you the concept..

?php

  // tell me its broken
  error_reporting(E_ALL);

class grabber{

  function grabber(){

}

function getLinks(){
  // regex to get the links
  $contents = $this-getUrl();
  preg_match_all(|http:?([^\' ]+)|i, $contents, $arrayoflinks);
  return $arrayoflinks;
}

// snarf the url into a string
function getUrl(){
  return file_get_contents($_POST['url']);
}


} // end class
?

html
body
h1Link Grabber/h1
form action=?php echo $_SERVER['PHP_SELF']; ? method=post
table
trtdURL:/tdtdinput type=text name=url maxlength=100 size=50 
value=http://www.php.net;/td/tr
trtdinput type=submit value=Grab em/td/tr
/table
/form

?php
  // check something was posted
  if(!isset($_POST['url']) || $_POST['url']=='')
{
// or tell them to
echo 'Please Enter a Valid url';
}
  else
{
// create a new grabber
$grab = new grabber;
// snarf the links
$arr=$grab-getLinks();
// check the size of the array
if(sizeof($arr['0'])=='0')
{
// echo out a little error
echo 'No links found in file '.$_POST['url'];
}
else
{
// filter out duplicates and print the results
foreach(array_unique($arr['0']) as $val){ echo 'a 
href='.$val.''.$val.'br /'; }
}
}
?
/body/html


enjoy,
Kevin
-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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




Re: [PHP] If no record in MySQL how to?

2003-02-11 Thread Marek Kilimajer
if there are no rows, the while condition will return false so the while 
block will never be executed, try

if(mysql_num_rows($link_result) ){
   while($documents = mysql_fetch_array($link_result)) {
   print table cellpadding='4'trtd
   width='40'img src='../images/adobepdf.gif' border='0'/tdtd
   width='136'a href='$documents[url]'
   class='greenlinks'$documents[name]/a/td/tr/table;
   }
} else {
   print table cellpadding='4'trtd
   width='10'img src='../images/nuoli_right_pieni.gif'
   border='0'/tdtd width='166'a
   href='mailto:[EMAIL PROTECTED]'No supporting documents 
with this
   article mail us for more information/a/td/tr/table;
}

Steve Jackson wrote:

I have a problem whereby I need to show links based on an ID which is in
a MySQL DB.
So if ID 1 exists I pull an array of links which are defined as
belonging to ID1. This works OK.
How though can I distinguish between ID's which are not in the DB. I
want to display something if there are no links also and don't know what
I'm doing wrong. I try to display table 1 listed below but just get
nothing returned with this command.
What am I doing wrong?

print td valign='top' align='right'img
src='pictures/document_heading_blue.gif' border='0';
// link to documents
$link_sql = select * from documents 
   where id = '$id';
$link_result = mysql_query($link_sql);
while ($documents = mysql_fetch_array($link_result)) 
		{
			if (!$documents[id])
//If no ID in DB display table 1...
			{
			print table cellpadding='4'trtd
width='10'img src='../images/nuoli_right_pieni.gif'
border='0'/tdtd width='166'a
href='mailto:[EMAIL PROTECTED]'No supporting documents with this
article mail us for more information/a/td/tr/table;
			}
			else
//Display table with array of linked files.
			{
			print table cellpadding='4'trtd
width='40'img src='../images/adobepdf.gif' border='0'/tdtd
width='136'a href='$documents[url]'
class='greenlinks'$documents[name]/a/td/tr/table;
			}
		}

// end check for documents

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


 



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




RE: [PHP] If no record in MySQL how to?

2003-02-11 Thread Steve Jackson
Thanks Marek,

That is the solution I was looking for.

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159





 -Original Message-
 From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] 
 Sent: 11. helmikuuta 2003 13:39
 To: Steve Jackson
 Cc: PHP General
 Subject: Re: [PHP] If no record in MySQL how to?
 
 
 if there are no rows, the while condition will return false 
 so the while 
 block will never be executed, try
 
 if(mysql_num_rows($link_result) ){
 while($documents = mysql_fetch_array($link_result)) {
 print table cellpadding='4'trtd
 width='40'img src='../images/adobepdf.gif' 
 border='0'/tdtd
 width='136'a href='$documents[url]'
 
 class='greenlinks'$documents[name]/a/td/tr/table;
 }
 } else {
 print table cellpadding='4'trtd
 width='10'img src='../images/nuoli_right_pieni.gif'
 border='0'/tdtd width='166'a
 href='mailto:[EMAIL PROTECTED]'No supporting 
 documents 
 with this
 article mail us for more 
 information/a/td/tr/table;
 }
 
 Steve Jackson wrote:
 
 I have a problem whereby I need to show links based on an ID 
 which is 
 in a MySQL DB. So if ID 1 exists I pull an array of links which are 
 defined as belonging to ID1. This works OK.
 How though can I distinguish between ID's which are not in the DB. I
 want to display something if there are no links also and 
 don't know what
 I'm doing wrong. I try to display table 1 listed below but just get
 nothing returned with this command.
 What am I doing wrong?
 
 print td valign='top' align='right'img 
 src='pictures/document_heading_blue.gif' border='0'; // link to 
 documents $link_sql = select * from documents
 where id = '$id';
 $link_result = mysql_query($link_sql);
 while ($documents = mysql_fetch_array($link_result)) 
  {
  if (!$documents[id])
 //If no ID in DB display table 1...
  {
  print table cellpadding='4'trtd
 width='10'img src='../images/nuoli_right_pieni.gif'
 border='0'/tdtd width='166'a
 href='mailto:[EMAIL PROTECTED]'No supporting documents with this
 article mail us for more information/a/td/tr/table;
  }
  else
 //Display table with array of linked files.
  {
  print table cellpadding='4'trtd
 width='40'img src='../images/adobepdf.gif' border='0'/tdtd
 width='136'a href='$documents[url]'
 class='greenlinks'$documents[name]/a/td/tr/table;
  }
  }
 
 // end check for documents
 
 Steve Jackson
 Web Developer
 Viola Systems Ltd.
 http://www.violasystems.com
 [EMAIL PROTECTED]
 Mobile +358 50 343 5159
 
 
   
 
 


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




[PHP] Re: Q. on ereg_replace

2003-02-11 Thread Michiel van Heusden
never mind it

i've solved it trimming the $replace and $replacement before using them in
ereg_replace()

thanks anyway


Michiel Van Heusden [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i'm creating sort of a very simple css-alike-thing for outputting html to
 flash actionscript.
 the php gets a string ($text) from the database, which look something
like:
 h1header 1 /h1 etc...

 then, from a 'css' file it reads the strings $replace and $replacement

 it looks something like:

$number = count($arr_replace);
$i = 0;

do {

$replace = stripcslashes($arr_replace[$i]);
$replacement = stripcslashes($arr_replace[$i]);

$text = ereg_replace($replace, $replacement, $text);

$i++;

} while ($i  $number);

 this works fine, except that after the ereg_replace some newlines are
 inserted. I could strip them, but then i'm also stripping the original
 newlines (which were in the string already) so, i'd be happier finding a
way
 of using this script without ereg_replace inserting newline (i don't
 understand why it does anyway)

 any suggestions?





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




[PHP] Re: Objects: Cant set object variables with refrences ...

2003-02-11 Thread michael kimsal
James wrote:
snip


However I would like refernce semantics and the final output of this script
to be 1000. So I changed the line to $this-t = $c; and suddenly I get
the error: Fatal error: Call to a member function on a non-object in
/user/sh/jmb/Project/Wiki/Public_html/test.php on line 25

Anyone have any help on what is happening?



$this-t = $c;

I dunno where = comes from.  I see people using it many times,
but = makes more sense imo.  The  is 'by reference', and putting
it explicitly in front of which variable is to be passed by
reference *seems* more logical to me.  Otherwise you could
end up with

$this-t = $c.$d;

What's being passed by reference at that point?


Michael Kimsal
http://www.phphelpdesk.com
http://www.phpappserver.com
734-480-9961


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




Re: [PHP] mac os 9 - file upload problems

2003-02-11 Thread Lowell Allen
 From: Jimmy Brake [EMAIL PROTECTED]
 
 I have a file upload page that accepts file uploads from pretty much
 every browser and os EXCEPT any browser on mac os 9.  I have no idea
 why, any of you ever have problems with file uploads on mac os 9? How
 did you solve the issue.

I have no problems with file uploads using IE 5.1, Mac OS 9.2.

--
Lowell Allen


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




[PHP] Re: Objects: Cant set object variables with refrences ...

2003-02-11 Thread James

Michael Kimsal [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 James wrote:
 snip
 
  However I would like refernce semantics and the final output of this
script
  to be 1000. So I changed the line to $this-t = $c; and suddenly I
get
  the error: Fatal error: Call to a member function on a non-object in
  /user/sh/jmb/Project/Wiki/Public_html/test.php on line 25
 
  Anyone have any help on what is happening?


 $this-t = $c;

This works great. Thanks.





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




RE: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-11 Thread Erin Fry

On Mon, 10 Feb 2003 16:23:10 -0600, you wrote:

Hi.
 
I’m working with a multidimensional array where the data in the 
array is a class (struct).  All the information is being stored correctly, 
but I need to sort each “column” (AA0, BA0, etc. – see below) 
by the fieldNo portion of the struct.
 
class fieldClass
{
var $fieldNo;
var $srcLineNo;
var $data;
}
[...]

Although I've never personally used it, I believe usort() is what you
need:

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

You would need to create a callback function, something like:

function cmp($a, $b) {
  if ($a-fieldNo == $b-fieldNo) { return 0; }
  return ($a-fieldNo  $b-fieldNo) ? 1 : -1;
}

usort($structArray, 'cmp');



Thanks for the reply.  I had already tried usort previously.  For some reason, there 
is no data for the array fields at all in the cmp function - not sure why.  Does 
anyone know?  All help is appreciated!  Thanks.

 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 

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




[PHP] help me

2003-02-11 Thread Cavallaro, Vito
how i do  work php with xml?

In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
workstation



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




[PHP] Image processing: tolerance of damaged files

2003-02-11 Thread Geoff Caplan
Hi folks,

I have an image processing module for converting  resizing uploaded
images.

My customer has 1000s of images from various sources, and a
significant percentage are not 100% correct.

At present I am using ImageMagick, but it chokes if the image is in
any way damaged. At present the customer has to load the images into
PhotoShop and re-save, which seems to fix them most of the time.

Do any of the other Linux libraries, such as Netpbm, handle damaged
images more robustly? I would very much value any feedback - I don't
have a lot of time for testing...

Thanks

-- 

Geoff Caplan
Advantae Ltd


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




[PHP] Problem with FTP and fopen

2003-02-11 Thread Chris Boget
OK, I used the php ftp_put function successfully to upload a file. But
this is not what I need. I need to use the ftp_fput function to transfer
from a file pointer. This function failed to transfer the file with
Pureftp server but transfers successfully using Wu-ftp. Any ideas on why
Pureftp is failing to trasfer from a file point? I don't understand why
it would even know the difference. Possible a bug in PHP?

On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:
 Anyone have any idea why this script cause a file to be created without
 the contents?
 
 script language=php
 set_time_limit(1200);
 $filename = testthis;
 $fp = fopen(ftp://user:pass@server/outbound/devel/$filename;,
 w);
 $tran_info = sprintf( %-10s\n,testthis);  
 echo $tran_info;
 fputs($fp, $tran_info );
 fclose($fp);
 /script
 
 Using the latest version of pure-ftpd from source on Linux.
 -- 
 
 Craig Jackson
 __
 Wildnet Group LLC
 103 North Park, Suite 110
 Covington, Lousiana 70433
 Office 985-875-9453
 __
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 

Craig Jackson
__
Wildnet Group LLC
103 North Park, Suite 110
Covington, Lousiana 70433
Office 985-875-9453
__




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




Re: [PHP] Problem with FTP and fopen

2003-02-11 Thread Adam Voigt




I don't think PHP checks to see what FTPD your running, it's probably a bug

in PureFTPD as opposed to PHP (since it works in WU).



On Tue, 2003-02-11 at 10:10, Chris Boget wrote:

OK, I used the php ftp_put function successfully to upload a file. But

this is not what I need. I need to use the ftp_fput function to transfer

from a file pointer. This function failed to transfer the file with

Pureftp server but transfers successfully using Wu-ftp. Any ideas on why

Pureftp is failing to trasfer from a file point? I don't understand why

it would even know the difference. Possible a bug in PHP?



On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:

 Anyone have any idea why this script cause a file to be created without

 the contents?

 

 script language=php

 set_time_limit(1200);

 $filename = testthis;

 $fp = fopen(ftp://user:pass@server/outbound/devel/$filename,

 w);

 $tran_info = sprintf( %-10s\n,testthis);  

 echo $tran_info;

 fputs($fp, $tran_info );

 fclose($fp);

 /script

 

 Using the latest version of pure-ftpd from source on Linux.

 -- 

 

 Craig Jackson

 __

 Wildnet Group LLC

 103 North Park, Suite 110

 Covington, Lousiana 70433

 Office 985-875-9453

 __

 

 

 

 -

 To unsubscribe, e-mail: [EMAIL PROTECTED]

 For additional commands, e-mail: [EMAIL PROTECTED]

-- 



Craig Jackson

__

Wildnet Group LLC

103 North Park, Suite 110

Covington, Lousiana 70433

Office 985-875-9453

__









-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP] mac os 9 - file upload problems

2003-02-11 Thread Step Schwarz
 I have a file upload page that accepts file uploads from pretty much
 every browser and os EXCEPT any browser on mac os 9.
[...]

Hi Jimmy,

I routinely use Mac OS 9.x and both Netscape 7 and IE 5.1 to upload files to
sites written in PHP.  I also maintain these sites.  The only problems I've
encountered are when users try to upload files with something funky in the
filename which I did not anticipate.

Is it possible that uploads are failing because your Mac users are uploading
files with no file extensions and this is somehow interfering with the code
you're using to process the file?  File extensions are not required on Mac
OS 9.x so it wouldn't be uncommon at all to find a Mac user uploading, say,
a PDF without a .pdf extension.  If you'd like to post a URL or some code
I'd be happy to take a look.

Hope this helps,
-Step


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




Re: [PHP] Problem with FTP and fopen

2003-02-11 Thread Robin Mordasiewicz
no sure if this helps but i had a similar problem with php  4.3 . Afeter
upgrading from 4.2.3 ftp worked fine.

On 11 Feb 2003, Adam Voigt wrote:

 I don't think PHP checks to see what FTPD your running, it's probably a
 bug
 in PureFTPD as opposed to PHP (since it works in WU).

 On Tue, 2003-02-11 at 10:10, Chris Boget wrote:

 OK, I used the php ftp_put function successfully to upload a file.
 But
 this is not what I need. I need to use the ftp_fput function to
 transfer
 from a file pointer. This function failed to transfer the file with
 Pureftp server but transfers successfully using Wu-ftp. Any ideas on
 why
 Pureftp is failing to trasfer from a file point? I don't understand
 why
 it would even know the difference. Possible a bug in PHP?

 On Mon, 2003-02-10 at 13:30, Craig Jackson wrote:
  Anyone have any idea why this script cause a file to be created
 without
  the contents?
 
  script language=php
  set_time_limit(1200);
  $filename = testthis;
  $fp =
 fopen(ftp://user:pass@server/outbound/devel/$filename;,
  w);
  $tran_info = sprintf( %-10s\n,testthis);
  echo $tran_info;
  fputs($fp, $tran_info );
  fclose($fp);
  /script
 
  Using the latest version of pure-ftpd from source on Linux.
  --
 
  Craig Jackson
  __
  Wildnet Group LLC
  103 North Park, Suite 110
  Covington, Lousiana 70433
  Office 985-875-9453
  __
 
 
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 --

 Craig Jackson
 __
 Wildnet Group LLC
 103 North Park, Suite 110
 Covington, Lousiana 70433
 Office 985-875-9453
 __




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




-- 
Robin Mordasiewicz
416-207-7012
UNIX Administrator
Primus Canada


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




Re: [PHP] Directory size

2003-02-11 Thread Jeff Pauls
You can try something like this. 

$dir = dir;

function dirsize($checkdir) {
$dh = opendir($checkdir);
$size = 0;
while (($file = readdir($dh)) !== false)
if ($file != . and $file != ..) {
$path = $checkdir./.$file;
if (is_dir($path))
$size += dirsize($path);
elseif (is_file($path))
$size += filesize($path);
}
closedir($dh);
 $formated_size = $size /1000;
return $formated_size;
}

$getFolderSize = dirsize(/files/personal);


Jeff



- Original Message - 
From: Marek Kilimajer [EMAIL PROTECTED]
To: Antti [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 03, 2003 4:37 AM
Subject: Re: [PHP] Directory size


 there is no php function for this, you can use unix command du or do it 
 in a loop
 
 Antti wrote:
 
  How do I get the directory size? Suppose there is a function for this.
 
  antti
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


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




[PHP] PHP can create, but not delete

2003-02-11 Thread Greg
Hi-
I'm having a problem with deleting a Cyrus IMAP mailbox.  I can create the
mailbox just fine.  Any ideas on why I can't delete the mailbox?  Here is
some code that I got off this newgroup a few months ago:

   function deleteMailbox ($mailbox) {

  $existing_boxes = imap_listmailbox($this-stream, { .
$this-imap[host$
  if ( empty($existing_boxes) ) {
 $this-Error = deleteMailbox(): mailbox does not exist.;
 return(false);
  }

  # Now we add the delete ACL to cyrus feature...
  if ( ! imap_setacl($this-stream, imap_utf7_encode($mailbox),
$this-imap$
 $this-Error = imap_last_error();
 return(false);
  }

  if ( imap_deletemailbox($this-stream, imap_utf7_encode({ .
$this-imap$
 return(true);
  } else {
 $this-Error = imap_last_error();
 return(false);
  }

   }




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




[PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Vernon
I've successfully created a search and result page for a dating site which
off of the result page is a detail page for reviewing the profile online and
so forth.

The problem I'm having is once a user does his/her search they may come up
with a number of results which after reviewing one of the members details
the search has to be done over again. If a user uses the back arrow or if I
use a javascript that causes the user to go back one page they get the
typical Web Page has Expired after Viewing Results message.

Now I that I can create profiles that are viewed from a pop-up window, but
that's really not convent. Is there any way to for go the expired page
message so that a user can go back to their results? Or does anyone have any
suggestions on better handling this?

Thanks



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




[PHP] Alternative to PDFlib with PDI

2003-02-11 Thread Michael E. Barker
I know of fpdf and am currently using it in one application.

But does anyone know if I can open other pdf files with fpdf and merge 
them into one big pdf file like can be done with PDFlib Import?  Or; is 
there an alternative besides fpdf that does this in php?

TIA

Michael E. Barker


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



Re: [PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Marek Kilimajer
Simple answer is - use GET method instead of POST for your searches

Vernon wrote:


I've successfully created a search and result page for a dating site which
off of the result page is a detail page for reviewing the profile online and
so forth.

The problem I'm having is once a user does his/her search they may come up
with a number of results which after reviewing one of the members details
the search has to be done over again. If a user uses the back arrow or if I
use a javascript that causes the user to go back one page they get the
typical Web Page has Expired after Viewing Results message.

Now I that I can create profiles that are viewed from a pop-up window, but
that's really not convent. Is there any way to for go the expired page
message so that a user can go back to their results? Or does anyone have any
suggestions on better handling this?

Thanks



 



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




[PHP] RSA implementation

2003-02-11 Thread José León Serna
Hello:
  I'm looking for an RSA implementation, the ones I have found are
really slow, and I just want to:

generatekey
decrypt

the encryptfunction will be done in javascript, it's for a login system
without SSL.

Regards.


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




[PHP] array_fill error

2003-02-11 Thread Erin Fry
I am trying to initialize a large array with all values being 0.  I’ve tried:
 
$arr = array_fill(0, 99, 0);
 
and I get this error message:
Fatal error: Call to undefined function: array_fill()
 
Any information and suggestions will be greatly appreciated.
 
Thanks.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 



[PHP] Help With Form Mail

2003-02-11 Thread WAW
Hello All,
I have a problem. I did this form mail script and it is sending the
email to the poster not the email specified in the $mailto. Can someone
help me. Sorry it will be long, the code that is:
CODE:
?
//File_name = send_form.php//
 
include header.htm;
include setup.php;
 
$msg .= Senders Name:  \t$_POST[senders_name]\n;
$msg .= Senders Email: \t$_POST[senders_email]\n\n;
$msg .= Message:   \t$_POST[message]\n\n;
$msg .= From:  \t$_POST[senders_name]\n\n;
$mailheader .= Reply To:  \t$_POST[senders_email]\n\n;
 
mail($mailto, $mailsubj, $msg, $mailheader);
?
html
head
titleEmail Sent Successfully!!!/title
/head
body
centerH2The Following E-Mail Has Been Sent Successfully:/H2
pstrongYour Name:/strongbr
? echo $_POST[senders_name]; ?
pstrongYour Message/strongbr
? echo $_POST[message]; ?
br
br
? include footer.htm; ?/center
/body
/html
 
And Here is the include file (setup):
?
//File_Name = setup.php//
 
//Change below to your email address//
$mailto = [EMAIL PROTECTED];
 
//change below to your subject//
$mailsubj = FeedBack;
 
//change below to the Subject you want in the email,//
//LEAVE THE \n AT THE END//
$msg .= Email Feedback From Site\n;
?
 
Thanks in advance!! :-)  I am new at the PHP programming thing, so bare
with me.
 
Thanks, WAW
 http://reptilians.org/ http://reptilians.org
Forums:  http://reptilians.org/boards http://reptilians.org/boards 
 http://allscripts.reptilians.org
http://allscripts.reptilians.org/cgi-bin/index.cgi
 



RE: [PHP] array_fill error

2003-02-11 Thread Barajas, Arturo
Try array only:

$arr = array(0, 99, 0);

print_r($arr);

HTH
--
Un gran saludo/Big regards...
   Arturo Barajas, IT/Systems PPG MX (SJDR)
   (427) 271-9918, x448

 -Original Message-
 From: Erin Fry [mailto:[EMAIL PROTECTED]]
 Sent: Martes, 11 de Febrero de 2003 10:47 a.m.
 To: [EMAIL PROTECTED]
 Subject: [PHP] array_fill error
 
 
 I am trying to initialize a large array with all values being 
 0.  I’ve tried:
  
 $arr = array_fill(0, 99, 0);
  
 and I get this error message:
 Fatal error: Call to undefined function: array_fill()
  
 Any information and suggestions will be greatly appreciated.
  
 Thanks.
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
  
 

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




[PHP] PHP 4.3.0 + MSSQL database authentication problem?

2003-02-11 Thread Alan Murrell
Hello,

Because I am not sure if this is just a PHP issue or a
PHP+DB issue, I will be posting this message
(seperately) to bith the General and PHP-DB lists.

First, a brief rundown of my setup:

Mandrake Linux 9.0
Apache 1.3.27
PHP 4.3.0

We are in the process of rebuilding our outdated
servers, and all sites have been moved over
successfully, except our own, which has a Control
Panel login.  The login authentication is done using
FreeTDS to an MSSQL 2000 database.

This setup works fine on the current server, but when
I test it on the new server, the authentication seems
to work fine, but instead of the screen I normally see
when logging in, I just get kicked back to the Control
Panel login screen.

At first, I suspected FreeTDS, but I have confirmed
that a connection is definately being made by enabling
and examining the dump file.  The FreeTDS mailing
list has confirmed that this is also the case.

The current (working) server is running Apache 1.3.27
+ PHP v4.1.2 .  I had a similar problem on the current
working server when I tried upgrading the PHP to
v4.2.3 just before Xmas.

I have not yet tried downgrading to v4.1.2 on the
new server, but I would rather not.

I am not really sure where to proceed from here.  I
can provide any further information you need, or can
possibly provide a Test account if you wish to see
for yourself what it is doing, which may give some
ideas as to what is happening.

Is there perhaps some logging variables I can enable
in the Control Panel PHP script to see what is going
on?

Thank you, in advance, for your help and advice in
this matter.

Sincerely,

Alan Murrell [EMAIL PROTECTED]


__ 
Post your free ad now! http://personals.yahoo.ca

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




Re: [PHP] array_fill error

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 00:46, Erin Fry wrote:
 I am trying to initialize a large array with all values being 0.  I’ve
 tried:

 $arr = array_fill(0, 99, 0);

 and I get this error message:
 Fatal error: Call to undefined function: array_fill()

 Any information and suggestions will be greatly appreciated.

Did you try reading the manual to see whether your version of PHP supports 
this function?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The disks are getting full; purge a file today.
*/


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




Re: [PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Vernon
When I do that I get syntax errors in the SQL

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Simple answer is - use GET method instead of POST for your searches



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




Re: [PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Chris Shiflett
--- Marek Kilimajer [EMAIL PROTECTED] wrote:
 Simple answer is - use GET method instead of POST for
 your searches

--- Vernon [EMAIL PROTECTED] wrote:
 When I do that I get syntax errors in the SQL

That obviously has nothing to do with what request method
you are using. You need to give more information if you
want any help.

Chris

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




Re: [PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Marek Kilimajer
Changing the method also implies changing $_POST to $_GET in your code.

Vernon wrote:


When I do that I get syntax errors in the SQL

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 

Simple answer is - use GET method instead of POST for your searches
   




 



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




Re: [PHP] Help With Form Mail

2003-02-11 Thread Marek Kilimajer
mail($mailto, $mailsubj, $msg, $mailheader);

- where does $mailto come from?



WAW wrote:


Hello All,
I have a problem. I did this form mail script and it is sending the
email to the poster not the email specified in the $mailto. Can someone
help me. Sorry it will be long, the code that is:
CODE:
?
//File_name = send_form.php//

include header.htm;
include setup.php;

$msg .= Senders Name:  \t$_POST[senders_name]\n;
$msg .= Senders Email: \t$_POST[senders_email]\n\n;
$msg .= Message:   \t$_POST[message]\n\n;
$msg .= From:  \t$_POST[senders_name]\n\n;
$mailheader .= Reply To:  \t$_POST[senders_email]\n\n;

mail($mailto, $mailsubj, $msg, $mailheader);
?
html
head
titleEmail Sent Successfully!!!/title
/head
body
centerH2The Following E-Mail Has Been Sent Successfully:/H2
pstrongYour Name:/strongbr
? echo $_POST[senders_name]; ?
pstrongYour Message/strongbr
? echo $_POST[message]; ?
br
br
? include footer.htm; ?/center
/body
/html

And Here is the include file (setup):
?
//File_Name = setup.php//

//Change below to your email address//
$mailto = [EMAIL PROTECTED];

//change below to your subject//
$mailsubj = FeedBack;

//change below to the Subject you want in the email,//
//LEAVE THE \n AT THE END//
$msg .= Email Feedback From Site\n;
?

Thanks in advance!! :-)  I am new at the PHP programming thing, so bare
with me.

Thanks, WAW
http://reptilians.org/ http://reptilians.org
Forums:  http://reptilians.org/boards http://reptilians.org/boards 
http://allscripts.reptilians.org
http://allscripts.reptilians.org/cgi-bin/index.cgi


 



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




[PHP] Date check

2003-02-11 Thread Fredrik
Hi

I have to dates that i want to check who is biggest.

This does not work:

if( $date1  $date2){


How can i check them?


Svein Olai




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




Re: [PHP] Search Results - Web Page has Expired after Viewing Results

2003-02-11 Thread Vernon
That did it. Thanks (in all the years I have been doing this you think I
would have learned that already)

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Changing the method also implies changing $_POST to $_GET in your code.



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




RE: [PHP] Date check

2003-02-11 Thread Jon Haworth
Hi Fredik,

 I have to dates that i want to check who is biggest.
 
 This does not work:
 if( $date1  $date2){
 
 
 How can i check them?

Presumably they're in SQL format, or something similar? 

The easiest way is to convert them to unix timestamps (look into the date()
and mktime() functions to see how this is done).

Timestamps are integers representing the number of seconds since 1st January
1970, so comparisons are extremely easy :-)

Cheers
Jon

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




Re: [PHP] RSA implementation

2003-02-11 Thread Chris Hewitt
José León Serna wrote:


Hello:
 I'm looking for an RSA implementation, the ones I have found are
really slow, and I just want to:

generatekey
decrypt

the encryptfunction will be done in javascript, it's for a login system
without SSL.



Have you considered using on one-way MD5 hash instead? Again, it would 
need JS to do the client-side hashing (so JS on the client mandatory). 
In the server database keep the hashed values and compare them with what 
the client sends.

Keeping the hashed values in the database is more secure than 
unencrypted passwords, and you don't want to look at users' passwords 
anyway, do you?

Just a thought, in case you had not yet considered it. The archives from 
a week or so ago will have something on this, I remember it being discussed.

HTH
Chris



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



Re: [PHP] PHP 4.3.0 + MSSQL database authentication problem?

2003-02-11 Thread Alan Murrell
Hi R'Twick,

--- R'twick Niceorgaw [EMAIL PROTECTED] wrote:
 check the register_globals in php.ini file.

In the 'php.ini' file on both servers (the current
working one, and the one I am having problems with),
'register_globals' is 'On'.

Actually, i did compare the two 'php.ini' files line
by line, and they are exact.  Just to be sure, i even
copied over the 'php.ini' file from the working
server, restarted Apache, and tried the Control Panel
again; still no joy :-(

Thank you for the suggestion, however!

Alan


__ 
Post your free ad now! http://personals.yahoo.ca

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




[PHP] Show the info to update depending on the selection

2003-02-11 Thread Miguel Brás
Hi,

I have a page that is intendend to update a table field on DB

i have a drop down menu wich displays all the position fields available on
db and a text area where i will insert the new data.

now the problem:

I'm using the query SELECT * FROM table WHERE position = $position

the $position is the choosen option from the drop down menu.

then have echo textarea$functions/textarea where it will show to me
the present data available on DB

after all this, i have another query
UPDATE table SET functions = $functions WHERE position = $position

All is ok and working except the fact that he doesn't displays $functions
when selecting a option from the drop down menu?

Any help out there?

Miguel



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




[PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
Hi Everyone

The webserver is a Unix machine.  I don't want to send the email from the
Unix machine, I want to do that from Window.  So, if I configure hte php.ini
to find the MS-Exchange on Window and use it to send the email while the
webpage is on the Unix webserver, such as form fill out and click the send
button.

Have anyone try this and does it work?  Anyone struggle with it??  I'm going
to go ahead and do it.

Thanks,
 Scott F.



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




Re: [PHP] help me

2003-02-11 Thread Ray Hunter
make sure that the php3_xml.dll is in your system path and it can be
found.

Ray

On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
 how i do  work php with xml?
 
 In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
 workstation
 
 
 
 -- 
 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] help me

2003-02-11 Thread Cavallaro, Vito
all *.dll are C:\PHP3 but internet explorer make unload the file.xml

-Mensaje original-
De: Ray Hunter [mailto:[EMAIL PROTECTED]]
Enviado el: martes 11 de febrero de 2003 15:06
Para: Cavallaro, Vito
Cc: [EMAIL PROTECTED]
Asunto: Re: [PHP] help me


make sure that the php3_xml.dll is in your system path and it can be
found.

Ray

On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
 how i do  work php with xml?
 
 In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
 workstation
 
 
 
 -- 
 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] help me

2003-02-11 Thread Ray Hunter
The system needs to be able to find the dll so you might need to add
C:\PHP3 to your system path...



On Tue, 2003-02-11 at 11:05, Cavallaro, Vito wrote:
 all *.dll are C:\PHP3 but internet explorer make unload the file.xml
 
 -Mensaje original-
 De: Ray Hunter [mailto:[EMAIL PROTECTED]]
 Enviado el: martes 11 de febrero de 2003 15:06
 Para: Cavallaro, Vito
 Cc: [EMAIL PROTECTED]
 Asunto: Re: [PHP] help me
 
 
 make sure that the php3_xml.dll is in your system path and it can be
 found.
 
 Ray
 
 On Tue, 2003-02-11 at 07:38, Cavallaro, Vito wrote:
  how i do  work php with xml?
  
  In php3.ini add extension = php3_xml.dll but not work. is runnig on winnt
  workstation
  
  
  
  -- 
  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] mail() and php.ini (Any Luck???)

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:

 The webserver is a Unix machine.  I don't want to send the email from the
 Unix machine, I want to do that from Window.  So, if I configure hte
 php.ini to find the MS-Exchange on Window and use it to send the email
 while the webpage is on the Unix webserver, such as form fill out and click
 the send button.

 Have anyone try this and does it work?  Anyone struggle with it??  I'm
 going to go ahead and do it.

It wouldn't work. On Unix, mail() uses the sendmail binary and ignores any 
SMTP setting. You can get yourself a mail class from www.phpclasses.org which 
can use SMTP regardless of whether you're on Unix or Windows.

Anyway, what is the reason for using an external mailserver?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Mausoleum:  The final and funniest folly of the rich.
-- Ambrose Bierce
*/


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




[PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Hello all.  I have a customer that purchased on of my scripts and
attempted
to install it on their server.  This script, among other things, FTPs a
text file 
from a central server.  When we tried to run my script, it simply
stops.  No
errors, no nothing.  I talked to his host and found out that they do
not allow
PHP FTP because it is a security risk.  ?  U, ok?

I spoke with my customer about this and below is what his web host told
him.
My understanding of PHP FTP is that my script opens an ftp connection
from
the server to another FTP server somewhere else on the internet. 
Basically, 
PHP FTP does nothing more than a program like SmartFTP or WS-FTP.  Even

the first line in the PHP manual about FTP says The functions in this
extension 
implement client access to file servers speaking the File Transfer
Protocol (FTP)

Someone please tell me that I am correct and that this webhost is
wrong.  :)

Chris


I have been speaking with our linux techs, and have gained a more
complete understanding of the feature in PHP that you want to use.  We
actually did have it enabled at one point, and it caused the server to
be compromised.  Essentially, it allows people on a machine to be able
to transfer files from anywhere on the internet.  This begs for people
who want to run warez sites, and the like, to hack the server, and use
it for their own illegal software stores.  The level of permission
required to allow this to run allows people to essentially load, and
run
whatever they want.  This is an EXTREME security problem. I understand
that you are moving, and I cannot persuade you differntly, but please
take my advise and do some independant research.  The individual that
is
advising you about this program is downplaying some real problems. It
is
the opinion of our techs, that if you are running this, eventaully,
you
WILL be hacked.  There a plenty of things that can be done to ftp to a
machine without that functionality running. 
 
   We know that you have a number of sites, and we know that you would
likely referr business.  That being the case, it just doesn't make
sense
that we would not do this for you if it were safe, or even a minor
problem.  It is a big problem, not just with us, but with anyone
running
it on the internet.  Please ask someone other than the person that is
trying to sell it to you.  That is all we ask. 





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




php-general Digest 11 Feb 2003 18:55:28 -0000 Issue 1877

2003-02-11 Thread php-general-digest-help

php-general Digest 11 Feb 2003 18:55:28 - Issue 1877

Topics (messages 135167 through 135223):

Regex Help
135167 by: Lord Loh.
135171 by: Ernest E Vogelsinger
135173 by: Chris Hayes
135183 by: Kevin Waterson

Re: Why use XML?
135168 by: Ilya Nemihin

Re:  and ' giving problems
135169 by: Michiel van Heusden

Re: How to use fopen() with protected directory (i.e .htaccess)
135170 by: Ernest E Vogelsinger

Re: Newbie recursive directory
135172 by: Chris Hayes

Objects: Cant set object variables with refrences ...
135174 by: James
135187 by: michael kimsal
135189 by: James

File upload???
135175 by: Kenneth Suralta
135176 by: Francesco Leonetti

Q: File not rewritable - why? Help needed.
135177 by: user.domain.invalid

How to check acces to modeuls files and dirs
135178 by: Konference

Re: several buttons in form - which one was clicked
135179 by: James

Session into class
135180 by: ZioBudda

Q. on ereg_replace
135181 by: Michiel van Heusden
135186 by: Michiel van Heusden

If no record in MySQL how to?
135182 by: Steve Jackson
135184 by: Marek Kilimajer
135185 by: Steve Jackson

Re: mac os 9 - file upload problems
135188 by: Lowell Allen
135195 by: Step Schwarz

Re: sorting multi-dimensional array where array elements are structs [simple class]
135190 by: Erin Fry

help me
135191 by: Cavallaro, Vito
135219 by: Ray Hunter
135220 by: Cavallaro, Vito
135221 by: Ray Hunter

Image processing: tolerance of damaged files
135192 by: Geoff Caplan

Problem with FTP and fopen
135193 by: Chris Boget
135194 by: Adam Voigt
135196 by: Robin Mordasiewicz

Re: Directory size
135197 by: Jeff Pauls

PHP can create, but not delete
135198 by: Greg

Search Results - Web Page has Expired after Viewing Results
135199 by: Vernon
135201 by: Marek Kilimajer
135208 by: Vernon
135209 by: Chris Shiflett
135210 by: Marek Kilimajer
135213 by: Vernon

Alternative to PDFlib with PDI
135200 by: Michael E. Barker

RSA implementation
135202 by: José León Serna
135215 by: Chris Hewitt

array_fill error
135203 by: Erin Fry
135205 by: Barajas, Arturo
135207 by: Jason Wong

Help With Form Mail
135204 by: WAW
135211 by: Marek Kilimajer

PHP 4.3.0 + MSSQL database authentication problem?
135206 by: Alan Murrell
135216 by: Alan Murrell

Date check
135212 by: Fredrik
135214 by: Jon Haworth

Show the info to update depending on the selection
135217 by: Miguel Brás

mail() and php.ini  (Any Luck???)
135218 by: Scott Fletcher
135222 by: Jason Wong

PHP FTP  a security risk?
135223 by: Christopher Ditty

Administrivia:

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

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

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


--

---BeginMessage---
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?

I am trying to make a link collector.

after opening the desired page, I want to get all the hyperlinks on it...

Thank You!
==
~ Lord Loh ~
==



---End Message---
---BeginMessage---
At 07:47 11.02.2003, Lord Loh. said:
[snip]
I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?

http://www.php.net/manual/en/ref.pcre.php
http://www.perldoc.com/perl5.6/pod/perlre.html


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



---End Message---
---BeginMessage---
At 07:47 11-2-2003, you wrote:

I am new to regex and broke my head on it the other day...in vain...

Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?


Some tutorials:
http://codewalkers.com/tutorials/30/3/  Codewalkers - Using PCRE
http://samuelfullman.com/team/php/working/regex.php PCRE - Samuel Fullman
 http://www.yapf.net/faq.php?cmd=viewitemamp;itemid=113  How can i 
replace text between two tags
http://www.yapf.net/faq.php?cmd=viewitemamp;itemid=152 Counting words
http://www.phpbuilder.com/columns/dario19990616.php3  Learning to use 
Regular Expressions by example
 http://www.phpbuilder.com/columns/dario19990616.php3?page=3 email addresses



I am trying to make a link collector.

after opening the desired page, I want to get all the hyperlinks on it...




---End Message---
---BeginMessage---
This one 

[PHP] passing array as a form variable

2003-02-11 Thread Edward Peloke
Can I take the select array

Ex.
$myrow=mysql_fetch_array($result);


and pass this as a form variable to another page?

input type='hidden' name='$myrow' value='$myrow'


Thanks,
Eddie

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




Re: [PHP] passing array as a form variable

2003-02-11 Thread Leif K-Brooks
www.php.net/serialize
www.php.net/unserialize

Edward Peloke wrote:


Can I take the select array

Ex.
$myrow=mysql_fetch_array($result);


and pass this as a form variable to another page?

input type='hidden' name='$myrow' value='$myrow'


Thanks,
Eddie

 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




Re: [PHP] passing array as a form variable

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 02:56, Edward Peloke wrote:
 Can I take the select array

 Ex.
 $myrow=mysql_fetch_array($result);


 and pass this as a form variable to another page?

 input type='hidden' name='$myrow' value='$myrow'

archives  passing array

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Dow's Law:
In a hierarchical organization, the higher the level,
the greater the confusion.
*/


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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
Someone send me an email to take a look at this
URLhttp://www.php.net/manual/fi/ref.imap.php .

The send mail on Unix is too basic, not like MS-Exchange...  I need things
like file attachment, Bcc, cc, etc  Also, it is too slow because the
machine have problem with DNS while many Windows doesn't have this problem.

Thanks for the link to www.phpclasses.org .  Will look into it.

Scott F.

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:

  The webserver is a Unix machine.  I don't want to send the email from
the
  Unix machine, I want to do that from Window.  So, if I configure hte
  php.ini to find the MS-Exchange on Window and use it to send the email
  while the webpage is on the Unix webserver, such as form fill out and
click
  the send button.
 
  Have anyone try this and does it work?  Anyone struggle with it??  I'm
  going to go ahead and do it.

 It wouldn't work. On Unix, mail() uses the sendmail binary and ignores any
 SMTP setting. You can get yourself a mail class from www.phpclasses.org
which
 can use SMTP regardless of whether you're on Unix or Windows.

 Anyway, what is the reason for using an external mailserver?

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Mausoleum:  The final and funniest folly of the rich.
 -- Ambrose Bierce
 */




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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 02:54, Christopher Ditty wrote:
 Hello all.  I have a customer that purchased on of my scripts and
 attempted
 to install it on their server.  This script, among other things, FTPs a
 text file
 from a central server.  When we tried to run my script, it simply
 stops.  No
 errors, no nothing.  I talked to his host and found out that they do
 not allow
 PHP FTP because it is a security risk.  ?  U, ok?

So you're tranferring a file from SOMEWHERE to the server that your website is 
hosted on? If so then the reasons outline below ...

 I have been speaking with our linux techs, and have gained a more
 complete understanding of the feature in PHP that you want to use.  We

[snip]

... is very uninformed. The problems mentioned would only apply if running an 
FTP server (and probably only of concern if running a notoriously buggy 
server such as WU-ftp).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You will pioneer the first Martian colony.
*/


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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Reuben D. Budiardja
On Tuesday 11 February 2003 02:11 pm, Jason Wong wrote:
 On Wednesday 12 February 2003 02:54, Christopher Ditty wrote:
  Hello all.  I have a customer that purchased on of my scripts and
  attempted
  to install it on their server.  This script, among other things, FTPs a
  text file
  from a central server.  When we tried to run my script, it simply
  stops.  No
  errors, no nothing.  I talked to his host and found out that they do
  not allow
  PHP FTP because it is a security risk.  ?  U, ok?

 So you're tranferring a file from SOMEWHERE to the server that your website
 is hosted on? If so then the reasons outline below ...

  I have been speaking with our linux techs, and have gained a more
  complete understanding of the feature in PHP that you want to use.  We

 [snip]

 ... is very uninformed. The problems mentioned would only apply if running
 an FTP server (and probably only of concern if running a notoriously buggy
 server such as WU-ftp).

I agree with that. It's only a (potential) problem if you're running an FTP 
server, not client.

The one thing that makes me curious is as to how webhost ban this ftp client. 

You said you're only transferring text file. Does the server that you're 
transferring the file from offer other methods than FTP? how about HTTP?

RDB

-- 
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-



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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Unfortunately, I can only get the file via FTP.  I just want to know
where this other host got it's information.

Chris

 Reuben D. Budiardja [EMAIL PROTECTED] 02/11/03
01:35PM 
On Tuesday 11 February 2003 02:11 pm, Jason Wong wrote:

I agree with that. It's only a (potential) problem if you're running an
FTP 
server, not client.

The one thing that makes me curious is as to how webhost ban this ftp
client. 

You said you're only transferring text file. Does the server that
you're 
transferring the file from offer other methods than FTP? how about
HTTP?




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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Reuben D. Budiardja
On Tuesday 11 February 2003 02:19 pm, Scott Fletcher wrote:
 Someone send me an email to take a look at this
 URLhttp://www.php.net/manual/fi/ref.imap.php .

 The send mail on Unix is too basic, not like MS-Exchange...  I need things
 like file attachment, Bcc, cc, etc  

All of those can be done with sendmail. Bcc and cc can be done with just 
adding extra header. In the php mail() function, it's the last argument IIRC.

There are a lot of classes out there that will allow you to put attachment 
using the mail() function. Basically you only need the correct MIME-encoding 
and stuff. Read the manual for mail() again in php.net, or google for php 
mail attachment. 
You have to do it the same way to even in Windoze machine. It's not because of 
sendmail on Unix is too basic.

If you still want to use Windoze smtp server for sending your mail, then I 
think you need to open a socket connection to the machine running smtp. In my 
opinion, this complicates stuff that can be done easier, but you can look 
here:
http://www.php.net/manual/en/function.fsockopen.php.

There is even an example by some user contributed notes on how to do that.

 Also, it is too slow because the
 machine have problem with DNS while many Windows doesn't have this problem.

hmm.. that sounds like something misconfigured in the machine, maybe??

Hope that helps.
--RDB


 Thanks for the link to www.phpclasses.org .  Will look into it.

 Scott F.

 Jason Wong [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
   The webserver is a Unix machine.  I don't want to send the email from

 the

   Unix machine, I want to do that from Window.  So, if I configure hte
   php.ini to find the MS-Exchange on Window and use it to send the email
   while the webpage is on the Unix webserver, such as form fill out and

 click

   the send button.
  
   Have anyone try this and does it work?  Anyone struggle with it??  I'm
   going to go ahead and do it.
 
  It wouldn't work. On Unix, mail() uses the sendmail binary and ignores
  any SMTP setting. You can get yourself a mail class from
  www.phpclasses.org

 which

  can use SMTP regardless of whether you're on Unix or Windows.
 
  Anyway, what is the reason for using an external mailserver?
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.biz
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
  --
  Search the list archives before you post
  http://marc.theaimsgroup.com/?l=php-general
  --
  /*
  Mausoleum:  The final and funniest folly of the rich.
  -- Ambrose Bierce
  */

-- 
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-


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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 03:19, Scott Fletcher wrote:

 The send mail on Unix is too basic, not like MS-Exchange...  I need things
 like file attachment, Bcc, cc, etc  

I think you're missing the point somewhere. sendmail (in fact any MTA) will do 
all that.

 Also, it is too slow because the
 machine have problem with DNS while many Windows doesn't have this problem.

That machine is probably misconfigured.

If you're looking for performance then, all things being equal (same machine, 
same network connectivity), you're more likely to get that with a un*x system 
than a Windows system.

In any case pumping mail through another machine (ie using SMTP) is always 
slower than calling sendmail directly.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Abandon the search for Truth; settle for a good fantasy.
*/


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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
No, nothing is misconfigured on this machine.  The problem is the firewall
and the nameserver.  So, the easy workaround to it is to use the MS-Exchange
on Window.  Sendmail on Unix still doesn't allow me to use more stuffs, so I
had to use MS-Exchange.  Sendmail is not the right kind of email service to
use, so I can't use it.

By the way, Found a nice open-source script at www.phpclasses.org that would
allow me to connect to MS-Exchange.  Very nice, I'm going to use this.
Thanks!!!

Thanks,
 Scott F.

Reuben D. Budiardja [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tuesday 11 February 2003 02:19 pm, Scott Fletcher wrote:
 Someone send me an email to take a look at this
 URLhttp://www.php.net/manual/fi/ref.imap.php .

 The send mail on Unix is too basic, not like MS-Exchange...  I need things
 like file attachment, Bcc, cc, etc

All of those can be done with sendmail. Bcc and cc can be done with just
adding extra header. In the php mail() function, it's the last argument
IIRC.

There are a lot of classes out there that will allow you to put attachment
using the mail() function. Basically you only need the correct MIME-encoding
and stuff. Read the manual for mail() again in php.net, or google for php
mail attachment.
You have to do it the same way to even in Windoze machine. It's not because
of
sendmail on Unix is too basic.

If you still want to use Windoze smtp server for sending your mail, then I
think you need to open a socket connection to the machine running smtp. In
my
opinion, this complicates stuff that can be done easier, but you can look
here:
http://www.php.net/manual/en/function.fsockopen.php.

There is even an example by some user contributed notes on how to do that.

 Also, it is too slow because the
 machine have problem with DNS while many Windows doesn't have this
problem.

hmm.. that sounds like something misconfigured in the machine, maybe??

Hope that helps.
--RDB


 Thanks for the link to www.phpclasses.org .  Will look into it.

 Scott F.

 Jason Wong [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
   The webserver is a Unix machine.  I don't want to send the email from

 the

   Unix machine, I want to do that from Window.  So, if I configure hte
   php.ini to find the MS-Exchange on Window and use it to send the email
   while the webpage is on the Unix webserver, such as form fill out and

 click

   the send button.
  
   Have anyone try this and does it work?  Anyone struggle with it??  I'm
   going to go ahead and do it.
 
  It wouldn't work. On Unix, mail() uses the sendmail binary and ignores
  any SMTP setting. You can get yourself a mail class from
  www.phpclasses.org

 which

  can use SMTP regardless of whether you're on Unix or Windows.
 
  Anyway, what is the reason for using an external mailserver?
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.biz
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
  --
  Search the list archives before you post
  http://marc.theaimsgroup.com/?l=php-general
  --
  /*
  Mausoleum:  The final and funniest folly of the rich.
  -- Ambrose Bierce
  */

--
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-



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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Chris Wesley
On Tue, 11 Feb 2003, Christopher Ditty wrote:

 errors, no nothing.  I talked to his host and found out that they do
 not allow PHP FTP because it is a security risk.  ?  U, ok?

I consider FTP a security risk, period.  (There /are/ ways to run an FTP
server securely, but I won't assume everyone, or even anyone, knows this.)
The possibility of having plain-text authentication flying around ...
security risk.  This is probably the perspective of your hosting company.

You may want to only access a server which provides anonymous FTP.  You
might not use the same username and password to the FTP server that you
use on the hosting server.  You might only be accessing a server on a
trusted network.  But you're just one user.  From a sysadmin perspective,
that's a lot of assumptions made about all the other users who could
potentially use those FTP functions and not take the precautions you took.
(Not to mention, that it's a bit rude to expose someone's FTP server to
compromise just because the security issue doesn't affect the hosting
server.  Plain-text authentication, such that FTP and Telnet use, are the
bane of sysadmin existence ... usernames and passwords are sniffed too
easily.)

That said ... FTP is a protocol;  there's nothing stopping you from
opening a socket and talking FTP back  forth across it (unless your host
has disabled fsockopen() too).  If you know the protocol, you probably
know how and why to avoid its security concerns.

Other options:  Move to a less security-minded hosting provider (looks
like you've already started that), or ask the FTP server admin to provide
download access to your file via HTTP.

... hope that provides some insight.

~Chris


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




[PHP] Newbie php.ini

2003-02-11 Thread Val Schmidt
I'm completely new to php but am interested in getting things runnng on a
live apache server.  The default php.ini file has a huge security
disclaimer at the top stating that the default configuration is not
sufficiently secure for production. It references the php manual chapter
on security for more information.

I've read the manual, but in my green state it's still not clear to me what
I should change to keep my server from being hacked.

Would anyone be able to provide a standard ini file or list of changes to
the default that would keep me out of trouble with regards to security and
let me learn to use php as time permits?

Thanks,

Val



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




[PHP] passing a query string to a popup window problems

2003-02-11 Thread Brad Esclavon
I am trying to pass 2 variable values(username and userpassword) to a popup
window to display those values when a button is clicked. When the window
pops up, the variable names aren't displayed because they havent been
passed.
Here is the code:

onclick=window.open('http://www.bluedorado.com/bdnfosrc/distributionpopup.p
hp?formuser=$formuserformpassword=$formpassword','BD_Hit_Distribution','hei
ght=300,width=600,menubar=0,status=0');

Any ideas why the values arent being passed?



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




Re: [PHP] passing a query string to a popup window problems

2003-02-11 Thread John Nichel
What's the value of $_GET['formuser'] and $_GET['formpassword'] in your 
pop up window?

Brad Esclavon wrote:
I am trying to pass 2 variable values(username and userpassword) to a popup
window to display those values when a button is clicked. When the window
pops up, the variable names aren't displayed because they havent been
passed.
Here is the code:

onclick=window.open('http://www.bluedorado.com/bdnfosrc/distributionpopup.p
hp?formuser=$formuserformpassword=$formpassword','BD_Hit_Distribution','hei
ght=300,width=600,menubar=0,status=0');

Any ideas why the values arent being passed?







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




Fw: [PHP] passing a query string to a popup window problems

2003-02-11 Thread Kevin Stone
What does that string look like when it is outputed?  You're asking us to
assume that $formuser and $formpassword are there in the first place.
- Kevin

- Original Message -
From: Brad Esclavon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 11, 2003 1:09 PM
Subject: [PHP] passing a query string to a popup window problems


 I am trying to pass 2 variable values(username and userpassword) to a
popup
 window to display those values when a button is clicked. When the window
 pops up, the variable names aren't displayed because they havent been
 passed.
 Here is the code:


onclick=window.open('http://www.bluedorado.com/bdnfosrc/distributionpopup.p

hp?formuser=$formuserformpassword=$formpassword','BD_Hit_Distribution','hei
 ght=300,width=600,menubar=0,status=0');

 Any ideas why the values arent being passed?



 --
 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 FTP a security risk?????

2003-02-11 Thread Chris Wesley
On Tue, 11 Feb 2003, Chris Wesley wrote:

 On Tue, 11 Feb 2003, Christopher Ditty wrote:

  errors, no nothing.  I talked to his host and found out that they do
  not allow PHP FTP because it is a security risk.  ?  U, ok?

 That said ... FTP is a protocol;  there's nothing stopping you from
 opening a socket and talking FTP back  forth across it (unless your host
 has disabled fsockopen() too).  If you know the protocol, you probably
 know how and why to avoid its security concerns.

 Other options:  Move to a less security-minded hosting provider (looks
 like you've already started that), or ask the FTP server admin to provide
 download access to your file via HTTP.

You might find this interesting too -- straight from Example 1 for fopen()
in the PHP manual:  http://www.php.net/manual/en/function.fopen.php

$handle = fopen (ftp://user:[EMAIL PROTECTED]/somefile.txt;, w);

b.careful ... g.luck,
~Chris



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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Chris, Did you read the rest of the message?  It sounds like the web
host is saying that 
someone can access PHP FTP from an outside server and hack into the
server.  

I am not trying to start a debate on whether or not people should send
passwords and 
userids over plain text.  Yes, that is a security risk.  My concern is
that this webhost is 
telling my customer that PHP FTP itself is a security risk when it does
nothing more than
act like ws-ftp.

 Chris Wesley [EMAIL PROTECTED] 02/11/03 02:22PM 
On Tue, 11 Feb 2003, Chris Wesley wrote:

 On Tue, 11 Feb 2003, Christopher Ditty wrote:

  errors, no nothing.  I talked to his host and found out that they
do
  not allow PHP FTP because it is a security risk.  ?  U,
ok?

 That said ... FTP is a protocol;  there's nothing stopping you from
 opening a socket and talking FTP back  forth across it (unless your
host
 has disabled fsockopen() too).  If you know the protocol, you
probably
 know how and why to avoid its security concerns.

 Other options:  Move to a less security-minded hosting provider
(looks
 like you've already started that), or ask the FTP server admin to
provide
 download access to your file via HTTP.

You might find this interesting too -- straight from Example 1 for
fopen()
in the PHP manual:  http://www.php.net/manual/en/function.fopen.php 

$handle = fopen (ftp://user:[EMAIL PROTECTED]/somefile.txt;, w);

b.careful ... g.luck,
~Chris



-- 
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 FTP a security risk?????

2003-02-11 Thread Chris Shiflett
--- Christopher Ditty [EMAIL PROTECTED] wrote:
 This script, among other things, FTPs a text file from a central server.
 When we tried to run my script, it simply stops.  No errors, no nothing.
 I talked to his host and found out that they do not allow PHP FTP because
 it is a security risk.

This is probably just a lot of miscommunication. My initial guess is that you
are talking about running an FTP client, and they are talking about running an
FTP server.

For them to allow PHP's FTP extension, they would need to configure PHP with
the --enable-ftp flag as described here:

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

They may not have done this, and your script would exit with an error similar
to the following:

Fatal error: Call to undefined function:  ftp_connect()...

Are you sure there are no errors? I am assuming you viewed the source, not just
the browser's rendered page.

If you are using fopen() to retrieve a file via FTP, it is possible that your
host uses the --disable-url-fopen-wrapper flag to disable this. This is
generally done to protect the inexperienced developers who may use these
functions with unvalidated client data, opening themselves to security risks.

 I have been speaking with our linux techs, and have gained a more complete
 understanding of the feature in PHP that you want to use.  We actually did
 have it enabled at one point, and it caused the server to be compromised.

This sounds like they are thinking about an FTP server.

 Essentially, it allows people on a machine to be able to transfer files from
 anywhere on the internet.  This begs for people who want to run warez sites,
 and the like, to hack the server, and use it for their own illegal software
 stores.  The level of permission required to allow this to run allows people
 to essentially load, and run whatever they want.  This is an EXTREME security
 problem.

This demonstrates that they have no idea what they are talking about and have
been scared by stories of security vulnerabilities found in FTP servers (such
as WU-FTP). By their logic, if Apache had security vulnerabilities, it would be
best to not allow people to run Mozilla.

 It is the opinion of our techs, that if you are running this, eventaully,
 you WILL be hacked.  There a plenty of things that can be done to ftp to a
 machine without that functionality running.

There seems to be too much confusion going on here for these people to be Web
hosts. You're probably wise to be leaving anyway.

Chris

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




[PHP] newbie-php user tracker prob

2003-02-11 Thread Fireborn Silvaranth
Pretty new to PHP but I've always wanted to make a user tracking system.
I'm trying to grab a number (sessionNum) out of a text file and increment it whenever 
someone leaves and comes back to the site.. the problem is the text file appears to be 
cached somewhere, the first time someone comes back the value is incremented and 
appended but if they leave again and then come back the file's contents appear to be 
unchanged. Opening the file up after the first time reveals that it has been appended 
but after subsequent visits it is not (but yet it still goes through the function).
I tried just appending the info on with 'a' but since it didnt work I have it 
rewriting the whole file still doesnt work however...
thanks if you can give any help.

an example of the file's contents:
1-12:17:2:Tuesday:February:11:2003--page1,page2,page3,
(sessionNum-date-referer-pagelist)

the function I'm using :
function incSession($trackFile, $pagename){
   
   if (file_exists($trackFile)){

  //read the file
  $fileLine = file_get_contents($trackFile);

print alert('File contents before write : $fileLine');;

  //split the tracker file's contents into major sections 
Session-Date-Referer-Pages
  $headerArray = explode(-, $fileLine);

  //get correct entry for last session number in the tracker file
  $headerArrLen = count($headerArray);
  $arrayentry = $headerArrLen - 3; //back 3 to get last session number entry
  $arrayentry = $arrayentry - 1;  //correct number to account for number sys. 
beggining with 0

  //get the old session number and increment it
  $sessionNum = $headerArray[$arrayentry];
  $sessionNum = $sessionNum + 1;

  //get timestamp-user function
  $currentDate = makeDate('PHP');

  //get referer site if it exists
  $referer = $_SERVER['HTTP_REFERER'];

  //put it together for output
  $addon = '-' . $sessionNum . '-' . $currentDate . '-' . $referer . '-' . 
$pagename;

  $everything = $fileLine . $addon;
  
print alert('To be appended to file : $addon');;
print alert('File contents after write : $everything');;

  //user tracker file is appended with new session date referer and page
  $fp = fopen($trackFile, 'w');
  fwrite($fp, $everything);
  fclose($fp);
  
   }
}



Re: [PHP] newbie-php user tracker prob

2003-02-11 Thread Chris Shiflett
--- Fireborn Silvaranth [EMAIL PROTECTED] wrote:
 I'm trying to grab a number (sessionNum) out of a text file and increment
 it whenever someone leaves and comes back to the site.

How about this:

?
session_start();
if (!isset($_SESSION['count']))
{
   $_SESSION['count'] = 0;
}
else
{
   $_SESSION['count']++;
}

echo 'You have visited ' . $_SESSION['count'] . ' times before.';
?

Chris

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




Re: [PHP] mail() and php.ini (Any Luck???)

2003-02-11 Thread Scott Fletcher
I can see what you meant about the MIME-encoding and stuffs.  This is pretty
cool also.


Reuben D. Budiardja [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tuesday 11 February 2003 02:19 pm, Scott Fletcher wrote:
 Someone send me an email to take a look at this
 URLhttp://www.php.net/manual/fi/ref.imap.php .

 The send mail on Unix is too basic, not like MS-Exchange...  I need things
 like file attachment, Bcc, cc, etc

All of those can be done with sendmail. Bcc and cc can be done with just
adding extra header. In the php mail() function, it's the last argument
IIRC.

There are a lot of classes out there that will allow you to put attachment
using the mail() function. Basically you only need the correct MIME-encoding
and stuff. Read the manual for mail() again in php.net, or google for php
mail attachment.
You have to do it the same way to even in Windoze machine. It's not because
of
sendmail on Unix is too basic.

If you still want to use Windoze smtp server for sending your mail, then I
think you need to open a socket connection to the machine running smtp. In
my
opinion, this complicates stuff that can be done easier, but you can look
here:
http://www.php.net/manual/en/function.fsockopen.php.

There is even an example by some user contributed notes on how to do that.

 Also, it is too slow because the
 machine have problem with DNS while many Windows doesn't have this
problem.

hmm.. that sounds like something misconfigured in the machine, maybe??

Hope that helps.
--RDB


 Thanks for the link to www.phpclasses.org .  Will look into it.

 Scott F.

 Jason Wong [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  On Wednesday 12 February 2003 02:12, Scott Fletcher wrote:
   The webserver is a Unix machine.  I don't want to send the email from

 the

   Unix machine, I want to do that from Window.  So, if I configure hte
   php.ini to find the MS-Exchange on Window and use it to send the email
   while the webpage is on the Unix webserver, such as form fill out and

 click

   the send button.
  
   Have anyone try this and does it work?  Anyone struggle with it??  I'm
   going to go ahead and do it.
 
  It wouldn't work. On Unix, mail() uses the sendmail binary and ignores
  any SMTP setting. You can get yourself a mail class from
  www.phpclasses.org

 which

  can use SMTP regardless of whether you're on Unix or Windows.
 
  Anyway, what is the reason for using an external mailserver?
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.biz
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
  --
  Search the list archives before you post
  http://marc.theaimsgroup.com/?l=php-general
  --
  /*
  Mausoleum:  The final and funniest folly of the rich.
  -- Ambrose Bierce
  */

--
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-



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




[PHP] OO newb question....query results from a class

2003-02-11 Thread Cory Hicks
Hello!

I am just getting going with OO stuff and I am stumped at how to pull
out query results once it is part of a class. I am also using PEAR. Here
is my code:

class user
{
var $retval;

function get_signin()
{
global $db_obj;
$DateView = date(Y-m-d);

$sql = SELECT date_format(sys_time_sign_in, '%h:%i %p') as sign_in FROM
system_log WHERE sys_time_user_id='$_SESSION[valid_user]' AND
sys_time_date='$DateView' AND sys_time_flag='ON';

$result = $db_obj-query($sql);
if (DB::isError($result)) 
die($result-getMessage()); 

while($rows = $db_obj-fetchRow($result, DB_FETCHMODE_ASSOC))
{
$retval[] = $rows;
}
$retval = Array();
$retval['signin'] = $signin;
return $retval;
}

} 


/*
now to try to get at the var $retval
*/


$userinfo = new user();
echo $userinfo-get_signin();


It just returns Array? How do I, for lack of a better wordget to
this array? Outside of a class it works great, I echo $rows['sign_in']
and it works. But this! Help!

Many many thanks!

Cory

-- 
Cory Hicks [EMAIL PROTECTED]
TRI-International


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




RE: [PHP] setcookie() in various browsers.. 3rd followup.. anyone?

2003-02-11 Thread Chad Day
This is with PHP 4.2 and register_globals off.

I am setting cookies and starting a session in the following fashion:

setcookie(EMAILADDR, $row[EMAIL], time()+2592000, '/', .$dn);

where $dn = mydomain.com

I want the cookies accessible sitewide .. at www.mydomain.com, mydomain.com,
forums.mydomain.com, etc.

in IE 5.5, IE 6.0, and NS 7.0, it seems this is being accomplished
correctly.

In NS 4.8 (and 4.7 I assume), the cookies are never even getting set.  Can
anyone tell me as to why?  I've been prodding around cookie docs and trying
to find something that works in all browsers, and a lot of people seem to
have the same question..

Thanks!
Chad



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




Re: [PHP] OO newb question....query results from a class

2003-02-11 Thread Chris Boget
 $userinfo = new user();
 echo $userinfo-get_signin();
 It just returns Array? How do I, for lack of a better wordget to
 this array? Outside of a class it works great, I echo $rows['sign_in']
 and it works. But this! Help!
 Many many thanks!

Do this instead:

$userArray = $userInfo-get_signin();
echo $userArray['sign_in'];

Chris


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




RE: [PHP] PHP FTP a security risk?????

2003-02-11 Thread James E Hicks III
Please correct me if I am wrong, but it is impossible for a remote machine to
make an ftp connection to local machine running just PHP/Apache/Mysql. The ftp
functions available in PHP enable PHP scripts to act as an FTP client and can
not be used to accept remote FTP connections.

Other functions (the socket functions) however, could be used to create what is
needed in order provide the FTP server functionality that your ISP fears. It is
these functions that your ISP should be disabling and not the FTP functions in
order to protect themselves from a client allowing FTP access via a PHP script
that they have written.

James Hicks


-Original Message-
From: Christopher Ditty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 3:34 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP FTP a security risk?


Chris, Did you read the rest of the message?  It sounds like the web
host is saying that
someone can access PHP FTP from an outside server and hack into the
server.

I am not trying to start a debate on whether or not people should send
passwords and
userids over plain text.  Yes, that is a security risk.  My concern is
that this webhost is
telling my customer that PHP FTP itself is a security risk when it does
nothing more than
act like ws-ftp.

 Chris Wesley [EMAIL PROTECTED] 02/11/03 02:22PM 
On Tue, 11 Feb 2003, Chris Wesley wrote:

 On Tue, 11 Feb 2003, Christopher Ditty wrote:

  errors, no nothing.  I talked to his host and found out that they
do
  not allow PHP FTP because it is a security risk.  ?  U,
ok?

 That said ... FTP is a protocol;  there's nothing stopping you from
 opening a socket and talking FTP back  forth across it (unless your
host
 has disabled fsockopen() too).  If you know the protocol, you
probably
 know how and why to avoid its security concerns.

 Other options:  Move to a less security-minded hosting provider
(looks
 like you've already started that), or ask the FTP server admin to
provide
 download access to your file via HTTP.

You might find this interesting too -- straight from Example 1 for
fopen()
in the PHP manual:  http://www.php.net/manual/en/function.fopen.php

$handle = fopen (ftp://user:[EMAIL PROTECTED]/somefile.txt;, w);

b.careful ... g.luck,
~Chris



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




[PHP] Re: File not rewritable - why? Help needed.

2003-02-11 Thread Bobby Patel
Are you on a Windows platform, or *nix. I would assume *nix since you
mentioned chmod.

what did you chmod the file to? who owns the file? and what user does PHP
run as (maybe nobody, or httpd)?
Just to get it to work chmod the file to 777, BUT this is a security risk.
MAKE SURE this file is NOT in the web folder (or any of it's subfolders).
Remember to write to a file PHP (the user nobody or httpd) also needs Read
and eXecute permisions on all the directories from the root all the way to
the directory contaning the file.


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

 Newbie question:

 I try to modify a txt-file but get not writable error.
 (just like in http://www.php.net/manual/en/function.fwrite.php )

 I've tried to change the chmode but now I need some help.

 All info welcome! Thanks in advance!

 Paul Dunkel
 --
 [EMAIL PROTECTED]




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




[PHP] Re: Why use XML?

2003-02-11 Thread David Eisenhart
big issues!! I'd recommend that you check out the book 'XML and PHP' by
Vikram Vaswani, New Riders. Its well written and concise - should answer
your queries and more.

(BTW, like you I also use Smarty to separate application logic and
presentation; for my purps and circumstances this is preferable to using xml
stylesheets)

David




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




[PHP] Re: [PHP-DEV] include() and sessions

2003-02-11 Thread Chris Shiflett
Hello Lindsey,

I am posting this to [EMAIL PROTECTED] for you. The php-dev list is for
the development of PHP itself, not for user questions.

Also, as a guess to your problem, when you include a resource by URL, you are
going to receive the same output that a browser would (when you view source),
so any PHP code in that resource is going to be executed prior to receipt. If
this is a local file, you should use the filesystem path instead. For example:

include '/home/lindsey/public_html/foo.php';

instead of:

include 'http://www.example.org/~lindsey/foo.php';

If you must use a URL and you want to retain session, you will have to pass
your session identifier on the URL.

Chris

--- Lindsey Simon [EMAIL PROTECTED] wrote:
 I have a situation involving my session and an include(). 
 
 I'm trying to include() a page using the full path. My session is
 registered and I can verify all is well with it. I want to retain the
 session from within the page I'm including. 
 
 So:
 
 I'm pasting my code here (please ignore the variables except the session
 stuff at the end.
 
 $this_URL = $URL . index.php?modu=display_shotsshow_ident= .
 $_REQUEST['select_ident'] . select_ident= . $_REQUEST['select_ident']
 .. noheader=1nofooter=1no_print_link=1add_record=1 .
 session_name() . = . session_id();
 include($this_URL);
 
 my webserver just hangs and I have to restart it in order to get any
 more pages from anywhere on the server.
 
 I've tested this in 4.2.3 and 4.3.
 
 Is my syntax correct in terms of what I should append to the
 URL when include()ing it? I'm basing it on what I read about passing SID
 (which I can't use since it's returning empty on the page where I have
 the include() line)
 
 Thanks for your help,
 -l

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




[PHP] possible mail() bug

2003-02-11 Thread Matt Phillips
I created a script that sent the contents of the form via the mail().  when
I created it the server was running PHP 4.1.2.  The server I am on was
upgraded to ver 4.2.2.  When that happend the script stop working correctly.
It appeared to work, but the email never arrived.  So, I wrote a simple
script that looked that this:

?

if(mail('[EMAIL PROTECTED]','Testing','testinging 123'));
  echo sent

?

it would always show sent, but the message never arrived.

My orginal script used PEAR, but since PEAR uses the mail() I think that
this is problem.

Matt Phillips



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




[PHP] grief with printf(), padding and alignment of text

2003-02-11 Thread Robert E. Harvey, M.D.
I'm running PHP 4.2.2 and I'm having trouble with the printf() 
function.  I want to be able to print data in  space padded fields with 
the alpha strings left justified and the numeric strings right 
justified.  For some reason I can't get printf() to pad with spaces.  It 
pads with  -s and right aligns the data

For example this code: printf(%' -20s %' 20s %' -20sbr\n,$algen, 
$calc_amt, $range);

returns this output: Algae 292 very high
which shows no padding.

This code: printf(%'-20s %'20s %'-20sbr\n,$algen, $calc_amt, $range);

returns this output: ---Algae 292 ---very high
which pads only the first and third strings with - and not  and 
right justifies to the right and not left.

This code: printf(%'\ -20s %'\ 20s %'\ -20sbr\n,$algen, $calc_amt, 
$range);

returns this output: Algae 292 very high

with no padding and no justification.

How do I get printf() to work properly?



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



[PHP] concurrent fopen fwrite fclose

2003-02-11 Thread Frederick L. Steinkopf
Hi,
How does php handle multiple concurrent fopen fwrite fclose calls?  I have a
website that gets 7 million page views a month and we have created a custom
log file using fopen fwrite and fclose.  When running this concurrently with
the apache log we notice significantly lower page hits with the php logger. 
My guess is that we're losing data when the requests come in concurrently. 
Any advice would be appreciated.
Fred Steinkopf

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




Re: [PHP] newbie-php user tracker prob

2003-02-11 Thread Fireborn Silvaranth

- Original Message -
From: Chris Shiflett [EMAIL PROTECTED]
To: Fireborn Silvaranth [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, February 11, 2003 1:04 PM
Subject: Re: [PHP] newbie-php user tracker prob

Pretty new to PHP but I've always wanted to make a user tracking system.
I'm trying to grab a number (sessionNum) out of a text file and increment it
whenever someone leaves and comes back to the site.. the problem is the text
file appears to be cached somewhere, the first time someone comes back the
value is incremented and appended but if they leave again and then come back
the file's contents appear to be unchanged. Opening the file up after the
first time reveals that it has been appended but after subsequent visits it
is not (but yet it still goes through the function).
I tried just appending the info on with 'a' but since it didnt work I have
it rewriting the whole file still doesnt work however...
thanks if you can give any help.

an example of the file's contents:
1-12:17:2:Tuesday:February:11:2003--page1,page2,page3,
(sessionNum-date-referer-pagelist)

the function I'm using :
function incSession($trackFile, $pagename){

   if (file_exists($trackFile)){

  //read the file
  $fileLine = file_get_contents($trackFile);

print alert('File contents before write : $fileLine');;

  //split the tracker file's contents into major sections
Session-Date-Referer-Pages
  $headerArray = explode(-, $fileLine);

  //get correct entry for last session number in the tracker file
  $headerArrLen = count($headerArray);
  $arrayentry = $headerArrLen - 3; //back 3 to get last session number
entry
  $arrayentry = $arrayentry - 1;  //correct number to account for number
sys. beggining with 0

  //get the old session number and increment it
  $sessionNum = $headerArray[$arrayentry];
  $sessionNum = $sessionNum + 1;

  //get timestamp-user function
  $currentDate = makeDate('PHP');

  //get referer site if it exists
  $referer = $_SERVER['HTTP_REFERER'];

  //put it together for output
  $addon = '-' . $sessionNum . '-' . $currentDate . '-' . $referer . '-'
. $pagename;

  $everything = $fileLine . $addon;

print alert('To be appended to file : $addon');;
print alert('File contents after write : $everything');;

  //user tracker file is appended with new session date referer and page
  $fp = fopen($trackFile, 'w');
  fwrite($fp, $everything);
  fclose($fp);

   }
}


 --- Fireborn Silvaranth [EMAIL PROTECTED] wrote:
  I'm trying to grab a number (sessionNum) out of a text file and
increment
  it whenever someone leaves and comes back to the site.

 How about this:

 ?
 session_start();
 if (!isset($_SESSION['count']))
 {
$_SESSION['count'] = 0;
 }
 else
 {
$_SESSION['count']++;
 }

 echo 'You have visited ' . $_SESSION['count'] . ' times before.';
 ?

 Chris

That's a good way to handle it while they're in the browser but what if they
close it and log off then come back on and visit again? I want to track the
user as they move through my site, write what pages they go to and when they
log onto my site, where they come from and how many times they come.
I thought about logging their IP but what good does that do when a lot of
people still have dial up? I could set a cookie, and I have tried that,
however when I try to access that cookie with PHP upon their return it does
not see it. Javascript sees the cookie fine but by then PHP is done
processing.
It could be that I set the cookie with Javascript but even then PHP still
sees it after the page is reloaded or the user browses to the next page. I
couldn't set the cookie with PHP because I needed it to occur after checking
to see if they had a cookie etc... I tried using output buffering but it
still didnt work.
I read in the manual that sessions are just meant to last as long as the
user is in the browser so I dont know what to do.
Your thoughts on this?
Learning is fun!


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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Chris Wesley
On Tue, 11 Feb 2003, Christopher Ditty wrote:

 Chris, Did you read the rest of the message?  It sounds like the web

Yes, I read your entire message.

 host is saying that
 someone can access PHP FTP from an outside server and hack into the
 server.

That's precisely NOT what the hosting provider said (at least it's not
what my appreciation for running a secured web host led me to believe they
said).  I don't expect you to be a security expert, but think with me
through a very common scenario sysadmins must account for.  I'll use the
word you in a general sense:

  You access an FTP server with a user name and a password to retrieve a
  file via PHP FTP.  The user name and password is the same that grants
  you access to your hosting providers server.  (People do this
  v.frequently.  Most people have trouble remembering one
  username/password, so they make the dangerous choice to use one
  username/password over and over again.)  A malicious individual sniffs
  your username and password while you transfer a file via FTP from to you
  hosting provider.  Once the individual has his way with your FTP site
  using your credentials, (s)he does the obvious next step ... attempts to
  use the same credentials to gain access to your hosting providers
  server.

Make sense?  That didn't take much time, effort, or thought to get the
hosting provider compromised.  And note that it had nothing to do with
PHP.  It has everything to do with FTP itself.

Like I said, originally, you and/or your customer might take precautions
against something like this, but there's no way a responsible sysadmin can
assume or be assured that every user on a system will do the same.

The hosting provider isn't trying to protect itself from malicious people
attacking some vulnerability in PHP's FTP extensions.  The webhost is
trying to protect itself from it's own users who might code somthing using
an insecure protocol which might allow malicious people easily gain access
credentials to its servers, or othewise allow abuse of a server's
resources.  PHP's FTP extenstions aren't a security risk.  The security
risk is what users can do with FTP.

At the /risk/ of introducing more reasons for the webhost to disallow the
FTP extensions, forward them this thread and ask if these are indeed
their reasons.

 I am not trying to start a debate on whether or not people should send
 passwords and userids over plain text.  Yes, that is a security risk.
 My concern is that this webhost is telling my customer that PHP FTP
 itself is a security risk when it does nothing more than act like
 ws-ftp.

Ws-ftp uses plain-text authentication.  The FTP extension to PHP uses
plain-text authentication.  (Neither has a choice, since FTP is a
plain-text protocol.)  They both present security risks for the same
reason.

~Chris



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




Re: [PHP] File upload???

2003-02-11 Thread Kenneth Suralta

Can anybody help me with file uploading, again...
I tried uploading a file through...

form enctype=multipart/form-data action=project_save.php method=post
input name=project_file type=file
input type=submit value=ok
/form

but, on project_save.php, the
$HTTP_POST_FILES[project_file][size] is zero(0) , and
$HTTP_POST_FILES[project_file][tmp_name] is an empty string.

i checked,
$HTTP_POST_FILES[project_files][error] has a value of 2.

What does error 2 mean???






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




[PHP] php javascript drop down menu???

2003-02-11 Thread Jeff Bluemel
OK...  I have a dynamic menu system, and I have to maintain a dynamic menu.
however, the amount of content I need in my menu is going to be rapidly
outgrown.  I believe my only solution is to deploy a javascript drop down
menu (users have to be javascript compatible anyway for some other issues in
my pages).

however, it seems like anytime I try to integrate php  javascript I run
into a total nightmare.  the php  javascript do not need to integrate at
the client level, but just on the server side to actually deploy the menu to
the user.  (have if then statements of info from a database that will
determine if the item is displayed to the user or not, so should be pretty
easy to accomodate)

does anybody have any sample code of a javascript menu across the top of the
page that will have menu, and submenu's they are deploying with php echo
statements?



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




Re: [PHP] sorting multi-dimensional array where array elements are structs [simple class]

2003-02-11 Thread Michael Sims
On Tue, 11 Feb 2003 08:27:57 -0600, you wrote:

Thanks for the reply.  I had already tried usort previously.  For some
 reason, there is no data for the array fields at all in the cmp function
 - not sure why.  Does anyone know?  All help is appreciated!  Thanks.

Can you post a short code sample which illustrates your problem?

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




[PHP] RE: PHP-based SMS solution

2003-02-11 Thread YC Nyon
I am developing a web-based GPS vehicle tracking solution using php.
I'm looking on how php can communicate with a SMSC using Smpp to issue AT
commands.
Development platform is windows 2000.

Thanks
Nyon


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003


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




[PHP] Classes, global objects, and pointers

2003-02-11 Thread John Hughes
In this example which parallels a problem I am having in my real life
script. I would like to have a global object, in this case $tester. I would
then like to be able to store local references to this global object right
inside the class. These are assigned byref in the classes constructor.

This script should, by my understanding work, only it craps out in test2's
constructor: $o = $tester;.

Any help would be greatly appreciated. (Please cc me on your replies)

John Hughes

?php

class test {
  var $a;
  function test() {
$this-a = 10;
  }
  function doit() {
$this-a = 20;
  }
}

global $tester;
$tester = new test();

class test2 {
  var $o;
  function test2() {
$o = $tester;
  }
  function mod() {
$o-doit();
  }
}

echo $tester-a . \n; // Should be 10

$newtest = new test2();
$newtest-mod();

echo $tester-a . \n; // Should be 20

?


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




[PHP] default php sessions in a database

2003-02-11 Thread Robin Mordasiewicz
Is there a way to configure php to use a database for sessions rather than
a text file.
I have a server farm and want the session files to be accessible to all
machines in the cluster. I can have the session file on nfs but I am
worried  about file locking.
I have read tutorials on how to set session.save_handler = user and then
each script configures their seesion variables and connections, but I
want this to be transparant to my users. I do not want users to have to
change anything in their scripts.


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




Re: [PHP] grief with printf(), padding and alignment of text

2003-02-11 Thread Matt
- Original Message -
From: Robert E. Harvey, M.D. [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Tuesday, February 11, 2003 6:21 PM
Subject: [PHP] grief with printf(), padding and alignment of text


 I'm running PHP 4.2.2 and I'm having trouble with the printf()
 function.  I want to be able to print data in  space padded fields with
 the alpha strings left justified and the numeric strings right
 justified.  For some reason I can't get printf() to pad with spaces.  It
 pads with  -s and right aligns the data

 For example this code: printf(%' -20s %' 20s %' -20sbr\n,$algen,
 $calc_amt, $range);

 returns this output: Algae 292 very high
 which shows no padding.

View source, and see what you find there.  You should consider tables or
replacing the spaces with the entity nbsp;



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




Re: [PHP] default php sessions in a database

2003-02-11 Thread Tom Rogers
Hi,

Wednesday, February 12, 2003, 1:34:49 PM, you wrote:
RM Is there a way to configure php to use a database for sessions rather than
RM a text file.
RM I have a server farm and want the session files to be accessible to all
RM machines in the cluster. I can have the session file on nfs but I am
RM worried  about file locking.
RM I have read tutorials on how to set session.save_handler = user and then
RM each script configures their seesion variables and connections, but I
RM want this to be transparant to my users. I do not want users to have to
RM change anything in their scripts.

Have a look at msession, it was built for your situation.

-- 
regards,
Tom


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




RE: [PHP] File upload???

2003-02-11 Thread David Freeman


  Can anybody help me with file uploading, again...

Have you tried using the fairly simple example that is given at
http://www.php.net/manual/en/features.file-upload.php yet?  I've found
that starting with this example and then adding all the extras tends to
work well when you've got problems.  But then, I ended up adding file
upload stuff to the form validation class that I use and this has ended
most of my file upload problems.

CYA, Dave





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




[PHP] Re: Need To Find A php Person

2003-02-11 Thread rija
Hello,
I'm likely the person you're looking for.
My name's Rija
I live in Vanuatu, and I teach IT and computer science for the MontMartre
High School.

I'll give you some of the best website I've done:
- trano-bongo.com
- evelyneproducts.com
- vanua2.com
- madeinpacific.com

Also, I've done plenty static websites.
For further information
contact me at this e.mail address : [EMAIL PROTECTED]



Michael McGlaughlin [EMAIL PROTECTED] a écrit dans le message :
[EMAIL PROTECTED]
 Hello,

 I am looking for someone well versed and established who understands the
php language and who can support a product that I have that I cannot receive
support from by the original developer.

 What would be the best way for me to go about finding someone? We paid the
developer by making a donation to him for his script, then paid him for some
further customizations, which he completed, but now he does not appear
interested in additional cusomization work on our system and I am left in a
bit of a lurch.

 Any help you can give would be greatly appreciated.

 Sincerely,
 Michael


 _
 Get your FREE email address
 http://www.hootingowl.com
 The Wise Way To Search

 _
 Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No
Ads, 6MB, POP  more! http://www.everyone.net/selectmail?campaign=tag



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




[PHP] Issue saving php that includes constant---

2003-02-11 Thread Shawn McKenzie
I collect some PHP code in an HTML form (textarea) I then save this in an
array in a file using export_var().  If the code entered in the textarea is
this:

echo To ._LOGIN. click the login link below;

And the constant _LOGIN happens to be defined in the current script that
generates the form (maybe _LOGIN = Login ), then the result after my
var_export() to the file is this:

$var = 'To Login click the login link below;';

Any ideas on how to keep the text of the constant definition in the string
instead of it being evaluated???

TIA,
Shawn



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




Re: [PHP] setcookie() in various browsers.. 3rd followup.. anyone?

2003-02-11 Thread Jason Wong
On Wednesday 12 February 2003 05:44, Chad Day wrote:
 This is with PHP 4.2 and register_globals off.

 I am setting cookies and starting a session in the following fashion:

 setcookie(EMAILADDR, $row[EMAIL], time()+2592000, '/', .$dn);

 where $dn = mydomain.com

 I want the cookies accessible sitewide .. at www.mydomain.com,
 mydomain.com, forums.mydomain.com, etc.

 in IE 5.5, IE 6.0, and NS 7.0, it seems this is being accomplished
 correctly.

 In NS 4.8 (and 4.7 I assume), the cookies are never even getting set.  Can
 anyone tell me as to why?  I've been prodding around cookie docs and trying
 to find something that works in all browsers, and a lot of people seem to
 have the same question..

archives  cookie handling

I'm sure there's some interesting reading to be found.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Emerson's Law of Contrariness:
Our chief want in life is somebody who shall make us do what we
can.  Having found them, we shall then hate them for it.
*/


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




  1   2   >