Re: [PHP-DB] error on post

2001-08-14 Thread Renze Munnik

On Mon, Aug 13, 2001 at 03:38:50PM -0700, John Telesh wrote:
 I have created a form which I cannot duplicate the error which is coming up
 only sometimes.  An affiliate to my client had received emails regarding the
 following error:
 
 The requested method POST is not allowed for the URL/index.html
 
 The page this is running on is called maxout.php and it is a post onto
 ?PHP_SELF?  I do not have a clue what is going on here.  Can anyone help,
 or have they seen this error before??
 
 Thanks,
 
 JT Telesh


Hai,

I've had this 'problem' to a few days ago. I know it wasn't anything
serious. I'm gonna look and try to find out what it was again.


-- 

* RzE:

-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
--
-- http://www.datalink.nl
-- 

-- 
PHP Database 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-DB] VERY strange erro

2001-08-14 Thread Markus Bertheau

Piotr Dubla wrote:
 Fatal error: Unsupported operand types in
 /usr/local/apache/htdocs/debit.php on line 51
 
 Now at line 51 there is a statement which says $day1 = $day1 - 1;

Hi,

look at line 50, maybe you forgot a ;.

bert

cenes data gmbh
berlin
germany
www.cenes.de


-- 
PHP Database 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-DB] Anyone used Pearson Corilations in PHP

2001-08-14 Thread Russ Michell

I'm not sure what the hell a Pearson Corilation is but it sounds 
statistical, so using Excel/Access should do the trick.

Use MyODBC from mysql.com to connect your local copy of access to your 
remote MySQL database. You can then export fron Access to Excel and do 
all sorts of analyses on your MySQL data.

HTH :-)

Russ

On Mon, 13 Aug 2001 18:31:48 + Robert Trembath 
[EMAIL PROTECTED] wrote:

 Good Afternoon Everyone,
 
 I am a fellow PHP developer that has run into a project where I need to 
 know if anyone has created anything like this.
 
 I need to do Pearson Corilations on Data from MySQL to do a top 10 
 match that compares DNA numerical image data(grayscale(0-255) and 
 creates an image based on that image data for each row of image data.
 
 Anyone done this before? Anything similar? Any comment are appreciated.
 
 Thanks,
 Robert -
 --- Robert Trembath
 [EMAIL PROTECTED]
 
 -- 
 PHP Database 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]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.com

#---#


-- 
PHP Database 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-DB] Re: NEXT - PREVIOUS coding

2001-08-14 Thread Boaz Amit

Hi,
what about other possibilities to do this ?

Tom

Other possibilities? Why not just utilize the second argument of the LIMIT function 
with a fairly simple SQL query?

Here's a portion of a script I wrote, modified to be an example on this matter:

?php

$articles_display_limit = 5; // set the number of articles to be displayed on each 
page

/*
$article_number sets the position in the database from which the current query results 
will begin from. $article_number is passed to the script as a GET method variable (i.e 
article.php?record_number=5)
*/

$articles = mysql_query(SELECT * FROM articles
 LIMIT $article_number,$articles_display_limit);

$next = $article_number + $articles_display_limit; // next page's starting point
$prev = $article_number - $articles_display_limit ; // previous page's starting 
point
$total_number_of_articles = mysql_num_rows(mysql_query(SELECT NULL FROM 
articles));

/* display this page's articles*/

 /* determine if a 'Previous' button is required */
if ($prev = 0) {
echo 'a href=article.php?article_number=' . $prev . 'Previous/a' . \n;
}

 /* determine if a 'Next' button is required */
if ($next  $total_number_of_articles) {
echo 'a href=article.php?article_number=' . $next . 'Next/a' . \n;
}

?

This should do the trick if I haven't modified too much.
There's a good but a bit messy article about it in PHPBuilder: 
http://phpbuilder.com/columns/rod2221.php3
The script is much more experienced and advanced than my own.

---
 regards,
  Boaz Amit


  Hello Pranot,
 
  On 16-Jul-01 06:09:33, you wrote:
 

  hi.. friends
  
  i have a database (mysql) in which their r many records. Through PHP i
want
   them to display on the page.
  
   Main requirement is that there should be a NEXT - PREVIOUS facility. So
