[PHP] Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread Daniel Negron/KBE

Hi all and Good Morning.

I have been struggling with this code:  I was wondering if someone could
lend me a hand.

I am working with this code and can't get the error to disappear.

After running I get
|-|
| Warning: Supplied argument is not a valid MySQL result resource in C:\My 
|Documents\My   |
| Webs\php\TMPibtpit3zq0.php on line 12
|   |
|-|


Line 12 happens to be the WHILE statement.  I am not sure if it is the
while statement or the results its looking for.

TIA  So far, i havent been able to sleep atleast until I get this.

html
?
if (isset($searchstring))
 {

 $db = mysql_connect(localhost,webuser,);
 mysql_select_db(cd_collection,$db);
 $sql= SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
ORDER BY artist ASC;
 $result = mysql_query($sql,$db);
 echo TABLE BORDER=2;
 echo trtdbArtist/btdbTitle/btdbOptions/b/tr;
 while ($myrow = mysql_fetch_array($result))
 {
   echo trtd.$myrow[artist].td.$myrow[title];
   echo tda href=\edit.php?id=.$myrow[cd_id].
\View/a;
  }
  echo /TABLE;
 }
else
 {
  ?
  form method=POST action=? $PHP_SELF ?
  table border=2 cellspacing=2
  trtdInsert Your Search String Here./td
  tdSearch Type/td/tr
  tr
  tdinput type=text name=searchstring size=28/td
  tdselect size=1 name=searchtype
   option selected value=artistArtist/option
   option value=titleTitle/option
   option value=categoryCategory/option
  /select/td
  /tr
  /table
  pinput type = submit value=Submit name=B1
  input type=reset value=Reset/p
  /form
  ?
 }
 ?

 /html


**DAN**




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




Re: [PHP] Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread Jason Wong

On Sunday 17 March 2002 16:38, Daniel Negron/KBE wrote:
 Hi all and Good Morning.

 I have been struggling with this code:  I was wondering if someone could
 lend me a hand.

 I am working with this code and can't get the error to disappear.

 After running I get

 |--
 |---| Warning: Supplied argument is not a valid MySQL result
 | resource in C:\My Documents\My   | Webs\php\TMPibtpit3zq0.php on line 12 
 |  |
 | -
 ||

 Line 12 happens to be the WHILE statement.  I am not sure if it is the
 while statement or the results its looking for.

Put in some error checking code when you use the mysql functions as per the 
manual examples and you'll soon find where the error is.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
I'm having an emotional outburst!!
*/

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




[PHP] Re: Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread jtjohnston

Daniel,

$myrow[artist] and $myrow[title]
might be a good place to start. It looks like all your ; are in place.
I don't think you can place  inside [] like that:

echo trtd.$myrow[artist].td.$myrow[title];


 I have been struggling with this code:  I was wondering if someone could
 lend me a hand.
 Line 12 happens to be the WHILE statement.  I am not sure if it is the
 while statement or the results its looking for.

 TIA  So far, i havent been able to sleep atleast until I get this.

 html
 ?
 if (isset($searchstring))
  {

  $db = mysql_connect(localhost,webuser,);
  mysql_select_db(cd_collection,$db);
  $sql= SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
 ORDER BY artist ASC;
  $result = mysql_query($sql,$db);
  echo TABLE BORDER=2;
  echo trtdbArtist/btdbTitle/btdbOptions/b/tr;
  while ($myrow = mysql_fetch_array($result))
  {
echo trtd.$myrow[artist].td.$myrow[title];
echo tda href=\edit.php?id=.$myrow[cd_id].
 \View/a;
   }
   echo /TABLE;
  }
 else
  {
   ?
   form method=POST action=? $PHP_SELF ?
   table border=2 cellspacing=2
   trtdInsert Your Search String Here./td
   tdSearch Type/td/tr
   tr
   tdinput type=text name=searchstring size=28/td
   tdselect size=1 name=searchtype
option selected value=artistArtist/option
option value=titleTitle/option
option value=categoryCategory/option
   /select/td
   /tr
   /table
   pinput type = submit value=Submit name=B1
   input type=reset value=Reset/p
   /form
   ?
  }
  ?

  /html

 **DAN**

--
John Taylor-Johnston
-
  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




[PHP] mysql fetch field

2002-03-17 Thread caspar kennerdale

I seem to be getting unexpected information from a mysql fetch field query.

My table has three fields- here is the schema-

CREATE TABLE template (
   id smallint(6) NOT NULL auto_increment,
   name mediumtext NOT NULL,
   multiple tinyint(4) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id)
);


Using the samplecode on php.net to output an object containing the
properties of eacj field I have been able to output the following

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - id
Not Null - 1
Numeric - 1
Primary Key - 1
Table - template
Type - int
Unique Key - 1
Unsigned - 0
ZeroFill - 0

Blob - 1
MaxLength - 7
Multiple Key - 0
Name - name
Not Null - 1
Numeric - 0
Primary Key - 0
Table - template
Type - blob
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - multiple
Not Null - 1
Numeric - 1
Primary Key - 0
Table - template
Type - unknown
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Which strange as the first field is specified as having a max length of 1
yet it is a small int with a length of 6.
Likewise the second field is specified as a blob with a maximum length of 7-
yet in my schema it is a medium text.
And again my third field is listed as havingan unkniwn typeyet in the schema
it is a tinyint

Here is my code

$TableInfo = new DB;
$TableInfoArray = $TableInfo -MySqlGetTableInfo('SELECT * FROM
template');
$a =-1;
$b = -1;
while (++$a  count($TableInfoArray)){
$Content[++$b]  = Blob - .$TableInfoArray[$a][0].br;
$Content[++$b]  = MaxLength - .$TableInfoArray[$a][1].br;
$Content[++$b]  = Multiple Key - .$TableInfoArray[$a][2].br;
$Content[++$b]  = Name - .$TableInfoArray[$a][3].br;
$Content[++$b]  = Not Null - .$TableInfoArray[$a][4].br;
$Content[++$b]  = Numeric - .$TableInfoArray[$a][5].br;
$Content[++$b]  = Primary Key - .$TableInfoArray[$a][6].br;
$Content[++$b]  = Table - .$TableInfoArray[$a][7].br;
$Content[++$b]  = Type - .$TableInfoArray[$a][8].br;
$Content[++$b]  = Unique Key - .$TableInfoArray[$a][9].br;
$Content[++$b]  = Unsigned - .$TableInfoArray[$a][10].br;
$Content[++$b]  = ZeroFill - .$TableInfoArray[$a][11].br;
$Content[++$b]  = br;
}
$Content = join('', $Content);
return $Content;


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:

 maybe you better use:

 session_unregister(counter);


I've put that, but it doesn't run. As you can see in the URLs
below, my code is:

if ($id == logout) { // the user wants logout :(
session_unregister(counter);
  }
  else { // user is navigating through our links
session_register(counter); // why I recover the previous value here,
// even I've clicked logout?
$counter++;
print counter: $counterbr/\n;
  }
}

  http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
  http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
  have the web page and the code, respectively.

Tom says that I must create a new session with a different name
(now I only start a new session implicitly via session_register()).
Perhaps I am confused with the 'session' term. I thought that if I do
session_destroy() the session forget all the info, but if I check
session_id() before and after session_destroy() I see that the value is
the same.

Thanks for your help,
Carlos.

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|




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




RE: [PHP] mysql fetch field

2002-03-17 Thread caspar kennerdale

Actually I've alreasdy worked it out- sorry

-Original Message-
From: caspar kennerdale [mailto:[EMAIL PROTECTED]]
Sent: 17 March 2002 10:31
To: [EMAIL PROTECTED]
Subject: [PHP] mysql fetch field


I seem to be getting unexpected information from a mysql fetch field query.

My table has three fields- here is the schema-

CREATE TABLE template (
   id smallint(6) NOT NULL auto_increment,
   name mediumtext NOT NULL,
   multiple tinyint(4) DEFAULT '0' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id)
);


Using the samplecode on php.net to output an object containing the
properties of eacj field I have been able to output the following

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - id
Not Null - 1
Numeric - 1
Primary Key - 1
Table - template
Type - int
Unique Key - 1
Unsigned - 0
ZeroFill - 0

Blob - 1
MaxLength - 7
Multiple Key - 0
Name - name
Not Null - 1
Numeric - 0
Primary Key - 0
Table - template
Type - blob
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Blob - 0
MaxLength - 1
Multiple Key - 0
Name - multiple
Not Null - 1
Numeric - 1
Primary Key - 0
Table - template
Type - unknown
Unique Key - 0
Unsigned - 0
ZeroFill - 0

Which strange as the first field is specified as having a max length of 1
yet it is a small int with a length of 6.
Likewise the second field is specified as a blob with a maximum length of 7-
yet in my schema it is a medium text.
And again my third field is listed as havingan unkniwn typeyet in the schema
it is a tinyint

Here is my code

$TableInfo = new DB;
$TableInfoArray = $TableInfo -MySqlGetTableInfo('SELECT * FROM
template');
$a =-1;
$b = -1;
while (++$a  count($TableInfoArray)){
$Content[++$b]  = Blob - .$TableInfoArray[$a][0].br;
$Content[++$b]  = MaxLength - .$TableInfoArray[$a][1].br;
$Content[++$b]  = Multiple Key - .$TableInfoArray[$a][2].br;
$Content[++$b]  = Name - .$TableInfoArray[$a][3].br;
$Content[++$b]  = Not Null - .$TableInfoArray[$a][4].br;
$Content[++$b]  = Numeric - .$TableInfoArray[$a][5].br;
$Content[++$b]  = Primary Key - .$TableInfoArray[$a][6].br;
$Content[++$b]  = Table - .$TableInfoArray[$a][7].br;
$Content[++$b]  = Type - .$TableInfoArray[$a][8].br;
$Content[++$b]  = Unique Key - .$TableInfoArray[$a][9].br;
$Content[++$b]  = Unsigned - .$TableInfoArray[$a][10].br;
$Content[++$b]  = ZeroFill - .$TableInfoArray[$a][11].br;
$Content[++$b]  = br;
}
$Content = join('', $Content);
return $Content;


--
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] send fax

2002-03-17 Thread heinisch

At 17.03.2002  07:35, you wrote:
Hi,
is it possible  to send automated faxes via PHP?
Thanks in advance,
Senih
If your ISP or your server is able to, yes.
something like
exec(sendfax options,$foo);
should do this. check out your system and ISP for more infos on it.
Some ISP´s offer the sending of faxes via an special e-mail adress,
it´s forwarding a message to a fax.
HTH Oliver


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




Re: [PHP] retrieving remote web page

2002-03-17 Thread heinisch

At 17.03.2002  00:45, you wrote:
Hi,

I'm wanting to retrieve a remote page and extract information from it to
insert into my own page. I know that this can be done with fopen, however
the page I am wishing to retrieve is generated with a POSTed form.

