Re: [PHP] Problem with PHP as CGI

2001-05-23 Thread midget2000x

This is not an answer, but a further question on this subject.  Do you (or
anybody) know of a way to keep the path to PHP from showing up when the PHP CGI
script is hit via HTTP?

On Wed, 23 May 2001, Stuart J. Browne wrote:
 Richard Kurth [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
   I have php config as a cgi and I put this at the top of my script
 
   #!/usr/local/bin/php -q
 
   when ever I run this script at root in
   telnet I get this message below. 
  Error in argument 1, char 3: option not found
  Error in argument 1, char 3: option not found
 
 Code snippett would help, but it sounds as if the first line (after the
 hash-bang) is NOT ?.
 
 I've found that oddities occur without that as the first line of your
 script..
 
 bkx
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] running a stand-alone PHP program

2001-05-17 Thread midget2000x

OK, thanks.  This is great.  But will this affect my existing installation of
PHP?  excuse the newbie questions!

I appreciate your help.

Thanks,

Rory

On Wed, 16 May 2001, Nathan Cook wrote:
 Assuming you are running linux...
 
 Just remove the --with-apache, from the ./configure statement... should look
 something like this
 
 # ./configure [DIRECTIVES] [--with-mysql=/usr/local/mysql]
 # make
 # make install
 
 Should install to:
 # /usr/local/bin/php
 
 then you can run scripts by:
 # /usr/local/bin/php /path/to/script/scriptname
 
 Have Fun!
 Nathan Cook
 [EMAIL PROTECTED]
 - Original Message -
 From: midget2000x [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 16, 2001 2:52 PM
 Subject: RE: [PHP] running a stand-alone PHP program
 
 
  I suppose I need to be more clear.  I already have PHP running, but I want to
  run actual PHP code that I write as a stand-alone program.  Is this what
 you're
  doing?
 
  On Wed, 16 May 2001, you wrote:
   yeah.  i run it as a CGI.
  
   compile it as a binary, then edit the apache config...
  
   that's it
  
-Original Message-
From: midget2000x [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 4:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] running a stand-alone PHP program
   
   
I apologize if this has already been covered...I can't seem to find it in
 the
archives...
   
can PHP be coded and run as a stand-alone program?  If so, where can I get
 more
info on that?
   
I am running Linux and would like to pass some data to PHP from a
CGI program.
   
Thanks!
   
Rory
---
providing the finest in midget technology
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
   
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
  --
  ---
  providing the finest in midget technology
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
-- 
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] running a stand-alone PHP program

2001-05-17 Thread midget2000x

Excellent.  I got this working.  From a command line the standalone PHP
scripts work well, but if I hit them via http, it renders the path to PHP at the
top of the page (but does execute the code).  Any fix for that?

Thanks,

Rory