if
   there r 20 records and suppose only 10 should show up on scren at a time,
   then a NEXT link should be visible which could show the remaining 10
   records.
  
   Their can be n no. of records.
  
  Maybe you would like to try this PHP class that does exactly what you are
  asking.
 
  http://phpclasses.UpperDesign.com/browse.html/package/130
 
 
  Regards,
  Manuel Lemos
 
  Web Programming Components using PHP Classes.
  Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
  --
  E-mail: [EMAIL PROTECTED]
  URL: http://www.mlemos.e-na.net/
  PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
  --
 





-- 
PHP Database 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-DB] [Q] MS-SQL Print Statements.....

2001-08-14 Thread Donovan J. Edye

G'Day,

My environment is as follows:

- MS-SQL 2k on Win32 box
- PHP 4.xx, TDS x.xx on Linux box

If I have the following stored procedure:

CREATE PROCEDURE MyProc AS
BEGIN
PRINT 'Hello World'
SELECT * FROM tblMyTable
END
GO

And I am using the mssq_* functions. How do I get to see any PRINT 
statements from the stored procedure.

TIA


-- Donovan
--
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems [www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': ...Uh Oh
--
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
--



RE: [PHP-DB] mail function

2001-08-14 Thread Tom Hodder



check that you have either specified

[mail function]
; For Win32 only.
SMTP = mail.myserver.com

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

or the sendmail path here;

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

otherwise mail cannot send mail at all.






-Original Message-
From: Travis Cannell [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2001 03:27
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mail function


hi all,

I cant seem to get my mail function to work. OK so i am a noob, that might
have something to do with it.  I am using a script I found called the HTML
Mime Mail Class, which does everything i need except actually send the mail.
I am guessing that there is some config problems, but i am not sure.  Even
when i try and use the mail() function i get a server error.  So i guess
that my problem is that my return address is messed up.  Does it have to  be
my own domain, or the domain that the server is running on?  Can i set the
return address as a hotmail account, or do i need my own server mail
program?  And is there anything that i need to config in the php.ini file?

Thanks for helping,

T P K Cannell



--
PHP Database 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 Database 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-DB] internal queries

2001-08-14 Thread Russ Michell

Hi crew:

I want to delete material from a database if it is older than say one 
month since its insertion. However I don't want to have to run a 
cron-job or something, as there must exist a way for a script to 
execute itself periodically or to have the MySQL database tell *itself* 
to execute a specific SQL query periodically.

I've heard it is possible to 'sink' a query into an Oracle DB itself 
instead of running something like a cron-job, so I'd like to hear from 
anyone who may have done this for MySQL or knows of an alternative 
method I can achieve my goal.

Many thnaks to you all in advance.
Russ


#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.com

#---#


-- 
PHP Database 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-DB] Re: Can PHP exclude % characters in external txt file?

2001-08-14 Thread Justin Buist

On Mon, 13 Aug 2001, Phillip Bow wrote:

 I can't think of a simple way to do it off of an include, but off the top of
 my head:
 ?php
 $file = file(data.txt);
 for($x=0; $xcount($file); $x++){
 $temp = str_replace(%, , $file[$x]);
 print $temp\n;
 }
 unset($file, $temp);
 ?
 --

Few things I think I should point out here.  The first being that
str_replace() will replace -every- percent sign in the line, not just the
one that occurs as the first character.

If you know for sure that the the first character is always a % and you
don't want to print it just use:

print substr($line, 1);
as the body of your for loop.

Secondly, you're callilng count() for every iteration of your for loop.
Might as well call it once, store the variable and save the computation
time of repeatdly calling it.

Thirdly, and this one is perhaps a bit anal retentive, PHP treats arrays
as dynamically growing linked lists.  So, when you call an array by it's
subscript the php engine starts at the head and walks X steps through the
list to get what you wanted.  If you don't plan on re-using the array,
It'd be better to do something like array_shift() to get values from it.

Perhaps something like this would work better:
 $file = file(data.txt);
 for($x=0; $xcount($file); $x++){
 $temp = str_replace(%, , $file[$x]);
 print $temp\n;
 }
 unset($file, $temp);
 ?

$file = file(data.txt);
$line = array_shift($file);
while ($line != NULL) {
print substr($line, 1);
$line = array_shift($file);
}
unset($file, $line);