Is there any way that I can retrieve a page that has been created by the
filling in of a form (using the POST method)?

Thanks for any help...

-Andy
there are several ways,
you can use the snoopy class, look at sourceforge (easiest way)
you can use header, to post the vars, and curl to retireve the vars,
for me curl works better than fopen.
Look at the manual or even at the archive for more infromations.
HTH Oliver


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




[PHP] securing the website with htaccess creates problems with getimagesize

2002-03-17 Thread andy

Hi there,

I did put a password via htaccess on my website to hide my testing
environment from other users. Now I discovered, that PHP can't read
imagefile information via getimagesize because it does not get access to
this dir anymore.

How could I add php as a user with propper password ?

Thanx for any help,

Andy



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




Re: [PHP] Re: No Sense: [PHP] Update: [PHP] Weird?

2002-03-17 Thread heinisch

At 17.03.2002  17:09, you wrote:

Hey folks, I read this with half of mind, but as I know, the function
date needs something to convert from.
  $date = date (MD);

for my opinion it should be called $date=date(MD,time());
or $date=date(MD,mktime(..));

then everything should work
$to_path = c:\\ccl_www\\.$date.\\ccl_www\\;
or
$to_path = c:\\ccl_www\\$date\\ccl_www\\;

HTH Oliver



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




Re: [PHP] Copy *.*

2002-03-17 Thread heinisch

At 17.03.2002  03:10, you wrote:

Does anyone know of another snippet any place where I can copy *.*
(files and all sub-directories) from one drive to another? In other
words, a backing-up function. The snippet I got from
http://www.php.net/manual/en/function.copy.php has been a disaster.

John
Which OS are you using ?


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




Re: [PHP] OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?

2002-03-17 Thread Oliver Heinisch

At 17.03.2002  10:01, you wrote:

?php
class A
{
 function A($i)
 {
 $this-value = $i;
 // try to figure out why we do not need a reference here
 $this-b = new B($this);
 }

 function createRef()
 {
 $this-c = new B($this);
 }

 function echoValue()
 {
 echo br,class ,get_class($this),': ',$this-value;
 }
}


class B
{
 function B($a)
 {
 $this-a = $a;
 }

 function echoValue()
 {
 echo br,class ,get_class($this),': ',$this-a-value;
 }
}

// try to undestand why using a simple copy here would yield
// in an undesired result in the *-marked line
$a =new A(10);
$a-createRef();

$a-echoValue();
$a-b-echoValue();
$a-c-echoValue();

$a-value = 11;

$a-echoValue();
$a-b-echoValue(); // *
$a-c-echoValue();

?
Even if I don´t understand what your code does, shouldn´t you
give any variable a place to be stored so it schould look like
class foo
{
 var $a;
 var $b;
function fooplus()
{
 $this - a = foofoo;
and so on ??
}
}
HTH Oliver


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Tom Rogers

hi
If you put:

?
session_start();

as the first line on your page it will behave as you want I think.
Tom




At 08:41 PM 17/03/2002, Carlos Costa Portela wrote:
On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:

  maybe you better use:
 
  session_unregister(counter);
 

 I've put that, but it doesn't run. As you can see in the URLs
below, my code is:

if ($id == logout) { // the user wants logout :(
 session_unregister(counter);
   }
   else { // user is navigating through our links
 session_register(counter); // why I recover the previous value here,
 // even I've clicked logout?
 $counter++;
 print counter: $counterbr/\n;
   }
}

   http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
   http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
   have the web page and the code, respectively.

 Tom says that I must create a new session with a different name
(now I only start a new session implicitly via session_register()).
Perhaps I am confused with the 'session' term. I thought that if I do
session_destroy() the session forget all the info, but if I check
session_id() before and after session_destroy() I see that the value is
the same.

 Thanks for your help,
 Carlos.

  ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] Class Function Issue

2002-03-17 Thread heinisch

At 16.03.2002  22:24, you wrote:

Hi!  I'm building a class, and am trying to include an authorization 
function the code works when used outside of the class, but when I put 
it inside the class, for some reason my session variables won't get 
set.  Am I attempting the impossible, or am I missing something that I 
need to make this work? Below is the code for the Auth function.


function Auth($username,$password) {
 $query = SELECT id,username,sl FROM KAOPA_users where 
 username='$username' AND password=PASSWORD('$password');
 $Auth = $this-Query($query);
 if ($this-number_returned($Auth) == '1') {
 $id = mysql_result($Auth,0,id);
 $uname = mysql_result($Auth,0,username);
 $sl = mysql_result($Auth,0,sl);
 global $HTTP_SESSION_VARS;
 $HTTP_SESSION_VARS[id] = $id;
 $HTTP_SESSION_VARS[user] = $uname;
 $HTTP_SESSION_VARS[sl] = $sl;
 }
 }
some vars make trouble, using inside a class or function inside a class. Even
making them global doesn´t work. Try to set the vars via an explicit function,
so that they´re available inside your class, or just make them parameters
so your authorisation could look like
$MyClass - Auth($username,$password,$session_vars);
HTH Oliver


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




[PHP] replacing all non [a-z] chars possible?

2002-03-17 Thread andy

Hi there,

I am wondering if it would be possible to replace all chars which are not
inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
bunch of citynames and I would like to create valid filenames out of those.
The prob is, that I do not know all special chars. For example there was
one: ï  which I did not know. So maybe there are a lot others similar like
that.

The point is, how could I create a valid filename out of those citynames
which contains only the chars from a - z? I tryed erregrplc, but I do have
to know the char for that.

Thanx for any help,

andy



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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Sun, 17 Mar 2002, Tom Rogers wrote:

 hi
 If you put:

 ?
 session_start();

 as the first line on your page it will behave as you want I think.

Thank you very much. It runs now ok :-). But I don't understand
why, if I call session_destroy(), the system remember the value of the
variable.

The system running at...
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.


Thank you very much,
Carlos.

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] replacing all non [a-z] chars possible?

2002-03-17 Thread bvr


A good solution is to store the file under a random generated filename 
and store that name,
together with the real name, to the database.

bvr.

andy wrote:

Hi there,

I am wondering if it would be possible to replace all chars which are not
inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
bunch of citynames and I would like to create valid filenames out of those.
The prob is, that I do not know all special chars. For example there was
one: ï  which I did not know. So maybe there are a lot others similar like
that.

The point is, how could I create a valid filename out of those citynames
which contains only the chars from a - z? I tryed erregrplc, but I do have
to know the char for that.

Thanx for any help,

andy







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




Re: [PHP] replacing all non [a-z] chars possible?

2002-03-17 Thread andy

I don't agree. Under this circumstances no picture search engine is gonna
find this file. Thats why I am rewriting this module.

Thanx anyway.

Andy


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

 A good solution is to store the file under a random generated filename
 and store that name,
 together with the real name, to the database.

 bvr.

 andy wrote:

 Hi there,
 
 I am wondering if it would be possible to replace all chars which are not
 inbetween [a-z] with a valid asccii coresponding to it. I have a db with
a
 bunch of citynames and I would like to create valid filenames out of
those.
 The prob is, that I do not know all special chars. For example there was
 one: ï  which I did not know. So maybe there are a lot others similar
like
 that.
 
 The point is, how could I create a valid filename out of those citynames
 which contains only the chars from a - z? I tryed erregrplc, but I do
have
 to know the char for that.
 
 Thanx for any help,
 
 andy
 
 
 






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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Tom Rogers

Hi
As you had not started a session at that point there was none to destroy or 
unregister :)
Tom

At 11:53 PM 17/03/2002, Carlos Costa Portela wrote:
On Sun, 17 Mar 2002, Tom Rogers wrote:

  hi
  If you put:
 
  ?
  session_start();
 
  as the first line on your page it will behave as you want I think.

 Thank you very much. It runs now ok :-). But I don't understand
why, if I call session_destroy(), the system remember the value of the
variable.

 The system running at...
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.


 Thank you very much,
 Carlos.

  ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Mon, 18 Mar 2002, Tom Rogers wrote:

 Hi
 As you had not started a session at that point there was none to destroy or
 unregister :)

Ok!!!. Thank you very much,
Carlos.

  http://www.tertulandia.com : sea cual sea tu tema... allí está tu sitio!

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] replacing all non [a-z] chars possible?

2002-03-17 Thread Michael Sims

At 02:31 PM 3/17/2002 +0100, andy wrote:
Hi there,

I am wondering if it would be possible to replace all chars which are not
inbetween [a-z] with a valid asccii coresponding to it. I have a db with a
bunch of citynames and I would like to create valid filenames out of those.
The prob is, that I do not know all special chars. For example there was
one: ï  which I did not know. So maybe there are a lot others similar like
that.

The point is, how could I create a valid filename out of those citynames
which contains only the chars from a - z? I tryed erregrplc, but I do have
to know the char for that.

I found this in the user contributed notes for the function strtr().  It looks
like what you need:

function removeaccents($string) {
   return strtr($string,
 ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ,
 SOZsozYYuAAACDNOOYsaaaconooyy);
}




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




[PHP] Session --trans-id

2002-03-17 Thread lists

I have complied PHP with the enable trans id option

However, when I start a session and go to a relivtive link , (./page.php) 
I do not get a session id in my URI.

Any Ideas?

Michael


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




[PHP] Writing files a problem

2002-03-17 Thread Ben Waldher

When writing to a file several problems occur with this code:

?php
$stuff = include (news.txt);
$file = fopen (news.txt, w);
$newnews = include (template.txt) . $stuff;
fwrite ($file, $newnews);
?

However, this code works:

?php
$file = fopen(template.txt, w);
fwrite ($file, $temp);
fclose ($file);
?

The problem with the first set of code is that it opens template.txt1, and
some letters that were in template.txt become a 1.



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




[PHP] Including an external php file existing on another server..

2002-03-17 Thread Martin Stix

Hi!

