Re: [PHP] Select drop-down box overflow?

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 13:17, Doug Parker wrote:
 I've got sort of an odd one here.  I'm populating a select drop down box
   with a substantial number of options - actually every county in the
 U.S.- which is about 3000 results from a query.  The problem is that
 when I load the page, there are all kinds of weird problems, characters,
 you name it.  I'm wondering if theres's a limit to how many options I
 can have in a select drop down box?

This is a browser issue. Having too many form elements in any(?) browser 
creates problems -- Mozilla, IE, Opera all exhibit this problem (under 
Windows at least). Can't you split your select box to some manageable 
proportions? Select state first, then show the list of counties within that 
state?

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

/*
An infallible method of conciliating a tiger is to allow oneself to be
devoured.
-- Konrad Adenauer
*/


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




[PHP] fgetcsv Help

2002-12-11 Thread Richard Baskett
I am parsing a csv file with fgetcsv and the fields are surrounding by
double quotes, now I am running into a problem periodically that when there
are quotes within the value it is treating it like another value instead of
the same value.

Any ideas on how to get around that?

I am thinking I might have to convert all quotes to quot; and then turn all
quot;,quot; back into quotes and then the first quot; in the file and
then last one since obviously they will not have a comma in between them.
This seems like a while lot of work..

Ideas?

Rick

A wise women once said:  No one can help everybody, but everybody can help
somebody. - Unknown 


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




Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values

2002-12-11 Thread KANM MD
Here is the code in a readable form (alterations for security, simplicity
...)

if
((stristr($HTTP_SERVER_VARS[remote_address],XXX.YYY.ZZZ))||($pwprotect==
'password')) {
 setcookie(pwprotect2,1,time()+300);
}
else {
 echo form(ASK FOR PASSWORD)/form;
}

Now when you say blank line does that mean actual empty lines between the
? tag and the beginning of the code?

ie

?