Note:  I've never done file I/O w/ PHP... I'm just assuming that the
original post was correct there.


Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612


-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Hugh Bothwell


Schleipp [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi everybody,
 I have created a webpage with two frames. One of this frames is a form
 in which the user can change some data, which you can see in the other
 frame. I want the latter frame being updated as soon as I send the form,
 which is changing the data, i.e. a reload of the frame containing the
 changed data. However, I do not know how to realize that with PHP. Does
 anybody have a suggestion?

form action='evaluator.php' target='name_of_second_frame'
...
/form



-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Russ Michell

I just needed a similar thing to occur in my app!
Just reload the page using the header function:

Once submit has been hit in one frame, pass a hidden value from Frame1 
to frame2:

input type=\hidden\ name=\refresh\

Then detect for it in the 2nd frame and refresh the page using the 
header() function:

if (isset($refresh)) {
header(Location: $PHP_SELF);
}

HTH :-)

Russ


On Tue, 14 Aug 2001 10:54:59 -0400 Hugh Bothwell 
[EMAIL PROTECTED] wrote:

 
 Schleipp [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi everybody,
  I have created a webpage with two frames. One of this frames is a form
  in which the user can change some data, which you can see in the other
  frame. I want the latter frame being updated as soon as I send the 
 form,  which is changing the data, i.e. a reload of the frame 
 containing the  changed data. However, I do not know how to realize 
 that with PHP. Does  anybody have a suggestion?
 
 form action='evaluator.php' target='name_of_second_frame'
 ... /form
 
 
 
 -- 
 PHP Database 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]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.com

#---#


-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Hugh Bothwell

Russ Michell [EMAIL PROTECTED] wrote in message
news:SIMEON.10108141609.F@k1c. anglia.ac.uk...
 I just needed a similar thing to occur in my app!
 Just reload the page using the header function:

 Once submit has been hit in one frame, pass a hidden value from Frame1
 to frame2:

 input type=\hidden\ name=\refresh\

 Then detect for it in the 2nd frame and refresh the page using the
 header() function:

 if (isset($refresh)) {
 header(Location: $PHP_SELF);
 }

That seems like an (umm...) *unusual* method...

When the form is submitted, it calls the target
page - which then calls itself again?

I don't see what this gains you.



-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Russ Michell

 I don't see what this gains you.
Well you asked if there was a way to refresh your target frame once a 
submission was made from an origin frame. This method would do that. 

Then again, why does the second frame not already display the results 
of the submission?? As it get's called from the first (origin) frame.

Maybe you should re-state your problem and indicate use of DB's in 
there too, as I may easily have got the wrong end of someone else's 
stick.

Cheers.
Russ


On Tue, 14 Aug 2001 11:09:28 -0400 Hugh Bothwell 
[EMAIL PROTECTED] wrote:

 Russ Michell [EMAIL PROTECTED] wrote in message
 news:SIMEON.10108141609.F@k1c. anglia.ac.uk...
  I just needed a similar thing to occur in my app!
  Just reload the page using the header function:
 
  Once submit has been hit in one frame, pass a hidden value from Frame1
  to frame2:
 
  input type=\hidden\ name=\refresh\
 
  Then detect for it in the 2nd frame and refresh the page using the
  header() function:
 
  if (isset($refresh)) {
  header(Location: $PHP_SELF);
  }
 
 That seems like an (umm...) *unusual* method...
 
 When the form is submitted, it calls the target
 page - which then calls itself again?
 
 I don't see what this gains you.
 
 
 
 -- 
 PHP Database 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]
 

#---#

  Believe nothing - consider everything   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331

  www.theruss.com

#---#


-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Hugh Bothwell


Russ Michell [EMAIL PROTECTED] wrote in message
news:SIMEON.10108141754.G@k1c. anglia.ac.uk...
  I don't see what this gains you.
 Well you asked if there was a way to refresh your target frame once a
 submission was made from an origin frame. This method would do that.

The question was originally posed by Christian
Schliepp, [EMAIL PROTECTED] (not by me).


 Then again, why does the second frame not already display the results
 of the submission?? As it get's called from the first (origin) frame.

That was kinda my point.




-- 
PHP Database 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-DB] Re: reload page

2001-08-14 Thread Justin Buist