On my Server i can`t use the date(W) function, and on another it works.

How can i first run the script on the other server and then include it in a
script on my server so i can use the date(W) variable?

thanks,
Martin



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




Re: [PHP] Writing files a problem

2002-03-17 Thread Jason Wong

On Monday 18 March 2002 00:46, Ben Waldher wrote:
 When writing to a file several problems occur with this code:

 ?php
 $stuff = include (news.txt);
 $file = fopen (news.txt, w);
 $newnews = include (template.txt) . $stuff;
 fwrite ($file, $newnews);
 ?

 However, this code works:

 ?php
 $file = fopen(template.txt, w);
 fwrite ($file, $temp);
 fclose ($file);
 ?

 The problem with the first set of code is that it opens template.txt1, and
 some letters that were in template.txt become a 1.

I've already replied to this before. The include() statement is NOT what you 
want. Have a look at the functions in the chapter Filesystem functions.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Please ignore previous fortune.
*/

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




Re: [PHP] Class Function Issue

2002-03-17 Thread Jason Bell

oops... meant to send this to the list

- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 10:27 AM
Subject: Re: [PHP] Class Function Issue


 Thanks for the tip. I tried that... I passed $HTTP_SESSION_VARS as a
 parameter, and it didn't work.  :/

 I also built another function inside the class to set session variables:

 function SetSVAR($var,$value) {
 global $HTTP_SESSION_VARS;
 $HTTP_SESSION_VARS[$var] = $value;
 }

 If I call $MyClass-SetSVAR($var,$Value); it works
 but if I put $this-SetSVAR($var,$Value); inside a class function it
doesn't
 work

 is it because these are in the same class? should they be seperated into 2
 seperate classes?

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, March 17, 2002 4:38 AM
 Subject: Re: [PHP] Class Function Issue


 At 16.03.2002  22:24, you wrote:
 
 Hi!  I'm building a class, and am trying to include an authorization
 function the code works when used outside of the class, but when I
put
 it inside the class, for some reason my session variables won't get
 set.  Am I attempting the impossible, or am I missing something that I
 need to make this work? Below is the code for the Auth function.
 
 
 function Auth($username,$password) {
  $query = SELECT id,username,sl FROM KAOPA_users where
  username='$username' AND password=PASSWORD('$password');
  $Auth = $this-Query($query);
  if ($this-number_returned($Auth) == '1') {
  $id = mysql_result($Auth,0,id);
  $uname = mysql_result($Auth,0,username);
  $sl = mysql_result($Auth,0,sl);
  global $HTTP_SESSION_VARS;
  $HTTP_SESSION_VARS[id] = $id;
  $HTTP_SESSION_VARS[user] = $uname;
  $HTTP_SESSION_VARS[sl] = $sl;
  }
  }
 some vars make trouble, using inside a class or function inside a class.
 Even
 making them global doesn´t work. Try to set the vars via an explicit
 function,
 so that they´re available inside your class, or just make them parameters
 so your authorisation could look like
 $MyClass - Auth($username,$password,$session_vars);
 HTH Oliver


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







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




php-general Digest 17 Mar 2002 18:49:42 -0000 Issue 1232

2002-03-17 Thread php-general-digest-help


php-general Digest 17 Mar 2002 18:49:42 - Issue 1232

Topics (messages 88804 through 88837):

Re: Again, and Again, and AGAIN!
88804 by: Jason Wong

Re: check on pictures
88805 by: Martin Kampherbeek

send fax
88806 by: Senih
88818 by: heinisch.creaction.de

Class Function Issue
88807 by: Jason Bell
88825 by: heinisch.creaction.de
88837 by: Jason Bell

problem with file writing
88808 by: Ben Waldher
88809 by: Jason Wong

Re: Weird?
88810 by: jtjohnston

Copy *.*
88811 by: jtjohnston
88822 by: heinisch.creaction.de

Invalid Argument ???  Not sure how to debug this
88812 by: Daniel Negron/KBE
88813 by: Jason Wong
88814 by: jtjohnston

mysql fetch field
88815 by: caspar kennerdale
88817 by: caspar kennerdale

Re: Problem with sessions.
88816 by: Carlos Costa Portela
88824 by: Tom Rogers
88827 by: Carlos Costa Portela
88830 by: Tom Rogers
88831 by: Carlos Costa Portela

Re: retrieving remote web page
88819 by: heinisch.creaction.de

securing the website with htaccess creates problems with getimagesize
88820 by: andy

Re: No Sense: [PHP] Update: [PHP] Weird?
88821 by: heinisch.creaction.de

Re: OBJECT£ºWHAT'S THE RALATION  BETWEEN A,B AND C?
88823 by: Oliver Heinisch

replacing all non [a-z] chars possible?
88826 by: andy
88828 by: bvr
88829 by: andy
88832 by: Michael Sims

Session --trans-id
88833 by: lists.mhess.qn.net

Writing files a problem
88834 by: Ben Waldher
88836 by: Jason Wong

Including an external php file existing on another server..
88835 by: Martin Stix

Administrivia:

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

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

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


--

---BeginMessage---

On Sunday 17 March 2002 13:14, Jason Wong wrote:


 You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see
 changelog/history/php.ini for details).


Sorry a typo:

$HTTP_POST_VARS[] has been replaced by $_POST[]


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
What's done to children, they will do to society.
*/

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

Thanks for repying. Yes, the page has pictures. But all jpg pictures must
link to another jpg pictures. A gif is alowed to link to a html file. The
minium numers of jpg pictures must be 12.

Cheers,
Martin.


- Original Message -
From: Boaz Yahav [EMAIL PROTECTED]
To: Martin Kampherbeek [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Saturday, March 02, 2002 7:35 PM
Subject: RE: [PHP] check on pictures


This is pretty Trivial if the remote pages had a standard. But from your
words I understand that the remote gallery pages can look like anything
and contain links to other places than only images.

Not trivial at all...

Sincerely

  berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Martin Kampherbeek [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 10:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] check on pictures


Can someone help me with this problem?

Someone fills in my form. One field on the form is galleryurl. Here he
types a url with some pictures on it. On this page the are thumbnail
with links to bigger pictures.
Now I want to check if the pictures are realy on it. And I want to check
if there is a link to a picture on the thumbnail and not to a html page.

I hope someone can help me.

Cheers,
Martin.





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

Hi,
is it possible  to send automated faxes via PHP?
Thanks in advance,
Senih

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

At 17.03.2002  07:35, you wrote:
Hi,
is it possible  to send automated faxes via PHP?
Thanks in advance,
Senih
If your ISP or your server is able to, yes.
something like
exec(sendfax options,$foo);
should do this. check out your system and ISP for more infos on it.
Some ISP´s offer the sending of faxes via an special e-mail adress,
it´s forwarding a message to a fax.
HTH Oliver


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

Hi!  I'm building a class, and am trying to include an authorization function the 
code works when used outside of the class, but when I put it inside the class, for 
some reason my session variables won't get set.  Am I attempting the impossible, or am 
I missing something that I need to make this work? Below is the code for the Auth 
function.


function Auth($username,$password) {
$query = SELECT id,username,sl FROM KAOPA_users where 
username='$username' AND password=PASSWORD('$password');
$Auth = $this-Query($query);
if ($this-number_returned($Auth) == '1') {
  

[PHP] creating a dBase III file

2002-03-17 Thread Don

Hi,

I need to create a dBase III file however, my ISP does not have PHP compiled with 
--enable-debase.  Does any one have or know of a class that could accomplish this?

Thanks,
Don



[PHP] substr_count() and regex

2002-03-17 Thread Gil Disatnik

Hello there,
I am trying to use substr_count() to count the number of Hebrew characters 
in a string,
I tried substr_count($test, /[à-ú]/), but it returns 0 as if it can't 
match the regex I have inserted there, I hoped it will work the same as 
preg_match() that works great (preg_match(/[à-ú]/, $test)) for example 
works just fine, but I guess substr_count() is a bit different...

Is there a way for me to do that? maybe with another similar function? (If 
not I will have to solve it in an ugly while loop that searches for Hebrew 
characters one by one...)

Thank you.



Regards

Gil Disatnik
UNIX system/security administrator.

GibsonLP@EFnet

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Windows NT has detected mouse movement, you MUST restart
your computer before the new settings will take effect, [ OK ]

Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
system, written for a 4 bit processor by a 2 bit company which can
not stand 1 bit of competition.
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-


Re: [PHP] substr_count() and regex

2002-03-17 Thread Bas Jobsen

?
function count_hebrew($string)
{
$i=0;
while(preg_match(/[à-ú]/,$string))
{
$string=preg_replace(/[à-ú]/,,$string,1);
$i++;
}
return $i;
}

$hebrew_characters=??? àhhjúkkk;
$number_of_hebrew_characters=count_hebrew($hebrew_characters);
echo $number_of_hebrew_characters;
?

Op zondag 17 maart 2002 20:15, schreef Gil Disatnik:
 Hello there,
 I am trying to use substr_count() to count the number of Hebrew characters
 in a string,
 I tried substr_count($test, /[à-ú]/), but it returns 0 as if it can't
 match the regex I have inserted there, I hoped it will work the same as
 preg_match() that works great (preg_match(/[à-ú]/, $test)) for example
 works just fine, but I guess substr_count() is a bit different...

 Is there a way for me to do that? maybe with another similar function? (If
 not I will have to solve it in an ugly while loop that searches for Hebrew
 characters one by one...)

 Thank you.



 Regards

 Gil Disatnik
 UNIX system/security administrator.

 GibsonLP@EFnet

 _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
 Windows NT has detected mouse movement, you MUST restart
 your computer before the new settings will take effect, [ OK ]
 
 Windows is a 32 bit patch to a 16 bit GUI based on a 8 bit operating
 system, written for a 4 bit processor by a 2 bit company which can
 not stand 1 bit of competition.
 -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

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




Re: [PHP] Class Function Issue

2002-03-17 Thread heinisch

At 17.03.2002  10:49, you wrote:
  Thanks for the tip. I tried that... I passed $HTTP_SESSION_VARS as a
  parameter, and it didn't work.  :/
 
  I also built another function inside the class to set session variables:
 
  function SetSVAR($var,$value) {
  global $HTTP_SESSION_VARS;
  $HTTP_SESSION_VARS[$var] = $value;
  }
 
  If I call $MyClass-SetSVAR($var,$Value); it works
  but if I put $this-SetSVAR($var,$Value); inside a class function it
doesn't
  work
I meant :
Main code
--
$FOO = new Yourclass
$sesvar = $HTTP_SESSION_VARS;
$FOO - SetSVars($sesvar);
--
CLASS

yourlass
var insidesesvars;
{
function SetSVAR($sesvar)
{
 $this - insidesesvars = $sesvars;
}
} // end Yourclass

There are often problems with so called globalvars like $HTTP_REFERER, 
$HTTP_SESSION_VARS ...
using inside Objects, don´t ask me why.

HTH Oliver

 
  At 16.03.2002  22:24, you wrote:
  
  Hi!  I'm building a class, and am trying to include an authorization
  function the code works when used outside of the class, but when I
put
  it inside the class, for some reason my session variables won't get
  set.  Am I attempting the impossible, or am I missing something that I
  need to make this work? Below is the code for the Auth function.
  
  
  function Auth($username,$password) {
   $query = SELECT id,username,sl FROM KAOPA_users where
   username='$username' AND password=PASSWORD('$password');
   $Auth = $this-Query($query);
   if ($this-number_returned($Auth) == '1') {
   $id = mysql_result($Auth,0,id);
   $uname = mysql_result($Auth,0,username);
   $sl = mysql_result($Auth,0,sl);
   global $HTTP_SESSION_VARS;
   $HTTP_SESSION_VARS[id] = $id;
   $HTTP_SESSION_VARS[user] = $uname;
   $HTTP_SESSION_VARS[sl] = $sl;
   }
   }
  some vars make trouble, using inside a class or function inside a class.
  Even
  making them global doesn´t work. Try to set the vars via an explicit
  function,
  so that they´re available inside your class, or just make them parameters
  so your authorisation could look like
  $MyClass - Auth($username,$password,$session_vars);
  HTH Oliver
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 



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


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




[PHP] Re: index.php question

2002-03-17 Thread LaserJetter

Try adding a slash to the end of the URL i.e. www.whatever.com/~jondoe/ and
see if that helps.
Maybe Apache tries to parse your PHP file as if it is an HTML file.



Omland Christopher M [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all, I'm new to the mailing list, I hope I'm in the right spot.
 I have installed php, and .php files work fine, unless they are my index
 file. For example http://whatever.com/~jondoe/info.php will work. But if I
 make a index.php file and go to http://whatever.com/~jondoe it wont work.
 I can view the source and see my php code, which I know means the server
 isn't translating it. I'm running RH LINUX, and running apache webserver.
 I have checked the httpd.conf file and the load modules lines are in
 there, and they are correct??(I THINK)
 Any help would be appreciated.
 Thank You.
 -Chris




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




[PHP] pdflib

2002-03-17 Thread Ben Edwards

I have a html report and am looking into using phplib to generate a pdf 
instead.  I have got it installed and started experimenting with it but 
ether it is extremely convoluted or I am missing something.  How would I 
create a simple list report (the type you would do in a table).  It seems 
all I can to is specify X/Y coordinates and print text.  Don't know how 
many pages the report will be for a start.

Ben


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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


Re: [PHP] replacing all non [a-z] chars possible?

2002-03-17 Thread mnc

I don't agree.

First of all, picture search engines don't use filenames, they use ALT
attributes and surrounding text.

Secondly, you can still make the images available using both the database 
ID and a urlencoded version of the original filename:

http://myserver.org/fetchimage.php/33445/guberstrasse.jpg

Just use $PATH_INFO.

fetchimage.php looks up 33445, finds the correct file, sends the
appropriate headers, and pumps the correct file's data to the browser. The
browser and search engines think the filename was guberstrasse.jpg. 
Everybody wins.

miguel

On Sun, 17 Mar 2002, andy wrote:

 I don't agree. Under this circumstances no picture search engine is gonna
 find this file. Thats why I am rewriting this module.
 
 Thanx anyway.
 
 Andy
 
 
 Bvr [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  A good solution is to store the file under a random generated filename
  and store that name,
  together with the real name, to the database.
 
  bvr.
 
  andy wrote:
 
  Hi there,
  
  I am wondering if it would be possible to replace all chars which are not
  inbetween [a-z] with a valid asccii coresponding to it. I have a db with
 a
  bunch of citynames and I would like to create valid filenames out of
 those.
  The prob is, that I do not know all special chars. For example there was
  one: ï  which I did not know. So maybe there are a lot others similar
 like
  that.
  
  The point is, how could I create a valid filename out of those citynames
  which contains only the chars from a - z? I tryed erregrplc, but I do
 have
  to know the char for that.
  
  Thanx for any help,
  
  andy
  
  
  
 
 
 
 
 
 
 


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




Re: [PHP] pdflib

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Ben Edwards wrote:
 I have a html report and am looking into using phplib to generate a pdf 
 instead.  I have got it installed and started experimenting with it but 
 ether it is extremely convoluted or I am missing something.  How would I 
 create a simple list report (the type you would do in a table).  It seems 
 all I can to is specify X/Y coordinates and print text.  Don't know how 
 many pages the report will be for a start.

I haven't found it to be particularly easy. It works okay for simple 
things - our example being a web-based generator for simple office 
stationery like business cards and envelopes - but for serious text 
processing you should probably look into adding a few pieces to the 
process.

You can easily generate, for instance, RTF from a database and then pipe
it through any of several freely-available programs that will turn that
into a PDF. This way you don't have to deal with painful details like page
breaks, word wrapping and line lengths, etc.

miguel



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




[PHP] links

2002-03-17 Thread Morten Nielsen

Hi,
I got a table where I on the left has a link to page1. Another place in the
table I have a button, which also links to page1. Is it possible to tell
which of the two links has been pressed.
I need to know so I only show a specific message when the button has been
pressed.

Regards,
Morten



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




Re: [PHP] links

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Morten Nielsen wrote:
 I got a table where I on the left has a link to page1. Another place in the
 table I have a button, which also links to page1. Is it possible to tell
 which of the two links has been pressed.
 I need to know so I only show a specific message when the button has been
 pressed.

The link:

   a href=page1.html?which=1

The button:

   a href=page1.html?which=2

page1.html:

   ? print they clicked link number {$HTTP_GET_VARS['which']}; ?

miguel


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




[PHP] Web Tables and php forms

2002-03-17 Thread mikeyb

I am completely stuck, and I am preying that someone will be able to help me.

I have set up a php web form that allows one of my users to write columns for my site. 
 This works great, I do a search and replace to replace /n with br because they 
don't know much about html.  I have managed to get them into the habit of using bold, 
italics and underline tags, but now a few of them want to add tables and I have no 
idea how I can make this easy for them.

Has anyone got any idea how I could allow them to do this, or perhaps know of a system 
that could be of some benefit, keeping in mind their minimal html expertise?

Any help would be GREATLY appreciated.

Peace



Re: [PHP] Saving data with cookies

2002-03-17 Thread heinisch

At 17.03.2002  18:21, you wrote:

Hi list,

I'm developing a system to store Resumes, since my form has a lot of fields,
about 70, i'd like to have the ability to save the filled ones if my user
wants to finish it later. Wha'ts the best way to implement this kind of
feature. Maybe I could use cookies, right?!?!? If so, how can I store this,
multiples cookies, one big cookie, like an array?? this is possible??

Thank's in advance

Rodrigo Peres
your form has (70?) inputs like
input type=text name=name_of_var[] -- this is an arrayvaraible every 
field the same name !
the form will then submit an (one) array, which could be stored in your 
database
(For I´m not shure how it will be saved, I would save this array as an
something separated text.)
you send an cookie with a long lifetime to the client,
this cookie is also stored in your DB. So a user wants to continue his form,
you can select the users form via the cookie, and send an pre prepared form
to the client. I think that´s all. If this user sends it back, you update the
textfield, for his next continuation.
But take a look on sending cookies, I found out, that the major browsers want
different style cookies.
HTH Oliver


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




Re: [PHP] Invalid Argument ??? Not sure how to debug this

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Daniel Negron/KBE wrote:
  $sql= SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
 ORDER BY artist ASC;

How about:

   SELECT * FROM cd_list WHERE searchstring LIKE '%{$searchstring}%' 

Then again, do you actually have a column called searchstring in your 
table? 

In any case, the way you had it didn't seem to make much sense unless you 
wanted to search a user-supplied column for a string that literally 
contained the string searchstring.

miguel


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




[PHP] Errormessages

2002-03-17 Thread Markus Falk

I run a script on my page that has worked fine before with 4.0.3 but now
when my provider has upgraded to 4.1.2,  a bunch of error messages appear. I
get some messages about variables not being defined just as if I can't send
variables via the adressbar (/ ../index.php?$kat=0 for example. ) How come
they suddenly appear as not being defined?
I also get a lot of messages saying PHP Warning: Undefined offset: 1 in
/home/f/falk/public_html/index.php on line 148
What does it mean that I have an undefined offset?

You can find all errormessages here http://www.acc.umu.se/~falk

Please help.

Markus



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




Re: [PHP] Errormessages

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Markus Falk wrote:
 I run a script on my page that has worked fine before with 4.0.3 but now
 when my provider has upgraded to 4.1.2,  a bunch of error messages appear. I
 get some messages about variables not being defined just as if I can't send
 variables via the adressbar (/ ../index.php?$kat=0 for example. ) How come
 they suddenly appear as not being defined?
 I also get a lot of messages saying PHP Warning: Undefined offset: 1 in
 /home/f/falk/public_html/index.php on line 148
 What does it mean that I have an undefined offset?

If you try to, say, print $arr[1] and there is no element in $arr with 
index '1', then you've got an undefined offset situation.

You might want to read 

   http://www.php.net/manual/en/function.error-reporting.php

to see how you can control at runtime which errors are displayed. 
Alternatively, perhaps a lot of fellow customers are having the same 
issue, and so it might be worth it for your provider to change this 
globally.

miguel


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




Re: [PHP] Web Tables and php forms

2002-03-17 Thread Bogdan Stancescu

If you want to do this the hard way (for you) then you can create a form 
which asks for the number of rows/columns and pops up another form with 
a table and rows x columns input boxes - then you can build the table 
code and maybe even insert it in the original code via JavaScript 
(assuming that the whole tables module would be a popup from the main 
text editing page).

You may want to take a look at nl2br() and htmlspecialchars() so they 
don't mess up your tables. htmlspecialchars() would obviously inhibit 
bold and italics rendering.

Be warned though that this will never end - they'll need table editing 
next, then they'll want to be able to delete rows/columns, insert 
rows/columns, merge cells, split cells, set background colors, styles 
and whatnot... ;-)

HTH

Bogdan

mikeyb wrote:

I am completely stuck, and I am preying that someone will be able to help me.

I have set up a php web form that allows one of my users to write columns for my 
site.  This works great, I do a search and replace to replace /n with br because 
they don't know much about html.  I have managed to get them into the habit of using 
bold, italics and underline tags, but now a few of them want to add tables and I have 
no idea how I can make this easy for them.

Has anyone got any idea how I could allow them to do this, or perhaps know of a 
system that could be of some benefit, keeping in mind their minimal html expertise?

Any help would be GREATLY appreciated.

Peace





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




[PHP] Moving server clock?

2002-03-17 Thread Leif K-Brooks

Right now, I have a static server time clock on my page, produced by date().
I would like to make it move, and I was wondering if anyone has code that
returns the server time to javascript to animate it or something? 

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




Re: [PHP] Web Tables and php forms

2002-03-17 Thread Justin French

I think you have to draw a line somewhere... you can't give them
everything they want, becasue the costs involved in making these
simple tools available is massive.  And at every step where you give
them more control, you lose a little more control.

Do you REALLY want them creating tables?  This could result in more
bugs, more code problems, poor presentation, etc etc.

That aside, if they just want simple columns, I guess you could have a
process where the select how many columns, the widths, etc etc, then
supply the content.

Also, if they wanted tables to display spreadsheet style data, it's
possible someone has created a small program which munch's up a CSV file
(comma separated file, which can be exported from programs such as
Excel), and spits it out into a table.

It couldn't be *that* hard to make one from scratch either.


It depends on what they want to achieve by using tables.


Justin French


mikeyb wrote:
 
 I am completely stuck, and I am preying that someone will be able to help me.
 
 I have set up a php web form that allows one of my users to write columns for my 
site.  This works great, I do a search and replace to replace /n with br because 
they don't know much about html.  I have managed to get them into the habit of using 
bold, italics and underline tags, but now a few of them want to add tables and I have 
no idea how I can make this easy for them.
 
 Has anyone got any idea how I could allow them to do this, or perhaps know of a 
system that could be of some benefit, keeping in mind their minimal html expertise?
 
 Any help would be GREATLY appreciated.
 
 Peace

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




Re: [PHP] Copy *.*

2002-03-17 Thread jtjohnston

Windows :)
John

[EMAIL PROTECTED] wrote:

 At 17.03.2002  03:10, you wrote:
 
 Does anyone know of another snippet any place where I can copy *.*
 (files and all sub-directories) from one drive to another? In other
 words, a backing-up function. The snippet I got from
 http://www.php.net/manual/en/function.copy.php has been a disaster.
 
 John
 Which OS are you using ?

--
John Taylor-Johnston
-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




Re: [PHP] creating a dBase III file

2002-03-17 Thread Miles Thompson

Don,

Since you are creating this file, you can wrap your character fields in 
quotes. (Surely you can amend it to look after plumbing issues?) They're 
automatically stripped off in the APPEND FROM .. DELIMITED WITH 
delimited. Alternately you can use tabs to separate fields, tildes, 
almost anything.

Miles

At 06:32 PM 3/17/2002 -0500, you wrote:
Hi Miles,

Thanks for your response.  I was thinking of a way to create a comma
delimited file but my problem is that the data might contain commas.
Therefore, and CSV file I create from the data might be corrupted.
Unfortunately, I cannot alter the data in any way prior.

- Original Message -
From: Miles Thompson [EMAIL PROTECTED]
To: Don [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 2:59 PM
Subject: Re: [PHP] creating a dBase III file


  Don,
  Maybe you can get at it sideways: create a comma delimited file which the
  dBase app can import. Alternately, there are sites on the 'Net which give
  you file structures; dBase is pretty simple as all field are fixed length
  and you'd only have to make certain that you had the header properly
adjusted.
  Miles Thompson
 
  At 02:13 PM 3/17/2002 -0500, you wrote:
  Hi,
  
  I need to create a dBase III file however, my ISP does not have PHP
  compiled with --enable-debase.  Does any one have or know of a class that
  could accomplish this?
  
  Thanks,
  Don
 
 


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




[PHP] T_CONSTANT_ENCAPSED_STRING error

2002-03-17 Thread Patrick Teague

I'm receiving Parse error: parse error, expecting
`T_CONSTANT_ENCAPSED_STRING' in /host/plugged/index.php on line 3 error
when trying to require_once a couple of files.