On Thu, 17 May 2001, Nathan Cook wrote:
 Not if you are currently running it as an apache module.  If you are running it
 as a cgi, then it might.  But it sounds as if you are running it as an apache
 module.
 
 Nathan Cook
 [EMAIL PROTECTED]
 - Original Message -
 From: midget2000x [EMAIL PROTECTED]
 To: Nathan Cook [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, May 17, 2001 10:38 AM
 Subject: Re: [PHP] running a stand-alone PHP program
 
 
  OK, thanks.  This is great.  But will this affect my existing installation of
  PHP?  excuse the newbie questions!
 
  I appreciate your help.
 
  Thanks,
 
  Rory
 
  On Wed, 16 May 2001, Nathan Cook wrote:
   Assuming you are running linux...
  
   Just remove the --with-apache, from the ./configure statement... should
 look
   something like this
  
   # ./configure [DIRECTIVES] [--with-mysql=/usr/local/mysql]
   # make
   # make install
  
   Should install to:
   # /usr/local/bin/php
  
   then you can run scripts by:
   # /usr/local/bin/php /path/to/script/scriptname
  
   Have Fun!
   Nathan Cook
   [EMAIL PROTECTED]
   - Original Message -
   From: midget2000x [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, May 16, 2001 2:52 PM
   Subject: RE: [PHP] running a stand-alone PHP program
  
  
I suppose I need to be more clear.  I already have PHP running, but I want
 to
run actual PHP code that I write as a stand-alone program.  Is this what
   you're
doing?
   
On Wed, 16 May 2001, you wrote:
 yeah.  i run it as a CGI.

 compile it as a binary, then edit the apache config...

 that's it

  -Original Message-
  From: midget2000x [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, May 16, 2001 4:18 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] running a stand-alone PHP program
 
 
  I apologize if this has already been covered...I can't seem to find it
 in
   the
  archives...
 
  can PHP be coded and run as a stand-alone program?  If so, where can I
 get
   more
  info on that?
 
  I am running Linux and would like to pass some data to PHP from a
  CGI program.
 
  Thanks!
 
  Rory
  ---
  providing the finest in midget technology
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
---
providing the finest in midget technology
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
   
   
  --
  ---
  providing the finest in midget technology
 
-- 
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] running a stand-alone PHP program

2001-05-17 Thread midget2000x

Yes, it has the path to PHP on the first line.  So there's no way to hide it? 
It doesn't show up when it's a perl script and it's the path to perl.  

On Thu, 17 May 2001, Nathan Cook wrote:
 Does your script happen to look like this?
 
 #!/usr/local/bin/php
 ?php
 
 If so then it is because of that magic line at the top the
 '#!/usr/local/bin/php'.  If you remove that you won't see the path anymore, but
 then the script won't be self executing:
 
 # ./script.php
 
 You will have to run them manually:
 
 # php script.php
 
 Nathan Cook
 [EMAIL PROTECTED]
 - Original Message -
 From: midget2000x [EMAIL PROTECTED]
 To: Nathan Cook [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Thursday, May 17, 2001 3:15 PM
 Subject: Re: [PHP] running a stand-alone PHP program
 
 
  Excellent.  I got this working.  From a command line the standalone PHP
  scripts work well, but if I hit them via http, it renders the path to PHP at
 the
  top of the page (but does execute the code).  Any fix for that?
 
  Thanks,
 
  Rory
 
  On Thu, 17 May 2001, Nathan Cook wrote:
   Not if you are currently running it as an apache module.  If you are running
 it
   as a cgi, then it might.  But it sounds as if you are running it as an
 apache
   module.
  
   Nathan Cook
   [EMAIL PROTECTED]
   - Original Message -
   From: midget2000x [EMAIL PROTECTED]
   To: Nathan Cook [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Thursday, May 17, 2001 10:38 AM
   Subject: Re: [PHP] running a stand-alone PHP program
  
  
OK, thanks.  This is great.  But will this affect my existing installation
 of
PHP?  excuse the newbie questions!
   
I appreciate your help.
   
Thanks,
   
Rory
   
On Wed, 16 May 2001, Nathan Cook wrote:
 Assuming you are running linux...

 Just remove the --with-apache, from the ./configure statement...
 should
   look
 something like this

 # ./configure [DIRECTIVES] [--with-mysql=/usr/local/mysql]
 # make
 # make install

 Should install to:
 # /usr/local/bin/php

 then you can run scripts by:
 # /usr/local/bin/php /path/to/script/scriptname

 Have Fun!
 Nathan Cook
 [EMAIL PROTECTED]
 - Original Message -
 From: midget2000x [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 16, 2001 2:52 PM
 Subject: RE: [PHP] running a stand-alone PHP program


  I suppose I need to be more clear.  I already have PHP running, but I
 want
   to
  run actual PHP code that I write as a stand-alone program.  Is this
 what
 you're
  doing?
 
  On Wed, 16 May 2001, you wrote:
   yeah.  i run it as a CGI.
  
   compile it as a binary, then edit the apache config...
  
   that's it
  
-Original Message-
From: midget2000x [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 4:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] running a stand-alone PHP program
   
   
I apologize if this has already been covered...I can't seem to
 find it
   in
 the
archives...
   
can PHP be coded and run as a stand-alone program?  If so, where
 can I
   get
 more
info on that?
   
I am running Linux and would like to pass some data to PHP from a
CGI program.
   
Thanks!
   
Rory
---
providing the finest in midget technology
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
   [EMAIL PROTECTED]
   
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
  --
  ---
  providing the finest in midget technology
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
--
---
providing the finest in midget technology
   
  --
  ---
  providing the finest in midget technology
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
---
providing the finest in midget technology

-- 
PHP General Mailing List (http

[PHP] running a stand-alone PHP program

2001-05-16 Thread midget2000x

I apologize if this has already been covered...I can't seem to find it in the
archives...

can PHP be coded and run as a stand-alone program?  If so, where can I get more
info on that?

I am running Linux and would like to pass some data to PHP from a
CGI program.

Thanks!

Rory
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] running a stand-alone PHP program

2001-05-16 Thread midget2000x

I suppose I need to be more clear.  I already have PHP running, but I want to
run actual PHP code that I write as a stand-alone program.  Is this what you're
doing?

On Wed, 16 May 2001, you wrote:
 yeah.  i run it as a CGI.
 
 compile it as a binary, then edit the apache config... 
 
 that's it
 
  -Original Message-
  From: midget2000x [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, May 16, 2001 4:18 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] running a stand-alone PHP program
  
  
  I apologize if this has already been covered...I can't seem to find it in the
  archives...
  
  can PHP be coded and run as a stand-alone program?  If so, where can I get more
  info on that?
  
  I am running Linux and would like to pass some data to PHP from a
  CGI program.
  
  Thanks!
  
  Rory
  ---
  providing the finest in midget technology
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] coding for 'no match found'

2001-05-15 Thread midget2000x

This is a simple yet fundamental programming question I am hoping somebody will
have the patience to explain...

I have a mysql database with the email field as the key.  Before inserting an
new record to it I want to check if there is already a record with that e-mail.
 This I can do fine.  But this script needs to also handle delete requests,
which I can also do fine, but I need to code for the instance that there is a
delete request for an e-mail record that does not exist.  How can I figure out
if after my 'while' loop is finished checking the database it has not found a
match (so i can inform the requester as such)?

Here's the code I have so far...

$email_check_query = SELECT email FROM $tablename WHERE email = 
'$email';
$email_check_result = mysql_query($email_check_query);
while($email_query_data = 
mysql_fetch_array($email_check_result)) { 
$db_email = $email_query_data[email];
//if match, it's an update or delete
if ($email==$db_email) {
if ($op==delete) {
$action=del;
echo delete requestbr;
} 
else {
$action = upd;
echo update requestbr;
}
} 
} //end while loop

 ---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] indexing records

2001-05-13 Thread midget2000x

What I want to do is figure out a way to index MySQL query results on my PHP
site that's not dependent on the id of each record.

I've got a MySQL photo database that runs my photo site.  Right now, the 'id'
field is a sequential, auto-incremented number, and I am using that id as an
index for the photos (because it was easy for me to grasp).

It works now because the groups are organized in order (for example all the
Iran pictures are sequential).  But 

 ---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] One database, different forms

2001-05-13 Thread midget2000x

I am writing a PHP application that will operate on a MySQL database.  There
will be 4 types of forms (like catalog request, info request, etc.) calling
the code which writes the data to the database.

Since the variable names on the forms will equal the MySQL column names (as they
should), I am wondering if there is a way for me to create my SQL statements on
the fly so that only data passed is written.  Otherwise I'll have to create 8
types of SQL statements...INSERT (if the record, keyed by e-mail address,
doesn't exist), and UPDATE (if the record does exist) for all 4 forms.

For example, on my add to mailing list form, only the e-mail address is
collected.  I'd like the PHP to recognize that only the 'email' field is passed
and create the SQL statement that only writes the e-mail to the database.

Any ideas greatly appreciated!

Thanks,

Rory

 --  ---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Forcing Case

2001-04-14 Thread midget2000x

Is there any way to force case...like if I have a string and want it to appear
in all lowercase (or uppercase, God forbid)?

Thanks,

Rory
 ---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] array output as a variable?

2001-04-12 Thread midget2000x

another newbie programmer question...
is it possible to output the results of an array loop into a variable, or
directly into an SQL call?

Obviously the code below is impossible, but illustrates what I want to do:

//declare the array
$info_request = array (1 = 
"firstname","lastname","email","howfound","optin","comments","request_type","request_bucket","date");
 

//output the array loop results to a variable
$array_results = foreach ($info_request As $value) { print "$value,"; }

//place the output variable into an SQL call (therefore making it
dynamic):

INSERT INTO $tablename ($array_results)
...

thanks!
---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Case-Sensitivity with PHP and MySQL

2001-04-11 Thread midget2000x


I am writing a PHP script that operates on a MySQL database that uses the
e-mail address as the primary key.  If the e-mail doesn't exist in the database
(when a form is submitted), I want to insert a new record.  If it does, I want
to update the existing record.  

How can I make the query that checks if the e-mail exists case-insensitive?  I
want to avoid users creating another record if they type in their e-mail in a
different case.

Thanks!

rory

 ---
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]