Actually... it's not a bad idea to refresh a page once it's been
submitted, even if that frame could be displaying the results with only
one hit.  We do it around here on quite a few things simply because it
prevents accidents from happening on the user's end.

If you redirect back to $PHP_SELF or $SCRIPT_NAME you clear out any
GET/POST variables.  If the user hit's refresh (for whatever reason) you
end up submitting a request that's already been executed once.

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Tue, 14 Aug 2001, Russ Michell wrote:

  I don't see what this gains you.
 Well you asked if there was a way to refresh your target frame once a
 submission was made from an origin frame. This method would do that.

 Then again, why does the second frame not already display the results
 of the submission?? As it get's called from the first (origin) frame.

 Maybe you should re-state your problem and indicate use of DB's in
 there too, as I may easily have got the wrong end of someone else's
 stick.

 Cheers.
 Russ


-- 
PHP Database 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-DB] Off the point here!

2001-08-14 Thread Scott Fletcher

Hi!  I got a configure error when trying to install PHP 4 on the AIX
machine.  As I looked around on the website and foudn that I would need to
have flex and bison installed.  So, I am looking for them and will download
them.  I have a question.

Is flex built into the bison?  Or is it a seperate software?

Thanks,
 Scott

P.S.  the php.general  php.version4 newsgroup is now closed!  Is there any
other newgroup that would host hte general questions?



-- 
PHP Database 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-DB] Oracle troubles with php 3.x

2001-08-14 Thread Leif Gripner


Have a working Oracle installation (8.0.5)

Have all my ORACLE_HOME/SID/BASE and so on corectly set up.

Configures apache
Configures php with --with-apache --with oracle . .. . . .. 
Works just good. Oracle are found and right version are found in the 
Configure output.

make and make install php and then make and make install apache. compiles 
just fine.

Doing a phpinfo(); showes OCI8 and NOTHING under ORACLE_HOME and libes 
used. SAme with the Oracle part.

User envirement (phpinfo();) I can read ORACLE_HOME/SID set to right values

STILL IT DONT WORK !  when i do get error reriving ora errors for and then 
different ORA-12545 and such

ga !

anyone able to help ?

 // LEIF



-- 
PHP Database 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-DB] mssql_connect() commandline problem

2001-08-14 Thread Richard Chauvaux

Sounds like you might be working with 2 different versions of php: 
Mod-php for Apache in the web environment, stand-alone php operating in 
the shell. You might want to start by ensuring that the stand alone 
version is compiled -with mssql. Try running phpinfo() in the shell?
Richard

Erik wrote:

 When running a (php 4.0.6) script (on redhat 6.1) using mssql_connect()
 directly on the shell with php -q script.php i get a fatal error:
 
 Call to undefined function:  mssql_connect()
 
 But this error does not occur when running the script through a browser
 (apache webserver)
 What's the deal here?
 
 Erik Kaber
 
 
 
 


-- 
PHP Database 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-DB] Re: Off the point here!

2001-08-14 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Scott Fletcher) wrote:

 P.S.  the php.general  php.version4 newsgroup is now closed!

No they're not.  I just accessed both lists (via news server) without 
difficulty.  Maybe something's funky with your newsreader config?

-- 
CC

-- 
PHP Database 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]




SV: [PHP-DB] mssql_connect() commandline problem

2001-08-14 Thread Erik

I wrote a script (? phpinfo(); ?) and executed it from the commandline
(php script.php  test.txt)
turns out text.txt doesnt have sybase support listed at all - which the
apache version of phpinfo has.
could this be the problem? and if so, how do i enable sybase support for the
commandline php?
or can i setup so i run the apache configured php from the commandline also?

thank you for your previous answer!


 Sounds like you might be working with 2 different versions of php:
 Mod-php for Apache in the web environment, stand-alone php operating in
 the shell. You might want to start by ensuring that the stand alone
 version is compiled -with mssql. Try running phpinfo() in the shell?
 Richard

 Erik wrote:

  When running a (php 4.0.6) script (on redhat 6.1) using mssql_connect()
  directly on the shell with php -q script.php i get a fatal error:
 
  Call to undefined function:  mssql_connect()
 
  But this error does not occur when running the script through a browser
  (apache webserver)
  What's the deal here?
 
  Erik Kaber
 
 
 
 