top of index.php looks like so (line 3 is where I use $homeDir .
/common/header.php)
?php
require_once(homedir.php);
require_once($homeDir . /common/header.php);
?

contents of homedir.php is
?php
if (getenv(SERVER_ADDR) == 127.0.0.1)
{
 $homeDir = C:/home/plugged;
}else{
// $homeDir = dirname(__FILE__);
 $homeDir = /home/plugged;
}
?

As you can see I've tried 2 different things in the else statement, I've
even commented out the whole if statement leaving only the else statement 
it still bombs.  This works perfectly well on my test server  it seemed to
be working just fine a couple days ago.  Only thing that I can think of is
the fact that I added a couple other variables to homedir.php, but none have
anywhere near the same variable name as $homeDir.  I'm not even sure what
the T_CONSTANT_ENCAPSED_STRING error is  I'm guessing it's an error or else
why would it stop my page from loading?

Patrick



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




Re: [PHP] Moving server clock?

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, Leif K-Brooks wrote:
 Right now, I have a static server time clock on my page, produced by date().
 I would like to make it move, and I was wondering if anyone has code that
 returns the server time to javascript to animate it or something? 

Are you particularly concerned about super precision?

If not, why not just output the JavaScript via PHP with the server time in 
a variable, then you can have your JavaScript calculate the delta against 
client PC time, and output the current time on an ongoing basis from 
there.