if ((stristr(

might cause problems? Seems kind of snarky, but I'm willing to try anything.

Anyway, thanks for responding ... ON A COMPLETELY SEPARATE NOTE, does anyone
here understand how the odbc_primarykeys() function ... err .. functions?
Tried all avenues, kept getting an SQL Error in SQLPrimaryKey, I imagine I'm
not entering proper values for the parameters, but I don't know any proper
values for the parameters ... any help?

Once again, thanks a lot!

Kyle Hale
Computer Guy
KANM Student Radio
Texas AM University




- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: KANM MD [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 10:39 PM
Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values


 Hey Aggie,

 Show us the rst of the code.  stristr() should not be a problem.  Chances
are there's a
 blank line elsewhere that's being sent.

 - Original Message -
 From: KANM MD [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, December 10, 2002 2:34 PM
 Subject: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values


 Here's my question:

 I'm running code that essentially checks for either a certain IP address
or a password
 before it sends a cookie. However, when I try to send the cookie, I get
the standard
 Error - headers already sent when I haven't output anything. After some
spot debugging,
 I found that

 if ( stristr($HTTP_SERVER_VARS[remote_address],XXX.YYY.ZZZ) ) { ...

 essentially counts as a sent header. I imagine this has to do with the
fact that stristr
 returns a TRUE or FALSE value, but not being an expert in programming
concepts, I wouldn't
 know.

 Anywho, if anyone knows a workaround for this or could explain the problem
that lies
 within, it would be greatly appreciated.

 Thanks,

 Kyle Hale
 Computer Guy
 KANM Student Radio
 Texas AM University





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




[PHP] Passing variables from script to script

2002-12-11 Thread Stefan Hoelzner
Hi folks,

surely this question has already been answered many times before in this ng, but 
nevertheless: I want to pass variables  from
one .php to another .php script. But I do not want to use either the 
http://localhost/target.php?var1=testvar2=test2 nor  
the
POST method. I would like to pass over general variables like usernames and passwords 
for several MySQL-connects;  obviously
it is not a good way to pass these vars via the mentioned ways.

What else does PHP offer? Are there any other methods? Can I define these vars as some 
kind of global variables in any
ini-file?

THX for your support!

Stefan.



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




Re: [PHP] Question Regarding Cookies, Sent Headers, and FunctionsThat Return Values

2002-12-11 Thread bahwi
Forgive if this is not the answer to the problem. I think he means a 
blank line at the beginning of the file before the ?

If you have anything before the ? it gets sent to the browser, and thus 
headers have already been sent (This is the same for print statements, etc).

--Joseph Guhlin - http://www.josephguhlin.com/ 
Was I helpful?  Let others know:
http://svcs.affero.net/rm.php?r=bahwi
-- or hire me! =)





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



Re: [PHP] Passing variables from script to script

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 07:56, Stefan Hoelzner wrote:
 Hi folks,

 surely this question has already been answered many times before in this
 ng, but nevertheless: 

So why don't you search the archives to read the answers!?!

 I want to pass variables  from one .php to another
 .php script. But I do not want to use either the
 http://localhost/target.php?var1=testvar2=test2 nor the
 POST method. I would like to pass over general variables like usernames and
 passwords for several MySQL-connects;  obviously it is not a good way to
 pass these vars via the mentioned ways.

 What else does PHP offer? Are there any other methods? Can I define these
 vars as some kind of global variables in any ini-file?

Use sessions.

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

/*
OS/2 must die!
*/


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




Re: [PHP] Passing variables from script to script

2002-12-11 Thread bahwi
If they are static you could store them in another php file and include 
them.

HTTP is stateless, meaning one person can go from one page to another or 
log out in between all of this. It also means there is no authentication 
for users, you can not prove that one person is the same person the next 
time he visits the page.

Without using GET or POST. I would go with cookies. In fact, I would go 
with SESSIONS.
http://www.php.net/manual/en/ref.session.php

This way, only the session ID is stored as a cookie, and you can store 
the other variables on the server under $_SESSION['username'] and 
$_SESSION['password']. This may not be the perfect solution to your 
problem, but take a look. It's really useful. You have to run 
session_start(); before anything else, and it does it all via 
cookies(and sometimes through GET), but works very well in my experience.

You may also want to look at:
http://www.php.net/manual/en/function.ini-set.php

to control various aspects of PHP's sessions. I've found ini_set() with 
sessions to be invaluable. Hope this helps!

--Joseph Guhlin - http://www.josephguhlin.com/ 
Was I helpful?  Let others know:
http://svcs.affero.net/rm.php?r=bahwi






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



Re: [PHP] Passing variables from script to script

2002-12-11 Thread Philip Olson
On Tue, 10 Dec 2002, Stefan Hoelzner wrote:

 Hi folks,
 
 surely this question has already been answered many times before in
 this ng, but nevertheless: I want to pass variables from one .php to
 another .php script. But I do not want to use either the
 http://localhost/target.php?var1=testvar2=test2 nor the POST method.
 I would like to pass over general variables like usernames and
 passwords for several MySQL-connects;  obviously it is not a good way
 to pass these vars via the mentioned ways.
 
 What else does PHP offer? Are there any other methods? Can I define
 these vars as some kind of global variables in any ini-file?

Use includes.  http://www.php.net/include

dbinfo.inc
?php
  $host = 'localhost';
  $user = 'foo';
  $pass = 'bar';
  ...
?

showstuff.php
?php
  include 'dbinfo.inc';

  if (!$conn = mysql_connect($host, $user, $pass)) {
  ...
?

Ideally this include will be outside the document root.  If 
not, make sure it's not viewable or use a php extension such 
as .php  See also the include_path php directive.

Regards,
Philip


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




[PHP] Rename an upload

2002-12-11 Thread Steve Jackson
I'm trying to rename an uploaded file with the value of a select I have
in the uploaded form. Can someone point me in the right direction. The
PHP.net rename manual isn't helping a lot? My code:

//Form for upload
form enctype=multipart/form-data action=eshop_upload.php
method=post
input type=hidden name=MAX_FILE_SIZE value=25000
input type=file name=userfile size=18 class=kapea
brbr
span class=adminisoleipaSelect the category to add the picture
to:brbr
select name='category'
option value=Please select.../option
? 
while ($array = mysql_fetch_array($mysql))
{
echo option
value='{$array[catid]}'{$array[catname]}/option;
}
?
/select
/td
/tr
trtdbr
input type=submit name=Submit value=Submit class=nappi
/form

//eshop_upload.php
?php
// Upload the picture to the selected directory and rename the file as
the category number.
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{

copy($HTTP_POST_FILES['userfile']['tmp_name'],http://www.violasystems.c
om/images/);
rename(($HTTP_POST_FILES['userfile']['tmp_name']),
$category);
}
else
{
echo Possible file upload attack. Filename:
.$HTTP_POST_FILES['userfile']['tmp_name']
}
?

TIA.

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] Uploading a directory via browser w/ php

2002-12-11 Thread Davíð Örn Jóhannsson
Hi I’m wondering if any body has done somthing like uploading a whole
directory trough webbrowser using php, 
or has any Ideas how such a thing can be done, any Ideas appriciated.
 
Regards, David



Re: [PHP] Passing variables from script to script

2002-12-11 Thread Chris Hewitt
Stefan Hoelzner wrote:



nevertheless: I want to pass variables  from
one .php to another .php script. But I do not want to use either the http://localhost/target.php?var1=testvar2=test2 nor  
the
POST method. I would like to pass over general variables like usernames and 

Sessions. The data is stored on the server and only a session id 
transferred by cookie/post/get.

HTH
Chris


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



[PHP] trimming nans from a string

2002-12-11 Thread Frands Sørensen
I want a user to type a number in an html-form. Afterwards I want to check
for wrong typing. How do I remove all non numbers from the string?



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




Re: [PHP] Rename an upload

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 17:30, Steve Jackson wrote:
 I'm trying to rename an uploaded file with the value of a select I have
 in the uploaded form. Can someone point me in the right direction. The
 PHP.net rename manual isn't helping a lot? My code:

What is the problem?


 //eshop_upload.php
 ?php
 // Upload the picture to the selected directory and rename the file as
 the category number.
 if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
   {

 copy($HTTP_POST_FILES['userfile']['tmp_name'],http://www.violasystems.c
 om/images/);

You've copied the uploaded file to another directory ...

   rename(($HTTP_POST_FILES['userfile']['tmp_name']),
 $category);

... but now you're renaming the [temporary] uploaded file? Shouldn't you be 
renaming the above copied file?

In fact you should be able to do it in a single step by copying the uploaded 
file to its new destination and new filename.

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

/*
Age before beauty; and pearls before swine.
-- Dorothy Parker
*/


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




Re: [PHP] trimming nans from a string

2002-12-11 Thread Leif K-Brooks
$variable = ereg_replace('[^0-9]','',$variable);

Frands Sørensen wrote:


I want a user to type a number in an html-form. Afterwards I want to check
for wrong typing. How do I remove all non numbers from the string?



 


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

2002-12-11 Thread Chris Hewitt
Beauford.2002 wrote:


--snip---

The problem is that the form is not sending the employee name to the php
page. If I insert the name in the php page manually, it works fine, so the
problem appears to be with the form.

--snip--
PCENTERFORM NAME=Employees
SELECT NAME=name
OPTION SELECTED VALUE=/OPTION
OPTION VALUE=John/OPTIONJohn
OPTION VALUE=Mary/OPTIONMary
/SELECT
INPUT TYPE=submit VALUE=Submit


Two suggestions. You do not specify whether your form should use GET or 
POST method (I'm not sure whether there is a default). The other is how 
you are accessing the variable name within php. If register_globals is 
on in php.ini then just $name is fine, but if its off then use $name = 
$_GET['name'] or $name = $_POST['name'] depending upon whether you 
specify GET or POST method.

HTH
Chris





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




Re: [PHP] Displaying output from MySQL

2002-12-11 Thread Chris Hewitt
Beauford.2002 wrote:


Hi,

Not sure if this is a PHP of a MySQL question, so I am sending it to both
groups. Basically I have a list of numbers with two decimal places in the
MySQL database, but I only want to display some of them with the decimal
points.


Check out number_format() in the manual (under Mathematical Functions).

HTH
Chris



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




Re: [PHP] Page display of query resuts using ODBC

2002-12-11 Thread Tom Rogers
Hi,

Wednesday, December 11, 2002, 2:05:25 AM, you wrote:
LR Hi,

LR Just wondering if anybody knows a script to display a resultset over several pages 
using page numers  previous, next links.

LR So far I've only found such scripts for mysql using the the following sql syntax 
which is not odbc compliant: SELECT * from table LIMIT 0, 4

LR I've looked at many sites to find such a script without luck so far...

LR Thanks in advance for your help,

LR -Luc
Here is a paging class I wrote, it is using mysql but the example is not using
the LIMIT feature so it should work with a little change for odbc.

?
class page_class {
var $count = 0; //total pages
var $start = 0; //starting record
var $pages = 0; //number of pages available
var $page = 1;  //current page
var $maxpages;  //shows up to 2 * this number and makes a sliding scale
var $show;  //number of results per page
function page_class($count=0,$show=5,$max=9){
$this-count = $count;
$this-show = $show;
$this-maxpages = $max;
($this-count % $this-show == 0)? $this-pages = 
intval($this-count/$this-show) :$this-pages = intval($this-count/$this-show) +1;
if(!empty($_GET['search_page'])){
$this-page = $_GET['search_page'];
$this-start = $this-show * $this-page -$this-show;
}
}
function get_limit(){
$limit = '';
if($this-count  $this-show) $limit = 
'LIMIT'.$this-start.','.$this-show;
return $limit;
}
function get_start(){
 return $this-start;
}
function get_end(){
 return ($this-start + $this-show);
}
function make_head_string($pre){
$r = $pre.' ';
$end = $this-start + $this-show;
if($end  $this-count) $end = $this-count;
$r .= ($this-start +1).' - '.$end.' of '.$this-count;
return $r;
}
function make_page_string($words,$pre='Result Page:'){
$r = $pre.' ';
if($this-page  1){
$y = $this-page - 1;
$r .= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Previous/anbsp;';
}
$end = $this-page + $this-maxpages-1;
if($end  $this-pages) $end = $this-pages;
$x = $this-page - $this-maxpages;
$anchor = $this-pages - (2*$this-maxpages) +1;
if($anchor  1) $anchor = 1;
if($x  1) $x = 1;
if($x  $anchor) $x = $anchor;
while($x = $end){
if($x == $this-page){
$r .= 'span class=s'.$x.'/spannbsp;';
}
else{
$r.= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$x.$words.''.$x.'/anbsp;';
}
$x++;
}
if($this-page  $this-pages){
$y = $this-page + 1;
$r .= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Next/anbsp;';
}
return $r;
}
}

//Usage
$searchword = 'MSIE';
$whatever = 'user=me';
mysql_connect(localhost, user, pw..) or die (mysql_error());

$Query = SELECT COUNT(*) AS cnt FROM db.table WHERE agent LIKE '% .$searchword. %';
if(!$result = mysql_query($Query)){
echo 'oops: '.mysql_error();
exit;
}
$row = mysql_fetch_array($result);
$count = $row['cnt'];

if($count  0){
  //start class total number of results,number of results to show,max number of 
pages on a sliding scale (ends up as 2x this number..ie 20)
$page = new page_class($count,5,10); 
$start = $page-get_start();
$end = $page-get_end();
$Query2= SELECT * FROM db.table WHERE agent LIKE '%.$searchword. %' ORDER BY  
time_stamp ASC ;
$result = mysql_query($Query2) or die(mysql_error());
$hstring = $page-make_head_string('Results');
$pstring = 
$page-make_page_string(amp;searchword=.$searchword.amp;whatever=.$whatever);//add
 the other variables to pass to next page in a similar fashion
echo tabletrtd.$hstring./td/tr;
$x = 0;
while($row = mysql_fetch_array($result)){
  if($x = $start){
echo 'trtd'.$x.' '.$row['agent'].' '.$row['time_stamp'].'/td/tr';
  }
  $x++;
  if($x  $end) break;
}
echo 'trtd'.$pstring.'/td/tr/table';
}
//Note: the search variables on subsequent pages will be passed by GET method
?



-- 
regards,
Tom


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




[PHP] PHP-4.3-dev - What is it for?

2002-12-11 Thread info
Hello all,

simple question:
I successfully compiled and installed PHP-4.3-dev from tarball on a RH7.3 box.

What is the meaning of dev in PHP-4.3-dev?
Can I use it as a fully working PHP distribution?

Oliver Etzel  


Re: [PHP] PHP-4.3-dev - What is it for?

2002-12-11 Thread Dan Hardiker
 What is the meaning of dev in PHP-4.3-dev?

Development release, not a Production release. Its a snapshot of the
upcoming 4.3 system.

 Can I use it as a fully working PHP distribution?

No, as the name suggests its purely an insight as to where the development
is up to at this point in time. Although it is recommended that you dont
use this in production systems, it would greatly help the Quality
Assurance and Release Engineering teams if you could download it to your
development machine(s) and test. Feedback should be sent to the relevant
lists.php.net group, more information on which lists to use for what
(bugs, qa, dev questions) can be found on the php website.


-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software  Systems Engineer
First Creative



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




[PHP] Refresing a PHP page! which is called from a FORM

2002-12-11 Thread Shams
Hi,

I have a index.html file, which creates a HTML  login page - which is a
simple FORM/FORM allowing a user to enter their username and password
into 2 seperate fields.

The action is to call another php script for processing, i.e. FORM
action=login.php method=post.

Now, I can understand why it brings up a pop-up-box with the message :

The page cannot be refreshed without resending the information.  Click
retry to send the information again, or click Cancel to return to the page
that you were trying to view.

while the browser is on the index.php script (with the form).

But why does it bring up the same message when the page is refreshed after
login.php has been processed ??

If I run login.php independantly (wihout calling it from the FORM in
index.php) then it displays some the text, and refreshes without popping up
the message box above.

All login.php does is display some text, at the moment it doesn't do any
checking on the user input.

Thanks for any help!

Shams



index.html
--

HTML
HEAD
TITLELogin/TITLE
/HEAD
BODY

FORM name'login actionlogin.php method=POST
INPUT name=username type=text size=10
INPUT name=password type=password size=10
/FORM

/BODY
/HTML

login.php
-

?php

print(hello);

// thats all!

?



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




Re[2]: [PHP] Page display of query resuts using ODBC

2002-12-11 Thread Tom Rogers
Hi,

Wednesday, December 11, 2002, 8:02:41 PM, you wrote:
TR Hi,

TR Wednesday, December 11, 2002, 2:05:25 AM, you wrote:
LR Hi,

LR Just wondering if anybody knows a script to display a resultset over several 
pages using page numers  previous, next links.

LR So far I've only found such scripts for mysql using the the following sql syntax 
which is not odbc compliant: SELECT * from table LIMIT 0, 4

LR I've looked at many sites to find such a script without luck so far...

LR Thanks in advance for your help,

LR -Luc
TR Here is a paging class I wrote, it is using mysql but the example is not using
TR the LIMIT feature so it should work with a little change for odbc.

TR ?
TR class page_class {
TR var $count = 0; //total pages
TR var $start = 0; //starting record
TR var $pages = 0; //number of pages available
TR var $page = 1;  //current page
TR var $maxpages;  //shows up to 2 * this number and makes a sliding 
scale
TR var $show;  //number of results per page
TR function page_class($count=0,$show=5,$max=9){
TR $this-count = $count;
TR $this-show = $show;
TR $this-maxpages = $max;
TR ($this-count % $this-show == 0)? $this-pages = 
intval($this-count/$this-show) :$this-pages = intval($this-count/$this-show) +1;
TR if(!empty($_GET['search_page'])){
TR $this-page = $_GET['search_page'];
TR $this-start = $this-show * $this-page -$this-show;
TR }
TR }
TR function get_limit(){
TR $limit = '';
TR if($this-count  $this-show) $limit = 
'LIMIT'.$this-start.','.$this-show;
TR return $limit;
TR }
TR function get_start(){
TR  return $this-start;
TR }
TR function get_end(){
TR  return ($this-start + $this-show);
TR }
TR function make_head_string($pre){
TR $r = $pre.' ';
TR $end = $this-start + $this-show;
TR if($end  $this-count) $end = $this-count;
TR $r .= ($this-start +1).' - '.$end.' of '.$this-count;
TR return $r;
TR }
TR function make_page_string($words,$pre='Result Page:'){
TR $r = $pre.' ';
TR if($this-page  1){
TR $y = $this-page - 1;
TR $r .= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Previous/anbsp;';
TR }
TR $end = $this-page + $this-maxpages-1;
TR if($end  $this-pages) $end = $this-pages;
TR $x = $this-page - $this-maxpages;
TR $anchor = $this-pages - (2*$this-maxpages) +1;
TR if($anchor  1) $anchor = 1;
TR if($x  1) $x = 1;
TR if($x  $anchor) $x = $anchor;
TR while($x = $end){
TR if($x == $this-page){
TR $r .= 'span class=s'.$x.'/spannbsp;';
TR }
TR else{
TR $r.= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$x.$words.''.$x.'/anbsp;';
TR }
TR $x++;
TR }
TR if($this-page  $this-pages){
TR $y = $this-page + 1;
TR $r .= 'a 
href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Next/anbsp;';
TR }
TR return $r;
TR }
TR }

TR //Usage
TR $searchword = 'MSIE';
TR $whatever = 'user=me';
TR mysql_connect(localhost, user, pw..) or die (mysql_error());

TR $Query = SELECT COUNT(*) AS cnt FROM db.table WHERE agent LIKE '% .$searchword. 
%';
TR if(!$result = mysql_query($Query)){
TR echo 'oops: '.mysql_error();
TR exit;
TR }
TR $row = mysql_fetch_array($result);
TR $count = $row['cnt'];

if($count  0){
TR   //start class total number of results,number of results to show,max number 
of pages on a sliding scale (ends up as 2x this number..ie 20)
TR $page = new page_class($count,5,10); 
TR $start = $page-get_start();
TR $end = $page-get_end();
TR $Query2= SELECT * FROM db.table WHERE agent LIKE '%.$searchword. %' ORDER 
BY  time_stamp ASC ;
TR $result = mysql_query($Query2) or die(mysql_error());
TR $hstring = $page-make_head_string('Results');
TR $pstring = 
$page-make_page_string(amp;searchword=.$searchword.amp;whatever=.$whatever);//add
 the other variables to pass to next page in a similar fashion
TR echo tabletrtd.$hstring./td/tr;
TR $x = 0;
TR while($row = mysql_fetch_array($result)){
TR   if($x = $start){
TR echo 'trtd'.$x.' '.$row['agent'].' '.$row['time_stamp'].'/td/tr';
TR   }
TR   $x++;
TR   if($x  $end) 

RE: [PHP] Rename an upload

2002-12-11 Thread Steve Jackson
 On Wednesday 11 December 2002 17:30, Steve Jackson wrote:
  I'm trying to rename an uploaded file with the value of a select I 
  have in the uploaded form. Can someone point me in the right 
  direction. The PHP.net rename manual isn't helping a lot? My code:
 
 What is the problem?
 

I can't figure out how to upload the file with the name I need. The
rename function in the manual says 
Its:
rename(string1,string2)
Ie.
?php
  rename(/tmp/tmp_file.txt, /home/user/login/docs/my_file.txt);
?

I want to rename the file copied to the server to the name of the select
value I sent in my previous post (held in the variable $category) so
basically How do I do that? Where do I do it in the upload script also?
You mention I should be able to do it in a single step, that would be
ideal but again how do I do it? Do I need to put the uploaded file in a
variable so I can rename the copied image?


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




[PHP] Problem relating to images in email

2002-12-11 Thread khuram noman
Hello Dear Members

Iam new at this mailing list . I have a problem in php
is that i want to store the images on local hard disk
that are in email (pop3 account) by runing a php file.
how can i do that. please help me asap.

Thanks
Khuram noman

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] How to test php.info from command line

2002-12-11 Thread Sean Burlington
Jason Wong wrote:

On Tuesday 10 December 2002 02:39, [EMAIL PROTECTED] wrote:


Hello All,



How to test php.info from command line:


#echo ?php phpinfo()? | php

to the standard output (screen) - or if you want to a file like this way:
#echo ?php phpinfo()? | php  /tmp/test_php.txt

Oliver Etzel

.eu - domain are coming soon
www.t-host.com



Or simply

  #php -i

It would be nice if there was a text-only version without all the HTML gunge.



this works nicely for me

php -i | lynx -stdin -dump



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




[PHP] PHP Editor Browser View? (Beginner Question)

2002-12-11 Thread Paul Lazare
A Company Programmed my Homepage in PHP. Now I want to make simple changes
like changing some text. And I want to try it alone, so I got myselv
PHPEdit.

I copied the complete Homepage on my harddisc to work on it tiht PHP Edit
and everthing works fine.

But how can I see the result of the changes (without uploading it the
provider again)?

I allready tried to click on new browser and it is opening an empty
browser...

sorry for the beginner question. Am I in the right newgroup for this
question?

greetings, paul



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




RE: [PHP] Re: Help please: Unable to get $_POST[variable]; to work in a form.

2002-12-11 Thread Ford, Mike [LSS]
 - Original Message - 
 From: Victor [EMAIL PROTECTED]
 To: 'Rick Emery' [EMAIL PROTECTED]
 Sent: Tuesday, December 10, 2002 1:49 PM
 Subject: RE: [PHP] Re: Help please: Unable to get 
 $_POST[variable]; to work in a form.
 
 
 Why are you using $_POST[]? I thought you had to use $_POST['']. I
 always use '' instead of  and it always works. Is it just 
 me? Can one
 really use double quotes? 

Of course you can -- it's just a string!  The difference, as with all
strings, is in whether you want variable names to be interpolated or not.
Consider:

   $num = 3;
   $array = array('var 3'='Interpolated!', 'var $nuum'='Not
Interpolated');
   echo $array['var $num'];// = Not Interpolated
   echo $array[var $num];// = Interpolated!
   echo $array['var '.$num];   // = Interpolated!

Of course, an arrray subscript can be any expression, so to go to extremes I
could even do something like:

   $x = 1;
   $y = 2;
   $a = 'a';

   echo $array['v'.$a.r .($x+$y)];   // = Interpolated!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] PHP Editor Browser View? (Beginner Question)

2002-12-11 Thread Chris Hewitt
Paul Lazare wrote:


I copied the complete Homepage on my harddisc to work on it tiht PHP Edit
and everthing works fine.

But how can I see the result of the changes (without uploading it the
provider again)?


In your browser, use the File menu to open a file (assuming this is a 
static not dynamic web page). If it is dynamic (perhaps using PHP?) then 
it does need to be put on a webserver. Where you copied it from (your 
provider) is probably your best bet.

sorry for the beginner question. Am I in the right newgroup for this
question?


If you want to ask a question about the PHP language, yes. Othewise no.

Hope this helps.

Chris




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




RE: [PHP] Flushing Output

2002-12-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: 11 December 2002 00:27
 
 Is there a way of flushing output to the browser.  So for 
 example, I have a
 script that checks things in a database, every check, or every hundred
 checks it would be nice to output something to the browser.. 

   http://www.php.net/flush

If that doesn't work, read up about output buffering.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] Repeat This...

2002-12-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: Stephen [mailto:[EMAIL PROTECTED]]
 Sent: 11 December 2002 02:50
 
 I want to repeat the following code as many times as the user 
 specifies in the variable $_POST['x']. I then need to have 
 the output display as all the numbers found in the sequence. 
 How would I do this?
 
 Code:
 
 $number = 1;
 $output = $num3;
 do {
  $output = $output * $r . , ;

Well, the first time you do this you no longer have a number but a string,
so you're already in trouble

  $number++;
 } while($number  $_POST['x']);
 
 What this is supposed to do is find the next X numbers in a 
 sequence with the common ratio (r) being the multiplier. 
 After that, it puts it in a list, and tells the user the next 
 X numbers in the sequence...

Why don't you just echo each number as you calculate it?  Whilst we're about
it, let's use a for loop instead of that cumbersome do while!

 for ($output = $num3, $number = 1; $number  $_POST['x']; $number++):
$output *= $r;
echo $output, ;
 endfor;

If you need to build the string for other purposes, you will need to build
it up in a separate variable:

 for ($list='', $output=$num3, $number=1; $number  $_POST['x'];
$number++):
$output *= $r;
$list .= ($list?', ':'') . $output;
 endfor;
 echo $list;

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values

2002-12-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: KANM MD [mailto:[EMAIL PROTECTED]]
 Sent: 11 December 2002 08:55
 
 Here is the code in a readable form (alterations for 
 security, simplicity
 ...)
 
 if
 ((stristr($HTTP_SERVER_VARS[remote_address],XXX.YYY.ZZZ))|
 |($pwprotect==
 'password')) {
  setcookie(pwprotect2,1,time()+300);
 }
 else {
  echo form(ASK FOR PASSWORD)/form;
 }

Well, what's the *full* error message -- in there, it tells you not only
which line has the header call, but also exactly which line produced the
output that's causing the problem.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




[PHP] Re: PHP Editor Browser View? (Beginner Question)

2002-12-11 Thread UberGoober
You might consider downloading a package like foxserve
(http://sourceforge.net/projects/foxserv) for your system. This is an
apache/php bundle that will allow you to test your code from a local
instance of php.


Paul Lazare [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 A Company Programmed my Homepage in PHP. Now I want to make simple changes
 like changing some text. And I want to try it alone, so I got myselv
 PHPEdit.

 I copied the complete Homepage on my harddisc to work on it tiht PHP Edit
 and everthing works fine.

 But how can I see the result of the changes (without uploading it the
 provider again)?

 I allready tried to click on new browser and it is opening an empty
 browser...

 sorry for the beginner question. Am I in the right newgroup for this
 question?

 greetings, paul





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




Re: [PHP] PHP Editor Browser View? (Beginner Question)

2002-12-11 Thread Marek Kilimajer
Simply make a test directory on your provider's webserver and test the 
changes there

Paul Lazare wrote:

A Company Programmed my Homepage in PHP. Now I want to make simple changes
like changing some text. And I want to try it alone, so I got myselv
PHPEdit.

I copied the complete Homepage on my harddisc to work on it tiht PHP Edit
and everthing works fine.

But how can I see the result of the changes (without uploading it the
provider again)?

I allready tried to click on new browser and it is opening an empty
browser...

sorry for the beginner question. Am I in the right newgroup for this
question?

greetings, paul



 



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




[PHP] Re: Uploading a directory via browser w/ php

2002-12-11 Thread Peter Dotinga
Föíö Öxî‰êójînyóon wrote:

Hi I’m wondering if any body has done somthing like uploading a whole
directory trough webbrowser using php, 
or has any Ideas how such a thing can be done, any Ideas appriciated.
 
A serverside-only solution isn't possible. On the clientside, a piece of 
software (eg. java-applet) has to be run to select all the files i a 
directory and somehow move them towards the server.
You could zip the directory to be uploaded into 1 single file, upload it 
and use php to unzip.
For moving large amounts of files around i suggest you use a 
file-transfer protocol such as ftp or scp.

Regards,

Peter


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



[PHP] Problem with globals

2002-12-11 Thread George's Fun Club
Hi,
I'm working with win2000-apache 2-php 4.3.x

I'm always working with register_globals=on, so all my previewes projects are written 
this way.

I'm having a problem to set up php and apache.

Does anyone knows the configs that i should do on apache2 and php.ini to work properly?

thenx


--
http://www.freemail.gr -.


Re: [PHP] Problem relating to images in email

2002-12-11 Thread DL Neil
Hello khuram,

 Iam new at this mailing list .

=welcome to our happy band!


I have a problem in php
 is that i want to store the images on local hard disk
 that are in email (pop3 account) by runing a php file.
 how can i do that. please help me asap.

=there are a number of classes available that you can absorb into your
project. I use email classes from PHPguru.org.

=In this case it seems that you will require the ability to first read msgs
off the POP server (also check out PHP's IMAP functions), then split them
into components, then identify the MIME encoded graphics and store them
away. Haven't done all of that myself, but it sounds 'easy' enough...

=Regards,
=dn


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




Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values

2002-12-11 Thread Rick Emery
If you want our help, we need to see all the code, not just the code that YOU think is
relevant.
What you've shown us is useless for diagnosing your problem.
Show the EXACT code, not a simple secure, readable version.  Just remove 
passwords.
- Original Message -
From: KANM MD [EMAIL PROTECTED]
To: Rick Emery [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, December 11, 2002 2:54 AM
Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return
Values


Here is the code in a readable form (alterations for security, simplicity
...)

if
((stristr($HTTP_SERVER_VARS[remote_address],XXX.YYY.ZZZ))||($pwprotect==
'password')) {
 setcookie(pwprotect2,1,time()+300);
}
else {
 echo form(ASK FOR PASSWORD)/form;
}

Now when you say blank line does that mean actual empty lines between the
? tag and the beginning of the code?

ie

?

if ((stristr(

might cause problems? Seems kind of snarky, but I'm willing to try anything.

Anyway, thanks for responding ... ON A COMPLETELY SEPARATE NOTE, does anyone
here understand how the odbc_primarykeys() function ... err .. functions?
Tried all avenues, kept getting an SQL Error in SQLPrimaryKey, I imagine I'm
not entering proper values for the parameters, but I don't know any proper
values for the parameters ... any help?

Once again, thanks a lot!

Kyle Hale
Computer Guy
KANM Student Radio
Texas AM University




- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: KANM MD [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 10:39 PM
Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values


 Hey Aggie,

 Show us the rst of the code.  stristr() should not be a problem.  Chances
are there's a
 blank line elsewhere that's being sent.

 - Original Message -
 From: KANM MD [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, December 10, 2002 2:34 PM
 Subject: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values


 Here's my question:

 I'm running code that essentially checks for either a certain IP address
or a password
 before it sends a cookie. However, when I try to send the cookie, I get
the standard
 Error - headers already sent when I haven't output anything. After some
spot debugging,
 I found that

 if ( stristr($HTTP_SERVER_VARS[remote_address],XXX.YYY.ZZZ) ) { ...

 essentially counts as a sent header. I imagine this has to do with the
fact that stristr
 returns a TRUE or FALSE value, but not being an expert in programming
concepts, I wouldn't
 know.

 Anywho, if anyone knows a workaround for this or could explain the problem
that lies
 within, it would be greatly appreciated.

 Thanks,

 Kyle Hale
 Computer Guy
 KANM Student Radio
 Texas AM University







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




Re: [PHP] fgetcsv Help

2002-12-11 Thread DL Neil
Richard,

 I am parsing a csv file with fgetcsv and the fields are surrounding by
 double quotes, now I am running into a problem periodically that when
there
 are quotes within the value it is treating it like another value instead
of
 the same value.
 Any ideas on how to get around that?

 I am thinking I might have to convert all quotes to quot; and then turn
all
 quot;,quot; back into quotes and then the first quot; in the file and
 then last one since obviously they will not have a comma in between them.
 This seems like a while lot of work..
 Ideas?


The first idea is that the system that outputs a .CSV with quotes within a
quoted field is broken big-time and that's the part that needs fixing!

I'm on the same wavelength as you describe: you can't use any automated csv
function on such a file. Quotes should only appear in pairs. The closing
quote must therefore appear immediately prior to a field separator (eg
comma) - whitespace not withstanding, unless it is the last field on a line,
in which case it will appear immediately prior to a record separator.

One possibility is to write a 'filter' script to do this - and thus leave
your existing code intact. The filter could take in the file, explode on
quotes, and then cycle through the resultant array looking at the first
non-whitespace data in every second element, clean/recode where necessary,
and then implode and output.

Alternatively could join/unset consecutive array elements which have been
split inappropriately (by 'internal' quotes), and then implode using the
other style of quotes/another separator, if this can be made to work later
in the process...

What a palaver!
=dn


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




[PHP] Re: Objects and Classes?

2002-12-11 Thread Christopher Raymond

Shawn:

  I beleive I can clarify the purpose of objects/classes for you and 
enrich my clarification with a couple of examples.


THE DIFFERENCE BETWEEN OBJECT AND CLASS:

  A class defines the structure of an object. A class is a template 
for an object. An object is a container for data and for functions that 
operate on that data. A class is a roadmap -- it defines the object's 
structure. You can then create several objects using one class. These 
several objects are separate from one another, but identical in 
structure. Each can contain different data but use the same functions to 
operate on that data.

  Functions contained within an object class are called methods. 
Functionally, methods are exactly the same as functions except that they 
are restricted to the scope of the object. Generally, a method is a 
function that operates on the object's data. An object contains variable 
data including variables, arrays and objects. These variables are called 
the object's properties.


WHEN TO USE OBJECTS:

  Objects could be used when you have several similar pieces of data 
especially when you wish to have that data manipulated by the same 
functions but wish to maintain separation between these data objects.


EXAMPLE:

  Let's say, for example, that you wished to store information about a 
number of different people within a single script execution. An 
insurance site might wish to gather information about the primary 
applicant, his wife and their three children all on the same page.

  You and I would agree that all people have similar properties; we all 
have an age, a height, a weight - we might smoke etc. Therefore, a class 
for people could be defined.

class Human
{
var $age;
var $height_inches;
var $weight_pounds;
var $smoker;

function HeightWeightRatio()
{
$ratio = $this-height_inches / 
$this-weight_pounds;
return $ratio;
}   }
}   }

  To create an instances of the class (an object) you would use 
something like this:

$father = new Human;
$mother = new Human;

  Once you have instantiated the class (previous lines) you could then 
set the values of the object with code like:

$father-age = 49;
$father-height = 5'11;
$father-weight = 215;
$father-smoker = false;

$father_ratio = $father-HeightWeightRatio();

$mother-age = 47;
$mother-height = 5'5;
$mother-weight = 145;
$mother-smoker = true;

$mother_ratio = $mother-HeightWeightRatio();

  By now, I'm sure you get the picture.


THE MOST USEFUL EXAMPLE FOR ME THUS FAR:

class HTMLTemplate
{

var $template;
var $html;
var $parameters 
= array();
var $populated = false;

function HTMLTemplate (
$template)
{

$this-template = $template;
$this-html = 
implode (, (file($this-template)));

}

function SetParameter (
$variable, $value)
{

$this-parameters[$variable] = $value;

}


function PopulateValues ()
{

foreach ($this-parameters as 
$key = $value)
{

$template_name = '!--{' . $key . '}--
';
$this-html = str_replace 
($template_name, $value, $this-html);
}


$this-populated = true;
}

function ReturnHTML ()
{
if (
$this-populated)
{
return $this-html;
}
else
{

$this-PopulateValues();
return $this-html;
}
}
}

  This class allows you to use an html template file which you can paste 
dynamic values/content into. Here's an example of how to use it:

?php

$title = My Web Page;
$content = Hello, this is my 

[PHP] Re: Forms

2002-12-11 Thread Christopher Raymond

 PCENTERFORM NAME=Employees
 SELECT NAME=name
 OPTION SELECTED VALUE=/OPTION
 OPTION VALUE=John/OPTIONJohn
 OPTION VALUE=Mary/OPTIONMary
 /SELECT
 INPUT TYPE=submit VALUE=Submit

TIA:

You are missing the action and method attributes to the form tag. You 
are also missing the closing form tag. I don't know if you accidentally 
omitted these when posting your question or if you are actually missing 
these in your actual HTML code as well.

Your code should look something like this:

FORM NAME=Employees ACTION=form-processor.php METHOD=POST  // 
You could also use METHOD=GET
SELECT NAME=name
OPTION SELECTED VALUE=/OPTION
OPTION VALUE=John/OPTIONJohn
OPTION VALUE=Mary/OPTIONMary
/SELECT
INPUT TYPE=submit VALUE=Submit
/FORM

If you've got all of this in place, but you are still having trouble 
gaining access to the variable, it may be that you are using a newer 
version of PHP which requires you to access the variable a different way. 
Try this:

?php

$employee = $HTTP_POST_VARS[name]; // Or $HTTP_GET_VARS if you are 
using GET to pass the variables.

?


Hope this helps,
Christopher

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




Re: [PHP] Flushing Output

2002-12-11 Thread Matt Vos
Try flush()

Matt
- Original Message -
From: Richard Baskett [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Tuesday, December 10, 2002 7:27 PM
Subject: [PHP] Flushing Output


 Is there a way of flushing output to the browser.  So for example, I have
a
 script that checks things in a database, every check, or every hundred
 checks it would be nice to output something to the browser.. currently it
 finishes what it does, or after a minute or so it then shows the final
page
 with the output.. I hope that made sense :)

 Cheers!

 Rick

 I regard as a mortal sin not only the lying of the senses in matters of
 love, but also the illusion which the senses seek to create where love is
 only partial. I say, I believe, that one must love with all of one's
being,
 or else live, come what may, a life of complete chastity. - George Sand


 --
 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] Filter vulger / controversial words - need word source

2002-12-11 Thread Christopher Raymond

Greetings:

I'm wondering if someone has a great source for a master-list of 
controversial and vulger words that I can use on my site. I would like 
to pattern match input text against this master-list in order to prevent 
vulger and controversial words from appearing on my site.

Thanks for any help or suggestions,
Christopher Raymond

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




Re: Re[2]: [PHP] Script not working from one computer

2002-12-11 Thread DL Neil
   I have a feeling it's going to work out to be something stupidly
   simple... like these problems always do. :)
  =embarrassingly so! If you're taking this all off a user's say-so,
 then it
  sounds like an eyeball job to me...
 I never did solve it, but it came down to a weird cookie problem. The
 Session cookie was being set and accepted correctly, but regular cookies
 would never set. Other web sites could set cookies, but none from this
 web site were ever written. I don't know if it's because of SSL or what.
 It's one of those things that worked fine yesterday and now doesn't work
 and the user didn't do anything. Oh well...


IE allows quite a bit of control over the handling of cookies. Most admins
would probably focus on the Security tab and the possibilities it offers.
However there is also a vicious back-hander under the Privacy tab (that
you can't see/get no warning about, under normal operation) and with a
simple command one can ban cookies from any nominated web site(s) - hence
everything works fine for accessing (eg) the NYTimes but blows up in your
face (sorry SeaBee humor) when you access the nominated site. Could be done
by FOBCAK, user brilliance=ignorance, or deliberate sabotage/cynical Admin
baiting! Couldn't access various online purchasing sites from a hardened
laptop, so if they didn't say that they required cookies and I called their
HelpDesk, much going round-and-round resulted... Herewith another argument
for keeping sessions/controls exclusively server-side!
=dn


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




RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi Christopher,

 I'm wondering if someone has a great source for a master-list 
 of controversial and vulger words that I can use on my site. 
 I would like to pattern match input text against this master-list 
 in order to prevent vulger and controversial words from appearing 
 on my site.

Before you spend ages finding a good list, get the routine working. 

Once you've got the routine working, post it here, because there are many
people who would like to know how to do this properly.

The problems that others have experienced in the past are:

  - what happens with misspellings, e.g. fsck?
  - what happens with dodgy formatting, e.g f s c k?
  - what happens with words like Scunthorpe?

Additionally, from my experience of the mail content filters we use here at
$WORKPLACE, you will also need to be careful not to cause offence by
catching peoples' names. We have a Chinese gentleman as a client with a
surname that could be mistaken for an offensive word - he was not best
pleased to receive a bounce message telling him that his email hadn't been
delivered because he was using profanity.

May I suggest, rather than picking your way through this minefield, you
provide a report abusive comment link instead?


Cheers
Jon


  

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




Re: [PHP] Forms

2002-12-11 Thread Hank Marquardt
I think Keith hits this one on the head --

Without an ACTION directive in the FORM definition, you're at the mercy
of the browser where it gets sent (if in fact it's sent anywhere) ...
You might find some browsers work (defaulting to resubmit to the current
page), whereas others will silently fail sending the page nowhere.

Hank

On Wed, Dec 11, 2002 at 04:36:39PM -0500, Beauford.2002 wrote:
 Hi,
 
 I'm sending this to both lists as I'm not sure where the problem is, but I
 believe it is an issue with my HTML form. Here's the problem:
 
 I have a drop-down menu form on my webpage with employee names in it. When I
 choose a name and click submit it gets passed to a php page which accesses a
 mysql database and displays information about that employee.
 
 The problem is that the form is not sending the employee name to the php
 page. If I insert the name in the php page manually, it works fine, so the
 problem appears to be with the form.
 
 Can someone help me out here - a sample of my code is below. I'm not sure
 how to explain this, but whatever gets sent to the PHP page has to be one
 variable - i.e. if I choose John, then the variable that gets sent to the
 PHP should have the value John, if I choose Mary, the value of the variable
 should be Mary. Hope this makes sense.
 
 TIA
 
 PCENTERFORM NAME=Employees
 SELECT NAME=name
 OPTION SELECTED VALUE=/OPTION
 OPTION VALUE=John/OPTIONJohn
 OPTION VALUE=Mary/OPTIONMary
 /SELECT
 INPUT TYPE=submit VALUE=Submit
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
Hank Marquardt [EMAIL PROTECTED]
http://web.yerpso.net
GPG Id: 2BB5E60C
Fingerprint: D807 61BC FD18 370A AC1D  3EDF 2BF9 8A2D 2BB5 E60C
*** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD
*** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild 
*** See http://www.hwg.org/services/classes

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




RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Following up to my own post

  Once you've got the routine working, post it here, 
  because there are many people who would like to know 
  how to do this properly.

I didn't use any profanity I was aware of in this post, but I still received
this a few minutes later:

 Trend SMEX Content Filter has detected sensitive content. 
 Place = 'Christopher Raymond'; [EMAIL PROTECTED];
 Sender = Jon Haworth 
 Subject = RE: [PHP] Filter vulger / controversial words 
 - need word source 
 Delivery Time = December 11, 2002 (Wednesday) 22:13:00 
 Policy = Dirty Words 
 Action on this mail = Delete message 

I wonder if it was Scunthorpe I suppose I'll find out when/if I get
another bounce :-)

Cheers
Jon

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




[PHP] PHP-4.x many ways of compiling/installing with GD-support

2002-12-11 Thread info
Hello list,

simple question:

I´ve heard that it is possible to compile php with dg-support on two ways
1) first way: Distribution dependant with the gd-files and libraries, eg. gd.c, gd.lo, 
gd.o 
coming with the distribution of the compiled php-4.x-tarball
compiled the follwing way:

./configure .. --with-gd 


2) second way: You can compile the newest Distribution from GD, eg. gd-2.0.8

compiling gd-2.0.8 this way
./configure --prefix=/usr/local/gd ...
eg. under  /usr/local/gd

and the compile php-4.x this way
./configure  --with-gd=/usr/local 


Did I got that right ?

Oliver Etzel



[PHP] upload image

2002-12-11 Thread Shaun
Hi,

i am using a form to upload an image to the server, is it possible to get
the image size during this process so i can store it for later use (i.e.
determining the size of the popup window to view the image)?

thanks for your help




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




[PHP] Add column to table

2002-12-11 Thread Shaun
Hi,

please could someone tell me what the sql command is to add a colummn to a
table?

Thanks for your help



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




RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
 Following up to my own post

And again...

 I wonder if it was Shorpe I suppose I'll 
 find out when/if I get another bounce :-)

I got another bounce :-)

Whoever is running this filter obviously doesn't want to do business with
any of the 70,000 odd people who live in a particular town in the north of
England.

Cheers
Jon

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




Fw: [PHP] Add column to table

2002-12-11 Thread Rick Emery
First, you've asked the wron list; ask the mysql list

Second:  ALTER mytable ADD COLUMN new column INT UNSIGNED AFTER old_column;

- Original Message - 
From: Shaun [EMAIL PROTECTED]
To: 
Sent: Wednesday, December 11, 2002 8:25 AM
Subject: [PHP] Add column to table


Hi,

please could someone tell me what the sql command is to add a colummn to a
table?

Thanks for your help



-- 
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] Add column to table

2002-12-11 Thread bbonkosk

look at the alter table syntax on the mysql Documentation page.
nice version of RTFM

-Brad

 Hi,
 
 please could someone tell me what the sql command is to add a colummn to a
 table?
 
 Thanks for your help
 
 
 
 -- 
 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] date() on two diff. servers

2002-12-11 Thread Ford, Mike [LSS]
 -Original Message-
 From: DL Neil [mailto:[EMAIL PROTECTED]]
 Sent: 10 December 2002 19:52
 
 =as a Windows user I struggle to cope with some of these UNIX 
 concepts, so I
 hit Google - with no joy, and ripped through the SuSE manuals 
 (I'm a closet
 Linux user - will become one, just as soon as I can find the 
 necessary spare
 machine (and time!) - till then, the box of manuals, CD-ROMs 
 etc lives in
 the closet!) Would you believe, none appear to clarify this 
 (maybe I'm using
 the wrong terminology/barking up the wrong trees...).

Well, I think the PHP manual is pretty good about this -- all the pages I've
looked at are careful to add the GMT timezone indicator when referring to
the base date of the Unix epoch, which is pretty much what tipped me off to
the correct interpretation.  (If you find a reference there that doesn't
include the GMT indicator, I reckon that would be worth a bug report in the
Documentation problem category.)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread DL Neil
Hi Jon,
I think we've seen this discussion on the list before
(so Christopher, check the archives!)


  I'm wondering if someone has a great source for a master-list
  of controversial and vulger words that I can use on my site.
  I would like to pattern match input text against this master-list
  in order to prevent vulger and controversial words from appearing
  on my site.
 Once you've got the routine working, post it here, because there are many
 people who would like to know how to do this properly.

 The problems that others have experienced in the past are:
   - what happens with misspellings, e.g. fsck?
   - what happens with dodgy formatting, e.g f s c k?
   - what happens with words like Scunthorpe?


Problem 1: add likely/popular mis-spellings to the list of vulger/vulgar
language

Problem 2: (contrived) very few single-letter words exist so remove
intervening white space prior to analysis

Problem 2a: (the more popular f*ck - someone suffering the misapprehension
that (s)he is somehow NOT guilty of using bad language/being offensive when
(s)he plainly is not only doing so but attempting to be deceptive as
well...) see response to Problem 1 (the probably habit would be to
replace/remove vowels)

Problem 3: Scunthorpe contains an unfortunate series of letters (amongst the
town's many disadvantages) however the critical four are not a word in and
of their own right so employ whitespace (\s) in the RegEx or token analysis.

 May I suggest, rather than picking your way through this minefield, you
 provide a report abusive comment link instead?

Most sensible! The employment of a technological solution to a social
problem is somewhat shooting the messenger. However some countries are now
legislating responsibility that ISPs/employers must discharge (shooting the
person who shoes the horses that the Pony Express messenger is riding!?)

In this case perhaps one could analyse the incoming text and place an
embargo on its publication on the web site until it has been reviewed by a
human editor?

If we were talking about filtering incoming email, then perhaps the original
message could be forwarded/wrapped with a message from the EmailAdmin/System
pointing out that a message has arrived from xyz (etc) and has been flagged
for a stated reason (but that there is room for interpretation within the
mechanical observation) and that the message should not be opened by anyone
fearing offence. (this similar to 'security' gateways that don't allow msgs
with attachments unless the 'employee' first authorises a 'pass-through')

Euro 0.02's worth?
=dn


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




[PHP] Install Problem

2002-12-11 Thread Adam Voigt




I'm attempting to install Pear DataObjects on Windows 2000 Advanced Server with all the most current patches and updates. When utilizing the php-cli exe to run createTables.php, we recieve the error invalid function call to getStaticProperty, in DataObject.php on line 1620. I have attempted to run the DataObjects install script but it gave a warning that the archive was an old format because there was no package.xml. We have downloaded the most recent TGZ and received the same error when installing locally.



Any ideas?





-- 
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] Rename an upload

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 18:55, Steve Jackson wrote:
  On Wednesday 11 December 2002 17:30, Steve Jackson wrote:
   I'm trying to rename an uploaded file with the value of a select I
   have in the uploaded form. Can someone point me in the right
   direction. The PHP.net rename manual isn't helping a lot? My code:
 
  What is the problem?

 I can't figure out how to upload the file with the name I need. The
 rename function in the manual says
 Its:
   rename(string1,string2)
 Ie.
 ?php
   rename(/tmp/tmp_file.txt, /home/user/login/docs/my_file.txt);
 ?

 I want to rename the file copied to the server to the name of the select
 value I sent in my previous post (held in the variable $category) so
 basically How do I do that? Where do I do it in the upload script also?
 You mention I should be able to do it in a single step, that would be
 ideal but again how do I do it? Do I need to put the uploaded file in a
 variable so I can rename the copied image?

  if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'],http://www.violasystems.c
om/images/$category);


That should do it in a single step.

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

/*
Many Myths are based on truth
-- Spock, The Way to Eden,  stardate 5832.3
*/


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




[PHP] Boucing Emails

2002-12-11 Thread bbonkosk
Hello...

I gotten a few of these, was wondering if this account is going to be axed from 
the distrbution list, hopefully soon.

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

   [EMAIL PROTECTED]

Thanks
-Brad




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




[PHP] Re: PHP Editor Browser View? (Beginner Question)

2002-12-11 Thread David Eisenhart
If your local machine is running Windows you could also use Personal Web
Server or IIS (whichever comes with your Windows) for the web server (of
course you will also need a local copy of php, but this is very easy to set
up)

David Eisenhart




Ubergoober [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You might consider downloading a package like foxserve
 (http://sourceforge.net/projects/foxserv) for your system. This is an
 apache/php bundle that will allow you to test your code from a local
 instance of php.


 Paul Lazare [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  A Company Programmed my Homepage in PHP. Now I want to make simple
changes
  like changing some text. And I want to try it alone, so I got myselv
  PHPEdit.
 
  I copied the complete Homepage on my harddisc to work on it tiht PHP
Edit
  and everthing works fine.
 
  But how can I see the result of the changes (without uploading it the
  provider again)?
 
  I allready tried to click on new browser and it is opening an empty
  browser...
 
  sorry for the beginner question. Am I in the right newgroup for this
  question?
 
  greetings, paul
 
 





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




Fw: [PHP] upload image

2002-12-11 Thread Rick Emery
If it is a GIF file, the header format is:
Byte #
0 - 2   GIF
3 - 5   87a or 89a
6 - 7   Width (in pixels)
8 - 9   Height (in pixels)

Be advised, the dimensions are in reverse major order; that is, 50 pixels is 
represented
as 32 00

- Original Message -
From: Shaun [EMAIL PROTECTED]
To: 
Sent: Wednesday, December 11, 2002 8:23 AM
Subject: [PHP] upload image


Hi,

i am using a form to upload an image to the server, is it possible to get
the image size during this process so i can store it for later use (i.e.
determining the size of the popup window to view the image)?

thanks for your help




--
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] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi,

 I think we've seen this discussion on the list before
 (so Christopher, check the archives!)

Quite :-)

  The problems that others have experienced in the past are:
  - what happens with misspellings, e.g. fsck?
  - what happens with dodgy formatting, e.g f s c k?
  - what happens with words like Scunthorpe?
 
 Problem 1: add likely/popular mis-spellings to the list of 
 vulger/vulgar language

So when I'm giving a Linux user advice on how to recover from a disk crash,
my run fsck comment will get trapped the problem here is that context
is *everything*. You just can't know, by seeing the word fsck without any
of the surrounding text, whether I'm swearing at another geek or helping
them out :-)

There will also be problems with slang and idiom - e.g. fag in .uk is a
cigarette, but it's something quite different on the other side of the pond.
Again, this can only be judged from the context.

Finally, the more words you have in your list (to cover common
misspellings), the more likely you are to get a false positive (again,
context) - and you *will* cause offense if you trap someone's name, for
example.

 Problem 2: (contrived) very few single-letter words exist so remove
 intervening white space prior to analysis

Yup, also line breaks, dashes, asterisks, plus signs, etc etc :-)

 Problem 3: Scunthorpe contains an unfortunate series of letters (amongst
the
 town's many disadvantages) however the critical four are not a word in and
 of their own right so employ whitespace (\s) in the RegEx or token
analysis.

That's a good solution, but it's something that obviously is being missed by
many developers of this sort of algorithm... see the couple of followups I
made immediately after my original response.

  May I suggest, rather than picking your way through this minefield, you
  provide a report abusive comment link instead?
 
 However some countries are now legislating responsibility that 
 ISPs/employers must discharge 

Whoops, forgot about that... 

 In this case perhaps one could analyse the incoming text and place an
 embargo on its publication on the web site until it has been reviewed by a
 human editor?

Looks like the best solution possible.

If the OP is interested I will see if I can get our content filter word list
from the network manager here... no promises though.

Cheers
Jon

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




[PHP] Populating form value fields.

2002-12-11 Thread Steve Jackson
I am having problems populating form fields. Here is my code:
//$ItemCode is passed to the page with this code
$mysql = mysql_query(SELECT * FROM products WHERE
ItemCode='$ItemCode');
$result = mysql_query($mysql);

Then the form:
form action=eshop_editprodprocess.php method=post
input type=text name=ItemName value=?=$ItemName;? size=18
class=kapea
input type=text name=ItemCode value=?=$ItemCode;? size=18
class=kapea
input type=text name=ItemDesc value=?=$ItemDesc;? size=18
class=kapea
/form

I have tried numerous ways to use $result to get these values to appear
but am stuck. How therefore do I select everything from the database
sorted by ItemCode and then displayed in a form as shown above.

Regards,

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] mail() problem

2002-12-11 Thread Carlos Alberto Pinto Hurtado
i setting php.ini

[mail function]
;For Win32 only
SMTP = hermes.ica.gov.co

sendmail_from = [EMAIL PROTECTED]


i invoke

mail($to,$subject,$body,$headers);

if $to is [EMAIL PROTECTED] is perfect.
if $to is user@otherdomain generate error

the problem is when the content  $to is different at ica.gov.co eg. [EMAIL PROTECTED] 
function mail dont'n response.

can help me? 
Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



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




Re: [PHP] Passing variables from script to script

2002-12-11 Thread Justin French
1. the only other ways to pass things around would be in sessions, or by
setting a cookie on the user's computer... i hate the latter, and would
prefer the former, but would NEVER carry things like a MySQL uname and
password around in cookies or sessions.  cookies, sessions, and even post 
get (url) should be used for user-specific things (who are they, what are
they asking the server to do), not program-related things (like the database
password, or the global font size, or the site admin's email address... this
is generally done with a config file or other included file:

2. you could define your vars (like the MySQL uname and pword) in a config
file, and include it at the top of all your PHP scripts:

? include('incdir/config.php'); ?
html
...
/html

3. you can extend this further, by setting a value php.ini (auto-prepend I
think) so that PHP will ALLWAYS includes the config file at the top of every
script.


Justin



on 11/12/02 10:56 AM, Stefan Hoelzner ([EMAIL PROTECTED]) wrote:

 Hi folks,
 
 surely this question has already been answered many times before in this ng,
 but nevertheless: I want to pass variables  from
 one .php to another .php script. But I do not want to use either the
 http://localhost/target.php?var1=testvar2=test2 nor
 the
 POST method. I would like to pass over general variables like usernames and
 passwords for several MySQL-connects;  obviously
 it is not a good way to pass these vars via the mentioned ways.
 
 What else does PHP offer? Are there any other methods? Can I define these vars
 as some kind of global variables in any
 ini-file?
 
 THX for your support!
 
 Stefan.
 
 

Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




[PHP] Converted version of mysqlhotcopy.pl

2002-12-11 Thread Riaan Stander
Hi all

Does any of you know if anybody has taken the time to convert the perl
script mysqlhotcopy.pl to PHP. And if so where can one find it.

Thanks
Riaan Stander



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




Re: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Sean Burlington
DL Neil wrote:

Hi Jon,

[SNIP]

May I suggest, rather than picking your way through this minefield, you
provide a report abusive comment link instead?



Most sensible! The employment of a technological solution to a social
problem is somewhat shooting the messenger. However some countries are now
legislating responsibility that ISPs/employers must discharge (shooting the
person who shoes the horses that the Pony Express messenger is riding!?)



I've worked on several projects where the client initially wanted 
filtering - in some cases we have implemented some kind of filtering - 
but it has always ended up being a human that doe the real work.

there simply is no definitive list of words

you can't stop people talking about pussy cats, turkey breasts or even 
shag pile carpets (and words have different meanings from one place to 
the next)


automated filters can be a usefull aid to human moderation - flagging up 
messages for review.

if you want a partial list of offensive terms - try looking at the
meta keywords on a few porn sites ...


--

Sean


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



Re: [PHP] Populating form value fields.

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 23:18, Steve Jackson wrote:
 I am having problems populating form fields. Here is my code:
 //$ItemCode is passed to the page with this code
 $mysql = mysql_query(SELECT * FROM products WHERE
 ItemCode='$ItemCode');
 $result = mysql_query($mysql);

 Then the form:
 form action=eshop_editprodprocess.php method=post
 input type=text name=ItemName value=?=$ItemName;? size=18
 class=kapea
 input type=text name=ItemCode value=?=$ItemCode;? size=18
 class=kapea
 input type=text name=ItemDesc value=?=$ItemDesc;? size=18
 class=kapea
 /form

 I have tried numerous ways to use $result to get these values to appear
 but am stuck. How therefore do I select everything from the database
 sorted by ItemCode and then displayed in a form as shown above.

You need to use one of the mysql_fetch_*() functions. See examples in manual.

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

/*
Prediction is very difficult, especially of the future.
- Niels Bohr
*/


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




Re: [PHP] upload image

2002-12-11 Thread Sean Burlington
Shaun wrote:

Hi,

i am using a form to upload an image to the server, is it possible to get
the image size during this process so i can store it for later use (i.e.
determining the size of the popup window to view the image)?

thanks for your help






you want

getimagesize()

http://www.php.net/manual/en/function.getimagesize.php
--

Sean


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




RE: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
Hi Sean,

 if you want a partial list of offensive terms - try looking 
 at the meta keywords on a few porn sites ...

Excellent idea!

Unfortunately I'd have to explain that to my boss... No, really, I'm doing
some research...

Cheers
Jon

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




[PHP] Re: Populating form value fields.

2002-12-11 Thread liljim
Hi Steve,

you will need to use mysql_fetch_* on the result (where * might be object,
row, array, assoc):

$query = SELECT * FROM products WHERE
ItemCode='$ItemCode';
$result = mysql_query($query)
// for debug
or die(Error in query quot;$queryquot;. MySQL said:  .
mysql_error());
$row = mysql_fetch_assoc($result);

Then the form:
form action=eshop_editprodprocess.php method=post
input type=text name=ItemName value=?php echo
htmlentities($row['ItemName']); ? size=18
class=kapea
input type=text name=ItemCode value=?php echo
htmlentities($row['ItemCode']); ?size=18
class=kapea
input type=text name=ItemDesc value=?php echo
htmlentities($row['ItemDesc']); ? size=18
class=kapea
/form

Check the manual for more details.

James

Steve Jackson [EMAIL PROTECTED] wrote in message
002b01c2a128$8c367c60$[EMAIL PROTECTED]">news:002b01c2a128$8c367c60$[EMAIL PROTECTED]...
 I am having problems populating form fields. Here is my code:
 //$ItemCode is passed to the page with this code
 $mysql = mysql_query(SELECT * FROM products WHERE
 ItemCode='$ItemCode');
 $result = mysql_query($mysql);

 Then the form:
 form action=eshop_editprodprocess.php method=post
 input type=text name=ItemName value=?=$ItemName;? size=18
 class=kapea
 input type=text name=ItemCode value=?=$ItemCode;? size=18
 class=kapea
 input type=text name=ItemDesc value=?=$ItemDesc;? size=18
 class=kapea
 /form

 I have tried numerous ways to use $result to get these values to appear
 but am stuck. How therefore do I select everything from the database
 sorted by ItemCode and then displayed in a form as shown above.

 Regards,

 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] fgetcsv Help

2002-12-11 Thread Justin French
How is the CSV being generated?  Seems to me like your problem isn't
ggetcsv(), but rather the file itself.

Commonly, a CSV file is a series of values, separated by a comma (duh!!).

The separated values are generally enclosed in double quotes (), as it
would appear yours are.

Any double quotes within each value (eg: she said hello) are escaped with
a slash (eg: she said \hello\).

If you are generating the CSV, then you can addslashes() to each value to
escape the quotes, and then later on, stripslashes() to get rid of them.


Sample line from your CSV should look like this:

---
1,foo,harry said \what is it?\,foo
1,bah,\don't know\ said sally,something
---

When echoing these values to the browser, you would strip the slashes.


Cheers,

Justin


on 11/12/02 7:13 PM, Richard Baskett ([EMAIL PROTECTED]) wrote:

 I am parsing a csv file with fgetcsv and the fields are surrounding by
 double quotes, now I am running into a problem periodically that when there
 are quotes within the value it is treating it like another value instead of
 the same value.
 
 Any ideas on how to get around that?
 
 I am thinking I might have to convert all quotes to quot; and then turn all
 quot;,quot; back into quotes and then the first quot; in the file and
 then last one since obviously they will not have a comma in between them.
 This seems like a while lot of work..
 
 Ideas?
 
 Rick
 
 A wise women once said:  No one can help everybody, but everybody can help
 somebody. - Unknown
 

Justin French

http://Indent.com.au
Web Development  
Graphic Design



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




RE: [PHP] Populating form value fields.

2002-12-11 Thread Steve Jackson
Cheers Jason.
Sorted.

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



 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]] 
 Sent: 11. joulukuuta 2002 17:17
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Populating form value fields.
 
 
 On Wednesday 11 December 2002 23:18, Steve Jackson wrote:
  I am having problems populating form fields. Here is my code: 
  //$ItemCode is passed to the page with this code $mysql = 
  mysql_query(SELECT * FROM products WHERE ItemCode='$ItemCode');
  $result = mysql_query($mysql);
 
  Then the form:
  form action=eshop_editprodprocess.php method=post input 
  type=text name=ItemName value=?=$ItemName;? size=18 
  class=kapea input type=text name=ItemCode 
  value=?=$ItemCode;? size=18 class=kapea
  input type=text name=ItemDesc value=?=$ItemDesc;? size=18
  class=kapea
  /form
 
  I have tried numerous ways to use $result to get these values to 
  appear but am stuck. How therefore do I select everything from the 
  database sorted by ItemCode and then displayed in a form as shown 
  above.
 
 You need to use one of the mysql_fetch_*() functions. See 
 examples in manual.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications 
 Development *
 
 /*
 Prediction is very difficult, especially of the future.
 - Niels Bohr
 */
 
 
 -- 
 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] Filter vulger / controversial words - need word source

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 23:12, Sean Burlington wrote:


 there simply is no definitive list of words

 you can't stop people talking about pussy cats, turkey breasts or even
 shag pile carpets (and words have different meanings from one place to
 the next)


 automated filters can be a usefull aid to human moderation - flagging up
 messages for review.

 if you want a partial list of offensive terms - try looking at the
 meta keywords on a few porn sites ...

This last paragraph is about the most useful comment on this whole subject :)

The fact is content filtering does not work without a heavy dose of human 
intervention.

It is quite shocking that large numbers of well known corporations deploy 
misconfigured content-filtering software which rejects perfectly innocent 
email.

It is particularly amusing when some 'security-conscious' person in one of 
these organisations subscribe to a list discussing for example the latest 
virus threats. However said 'security-conscious' person may find that they 
receive nothing of importance from the list because messages containing just 
*the name* of a known virus is enough for the misconfigured content-filtering 
software to step in and reject the message.

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

/*
I finally went to the eye doctor.  I got contacts.  I only need them to
read, so I got flip-ups.
-- Steven Wright
*/


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




Re: [PHP] mail() problem

2002-12-11 Thread Chris Hewitt
Carlos Alberto Pinto Hurtado wrote:



mail($to,$subject,$body,$headers);

if $to is [EMAIL PROTECTED] is perfect.
if $to is user@otherdomain generate error

the problem is when the content  $to is different at ica.gov.co eg. [EMAIL PROTECTED] function mail dont'n response.


Carlos,

This has to be a smtp mailer problem on

hermes.ica.gov.co

. Is the computer that php is running on setup to send email as a normal 
user (e.g. using Outlook)? If so, trying to send an email from Outlook 
to outside your domain will also fail, proving that it is the setup of 
hermes.ica.gov.co that is not allowing the email to be sent.

HTH
Chris


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



[PHP] Automatic include of files containing functions

2002-12-11 Thread Dave [Hawk-Systems]
On a few sites we have used a master include or function file containing all the
unctions required for the site...  Some of these function files may contain
30-40 functions and some pages use only 1 function from the file.

Would like to be a little more dynamic in our approach of this, and have started
moving all the functions into their own files...  for example moving connectdb()
from the functions.php file to a connectdb.php or connectdb.inc file.

Then for any particular php page, we would pull in only the functions that we
need for that particular page.  From a script/function management perspective
this would be ideal.

Questions//

What would this do as far as speed and efficiency (having to load 4 or 5
includes/requires rather than one larger include that has 25 functions that
aren't needed or used)?

Then the hard one...

Is there a way to have the PHP script dynamically pull in the required include
files?  for example, have a function at the top of each page to include any
files required as a result of functions that exist in the script...  ie: this
page uses abc() 123() and so it include/require ./includes/abc.php and
./includes/123.php which contain the appropriate functions.

OR

is there an easier way to manage what is becoming an over abundance of functions
for particular sites.

Have gotten in the habit of creating a function for anything I have to do more
than 1 or 2 times on seperate pages just to speed and simplify code from a
design and readability point of view.


Appreciate any comments.

Dave



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




[PHP] php, ldap, and ssl

2002-12-11 Thread dweise
hi,
   i sent this to the php install list but nobody was able to help me. 
thus i'm giving this list a crack at it.
When i installed php v4.2.1 on my Solaris 8 (x86) using this install command:

./configure --with-mysql=/usr/local/mysql 
--with-apxs=/usr/local/apache/bin/apxs --with-gd=/usr/local
--with-sockets --enable-track-vars --enable-force-cgi-redirect 
--with-gettext --with-ldap --with-openssl=/usr/local/ssl


i get this error.:

/usr/local/i386-pc-solaris2.8/bin/ld: .libs/libphp4.so: undefined versioned 
symbol name des_encrypt1 @@SUNWprivate_1.1
/usr/local/i386-pc-solaris2.8/bin/ld: failed to set dynamic section sizes: 
Bad value collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `libphp4.la'
Current working directory /usr/local/downloads/php-4.2.1
*** Error code 1
make: Fatal error: Command failed for target `install-recursive'


i've looked high and low but can find no solution. can please somebody 
help. thanx.

--dave
Rider University
OIT
--dave


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



Re: [PHP] mail() problem

2002-12-11 Thread Chris Hewitt
Carlos Alberto Pinto Hurtado wrote:


SMTP = hermes.ica.gov.co


I forgot to add, look at the mail log on the above computer. It should 
show the attempt to send the email. If so, then it is another 
confirmation that your php is OK and it is the email server.

Chris


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



Re: [PHP] date() on two diff. servers

2002-12-11 Thread DL Neil
Mike,
No complaints about explanations in PHP manual - I often say that it IS a
cut-above the average. However it does NOT explain the underlying concepts
of timestamps, (quite rightly) expecting that we pick up such from
other/more appropriate sources. Hence my comments are refering to such
sources/attempting to find such sources...

Like you, when I re-read that entry in the PHP manual (after your
informative reply) I 'saw' the logic and discovered that I had to move the
'location' in my mind-map where I had framed the GMT/TZ adjustment.
Fortunately it didn't nullify any design decisions I've made/relied upon.
Unfortunately *NIX sources thus far consulted don't seem to feel it
necessary to do the same/print anything confirming (and many of them most
careless in your GMT point) - and hence the discomfort. It is always
difficult to learn new things, and if not more so, can be v.awkward trying
to adapt from one philosophy to another, eg Windows to *NIX. Getting the
terminology straight is one thing, getting the model worked out another. I
don't doubt what you say/am happy to be shown to be wrong, but would sure
like to 'prove' it. As I say, am probably just barking up the wrong
(Christmas) tree(s). No worries - it's familiar territory!

Thanks for your help,
=dn


  -Original Message-
  From: DL Neil [mailto:[EMAIL PROTECTED]]
  Sent: 10 December 2002 19:52
 
  =as a Windows user I struggle to cope with some of these UNIX
  concepts, so I
  hit Google - with no joy, and ripped through the SuSE manuals
  (I'm a closet
  Linux user - will become one, just as soon as I can find the
  necessary spare
  machine (and time!) - till then, the box of manuals, CD-ROMs
  etc lives in
  the closet!) Would you believe, none appear to clarify this
  (maybe I'm using
  the wrong terminology/barking up the wrong trees...).

 Well, I think the PHP manual is pretty good about this -- all the pages
I've
 looked at are careful to add the GMT timezone indicator when referring to
 the base date of the Unix epoch, which is pretty much what tipped me off
to
 the correct interpretation.  (If you find a reference there that doesn't
 include the GMT indicator, I reckon that would be worth a bug report in
the
 Documentation problem category.)

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211



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




Re: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread DL Neil
  if you want a partial list of offensive terms - try looking
  at the meta keywords on a few porn sites ...

 Excellent idea!
 Unfortunately I'd have to explain that to my boss... No, really, I'm
doing
 some research...


=guess monopolising the color printer for a whole afternoon would give you
away, huh?

=but won't your gateway/web server's filter prevent access to such sites
anyway?

=dn


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




Re: [PHP] Automatic include of files containing functions

2002-12-11 Thread R'twick Niceorgaw
I don't know about the efficiency .. but to do it .. you can use
function_exists() to see if a function is already defined if not include the
file for that function before using a function.

HTH

- Original Message -
From: Dave [Hawk-Systems] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 11, 2002 10:40 AM
Subject: [PHP] Automatic include of files containing functions


 On a few sites we have used a master include or function file containing
all the
 unctions required for the site...  Some of these function files may
contain
 30-40 functions and some pages use only 1 function from the file.

 Would like to be a little more dynamic in our approach of this, and have
started
 moving all the functions into their own files...  for example moving
connectdb()
 from the functions.php file to a connectdb.php or connectdb.inc file.

 Then for any particular php page, we would pull in only the functions that
we
 need for that particular page.  From a script/function management
perspective
 this would be ideal.

 Questions//

 What would this do as far as speed and efficiency (having to load 4 or 5
 includes/requires rather than one larger include that has 25 functions
that
 aren't needed or used)?

 Then the hard one...

 Is there a way to have the PHP script dynamically pull in the required
include
 files?  for example, have a function at the top of each page to include
any
 files required as a result of functions that exist in the script...  ie:
this
 page uses abc() 123() and so it include/require ./includes/abc.php and
 ./includes/123.php which contain the appropriate functions.

 OR

 is there an easier way to manage what is becoming an over abundance of
functions
 for particular sites.

 Have gotten in the habit of creating a function for anything I have to do
more
 than 1 or 2 times on seperate pages just to speed and simplify code from a
 design and readability point of view.


 Appreciate any comments.

 Dave



 --
 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] Filter vulger / controversial words - need word source

2002-12-11 Thread Jon Haworth
   if you want a partial list of offensive terms - try looking
   at the meta keywords on a few porn sites ...
 
  Excellent idea!
  Unfortunately I'd have to explain that to my boss... No, 
  really, I'm doing some research...
 
 but won't your gateway/web server's filter prevent access to 
 such sites anyway?

Nope, only the really offensive ones like
http://www.thisisscunthorpe.co.uk/index.jsp ;-)

Cheers
Jon

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




Re: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread DL Neil
Jason,

  there simply is no definitive list of words

 The fact is content filtering does not work without a heavy dose of human
 intervention.
 It is quite shocking that large numbers of well known corporations deploy
 misconfigured content-filtering software which rejects perfectly innocent
 email.

Earlier contributions highlight this admirably.

I was at an Information show last week where a stand displayed the good
work of the EU organisation in the field. I spoke to a Brussels(*)
wonk/weenie/suit about such legislation (proposed and awaiting national
enactment). I suggested that it would be unfair to 'bring to justice' anyone
for apparently offending some employee/user's sensitivities without first
defining WHAT would cause offence (eg the requested list of vulgar words).
Otherwise the first you might know about it is when a court decides (against
you) that  is unacceptable in polite company. Accordingly I suggested
that his department publish such a list (in all of the languages/cultures of
the EU???), but observed that he would have a serious problem being able to
distribute it without his own office prosecuting itself! As is to be
expected, he failed to see the humor (and failed to see the
sense/requirement to do so)...

The joke is on our Indian friends @upv.pertamina.co.id whose 'filter' simply
bounces messages containing Dirty Words, because as you say there is no
human involvement so they can't even benefit from Jon's observations. This
policy means that every contact/contract with Sc*nthorp that they lose, is
deservedly so, and an unfortunate advertisement not to use that country for
out-sourcing if the culture-gap is so great!?

Summary attitude: hey I'll code it if you want it/pay me to do so, but what
are you going to do when you meet the rest of society as soon as you come
off the email system? NB it has 'always' been illegal to use such language
in (British, and many others) phone conversations, but who does that
stop/what filters are in place there?
=dn

*for the benefit of more distant members: Brussels is the home of many
European Union (EU) offices, and the source of much bureaucratic 'stupidity'
such as the legislation mentioned earlier.



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




[PHP] right or wrong - Two ways of compiling/installing with GD-support

2002-12-11 Thread info
Hello list,

simple question:

I´ve heard that it is possible to compile php with dg-support on two ways
1) first way: Distribution dependant with the gd-files and libraries, eg. gd.c, gd.lo, 
gd.o 
coming with the distribution of the compiled php-4.x-tarball
compiled the follwing way:

./configure .. --with-gd 


2) second way: You can compile the newest Distribution from GD, eg. gd-2.0.8

compiling gd-2.0.8 this way
./configure --prefix=/usr/local/gd ...
eg. under  /usr/local/gd

and the compile php-4.x this way
./configure  --with-gd=/usr/local 


Did I got that right ?

Oliver Etzel



Re: [PHP] mail() problem

2002-12-11 Thread DL Neil
i setting php.ini

[mail function]
;For Win32 only
SMTP = hermes.ica.gov.co
sendmail_from = [EMAIL PROTECTED]


=it is impressive to see that the Greeks' messenger has made it all the way
over to Colombia! Wasn't he also held responsible for dealing with people
who were guilty of indiscreet speech - good name for an email server...


=I'm immediately suspicious of the sub-domain address for the SMTP server.
What do you have for server identification in your email package? Make the
two definitions the same.

=Whereas this might be the name of your MS-Exchange box, what happens if you
remove the hermes. and just go with the domain name?

=Regards,
=dn


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




[PHP] GD installation - Simple Question

2002-12-11 Thread info
Hello list,

simple question:

I´ve heard that it is possible to compile php with dg-support on two ways
1) first way: Distribution dependant with the gd-files and libraries, eg. gd.c, gd.lo, 
gd.o 
coming with the distribution of the compiled php-4.x-tarball
compiled the follwing way:

./configure .. --with-gd 


2) second way: You can compile the newest Distribution from GD, eg. gd-2.0.8

compiling gd-2.0.8 this way
./configure --prefix=/usr/local/gd ...
eg. under  /usr/local/gd

and the compile php-4.x this way
./configure  --with-gd=/usr/local 


Did I got that right ?

Oliver Etzel



[PHP] Stable version of php-4.2

2002-12-11 Thread info
Hello list,
anybody here know where I can get a stable linux version of  php-4.2?

Oliver Etzel


Re: [PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Chris Hewitt



there simply is no definitive list of words


I agree. In Amateur Radio we faced this problem in the UK in the mid-90s 
on the ax25/tcpip network when the Home Office made the sysops 
responsible for content. Filtering messages off for human reading if any 
words on the list occured was the only practical solution. The sysops 
gradually built up a list and circulated it. The rules state something 
like the sysop must take all reasonable precautions to prevent 
offensive material circulating. So a sysop filtering/human reading is OK 
if an offensive message got through, whereas one not doing anything lost 
their licence.

This still leaves the problem of the English-only speaking sysop getting 
smtp/nntp in a different language!

Regards

Chris
PS Sorry about this being OT, my one and only post on this topic.



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



RE: [PHP] Automatic include of files containing functions

2002-12-11 Thread Dave [Hawk-Systems]
I don't know about the efficiency .. but to do it .. you can use
function_exists() to see if a function is already defined if not include the
file for that function before using a function.

Please check this for viability...
# the directory ./includes/ contains
#   - get_my_info.php containing the function get_my_info()
#   - and numerous other functions which may or may not be
# needed by any particular file
#
# include at the top of each page

# function_do(FunctionName,FunctionVariables)
function function_do($f_name,$f_string){
if (!function_exists($f_name)) {
# function doesn't exists, needs to be included
require('./includes/'.$f_name.'.php');
} else {
# function already exists, no action required
}
eval(\$return=$f_name($f_string););
return $return;
}

/*

...

*/

# when we need to run a function
# instead of...
$my_info = get_my_info('name','account');
# we would do...
$my_info = function_do(get_my_info,'name','account');



This would check to see if the function was already called and included, and if
not, include, then run and return the result.  this would avoid having to
include explicitly any files containing functions on any page as they would all
be loaded dynamically.

Am I groking this correctly?

Original questions/requirements included below.

Dave

- Original Message -
From: Dave [Hawk-Systems] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 11, 2002 10:40 AM
Subject: [PHP] Automatic include of files containing functions


 On a few sites we have used a master include or function file containing
all the
 unctions required for the site...  Some of these function files may
contain
 30-40 functions and some pages use only 1 function from the file.

 Would like to be a little more dynamic in our approach of this, and have
started
 moving all the functions into their own files...  for example moving
connectdb()
 from the functions.php file to a connectdb.php or connectdb.inc file.

 Then for any particular php page, we would pull in only the functions that
we
 need for that particular page.  From a script/function management
perspective
 this would be ideal.

 Questions//

 What would this do as far as speed and efficiency (having to load 4 or 5
 includes/requires rather than one larger include that has 25 functions
that
 aren't needed or used)?

 Then the hard one...

 Is there a way to have the PHP script dynamically pull in the required
include
 files?  for example, have a function at the top of each page to include
any
 files required as a result of functions that exist in the script...  ie:
this
 page uses abc() 123() and so it include/require ./includes/abc.php and
 ./includes/123.php which contain the appropriate functions.

 OR

 is there an easier way to manage what is becoming an over abundance of
functions
 for particular sites.

 Have gotten in the habit of creating a function for anything I have to do
more
 than 1 or 2 times on seperate pages just to speed and simplify code from a
 design and readability point of view.


 Appreciate any comments.

 Dave



 --
 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] Can PHP do this...?

2002-12-11 Thread RClark
Hello all. I have a question that I hope someone can answer. Is it possible
to determine is someone is hitting your site over SSL or plain http using
PHP? If so, is it part of getenv()?

Thanks in advance,
Ron Clark



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




[PHP] PHP imagick Windows DLL

2002-12-11 Thread Michael Montero
For any Windows users of PHP that want ImageMagick functionality built 
into PHP, you can download the ImageMagick PHP DLL from here:

http://php.chregu.tv/php_imagick.dll

Christian Stocker was gracious enough to spend time figuring out how to 
get it to work.

For the official imagick PEAR site, go here:

http://pear.php.net/package-info.php?package=imagick

For examples of using the functions, you should download the latest 
version from the PEAR site and look at all the examples in the examples 
directory contained in the tar.

-- 
Michael C. Montero
Chief Technology Officer
Community Connect Inc. Co-founder
[EMAIL PROTECTED]

-=-=-=-=-=  Community Connect Inc.  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

The Premier Source of Interactive Online Communities149 Fifth Avenue
http://www.CommunityConnectInc.com/ New York, NY 10010

http://www.AsianAvenue.com/ http://www.BlackPlanet.com/
Click into Asian AmericaThe World Is Yours

http://www.MiGente.com/ http://www.DiversityJobMarket.com/
The Power of LatinosIn partnership with The New
York Times

-  Your Message May Appear Below This Line



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




RE: [PHP] Stable version of php-4.2

2002-12-11 Thread John W. Holmes
 Hello list,
 anybody here know where I can get a stable linux version of  php-4.2?

www.php.net always works for me. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 11, 2002 12:10 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Stable version of php-4.2
 
 
 Oliver Etzel



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




RE: [PHP] Can PHP do this...?

2002-12-11 Thread John W. Holmes
 Hello all. I have a question that I hope someone can answer. Is it
 possible
 to determine is someone is hitting your site over SSL or plain http
using
 PHP? If so, is it part of getenv()?

I think it's $_SERVER['HTTPS']. If that is set, then the connection is
over SSL.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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




[PHP] Move Decimal Point

2002-12-11 Thread Stephen



I have a question. How would you move the decimal left or 
right, depending on if the number a user enters is negative or not, and then 
move it that many spaces? If needed, it would add zeros.

One other question. How would I find the first 0 of a 
repeating zero. Like 204,000. How would you find the 0 in the 4th 
column.
Thanks,Stephen Cratonhttp://www.melchior.us

"What is a dreamer that cannot persevere?" -- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Fwd: RE: [PHP] Odd Strpos Behavior

2002-12-11 Thread Steve Keller
At 12/10/2002 03:43 PM, you wrote:


John's suggestion of using '{', and '}' as the tag delimiters was to simplify
the regex. You can continue to use '[', and ']' as your delimiters, just
change the regex accordingly -- and don't forget that '[', and ']' needs to
be escaped.


Ah, all right. That went completely over my head when he suggested it. 
Thanks for clarifying.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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



RE: [PHP] Move Decimal Point

2002-12-11 Thread John W. Holmes
I have a question. How would you move the decimal left or right,
depending on if the
number a user enters is negative or not, and then move it that many
spaces? If 
needed, it would add zeros.

Hmm. Trying to remember what grade I learned this in. You multiply by 10
to move it right, divide by 10 to move it left.

One other question. How would I find the first 0 of a repeating zero.
Like 204,000. 
How would you find the 0 in the 4th column.

Treat it as a string and look for the first set of double zeros. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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




Re: [PHP] Move Decimal Point

2002-12-11 Thread Chris Wesley
On Wed, 11 Dec 2002, Stephen wrote:

 I have a question. How would you move the decimal left or right,
 depending on if the number a user enters is negative or not, and then
 move it that many spaces? If needed, it would add zeros.

Math ... multiply  divide ... I assume you're using a base-10 number
system, so multiply or divide by 10 when your user's input indicates you
should do so.

 One other question. How would I find the first 0 of a repeating zero.
 Like 204,000. How would you find the 0 in the 4th column.

I have one for you first.  Are you using this list to do your homework?
I've noticed that over the past couple days you've been asking
not-necessarily PHP questions, but /basic/ programming questions.

For your repeating zeors question, you'll have to make use of some string
functions or a regexp function.  Look for a pattern of more than 1 zero.

g.luck,
~Chris


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




[PHP] strstr-pls help

2002-12-11 Thread Mekrand
i couldnt find out what is wrong with this script ,
can anbody explain

$ip=fopen(ip.txt, 'r+');
$adam=fread($ip,filesize($adam));
fclose($ip);
if(stristr($adam,$_SERVER[REMOTE_ADDR]))
echo an entry submitted from this ip already;
else
{
..
//block 1
..
}

the ip.txt
10.8.0.21 10.8.5.21 10.8.7.21 10.8.0.24

although users ip is for example 10.8.0.21, the script doesnt echo warning,
instead it goes throug the block 1,
thanks for any assistance,

ps: i hope , this thread isnt off -topic ,if so , please warn



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




[PHP] hi

2002-12-11 Thread Mekrand
test



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




Re: [PHP] strstr-pls help

2002-12-11 Thread Mako Shark
Your problem is with this line:

$adam=fread($ip,filesize($adam));

Remember that $adam is not a file pointer, but text
read from a file. The file pointer is $ip, so the line
should read:

$adam=fread($ip,filesize($ip));

(and should probably be contained within an if
statement for error handling).

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Thanks

2002-12-11 Thread Mako Shark
Long time in coming, but thanks to all that have
helped with my stremaing audio and $_array questions.
I've figured out my problems thanks to all your help!

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] fgetcsv Help

2002-12-11 Thread Richard Baskett
I did email the company that the csv feed is coming from so we'll see what
comes of that.  I really hope they fix it.

Well here is what I did to solve the problem:

I pulled the csv file in using file(), then found the string length, used
substr() to get rid of the first double quote in the line and the newline
and double quote at the end of the line.  Then I replaced all double quotes
with it's html entity equivalent.  Then replaced quot;,quot; back into ,
since that means those quotes are supposed to be there.. hopefully :)