-- 
PHP Database 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-DB] Re: ODBC failed

2001-08-14 Thread Al

You are using phoneinfo both as a table name and a datasource name.
You *could* do that, but I don't think it's what you're trying for :)

Go back to your control panel and see what you named the ODBC you
created (datasource name, or DSN). You use that name for the first
parameter for your ODBC connection call, like so:

$odbc_dsn=my_odbc_dsn;
$odbc_uid=my_db_uid;
$odbc_pwd=my_db_pwd;
$sql=SELECT * FROM my_table;

$connection = odbc_connect ($odbc_dsn, $odbc_uid, $odbc_pwd) or die
(Can not connect to $odbc_dsn.);

$resultset  = odbc_exec ($connection, $sql) or die (Can not perform
query);

Note that $odbc_uid and $odbc_pwd can be blank (), providing your
database allows access via NT authentication *AND* you specified in
your ODBC DSN that you wish to use that type of authentication.
Otherwise, use a UID and password, and ensure they're in your ODBC DSN
too.

Caveat: I don't use MS Access -- I use MSSQL, but I'm pretty sure the
principles are the same for the two drivers.

On Thu, 26 Jul 2001 22:34:58 -0700 (PDT), [EMAIL PROTECTED] (Meng Yoke)
wrote:

Hi,

php 405
IIS 5.0 / W2K
MS Access 2000 

I had a simple script that will connect to MS Access
DB. I had created the DSN and it was tested ok on the
dos promopt.

When I tested using the IIS, it failed:

Warning: SQL error: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver
specified, SQL state IM002 in SQLConnect in
c:\inetpub\wwwroot\o2.php on line 3

Warning: Supplied argument is not a valid ODBC-Link
resource in c:\inetpub\wwwroot\o2.php on line 5


This is my script: 

?
$cx=odbc_connect (phoneinfo, , );

$cur=odbc_exec($cx,select * from phoneinfo);
?

any help appreciated?

thanks.

- yoke


=
===
   Yoke Meng Keong
   Email : [EMAIL PROTECTED] 
   eFax  : (253) 669-6578 (US)
===

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/


-- 
PHP Database 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-DB] ever send SMIME Encrypted mail from PHP4 Mail() to an OUTLOOK EXPRESS user?

2001-08-14 Thread Ken Sommers

hi,
has anyone ever sent SMIME Encrypted mail from a PHP4 script using the
Mail() function to an MS OUTLOOK EXPRESS user?
from a linux/apache/mysql/PHP4 Server?
I would like to be able to send Secure emails (from within my PHP scripts)
to the members of my site. After these members have gotten their FREE
Personal email cert from www.thawte.com.
anyone come across a tutorial or any docs on this?
thanks,

Ken



-- 
PHP Database 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-DB] Design/Permissions Question

2001-08-14 Thread o o

I'm relatively new to MySQL and am drawing up some ideas for writing a
support/trouble tracking database for my company. I envisioned a single
database with seperate tables for various data I would be storing
(IP/Connection info table, Machine Inventory Table, etc). Each table would
have data for all the clients, and each client would have their own login
(via web/php) to view their information. However, it doesn't seem that I can
restrict a given mysql user to access only those rows of data that are
relevant to their company. It seems that I can only restrict user access to
certain tables, which would seem that I would have to have a seperate table
per client/company. This doesn't seem to be an ideal way of storing the data
I would be collecting though. Is there some other means of restricting
access in the desired way or am I being too ambitious in my goals of having
the client data accessible via a per user/login basis? The other thought I
had was of setting cookie/session variable with the client id (unique) at
login. Then all requests for data would be validated since each row of data,
regardless of table, would have the client id as one of the keys. Would this
work or be too much overhead? Is there a better way of doing this? Thanks
for your time.

PS. If you could copy me on your replys that would be great as I am not
currently subscribed to the list.


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database 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-DB] Design/Permissions Question

2001-08-14 Thread Miles Thompson


First of all, search the web for a tutorial on basic SQL and database 
design. There are lots out there, and most are good. It's important to work 
through this stuff and get a handle on it. I believe there are good ones at 
DevShed and WebMonkey.

Secondly, this is really a MySQL question and properly belongs on the MySQL 
list.