miguel


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




Re: [PHP] Targetted redirection?

2002-03-17 Thread Michael P. Carel

is there any limitation with header function?im wondering why it not realy
working for me. it really gives me a headache.
i've done exactly what you've told us but  it does'nt work. i remove the
comment from the left.php or right.php and retain the index.ph as-is, but
still it doesnt jump out the frames.


 * index.php **

 ?php
#   This has no effect.
 #   header('Window-target: _top');
 ?

html
 headtitleindex page/title/head
 frameset COLS=120,*
 FRAME SRC=left.php name=menu scrolling=no
 frame src=right.php name=content
 /frameset
 /html


* left.php **
 ?php
 #   Turning this on will jump this page out of the frames.
 header('Window-target: _top');
?

 htmlheadtitlethe menu/title/headbody
 a href=right.php target=contentright/a
br /a href=right2.php target=contentright 2/a
/body/html

 * right.php **

 ?php
 #   Turning this on will jump this page out of the frames.
 header('Window-target: _top');
 ?

 HTMLHEADTITLERight/TITLE/HEADBODY
 Hi there. This is the main content page in the right frame.
/BODY/HTML


 * right2.php **

 ?php
 #  This has no effect.
 #  header('Window-target: _top');
 ?

 HTMLHEADTITLERight 2/TITLE/HEADBODY
 Hi there. This is the secondary content page in the right frame.
 /BODY/HTML



 Now, put all those files on your machine.  Hit index.php and you'll see
 everything normally.  Then, uncomment the header function in left.php or
 right.php and you'll see that page jump out of the frames.  But, turn
 the header on in index.php or index2.php and you'll still be in the
 frames.

 Enjoy,

 --Dan

 --
 PHP scripts that make your job easier
   http://www.analysisandsolutions.com/code/
  SQL Solution  |  Layout Solution  |  Form Solution
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

 --
 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] Brain Dead...

2002-03-17 Thread Chuck \PUP\ Payne

I am trying to get a form to work with pull down menu. But I am so brain
dead I forgot how to get the input from the pull down menu. Where do I put
input to pass on to php?

Chuck Payne


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




Re: [PHP] Brain Dead...

2002-03-17 Thread Thalis A. Kalfigopoulos

Dropdownmenu is a select name=ddmenuoption/select
So the php variable that will hold the user's choice is stored in variable $ddmenu.
Thus, no input needed.


cheers,
--thalis


On Sun, 17 Mar 2002, Chuck PUP Payne wrote:

 I am trying to get a form to work with pull down menu. But I am so brain
 dead I forgot how to get the input from the pull down menu. Where do I put
 input to pass on to php?
 
 Chuck Payne
 
 
 -- 
 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] Brain Dead...

2002-03-17 Thread Chuck Payne

Ok, but I have this as an example

select name=abc size=1
option value=a selectedA/option
option value=bB/option
option value=cC/option
option value=dD/option
   /select

Are you saying that abc should be $abc? I not clear.

I have for my sql as this...

db_name = xxxinks;

$table_name = ssslinks;

$connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die (Couldn't
connect);

$db = @mysql_select_db($db_name, $connection) or die (Couldn't select
database.);

$sql = INSERT INTO $table_name
  (abc, key_word, links, name)
   VALUES
  ('$abc', '$keywords', '$links', '$name');

$result = @mysql_query($sql, $connection) or die(Couldn't execute query.);

but I get that it can't do the query. So I am think it not passing abc...

Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:25 PM
Subject: Re: [PHP] Brain Dead...


 Dropdownmenu is a select name=ddmenuoption/select
 So the php variable that will hold the user's choice is stored in variable
$ddmenu.
 Thus, no input needed.


 cheers,
 --thalis


 On Sun, 17 Mar 2002, Chuck PUP Payne wrote:

  I am trying to get a form to work with pull down menu. But I am so brain
  dead I forgot how to get the input from the pull down menu. Where do I
put
  input to pass on to php?
 
  Chuck Payne
 
 
  --
  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] Brain Dead...

2002-03-17 Thread Thalis A. Kalfigopoulos

What does I get that it can't do the query mean? What error are you getting?


On Sun, 17 Mar 2002, Chuck Payne wrote:

 Ok, but I have this as an example
 
 select name=abc size=1
 option value=a selectedA/option
 option value=bB/option
 option value=cC/option
 option value=dD/option
/select
 
 Are you saying that abc should be $abc? I not clear.
 
 I have for my sql as this...
 
 db_name = xxxinks;
 
 $table_name = ssslinks;
 
 $connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die (Couldn't
 connect);
 
 $db = @mysql_select_db($db_name, $connection) or die (Couldn't select
 database.);
 
 $sql = INSERT INTO $table_name
   (abc, key_word, links, name)
VALUES
   ('$abc', '$keywords', '$links', '$name');
 
 $result = @mysql_query($sql, $connection) or die(Couldn't execute query.);
 
 but I get that it can't do the query. So I am think it not passing abc...
 
 Chuck
 - Original Message -
 From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
 To: Chuck PUP Payne [EMAIL PROTECTED]
 Cc: PHP General [EMAIL PROTECTED]
 Sent: Sunday, March 17, 2002 9:25 PM
 Subject: Re: [PHP] Brain Dead...
 
 
  Dropdownmenu is a select name=ddmenuoption/select
  So the php variable that will hold the user's choice is stored in variable
 $ddmenu.
  Thus, no input needed.
 
 
  cheers,
  --thalis
 
 
  On Sun, 17 Mar 2002, Chuck PUP Payne wrote:
 
   I am trying to get a form to work with pull down menu. But I am so brain
   dead I forgot how to get the input from the pull down menu. Where do I
 put
   input to pass on to php?
  
   Chuck Payne
  
  
   --
   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] Brain Dead...

2002-03-17 Thread Martin Towell

do other variables you pass to the script get set?
if not, do you have register_globals (or whatever it is) turned on?
maybe use $_GET or $_POST instead?