then I just stuck quotes on the beginning and end of the line.

Created a new file and flushed the data into a new file.

If anybody needs the code, I can send it to them.  Hopefully though the
company will get this fixed!  Cheers!

Rick

 I am parsing a csv file with fgetcsv and the fields are surrounding by
 double quotes, now I am running into a problem periodically that when there
 are quotes within the value it is treating it like another value instead of
 the same value.
 Any ideas on how to get around that?
 
 I am thinking I might have to convert all quotes to quot; and then turn all
 quot;,quot; back into quotes and then the first quot; in the file and
 then last one since obviously they will not have a comma in between them.
 This seems like a while lot of work..
 Ideas?

The happiest people are those who think the most interesting thoughts.
Those who decide to use leisure as a means of mental development, who love
good music, good books, good pictures, good company, good conversation, are
the happiest people in the world. And they are not only happy in themselves,
they are the cause of happiness in others. - Phelps


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




[PHP] 2 dates, difference in days AARGH!!

2002-12-11 Thread Curtis Gordon
HI! I have two dates, one in the future, and the current date, I want to 
calculate the difference between the two in # of days. I have converted 
both dates to seconds:

future date:
?$maturity_date = mktime (0,0,0,$mday_row[3],$mday_row[2],$mday_row[5]);?
current date:
?$today = getdate();?
?$now_date = mktime 
(0,0,0,$today['month'],$today['wday'],$today['year']);?

Then I found the difference between the two:
?$difference_date = ($maturity_date - $now_date);?

Now I want to convert the difference to days:
?$difference_days = ($difference_date / 86400);?
(24 [hours in a day] * 60 [minutes in an hour] * 60 [seconds in a 
minute] = 86400)

This seems to make sense to me, but I don't get the answer I want. As a 
test I start with a date 14 days in the future, so I should come out 
with an answer of 14, but it comes out as 3!

Please help this shoudln't be a big enough problem to throw me off schedule.

Curtis


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



  1   2   >