Thirdly, you're on the right track. A unique key value for each client will 
ensure that they will see only their data, particularly if they never see 
that value on a web page. Session would be the way to go.

Fourthly, you don't want a set of tables for each client, but you've 
probably figured that out by now.

Fifthly, join the list! It's busy and informative.

Cheers - Miles

At 05:13 PM 8/14/01 -0700, o o wrote:
I'm relatively new to MySQL and am drawing up some ideas for writing a
support/trouble tracking database for my company. I envisioned a single
database with seperate tables for various data I would be storing
(IP/Connection info table, Machine Inventory Table, etc). Each table would
have data for all the clients, and each client would have their own login
(via web/php) to view their information. However, it doesn't seem that I can
restrict a given mysql user to access only those rows of data that are
relevant to their company. It seems that I can only restrict user access to
certain tables, which would seem that I would have to have a seperate table
per client/company. This doesn't seem to be an ideal way of storing the data
I would be collecting though. Is there some other means of restricting
access in the desired way or am I being too ambitious in my goals of having
the client data accessible via a per user/login basis? The other thought I
had was of setting cookie/session variable with the client id (unique) at
login. Then all requests for data would be validated since each row of data,
regardless of table, would have the client id as one of the keys. Would this
work or be too much overhead? Is there a better way of doing this? Thanks
for your time.

PS. If you could copy me on your replys that would be great as I am not
currently subscribed to the list.


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
PHP Database 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 Database 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: SV: [PHP-DB] mssql_connect() commandline problem

2001-08-14 Thread Richard Chauvaux

Erik,

Having only set up PHP once on Windoze and once with Apache on Linux, I 
would have to reference the installation docs on php.net. On Windoze, 
you edit the php.ini file-- maybe that's also true for the stand-alone 
on Linux?  You need the stand-alone version if you want to bypass the 
Apache server and work within the shell environment.

Richard

Erik wrote:

 I wrote a script (? phpinfo(); ?) and executed it from the commandline
 (php script.php  test.txt)
 turns out text.txt doesnt have sybase support listed at all - which the
 apache version of phpinfo has.
 could this be the problem? and if so, how do i enable sybase support for the
 commandline php?
 or can i setup so i run the apache configured php from the commandline also?
 
 thank you for your previous answer!
 
 
 Sounds like you might be working with 2 different versions of php:
 Mod-php for Apache in the web environment, stand-alone php operating in
 the shell. You might want to start by ensuring that the stand alone
 version is compiled -with mssql. Try running phpinfo() in the shell?
 Richard
 
 Erik wrote:
 
 When running a (php 4.0.6) script (on redhat 6.1) using mssql_connect()
 directly on the shell with php -q script.php i get a fatal error:
 
 Call to undefined function:  mssql_connect()
 
 But this error does not occur when running the script through a browser
 (apache webserver)
 What's the deal here?
 
 Erik Kaber
 
 
 
 


-- 
PHP Database 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-DB] Querying active directory from PHP

2001-08-14 Thread tony . mccrory

Has anyone done anything with Windows 2000 Active Directory from PHP? I'd
quite like to try this out but I haven't been able to get anything to work!

To begin with I'd like to query basic attributes like user name, phone
number, email address

Any info/pointers whatsoever would be appreciated!


Tony















IMPORTANT NOTICE  The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended
to be relied upon by any person without subsequent written confirmation of
its contents.  Furthermore, the content of this e-mail is the personal view
of the sender and does not represent the advice, views or opinion of our
company.  Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation.  In particular (but
not by way of limitation) our company disclaims all responsibility and
accepts no liability for any e-mails which are defamatory, offensive,
racist or in any other way are in breach of any third party's rights,
including breach of confidence, privacy or other rights.  If you have
received this e-mail message in error, please notify me immediately by
telephone.  Please also destroy and delete the message from your computer.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message is strictly
prohibited.  Trinity Mirror plc is the holding company for the Trinity
Mirror group of companies and is registered in England No. 82548, with its
address at Kingsfield Court, Chester Business Park, Chester CH4 9RE.


-- 
PHP Database 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-DB] includes and filenames

2001-08-14 Thread travis forden

Hi.

This is my setup. I have a PHP file that pulls in two includes - content and footer. 
content is done with readfile() since no processing done (in most cases). footer in 
done with include() - or will be once i find an answer to my question. 