-Original Message-
From: Chuck Payne [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 1:36 PM
To: Thalis A. Kalfigopoulos
Cc: PHP General
Subject: Re: [PHP] Brain Dead...


Ok, but I have this as an example

select name=abc size=1
option value=a selectedA/option
option value=bB/option
option value=cC/option
option value=dD/option
   /select

Are you saying that abc should be $abc? I not clear.

I have for my sql as this...

db_name = xxxinks;

$table_name = ssslinks;

$connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die (Couldn't
connect);

$db = @mysql_select_db($db_name, $connection) or die (Couldn't select
database.);

$sql = INSERT INTO $table_name
  (abc, key_word, links, name)
   VALUES
  ('$abc', '$keywords', '$links', '$name');

$result = @mysql_query($sql, $connection) or die(Couldn't execute query.);

but I get that it can't do the query. So I am think it not passing abc...

Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:25 PM
Subject: Re: [PHP] Brain Dead...


 Dropdownmenu is a select name=ddmenuoption/select
 So the php variable that will hold the user's choice is stored in variable
$ddmenu.
 Thus, no input needed.


 cheers,
 --thalis


 On Sun, 17 Mar 2002, Chuck PUP Payne wrote:

  I am trying to get a form to work with pull down menu. But I am so brain
  dead I forgot how to get the input from the pull down menu. Where do I
put
  input to pass on to php?
 
  Chuck Payne
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 





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

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




Re: [PHP] Brain Dead...

2002-03-17 Thread Chuck Payne

When I go to post, I get the following alertCouldn't execute query so
I know I can connect, so it must be my SQL statement. That why I wondering
how to pass the menu information to php so that it can do the SQL statement.

I don't have $abc in the menu but I do have abc. So I am trying to find out
how to do that. Maybe I am going about it the wrong way.

Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:40 PM
Subject: Re: [PHP] Brain Dead...


 What does I get that it can't do the query mean? What error are you
getting?


 On Sun, 17 Mar 2002, Chuck Payne wrote:

  Ok, but I have this as an example
 
  select name=abc size=1
  option value=a selectedA/option
  option value=bB/option
  option value=cC/option
  option value=dD/option
 /select
 
  Are you saying that abc should be $abc? I not clear.
 
  I have for my sql as this...
 
  db_name = xxxinks;
 
  $table_name = ssslinks;
 
  $connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die
(Couldn't
  connect);
 
  $db = @mysql_select_db($db_name, $connection) or die (Couldn't select
  database.);
 
  $sql = INSERT INTO $table_name
(abc, key_word, links, name)
 VALUES
('$abc', '$keywords', '$links', '$name');
 
  $result = @mysql_query($sql, $connection) or die(Couldn't execute
query.);
 
  but I get that it can't do the query. So I am think it not passing
abc...
 
  Chuck
  - Original Message -
  From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
  To: Chuck PUP Payne [EMAIL PROTECTED]
  Cc: PHP General [EMAIL PROTECTED]
  Sent: Sunday, March 17, 2002 9:25 PM
  Subject: Re: [PHP] Brain Dead...
 
 
   Dropdownmenu is a select name=ddmenuoption/select
   So the php variable that will hold the user's choice is stored in
variable
  $ddmenu.
   Thus, no input needed.
  
  
   cheers,
   --thalis
  
  
   On Sun, 17 Mar 2002, Chuck PUP Payne wrote:
  
I am trying to get a form to work with pull down menu. But I am so
brain
dead I forgot how to get the input from the pull down menu. Where do
I
  put
input to pass on to php?
   
Chuck Payne
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
 
 


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





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




RE: [PHP] Brain Dead...

2002-03-17 Thread Martin Towell

Another thing you might want to try doing is throwing in phpinfo() somewhere
to see what variables you are actually getting

-Original Message-
From: Chuck Payne [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 1:44 PM
To: Thalis A. Kalfigopoulos
Cc: PHP General
Subject: Re: [PHP] Brain Dead...


When I go to post, I get the following alertCouldn't execute query so
I know I can connect, so it must be my SQL statement. That why I wondering
how to pass the menu information to php so that it can do the SQL statement.

I don't have $abc in the menu but I do have abc. So I am trying to find out
how to do that. Maybe I am going about it the wrong way.

Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:40 PM
Subject: Re: [PHP] Brain Dead...


 What does I get that it can't do the query mean? What error are you
getting?


 On Sun, 17 Mar 2002, Chuck Payne wrote:

  Ok, but I have this as an example
 
  select name=abc size=1
  option value=a selectedA/option
  option value=bB/option
  option value=cC/option
  option value=dD/option
 /select
 
  Are you saying that abc should be $abc? I not clear.
 
  I have for my sql as this...
 
  db_name = xxxinks;
 
  $table_name = ssslinks;
 
  $connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die
(Couldn't
  connect);
 
  $db = @mysql_select_db($db_name, $connection) or die (Couldn't select
  database.);
 
  $sql = INSERT INTO $table_name
(abc, key_word, links, name)
 VALUES
('$abc', '$keywords', '$links', '$name');
 
  $result = @mysql_query($sql, $connection) or die(Couldn't execute
query.);
 
  but I get that it can't do the query. So I am think it not passing
abc...
 
  Chuck
  - Original Message -
  From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
  To: Chuck PUP Payne [EMAIL PROTECTED]
  Cc: PHP General [EMAIL PROTECTED]
  Sent: Sunday, March 17, 2002 9:25 PM
  Subject: Re: [PHP] Brain Dead...
 
 
   Dropdownmenu is a select name=ddmenuoption/select
   So the php variable that will hold the user's choice is stored in
variable
  $ddmenu.
   Thus, no input needed.
  
  
   cheers,
   --thalis
  
  
   On Sun, 17 Mar 2002, Chuck PUP Payne wrote:
  
I am trying to get a form to work with pull down menu. But I am so
brain
dead I forgot how to get the input from the pull down menu. Where do
I
  put
input to pass on to php?
   
Chuck Payne
   
   
--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Invalid Argument ??? Not sure how to debug this (RESOLVED)

2002-03-17 Thread Daniel Negron/KBE


I guess I should have walked away then come back to it.  I was just trying
to get this code to work with little effort as possible.  I guess, I should
have done it right in the first place.  What I didn't realize is that I
mistakenly made

 $sql= SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'

I should have made $searchstring to $searchtype that resolved the initial
problem with the code.

Thank you Nathan.  I guess from now on I wont be trying to shortcut coding

Also thank you all for you assistance in this matter.



Thank You



Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com




   
 
Nathan   
 
etherwolf@sop   To: Daniel Negron/KBE 
[EMAIL PROTECTED]   
ris.net cc:   
 
 Subject: Re: Invalid Argument ???  Not 
sure how to debug this  
03/17/2002 
 
04:54 PM   
 
   
 
   
 




The simplest thing to do to narrow down the source of the problem is change
line 9 to read:

$result = mysql_query($sql,$db) or exit(mysql_error().BR.$sql);

This will halt the script before it even gets to line 12 and give you the
error MySQL had as well as
the query that was sent to the database. This is a very good practice for
the rest of your php code.

Your ...LIKE %searchstring%... bit with no $ will give you all rows
matching:
searchstring*

I take it that is not your intention... You probably need to change that
to:

...LIKE %.$searchstring.%...

Also, why are both your column name and desired value the same? Should you
be selecting WHERE
columnname LIKE %$searchstring%?

If you are still unsuccessful in resolving this, I'll help out however I
can.

Cheers,

# Nathan


- Original Message -
From: Daniel Negron/KBE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 1:38 AM
Subject: Invalid Argument ??? Not sure how to debug this


Hi all and Good Morning.

I have been struggling with this code:  I was wondering if someone could
lend me a hand.

I am working with this code and can't get the error to disappear.

After running I get
|-|

| Warning: Supplied argument is not a valid MySQL result resource in C:\My
Documents\My   |
| Webs\php\TMPibtpit3zq0.php on line 12
|
|-|



Line 12 happens to be the WHILE statement.  I am not sure if it is the
while statement or the results its looking for.

TIA  So far, i havent been able to sleep atleast until I get this.

html
?
if (isset($searchstring))
 {

 $db = mysql_connect(localhost,webuser,);
 mysql_select_db(cd_collection,$db);
 $sql= SELECT * FROM cd_list WHERE $searchstring LIKE '%searchstring%'
ORDER BY artist ASC;
 $result = mysql_query($sql,$db);
 echo TABLE BORDER=2;
 echo trtdbArtist/btdbTitle/btdbOptions/b/tr;
 while ($myrow = mysql_fetch_array($result))
 {
   echo trtd.$myrow[artist].td.$myrow[title];
   echo tda href=\edit.php?id=.$myrow[cd_id].
\View/a;
  }
  echo /TABLE;
 }
else
 {
  ?
  form method=POST action=? $PHP_SELF ?
  table border=2 cellspacing=2
  trtdInsert Your Search String Here./td
  tdSearch Type/td/tr
  tr
  tdinput type=text name=searchstring size=28/td
  tdselect size=1 name=searchtype
   option selected value=artistArtist/option
   option value=titleTitle/option
   option value=categoryCategory/option
  /select/td
  /tr
  /table
  pinput type = submit value=Submit name=B1
  input type=reset value=Reset/p
  /form
  ?
 }
 ?

 /html


**DAN**




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: 

Re: [PHP] Brain Dead...

2002-03-17 Thread Thalis A. Kalfigopoulos

Is it possible to check the Mysql log and tell us its point of view?


On Sun, 17 Mar 2002, Chuck Payne wrote:

 When I go to post, I get the following alertCouldn't execute query so
 I know I can connect, so it must be my SQL statement. That why I wondering
 how to pass the menu information to php so that it can do the SQL statement.
 
 I don't have $abc in the menu but I do have abc. So I am trying to find out
 how to do that. Maybe I am going about it the wrong way.
 
 Chuck
 - Original Message -
 From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
 To: Chuck Payne [EMAIL PROTECTED]
 Cc: PHP General [EMAIL PROTECTED]
 Sent: Sunday, March 17, 2002 9:40 PM
 Subject: Re: [PHP] Brain Dead...
 
 
  What does I get that it can't do the query mean? What error are you
 getting?
 
 
  On Sun, 17 Mar 2002, Chuck Payne wrote:
 
   Ok, but I have this as an example
  
   select name=abc size=1
   option value=a selectedA/option
   option value=bB/option
   option value=cC/option
   option value=dD/option
  /select
  
   Are you saying that abc should be $abc? I not clear.
  
   I have for my sql as this...
  
   db_name = xxxinks;
  
   $table_name = ssslinks;
  
   $connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die
 (Couldn't
   connect);
  
   $db = @mysql_select_db($db_name, $connection) or die (Couldn't select
   database.);
  
   $sql = INSERT INTO $table_name
 (abc, key_word, links, name)
  VALUES
 ('$abc', '$keywords', '$links', '$name');
  
   $result = @mysql_query($sql, $connection) or die(Couldn't execute
 query.);
  
   but I get that it can't do the query. So I am think it not passing
 abc...
  
   Chuck
   - Original Message -
   From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
   To: Chuck PUP Payne [EMAIL PROTECTED]
   Cc: PHP General [EMAIL PROTECTED]
   Sent: Sunday, March 17, 2002 9:25 PM
   Subject: Re: [PHP] Brain Dead...
  
  
Dropdownmenu is a select name=ddmenuoption/select
So the php variable that will hold the user's choice is stored in
 variable
   $ddmenu.
Thus, no input needed.
   
   
cheers,
--thalis
   
   
On Sun, 17 Mar 2002, Chuck PUP Payne wrote:
   
 I am trying to get a form to work with pull down menu. But I am so
 brain
 dead I forgot how to get the input from the pull down menu. Where do
 I
   put
 input to pass on to php?

 Chuck Payne


 --
 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Brain Dead...

2002-03-17 Thread Chuck Payne

I think it I am the right path now, it has to do with $_GET or $_POST not
passing the information on to mysql.

But I will look at the log shortly.

Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 10:00 PM
Subject: Re: [PHP] Brain Dead...


 Is it possible to check the Mysql log and tell us its point of view?


 On Sun, 17 Mar 2002, Chuck Payne wrote:

  When I go to post, I get the following alertCouldn't execute query
so
  I know I can connect, so it must be my SQL statement. That why I
wondering
  how to pass the menu information to php so that it can do the SQL
statement.
 
  I don't have $abc in the menu but I do have abc. So I am trying to find
out
  how to do that. Maybe I am going about it the wrong way.
 
  Chuck
  - Original Message -
  From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
  To: Chuck Payne [EMAIL PROTECTED]
  Cc: PHP General [EMAIL PROTECTED]
  Sent: Sunday, March 17, 2002 9:40 PM
  Subject: Re: [PHP] Brain Dead...
 
 
   What does I get that it can't do the query mean? What error are you
  getting?
  
  
   On Sun, 17 Mar 2002, Chuck Payne wrote:
  
Ok, but I have this as an example
   
select name=abc size=1
option value=a selectedA/option
option value=bB/option
option value=cC/option
option value=dD/option
   /select
   
Are you saying that abc should be $abc? I not clear.
   
I have for my sql as this...
   
db_name = xxxinks;
   
$table_name = ssslinks;
   
$connection = @mysql_connect(mybox.com,anyusers,!@#$%) or die
  (Couldn't
connect);
   
$db = @mysql_select_db($db_name, $connection) or die (Couldn't
select
database.);
   
$sql = INSERT INTO $table_name
  (abc, key_word, links, name)
   VALUES
  ('$abc', '$keywords', '$links', '$name');
   
$result = @mysql_query($sql, $connection) or die(Couldn't execute
  query.);
   
but I get that it can't do the query. So I am think it not passing
  abc...
   
Chuck
- Original Message -
From: Thalis A. Kalfigopoulos [EMAIL PROTECTED]
To: Chuck PUP Payne [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 9:25 PM
Subject: Re: [PHP] Brain Dead...
   
   
 Dropdownmenu is a select name=ddmenuoption/select
 So the php variable that will hold the user's choice is stored in
  variable
$ddmenu.
 Thus, no input needed.


 cheers,
 --thalis


 On Sun, 17 Mar 2002, Chuck PUP Payne wrote:

  I am trying to get a form to work with pull down menu. But I am
so
  brain
  dead I forgot how to get the input from the pull down menu.
Where do
  I
put
  input to pass on to php?
 
  Chuck Payne
 
 
  --
  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 General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





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




RE: [PHP] PHP CGI

2002-03-17 Thread Martin Towell

simple answer - yes and possibly
I believe, anything that's run on a server to output stuff to a browser, can
be considered a CGI program
The second question is like asking - Will COBOL ever become obsolete? -
maybe, possibly, but there'll, no doubt, be someone, somewhere still using
it.

-Original Message-
From: David Duong [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP CGI


Can PHP be considered CGI?

Would PHP replace Perl as the main language of CGI?



-- 
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] Having problems doing a binary upload. open_basedir problem?

2002-03-17 Thread Jack E. Ambrose

I'm attempting to get file uploads via a HTML form to work. I've been 
working on this for a couple of days, reading the PHP.net manual, and 
searching the newsgroups and various web sites. Haven't come up with a 
solution to my problem.

Basically I'm unable to upload any files to my web site. I don't have 
control over the server since my site is hosted. Here is the error messages 
I'm getting followed by the code.

** HTML output: **
User file: /tmp/phpEhNNmW
User filename: biglaugha.gif
User file size: 1370
User file type: image/gif

Testing short track var names.
$_FILES['userfile']['tmp_name']: /tmp/phpEhNNmW
$_FILES['userfile']['name']: biglaugha.gif

Warning: open_basedir restriction in effect. File is in wrong directory
in /usr/local/psa/home/vhosts/logicalsystem.com/httpdocs/up_load.php on
line 18 

Warning: Unable to create '/httpdocs/biglaugha.gif': No such file or
directory in
/usr/local/psa/home/vhosts/logicalsystem.com/httpdocs/up_load.php on
line 23 

Warning: Unable to move '/tmp/phpEhNNmW' to '/httpdocs/biglaugha.gif' in
/usr/local/psa/home/vhosts/logicalsystem.com/httpdocs/up_load.php on
line 23 
** end of output **


** HTML/PHP file containing the form **
!DOCTYPE html public -//W3C//DTD HTML 4.01 Transitional//EN
HTML
HEAD
TITLETest Upload/TITLE
/HEAD
BODY
FORM action=up_load.php method=post enctype=multipart/form-
data  
INPUT type=hidden name=MAX_FILE_SIZE value=10Send 
this file:  
INPUT name=userfile type=file 
INPUT type=submit value=Send File
/FORM
/BODY
/HTML
** end of file **

** PHP files that processes the submitted form(up_load.php) **
?php 
//Print some vars for debugging
print strongUser file:/strong $userfile;
print br;
print strongUser filename:/strong $userfile_name;
print br;
print strongUser file size/strong: $userfile_size;
print br;
print strongUser file type:/strong $userfile_type;
print br;
print brTesting short track var names.br;
print strong\$_FILES['userfile']['tmp_name']:/strong .$_FILES
['userfile']['tmp_name'];
print br;
print strong\$_FILES['userfile']['name']:/strong .$_FILES['userfile']
['name'];
print br;

// In PHP 4.1.0 or later, $_FILES should be used instead of 
$HTTP_POST_FILES.
//This code is a direct lift from the PHP.net site.
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) 
{
//made some changes to this line to reflect target directory.
//I also have another directory /httpdocs/tmp that has rwx for world.
//Same results
copy($HTTP_POST_FILES['userfile']['tmp_name'], /httpdocs/);
} else {
echo Possible file upload attack. Filename:  . $HTTP_POST_FILES
['userfile']['name'];
}
/* ...or... */
move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], /httpdocs/
$userfile_name);
?
** end of file **

** Some vars returned using phpinfo() **
safe_mode: On 
open_basedir: /usr/local/psa/home/vhosts/logicalsystem.com/httpdocs
upload_tmp_dir: /tmp

PHP is version 4.1.0

The end goal is to put the data into a database. I've used the fopen and 
fread functions with not success. I backed off and tried the example from 
the PHP.net manual and that doesn't work either. This appears to be a 
problem with safe mode and/or open_basedir being set. Is there a work 
around or something? 

Thanks!
Jack

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




Re: [PHP] Errormessages

2002-03-17 Thread Jason Wong

On Monday 18 March 2002 06:31, Markus Falk wrote:
 I run a script on my page that has worked fine before with 4.0.3 but now
 when my provider has upgraded to 4.1.2,  a bunch of error messages appear.
 I get some messages about variables not being defined just as if I can't
 send variables via the adressbar (/ ../index.php?$kat=0 for example. ) How
 come they suddenly appear as not being defined?
 I also get a lot of messages saying PHP Warning: Undefined offset: 1 in
 /home/f/falk/public_html/index.php on line 148
 What does it mean that I have an undefined offset?

 You can find all errormessages here http://www.acc.umu.se/~falk

Because in PHP 4.1.1+ the setting register_globals has been turned off by 
'default'. To access the variables passed through the URL you need to use 
$_GET[]. For your example above that would be $_GET['kat'].


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
When the English language gets in my way, I walk over it.
-- Billy Sunday
*/

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




[PHP] I need help building The CGI Open Source Foundry (COSF)

2002-03-17 Thread David Duong

I need some experienced people to become managers of the CGI Open Source
Foundry (COSF)?

I am planning to make a CGI Open Source Foundry

We will start in stages.

Stage 1 getting initial members (Hard Part)
- Once we gain 10-20 members we will start stage 2.

Stage 2 Dividing them into groups (members can be in multiple groups)
- Managers - Head(s) of the specific groups.
- GUI - Members with strong webdesigner skills
- Database
- File Wizards - Good with file manipulation
- Clean-up - Clean up the source
- General Developers
- Resource - Find servers to host this
- Marketers - Those who will distribute the scripts.
- Newbies/Learners
- Webmasters - See Stage 5

Stage 3 Finding/Creating a Groupware script that will allow us to all to
work on single or multiple scripts.

Stage 4 Decide what would be the perfect first project.  This project may be
an existing one in the makes with high potential, or something from scratch.
(Ten people on one script may sound crazy but I think it will work if we
planned it out.)

Stage 5 Making the main site.  The site will include a place to Release and
Plan all our scripts.  I have my eye on SourceForge.net as host.

After the first stages well start making other scripts that will be of use.



If your interested or have comments than your input would be appreciated.



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




[PHP] password protect off site file

2002-03-17 Thread Sean Karshis

Hello,

Is there any way to password protect a file for an include(); that is off
site?

Server A has a php script that has a call to a text file on server B, but to
get access I need the A user to enter a password  ID before they can take a
look at the file on B.

htaccess only works for images - not includes in php.

Any suggestions?

Thanks for any input,
Sean


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




Re: [PHP] PHP CGI

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, David Duong wrote:
 Can PHP be considered CGI?

Sometimes.

CGI is a standardized interface between web servers and backend 
applications. PHP can communicate with web servers using that mechanism, 
but it doesn't have to (depends on the web server in use).

I think the problem here is that you're not asking the question you think 
you're asking. Unfortunately, I'm not sure what you're really trying to 
figure out.

 Would PHP replace Perl as the main language of CGI?

Who knows? It might. Its use is growing rapidly, and it's much easier to 
learn. A few years ago the prospect would have been unthinkable, due to 
the vastly greater supply of Perl CGI web apps and free libraries in 
circulation. These days the advantage is not so strong. And PHP is far 
better optimized for the specific task of web application development.

On the other hand, Perl is in the abstract a more powerful language. So 
many programmers will continue to prefer it.

miguel


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




Re: [PHP] PHP CGI

2002-03-17 Thread David Duong

I mean any time you hear the word CGI it is rarely referring to PHP, always
Perl (My most comfortable Web language).  You'd think that CGI only refers
to Perl.

If you goto a site and download scripts under category CGI you would be
downloading Perl scripts, PHP has its own category.

Should CGI still mainly Perl even though PHP is somewhat easier, quicker
thus easier suited for CGI.

I think the meaning of CGI is quite blured.
Anyone else think so?


[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sun, 17 Mar 2002, David Duong wrote:
  Can PHP be considered CGI?

 Sometimes.

 CGI is a standardized interface between web servers and backend
 applications. PHP can communicate with web servers using that mechanism,
 but it doesn't have to (depends on the web server in use).

 I think the problem here is that you're not asking the question you think
 you're asking. Unfortunately, I'm not sure what you're really trying to
 figure out.

  Would PHP replace Perl as the main language of CGI?

 Who knows? It might. Its use is growing rapidly, and it's much easier to
 learn. A few years ago the prospect would have been unthinkable, due to
 the vastly greater supply of Perl CGI web apps and free libraries in
 circulation. These days the advantage is not so strong. And PHP is far
 better optimized for the specific task of web application development.

 On the other hand, Perl is in the abstract a more powerful language. So
 many programmers will continue to prefer it.

 miguel




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




RE: [PHP] PHP CGI

2002-03-17 Thread Martin Towell

I think the meaning of CGI is quite blured.
Anyone else think so?

I think the the meaning of CGI (Common Gateway Interface) has lost it's
meaning by a lot of people who just hear the acronym and not the full
phrase. It's like the term PC - when people hear that, they almost
straight away think IBM/IBM Compats, but, as all of you should know,
there's MANY other types of PC around the place, not just IBM/IBM Compats.
Same goes for CGI programs.


-Original Message-
From: David Duong [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 3:47 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP CGI


I mean any time you hear the word CGI it is rarely referring to PHP, always
Perl (My most comfortable Web language).  You'd think that CGI only refers
to Perl.

If you goto a site and download scripts under category CGI you would be
downloading Perl scripts, PHP has its own category.

Should CGI still mainly Perl even though PHP is somewhat easier, quicker
thus easier suited for CGI.

I think the meaning of CGI is quite blured.
Anyone else think so?


[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sun, 17 Mar 2002, David Duong wrote:
  Can PHP be considered CGI?

 Sometimes.

 CGI is a standardized interface between web servers and backend
 applications. PHP can communicate with web servers using that mechanism,
 but it doesn't have to (depends on the web server in use).

 I think the problem here is that you're not asking the question you think
 you're asking. Unfortunately, I'm not sure what you're really trying to
 figure out.

  Would PHP replace Perl as the main language of CGI?

 Who knows? It might. Its use is growing rapidly, and it's much easier to
 learn. A few years ago the prospect would have been unthinkable, due to
 the vastly greater supply of Perl CGI web apps and free libraries in
 circulation. These days the advantage is not so strong. And PHP is far
 better optimized for the specific task of web application development.

 On the other hand, Perl is in the abstract a more powerful language. So
 many programmers will continue to prefer it.

 miguel




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

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




Re: [PHP] PHP CGI

2002-03-17 Thread mnc

On Sun, 17 Mar 2002, David Duong wrote:
 I mean any time you hear the word CGI it is rarely referring to PHP, always
 Perl (My most comfortable Web language).  You'd think that CGI only refers
 to Perl.

Back in the day, CGI repositories had a greater representation of programs 
written in C and other hardcore languages. As web servers became more 
available, the center of gravity of CGI development moved toward more 
accessible languages, such as Perl (along with shell scripts, Python, TCL, 
etc.).

 If you goto a site and download scripts under category CGI you would be
 downloading Perl scripts, PHP has its own category.

One reason for this is that PHP is not necessarily CGI. The typical 
high-performance PHP installation is running as either a static or dynamic 
module linked into Apache through that web server's proprietary interface. 
For all these people, CGI has nothing to do with it.

In point of fact, many people also run Perl in similar fashions (such as 
mod_perl), in which case CGI is also out of the equation. But by the time 
this became common, Perl web development had already developed a strong 
connection to the term CGI.

 Should CGI still mainly Perl even though PHP is somewhat easier, quicker
 thus easier suited for CGI.

People should do their development any way they feel comfortable. 

Once again, though, you're confusing CGI, which is a specific interface, 
with server-side web application development in general.

 I think the meaning of CGI is quite blured.
 Anyone else think so?

Yes, the term is very often misused and has come to be misconstrued as 
referring to things that have nothing to do with CGI.

miguel


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




[PHP] $_SESSION / Windows doesn't work!?

2002-03-17 Thread Hiroshi Ayukawa


Hi,

I'm trying to use $_SESSION on Windows2000+PHP4.1.2 binary version.
But it seems that $_SESSION doesn't work, even in the simplest samples 
like;
--
?php 
session_start();
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
}
else {
$_SESSION['count']++;
}
print session_name().=.session_id().br.$_SESSION['count'];
?
a href='?=$PHP_SELF ?'!/a
---
session_id is set properly in this case.
Moreover, the old way of using session works, i.e. session_register(...) 
and so on.

Does anyone know about this trouble?

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

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




[PHP] empty lines cause http headers?

2002-03-17 Thread Michael Zornek

I'm writing a page that will do a little snooping into a db (based on a
previous form submit) and start a session based on the results.

The problem is that PHP seems to be sending the HTTP headers when it
encounters the first blank line in the code (which I do use to help separate
the code a bit).

Am I right in this assumption .. and then the big Q.. how do I do PHP
calculations and then specify a session without sending premature headers by
accident?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


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




Re: [PHP] empty lines cause http headers?

2002-03-17 Thread mnc

On Mon, 18 Mar 2002, Michael Zornek wrote:
 The problem is that PHP seems to be sending the HTTP headers when it
 encounters the first blank line in the code (which I do use to help separate
 the code a bit).
 
 Am I right in this assumption .. and then the big Q.. how do I do PHP
 calculations and then specify a session without sending premature headers by
 accident?

Just make sure the blank lines are ? inside php tags ?

If they're out in the raw HTML area, the headers will get packaged up and
the content output buffer collection will begin.

- - - - - - bad - - - - - -

?
   header('X-Site-Type: Fabulous');
   print 'That blank line gave me just the breathing room I needed.';
?

- - - - - - good - - - - - -
?

   header('X-Site-Type: Fabulous');
   print 'So did this one, but it won't stop my header from working.';

?
- - - - - - - - - - - -

miguel


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




[PHP] unscriber please

2002-03-17 Thread RoyD


Roy Daniel , ST
IT Developer System - PT BERCA COMPUTEL
My E-mail : [EMAIL PROTECTED]
and : [EMAIL PROTECTED] / [EMAIL PROTECTED]
My ICQNumber : # 103507581
My Phone Cell : 0816-1192832


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




Re: [PHP] empty lines cause http headers? [FIXED]

2002-03-17 Thread Michael Zornek

Twas 3/18/02 12:21 AM, when [EMAIL PROTECTED] [EMAIL PROTECTED] said:

 Just make sure the blank lines are ? inside php tags ?
 
 If they're out in the raw HTML area, the headers will get packaged up and
 the content output buffer collection will begin.

After some investigation I saw an extra space after the closing PHP ? tag
after an include call. No more error :-) .. not to say my script is working
as anticipated yet though .. hehe..

Thanks guys!

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


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




[PHP] pathname

2002-03-17 Thread jtjohnston

I need a function to traverse a pathname
to check if the path exists, if not start from scratch
and create (MkDir) the path.

Let's say:

$to_path = c:\\aaa\\bbb\\ccc\\ddd\\;
or
$to_path = c:/aaa/bbb/ccc/ddd/;

if(!is_dir($to_path))
{
#I need to explode by both \\ AND / to find out
mkdir($to_path, 0777);
}

How do I parse it and MkDir the path?

Thanks,
John


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




Re: [PHP] pathname

2002-03-17 Thread mnc

On Mon, 18 Mar 2002, jtjohnston wrote:
 I need a function to traverse a pathname
 to check if the path exists, if not start from scratch
 and create (MkDir) the path.
 
 Let's say:
 
 $to_path = c:\\aaa\\bbb\\ccc\\ddd\\;
 or
 $to_path = c:/aaa/bbb/ccc/ddd/;
 
 if(!is_dir($to_path))
 {
 #I need to explode by both \\ AND / to find out
 mkdir($to_path, 0777);
 }
 
 How do I parse it and MkDir the path?

1. Change all \\ to /
2. Explode the string on /
3. Loop $i from 1 to number of parts
3a. Implode $i elements from the exploded array on / to form a subpath
3b. Does that directory exist?
3c. If not, mk it
3d. Increment $i and go back to 3a
4. Presto, you're done

miguel


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




[PHP] NNTP Services

2002-03-17 Thread news.php.net

Hello everyone

I have a problem to post messages to newsgroups. How can i do it.

thanks
Muhammad Fawad



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




[PHP] rec_copy

2002-03-17 Thread jtjohnston

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

Thanks all! I needed to check if pathname exists:

if (!is_dir($to_path))
{
  echo Creating destination pathbr;
 create_path($to_path);
}

John Steele helped out with a few lines of code. I added a comment to
http://www.php.net/manual/en/function.copy.php

Here is the result:

?
###
$date = date (Ymd);

###
#$from_path = c:\\tmp\\cp\\from;
$from_path = c:/program files/easyphp/ccl_www;
$to_path = c:/tmp/cp/to/$date/ccl_www;

###
if (!is_dir($to_path))
{
  echo Creating destination pathbr;
 create_path($to_path);
}
###
if(!is_dir($from_path))
{
  echo failed;
  exit;
}
else
{
  rec_copy($from_path, $to_path);
  echo Files copied from $from_path and backed up to $to_path\n;
}

#

function rec_copy($from_path, $to_path)
{
  if (!is_dir($to_path))
#   create_path($to_path);
mkdir($to_path, 0777);

  $this_path = getcwd();

  if (is_dir($from_path))
  {
chdir($from_path);
$handle = opendir('.');

while (($file = readdir($handle)) !== false)
{
  if (($file != .)  ($file != ..))
  {
if (is_dir($file))
{
  rec_copy ($from_path.\\.$file,  $to_path.\\.$file);
  chdir($from_path);
}
if (is_file($file))
{
  copy($from_path.\\.$file, $to_path.\\.$file);
}
  }
}
closedir($handle);
  }
  else
  {
echo if (is_dir($from_path))br;
  }
}

function create_path($to_path)
{
$path_array = explode('/', $to_path);  // split the path by directories
/*
echo 'pre';// show everything in the $path_array variable
var_dump($path_array);
echo '/pre';
*/
$dir=''; // start with empty directory
foreach($path_array as $key = $val) {
  // echo $key = $valbr;
  if (!strpos($val, ':')) {  // if it's not a drive letter
$dir .= '/'. $val;
if (!is_dir($dir)) {
  // echo Not a dir: $dirbr;
  if (!mkdir($dir, 0777))
echo Failed creating directory: $dirbr;
  else
echo Created directory: $dirbr;
  }
}
  }
}
?


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