currently the footer is exactly the same for each page. i want to add a dynamic link 
that uses the filename of the includer file.

in effect i want a function that will find the filename of the includer file and past 
it into a link.

something like this would appear in the include file.
$path = filename [this is a function or functions that find the filename of the file 
accessing the include file, footer.txt]
text text text A href=http://validator.w3.org/check?uri=.$pathtext/a

I want to tack the value of $path onto the end of the first part of the HREF.

How can I do this?

travis


-- 
PHP Database 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-DB] Querying active directory from PHP

2001-08-14 Thread Chris Hobbs

[EMAIL PROTECTED] wrote:

 Has anyone done anything with Windows 2000 Active Directory from PHP? I'd
 quite like to try this out but I haven't been able to get anything to work!

 To begin with I'd like to query basic attributes like user name, phone
 number, email address


Well, having never done this, and not being anything close to an expert in
Active Directory (is your confidence soaring yet?), I'd suggest you'll probably
be able to treat it like any other LDAP server, and query it through php's LDAP
toools. Perhaps posting to the general php list would garner some further
responses.


 IMPORTANT NOTICE  The information in this e-mail is confidential

rant mode=on
Not to pick solely on you, but I find these types of notices very humorous when
sent to public mailing lists - it seems like the very act of attaching them to
what are essentially public notices would dilute their usefulness if you ever
wanted to sue someone over reposting truly confidiential info (include
'IANAL.php';).

I'm assuming your employer's mail server attaches these to every outbound
message from your company, but perhaps there'd be a way for your postmaster to
make it a little less brain-dead by not attaching it to mail sent to certain
addresses, namely _any_ public mailing list.
/rant

I feel better

Chris Hobbs
Silver Valley Unified School District

--- The views expressed herein do not necessarily reflect the views of my
employer...
 but they should!


-- 
PHP Database 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-DB] Session variables

2001-08-14 Thread CK Raju

I have compiled php-4.0.6 from source with --enable-track-vars and
--enable-trans-sid options (--with-mysql and --with-apxs).

I use RH7.1 and mysql-3.23.41.

In my /usr/local/test/connect.inc I use the following code
?php
  $login = $HTTP_SESSION_VARS[login];
$passwd = $HTTP_SESSION_VARS[passwd];
$hostlink = msyql_connect(xxx, $login, $passwd) or die ---

$dblink =  mysql_select_db (yyy, $hostlink);
?

This file is invoked in all my script files. (The system works without
session variables.)

In my login file (main.html) I do a
?php
session_start();
session_register(login);
session_register(passwd);
print (form action=login.html method=POST);

print(input type=text name=login size=20input type=password
name=passwd size=20);
print (input type=submit value=login);
print(/form);
?
--

In my login.html script file I start the links to other database
utilities, where the /usr/local/test/connect.inc file is invoked.

When I run main.html, I get the following error message :
Warning : Cannot send session cookie - headers already sent by (output
started at /var/www/html/main.html: 10) in /var/www/html/main.html on
line 11

Warning : Cannot send session cache limiter - headers already sent
(output (- etc etc like the one earlier))

(These are the lines containing session_start(); and
session_register(login); in the main.html file)

In my phpinfo(), I find that
session.auto_start=ON
session.cookie_limiter i=nocache
session.cache_expire=180
session.save_path=/tmp
session.serialize_handler=php

Where could I be wrong ?

Raju



-- 
PHP Database 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-DB] Session variables

2001-08-14 Thread Jason Wong

 When I run main.html, I get the following error message :
 Warning : Cannot send session cookie - headers already sent by (output
 started at /var/www/html/main.html: 10) in /var/www/html/main.html on
 line 11

 Where could I be wrong ?

 Raju

You must make sure that in pages where you use cookies that you do not have
any 'output' before the point where your cookies are set. Output includes
whitespace and blank lines.

Thus:

--- - beginning of file
?
   session_start();
   ...
   ...
?

would be fine. But:


--- - beginning of file

?
   session_start();
   ...
   ...
?

would not work because there is a blank line between the beginning of the
file and the place where you actually set the cookie -- session_start();.

This of course applies to any included files as well.

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




-- 
PHP Database 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]