[PHP] php NEWBIE Question

2003-08-25 Thread Dennis Dujan - Partycult.de
Hi,
can you tell me how is it possible to connect to a linux shell via PHP?
 
Greetz
Dennis


[PHP] mail() question

2003-08-25 Thread Matthias Wulkow

Hi php-general,

I have followig error reported:

Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 235

What is the trouble here?  If I would have trouble because of
delivery, normally mail would return false. But here...

I have php4.3.1 running on linux. I just installed postfix to have the
sendmail binary at the right place.

Thx for help

SvT

-- 
Who is the ennemy?

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



Re: [PHP] script not terminating on user abort

2003-08-25 Thread Curt Zirzow
* Thus wrote Dennis Jacobfeuerborn ([EMAIL PROTECTED]):
 Hi!
 The connection_* function don't seem to work for me and I can no longer
 determine when the user has aborted the script. When I close the browser
 window the script just keeps running. (see bug #23163)
 
 The body of the script essentially looks like this:
 
 while( !$done ) {
   $con-sendMessage(x); # Send msg to Jabber server
   sleep(1);
 }
 
 I made an interesting and somewhat weird observation though:
 If I use the print or echo command in the while-loop once (!) then the
 script will terminate after the loop has run *exactly* three times after
 the abort.
 
 If I put more than one print/echo in the loop (2-inf) then the script
 will terminate after *exactly* 2 (!) iterations of the loop after the
 script has aborted.
 
how is it your knowing the number of times it is going through the
loop when the conneciton is aborted? If you know that the
connection is aborted why isn't it breaking out of the loop? Do you
have some code that can show this?



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] php NEWBIE Question

2003-08-25 Thread Curt Zirzow
* Thus wrote Dennis Dujan - Partycult.de ([EMAIL PROTECTED]):
 Hi,
 can you tell me how is it possible to connect to a linux shell via PHP?

Ok, i suppose I should reply to this before you ask the same
question with less details, again.

Please be a little more specific in your question, like what you
are trying to achieve.  Otherwise we will be just trying to guess
at what you want to do, and most likley guess wrong.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] mail() question

2003-08-25 Thread Curt Zirzow
* Thus wrote Matthias Wulkow ([EMAIL PROTECTED]):
 
 Hi php-general,
 
 I have followig error reported:
 
 Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 
 235
 
 What is the trouble here?  If I would have trouble because of
 delivery, normally mail would return false. But here...

mail() wasn't compiled into php.

 
 I have php4.3.1 running on linux. I just installed postfix to have the
 sendmail binary at the right place.

You'll have to recompile php. the first time you compiled it php it
couldnt find sendmail, so it left it out in the binary.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Giz
Access is a pc database.  It doesn't run on unix.  Why people insist on
beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every day.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 24, 2003 11:55 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Reading an MS Access Database file on *NIX platform using PHP

I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site by
FTP'ing 
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I believe),
so
this means COM functions aren't available. ODBC was my next thought, but
I've
never used it, and there are a few things I don't understand. Setting up a 
DSN is one of them -- apparently this isn't as simple as constructing a
string,
and all the tutorials I can find seem to involve going into a Windows
control
panel and making a setting. This of course will not be possible, since there
are no windows control panels on FreeBSD.

In short: can anyone offer any quick tips on how to use the odbc database
functions or PEAR::DB to query data from an MS Access file sitting on a UNIX
box?

Thanks,
Weston

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



AW: [PHP] php NEWBIE Question

2003-08-25 Thread Dennis Dujan - Partycult.de
Iam currently writing some Scripts in PHP for a Webappliance.
And now I have the problem that I have to connect with
a PHP Script to a Shell that is located on another Server.
But I don't know how to do this... :-/
Perhaps you can help me with an example or a Page with a Tutorial.

Greetz
Dennis

-Ursprungliche Nachricht-
Von: Curt Zirzow [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 25. August 2003 01:22
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] php NEWBIE Question

* Thus wrote Dennis Dujan - Partycult.de ([EMAIL PROTECTED]):
 Hi,
 can you tell me how is it possible to connect to a linux shell via PHP?

Ok, i suppose I should reply to this before you ask the same
question with less details, again.

Please be a little more specific in your question, like what you
are trying to achieve.  Otherwise we will be just trying to guess
at what you want to do, and most likley guess wrong.

Curt
--
I used to think I was indecisive, but now I'm not so sure.

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

2003-08-25 Thread Dennis Dujan - Partycult.de
Ok thank you very much

-Ursprungliche Nachricht-
Von: Chris Kay [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 25. August 2003 01:37
An: 'Dennis Dujan - Partycult.de'
Betreff: RE: [PHP] php NEWBIE Question


Try http://au.php.net/manual/en/function.fsockopen.php

If your looking for a tutorial, goto google and search for telnet with
php

--
Chris Kay (CK)
Eleet Internet Services
M: 0415 451 372
P: 02 4620 5076
F: 02 4620 7008
E: [EMAIL PROTECTED]

-Original Message-
From: Dennis Dujan - Partycult.de [mailto:[EMAIL PROTECTED]
Sent: Monday, 25 August 2003 9:34 AM
To: [EMAIL PROTECTED]
Subject: AW: [PHP] php NEWBIE Question

Iam currently writing some Scripts in PHP for a Webappliance.
And now I have the problem that I have to connect with
a PHP Script to a Shell that is located on another Server.
But I don't know how to do this... :-/
Perhaps you can help me with an example or a Page with a Tutorial.

Greetz
Dennis

-Ursprungliche Nachricht-
Von: Curt Zirzow [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 25. August 2003 01:22
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] php NEWBIE Question

* Thus wrote Dennis Dujan - Partycult.de ([EMAIL PROTECTED]):
 Hi,
 can you tell me how is it possible to connect to a linux shell via
PHP?

Ok, i suppose I should reply to this before you ask the same
question with less details, again.

Please be a little more specific in your question, like what you
are trying to achieve.  Otherwise we will be just trying to guess
at what you want to do, and most likley guess wrong.

Curt
--
I used to think I was indecisive, but now I'm not so sure.

--
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] Using PHP on an .html file

2003-08-25 Thread Mike Migurski
 Better to do this in an .htaccess file, so you don't incur PHP
 processing overhead on the entire server (if there are others using
 it).

Apache suggests not using .htaccess files at all because they require a
recursive traversing of directories looking for .htaccess files, because
some supersede others or something like that.

The only way to eliminate the overhead of searching for .htaccess files is
to set the Allowoverride directive to 'None' in your httpd.conf file -
otherwise, they will be checked for on every request whether they exist or
not. The question is: does the additional benefit of using per-directory
configuration and selective .html-as-.php handling outweigh the speed gain
of not looking for .htaccess files? This depends on the server, how it's
used, and how important raw performance is vs. ease of use.

Just to quickly return to the original question, I would not use either
method - instead I would turn multiviews on, and not use file extensions
in URL's at all.

http://httpd.apache.org/docs/content-negotiation.html

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] mail() question

2003-08-25 Thread Matthias Wulkow
Hallo Curt,

am Montag, 25. August 2003 um 01:35 hast Du Folgendes gekritzelt:

 I have followig error reported:
 
 Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on line 
 235
 
 What is the trouble here?  If I would have trouble because of
 delivery, normally mail would return false. But here...

CZ mail() wasn't compiled into php.

 
 I have php4.3.1 running on linux. I just installed postfix to have the
 sendmail binary at the right place.

CZ You'll have to recompile php. the first time you compiled it php it
CZ couldnt find sendmail, so it left it out in the binary.

Well, that makes sense to me. But I just recompiled the same way I did
it first time (config.nice), but I still get the same error reported.
I looked in ./configure --help to see if there are specific arguments
I need to add, but couldn't find any... and this time sendmail is
there (/usr/sbin/sendmail).

What's wrong?

Thx

SvT


-- 
Who is the ennemy?

mailto:[EMAIL PROTECTED]

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote Giz ([EMAIL PROTECTED]):
 Access is a pc database.  It doesn't run on unix.  Why people insist on
 beating their heads against the wall in this manner I will never know.
 Ignorance I suppose.  The alternative is to have your friend use a
 relational database and have a few simple forms that will allow him to
 insert/update/delete.  Best of both worlds, and the open source/free
 databases mysql/postgresql are used on thousands of websites every day.

First off, Access has nothing to do with a pc, it is the
communication layer that causes the problem. And the only drivers
available for this layer are for MS Windows. 

PC !=  MS Windows

Second, Not every solution can be solved by plopping a
mysql/postregsql database server somewhere and use it. There are
multiple reasons why people choose one database over the other,
like costs, familiarity, and quickness of results.

MS Access is used on thousands of websites every day too.




Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Paul Fitzpatrick


* Thus wrote Giz ([EMAIL PROTECTED]):
 Access is a pc database.  It doesn't run on unix.  Why people insist
on
 beating their heads against the wall in this manner I will never know.
 Ignorance I suppose.  The alternative is to have your friend use a
 relational database and have a few simple forms that will allow him to
 insert/update/delete.  Best of both worlds, and the open source/free
 databases mysql/postgresql are used on thousands of websites every
day.


Programmers often get their heads banged against a wall 'by' clients.

I recently had to go through the whole issue of trying to use a client's
favorite Access DB on a Linux server with no success.  I tried
convincing him to switch to MySQL etc. but of course he wanted to stay
with what he knew.

Maybe try for some MSSQL capable hosting with this job, PEAR and ADODB
are great for ODBC, the only issue is setting up an ACCESS DSN, which
can't be done on a Unix box at this time.  I have heard of tricky
windows/linux bridging techniques though, but what ISP is going to set
up an extra windows box for one Access db?

Cheers,
Paul

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



Re: [PHP] mail() question

2003-08-25 Thread Stevie D Peele
What is on line 235?? That would help us -


SDP


On Mon, 25 Aug 2003 01:09:29 +0200 Matthias Wulkow [EMAIL PROTECTED]
writes:
 
 Hi php-general,
 
 I have followig error reported:
 
 Fatal error: Call to undefined function: mail() in 
 /usr/local/www/login.php on line 235
 
 What is the trouble here?  If I would have trouble because of
 delivery, normally mail would return false. But here...
 
 I have php4.3.1 running on linux. I just installed postfix to have 
 the
 sendmail binary at the right place.
 
 Thx for help
 
 SvT
 
 -- 
 Who is the ennemy?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

Re: [PHP] Reading an MS Access Database file on *NIX platform usingPHP

2003-08-25 Thread [EMAIL PROTECTED]
Hi,

The simplest way i know of to use access from linux is to use mdbtools 
(a free download at sourceforge). Haven't tried to invoke this from PHP 
but it would not be all that difficult to create a MDB module.



Curt Zirzow wrote:

* Thus wrote Giz ([EMAIL PROTECTED]):
 

Access is a pc database.  It doesn't run on unix.  Why people insist on
beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every day.
   

First off, Access has nothing to do with a pc, it is the
communication layer that causes the problem. And the only drivers
available for this layer are for MS Windows. 

PC !=  MS Windows

Second, Not every solution can be solved by plopping a
mysql/postregsql database server somewhere and use it. There are
multiple reasons why people choose one database over the other,
like costs, familiarity, and quickness of results.
MS Access is used on thousands of websites every day too.



Curt
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading an MS Access Database file on *NIX platform usingPHP

2003-08-25 Thread [EMAIL PROTECTED]
Hi,

One of these ' tricky' windows linux bridging techniques is with JDBC. 
But that only works for sql server and not for access. This works like a 
dream if you are on J2EE. can be used with php as well if you don't mind 
mixing java and php classed. I have also had success with 'ODBC socket 
server' they renamed themselves and i am not sure of the new name though.

It wouldn't matter so much if people wanted to use ms SQL server instead 
they alsays insist on access :-((



Paul Fitzpatrick wrote:

* Thus wrote Giz ([EMAIL PROTECTED]):
 

Access is a pc database.  It doesn't run on unix.  Why people insist
   

on
 

beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every
   

day.

Programmers often get their heads banged against a wall 'by' clients.

I recently had to go through the whole issue of trying to use a client's
favorite Access DB on a Linux server with no success.  I tried
convincing him to switch to MySQL etc. but of course he wanted to stay
with what he knew.
Maybe try for some MSSQL capable hosting with this job, PEAR and ADODB
are great for ODBC, the only issue is setting up an ACCESS DSN, which
can't be done on a Unix box at this time.  I have heard of tricky
windows/linux bridging techniques though, but what ISP is going to set
up an extra windows box for one Access db?
Cheers,
Paul
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote David Otton ([EMAIL PROTECTED]):
 On Sun, 24 Aug 2003 14:54:41 -0400 (EDT), you wrote:
 
 I'm building a small web application for a friend using PHP. He'd like to
 use MS Access to keep the data in, and update the data on the site by FTP'ing 
 
 Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
 driver, and use Access as a front-end onto that data (Access makes a good
 front-end for manipulating other databases). I've done this with SQL Server,
 but it should be possible with anything that can talk ODBC.

I would  also suggest this. Basically you create a MS Access on his
computer and link (with odbc) mysql tables into the MS Access.

The only problem I forsee is granting remote access to the server.
Seeing that this is on a verio machine, I doubt they'll allow
access remotely. Perhaps there is a chance if your friend has a
static ip.

 Either that or export the data from Access in a readable format, and import
 it at the other end.

Yep, and this would be my alternative :)  Using CSV files of
course!


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Hi,
 
 The simplest way i know of to use access from linux is to use mdbtools 
 (a free download at sourceforge). Haven't tried to invoke this from PHP 
 but it would not be all that difficult to create a MDB module.
 
yeah, I saw a reference to that with some google searches.  Also
some references of using 'wine' but that seemed to be a little
overkill just to communicate with ms access.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] mail() question

2003-08-25 Thread Alister
 On Mon, 25 Aug 2003 01:09:29 +0200 Matthias Wulkow [EMAIL PROTECTED]
 writes:
  
  Hi php-general,
  I have followig error reported:
  
  Fatal error: Call to undefined function: mail() in 
  /usr/local/www/login.php on line 235
  What is the trouble here?  If I would have trouble because of
  delivery, normally mail would return false. But here...

  I have php4.3.1 running on linux. I just installed postfix to have 
  the
  sendmail binary at the right place.

Did you install postfix _after_ PHP?  Did you have a sendmail binary in
place before you configured PHP?  If it's not there are configure time,
it won't even compile the 'mail' function.

I've had the same problem before - now that PHP can recognise it's got a
way to send email, re-running ./configure / make / make install should
work.  It did for me.

Alister

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Weston Cann
On Sunday, August 24, 2003, at 05:31 PM, Giz wrote:

Access is a pc database.  It doesn't run on unix.  Why people insist on
beating their heads against the wall in this manner I will never know.
Ignorance I suppose.  The alternative is to have your friend use a
relational database and have a few simple forms that will allow him to
insert/update/delete.  Best of both worlds, and the open source/free
databases mysql/postgresql are used on thousands of websites every day.
I share a low regard for Access, and I've got a set of standard 
forms/code I use to set up a nice interface to MySQL, and I showed it to 
my friend. He likes that, but there's a problem:

He wants to be able to make changes offline, and then sync up.

This isn't an uncommon desire... I've run into people wanting to do this 
before (with Excel spreadsheets, no less).  And in fact, it's probably 
the most convenient way of doing things, as long as they're warned about 
certain dangers (overwrites from competing unsynced database files).  
There's a certain cumbersome nature about web forms and the time delay 
involved in HTTP transactions.

So anyway, that's the motivation for using Access here.

David Otton [EMAIL PROTECTED] wrote:

Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
driver, and use Access as a front-end onto that data (Access makes a 
good
front-end for manipulating other databases). I've done this with SQL 
Server,
but it should be possible with anything that can talk ODBC.

He gets the interface he's used to, you get a database that can run 
under
BSD. Of course, changes will be reflected in the site in real-time, 
which
may be a good thing or a bad thing.

Either that or export the data from Access in a readable format, and 
import
it at the other end.
These ideas might work better; especially the latter. If COM doesn't 
work under UNIX and ODBC can only talk to FoxPro, Access, and other 
document (rather than server) oriented databases with the help of some 
special Win32 control panel/dll, then it would seem that the only way to 
do offline updates that are then synced would be exporting from Access 
in some standard format.

But it seems somewhat odd to me that there aren't any UNIXy (PHP, Perl, 
something) for parsing Access files. I know there's a few CPAN 
modules for Excel, but it's interesting that there's apparently nothing 
for Access.

~ == ~
http://weston.canncentral.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using PHP on an .html file

2003-08-25 Thread Curt Zirzow
* Thus wrote Mike Migurski ([EMAIL PROTECTED]):
  Better to do this in an .htaccess file, so you don't incur PHP
  processing overhead on the entire server (if there are others using
  it).
 
 Apache suggests not using .htaccess files at all because they require a
 recursive traversing of directories looking for .htaccess files, because
 some supersede others or something like that.
 
 The only way to eliminate the overhead of searching for .htaccess files is
 to set the Allowoverride directive to 'None' in your httpd.conf file -
 otherwise, they will be checked for on every request whether they exist or
 not. The question is: does the additional benefit of using per-directory
 configuration and selective .html-as-.php handling outweigh the speed gain
 of not looking for .htaccess files? This depends on the server, how it's
 used, and how important raw performance is vs. ease of use.

I believe the only time it become a perfomance issue is when you
have a complex sub directory structure:
 http://host/dir1/dir2/dir3/dir4

apache will look at each directory (dirX) and apply .htaccess rules
overriding each dir from from document root.

 
 Just to quickly return to the original question, I would not use either
 method - instead I would turn multiviews on, and not use file extensions
 in URL's at all.
 
 http://httpd.apache.org/docs/content-negotiation.html

This is very interesting and I'm surprized I've overlooked this
option.  Unfortantly, apache doesn't provide a good example of what
this actaully does. A Quick google search didn't result in too good
of results. Do you have any other references on how this
'multiview' option work?


Thanks, 

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread Cody Phanekham
Murugesan,

Ok lets say you want every user to login before they can access other parts of your 
site.

index.php:
?
session_name(mysessionname);
session_start();
session_register(s_authed);
$s_authed = 0; // initialize session flag

if ((!$passwd) || (!$username)) // user hasnt logged in
{
  // display login form
  ...
}
else
{
  // retrieve database username and password here
  ...
  // check if they match
  if (($db_passwd == $passwd)  ($db_username == $username))
  {
$s_authed = 1; // user has been authorised
// redirect to real page
echo 
script
  window.location='main.php'
/script;
  }
}
?

main.php:
?
session_name(mysessionname);
session_start();
if (!$s_authed) // check access
{
  // user hasnt been authorised, therefore redirect to login page
  echo 
  script
window.location='index.php'
  /script;
}
else
{
  // display page
  ...
}
?


if a user tries to access main.php directly without logging in they will be redirected 
to index.php

checkout http://www.php.net/manual/en/ref.session.php for more information


 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Friday, 22 August 2003 20:04
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Re: [PHP] How to open random Flash page with hyperlink?
 
 
 Thanks for the message.
 Can you please tell me how to do session authentication?.
 
 -murugesan


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



Re: [PHP] mail() question

2003-08-25 Thread Curt Zirzow
* Thus wrote Matthias Wulkow ([EMAIL PROTECTED]):
 Hallo Curt,
 
 am Montag, 25. August 2003 um 01:35 hast Du Folgendes gekritzelt:
 
  I have followig error reported:
  
  Fatal error: Call to undefined function: mail() in /usr/local/www/login.php on 
  line 235
  
  What is the trouble here?  If I would have trouble because of
  delivery, normally mail would return false. But here...
 
 CZ mail() wasn't compiled into php.
 
  
  I have php4.3.1 running on linux. I just installed postfix to have the
  sendmail binary at the right place.
 
 CZ You'll have to recompile php. the first time you compiled it php it
 CZ couldnt find sendmail, so it left it out in the binary.
 
 Well, that makes sense to me. But I just recompiled the same way I did
 it first time (config.nice), but I still get the same error reported.
 I looked in ./configure --help to see if there are specific arguments
 I need to add, but couldn't find any... and this time sendmail is
 there (/usr/sbin/sendmail).
 
 What's wrong?

When you configure PHP it uses your $PATH envirmonment (plus som
e standard paths.)  

To get more detailed on the situation There is a file in your surce
tree:
  main/php_config.h:

there should be a line (around line #972) that says something like:
  #define HAVE_SENDMAIL 1

If it says 'undef HAVE_SENDMAIL', that generaly means that your
configure script can't find it.

If this is the case I would strongly encourge a search/report at
bugs.php.net to find out how to resolve this.

As long as your sendmail is in a common place you shouldn't have
any problems.



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] mysql_connect error

2003-08-25 Thread Mjec
Hi,

again this line is causing problems:

$h = 
mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
;

Aparantly a parse error.  Idaes?

Thanks,

Mjec

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



Re: [PHP] mysql_connect error

2003-08-25 Thread John W. Holmes
Mjec wrote:

Hi,

again this line is causing problems:

$h = 
mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
;

Aparantly a parse error.  Idaes?
Is there a reason you're using constant()??

Try: $h = mysql_connect('localhost', mysql_user, mysql_password);

One thing to note about parse errors. If PHP says you have a parse error 
on line 8 (for example), that means there is an error somewhere before 
OR on line 8. The line PHP gives is just the point where it realized 
something was wrong, but the cause could be on a previous line.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP] mysql_connect error

2003-08-25 Thread Mjec
on 25/08/2003 12:11 PM, John W. Holmes at [EMAIL PROTECTED] wrote:

 Mjec wrote:
 
 Hi,
 
 again this line is causing problems:
 
 $h = 
 mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
 ;
 
 Aparantly a parse error.  Idaes?
 
 Is there a reason you're using constant()??
 
 Try: $h = mysql_connect('localhost', mysql_user, mysql_password);
 
 One thing to note about parse errors. If PHP says you have a parse error
 on line 8 (for example), that means there is an error somewhere before
 OR on line 8. The line PHP gives is just the point where it realized
 something was wrong, but the cause could be on a previous line.

Error line 43 (or 42 if 43 commented out and 42 uncommented)

 38: define(mysql_password, did you think);
 39: define(mysql_user, 'i would say this');
 40: 
 41: // Initialize MySQL database
 42: //$h = 
mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
;
 43: $h = mysql_connect('localhost',mysql_user,mysql_password);
 44: mysql_select_db('mjec_mjecnet', $h);

ideas?

--mjec

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



[PHP] php qmail

2003-08-25 Thread Kris Reid
Hi

I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.

Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = /var/qmail/bin/qmail-remote $host $from $to;
 echo Program = $prog \r\n;

 $handle = popen ($prog, w);
// fwrite($handle, $message) ;
 pclose($handle);
 }

The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX

How can I type Message control + D into the program ?

Thanks

Kris



[PHP] Re: php qmail

2003-08-25 Thread Manuel Lemos
Hello,

On 08/25/2003 12:43 AM, Kris Reid wrote:
I'm trying to build a program using PHP to increase the performance of Qmail.

I'm trying to use PHP to send an email qmail-remote which connects directly to the 
recipients mail server.
If this fails it will then add it to the queue normally so it can retry later.
Here is what I have so far (Note this runs on the command line)

function sendMail($host, $to, $from, $message) {

 $prog = /var/qmail/bin/qmail-remote $host $from $to;
 echo Program = $prog \r\n;
 $handle = popen ($prog, w);
// fwrite($handle, $message) ;
 pclose($handle);
 }
The problem I have is I don't know how to write the message.
When you manually run qmail-remote $host $from $to
You then have to type the message then press control + D
Just like the standard mail function in UNIX
How can I type Message control + D into the program ?
If you want to send a message directly to recipient SMTP server, you may 
want to try this SMTP class enabling the direct delivery mode.

http://www.phpclasses.org/smtpclass

To actually compose the message you want to send, you would better use 
that in class in conjunction with this other class for composing and 
sending e-mail messages. It comes with a sub-class specialized in 
deliverying via SMTP that using the class above.

http://www.phpclasses.org/mimemessage



--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Passing values from one page to another

2003-08-25 Thread murugesan
Hello all,

[snip]


//Page0.php
a href=page1.php?empid=1Enter/a



//page1.php
script language=javascript
function submitform()
{
   //Check for empty values in text box
}
/script

form  onsubmit='return submitform()' method=POST action='page2.php'
input type=text name=uname 
input type=hidden name=empid value=?php echo $empid;?
/form
?php
echo $empid;
?




//page2.php
?php
echo $empid;
?

In page 1 I am able to get the value 1 of empid.
But in page 2 I am not  able to get it.
Any solutions

-murugesan

Re: [PHP] mysql_connect error

2003-08-25 Thread murugesan
This is working for me.

---
  define('db_host','localhost');
  define('db_name','mydb') ;
  define('db_user','use1') ;
  define('db_pass','pwd1') ;
  $h = @mysql_pconnect(db_host,db_user,db_pass);
  if($h)
  mysql_select_db (db_name) or die (could not select db);;
---
-murugesan

- Original Message -
From: Mjec [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 25, 2003 7:53 AM
Subject: Re: [PHP] mysql_connect error


on 25/08/2003 12:11 PM, John W. Holmes at [EMAIL PROTECTED] wrote:

 Mjec wrote:

 Hi,

 again this line is causing problems:

 $h =

mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
 ;

 Aparantly a parse error.  Idaes?

 Is there a reason you're using constant()??

 Try: $h = mysql_connect('localhost', mysql_user, mysql_password);

 One thing to note about parse errors. If PHP says you have a parse error
 on line 8 (for example), that means there is an error somewhere before
 OR on line 8. The line PHP gives is just the point where it realized
 something was wrong, but the cause could be on a previous line.

Error line 43 (or 42 if 43 commented out and 42 uncommented)

 38: define(mysql_password, did you think);
 39: define(mysql_user, 'i would say this');
 40:
 41: // Initialize MySQL database
 42: // $h =
mysql_connect('localhost',constant(mysql_user),constant(mysql_password))
;
 43: $h = mysql_connect('localhost',mysql_user,mysql_password);
 44: mysql_select_db('mjec_mjecnet', $h);

ideas?

--mjec

--
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] Re: php qmail

2003-08-25 Thread Kris Reid
Manuel

Thanks for the advice however I want to use qmail-remote as I believe it
will suit my needs better.

I have been reading a great deal about tweaking qmail. I run a newsletter
and the fastest way is to try remote deliveries and only add them to the
queue if this fails.

The function that I wrote works I just don't know how to insert the message
content.

Thanks

Kris

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



Re: [PHP] Passing values from one page to another

2003-08-25 Thread Chris Shiflett
--- murugesan [EMAIL PROTECTED] wrote:
 a href=page1.php?empid=1Enter/a
...
 input type=hidden name=empid value=?php echo $empid;?

http://www.php.net/register_globals

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] Re: php qmail

2003-08-25 Thread Manuel Lemos
Hello,

On 08/25/2003 01:34 AM, Kris Reid wrote:
Thanks for the advice however I want to use qmail-remote as I believe it
will suit my needs better.
I have been reading a great deal about tweaking qmail. I run a newsletter
and the fastest way is to try remote deliveries and only add them to the
queue if this fails.
Maybe I was not clear but my SMTP class does remote deliveries when you 
enable the direct delivery mode, so it acts exactly as qmail-remote. If 
you doubt it, just try it. Here is the address again in case you missed it:

http://www.phpclasses.org/smtpclass


The function that I wrote works I just don't know how to insert the message
content.
That is what the MIME message composing and sending class does. It 
composes the message headers and body and calls functions to send messages.

It comes with specialized sub-classes for deliverying the messages 
through various methods. It supports delivery the mail(), sendmail 
program, SMTP either relaying to an intermedite or delivering direcly to 
the recipient SMTP server, or even qmail via qmail-queue.

I use this class for sending newsletters for tens of thousands of users 
every day. The direct delivery mode, I only use for urgent messages, 
like messages to let the users choose their initial passwords.

I could add support to deliver alternatively via qmail-remote but I 
would have to see a good reason to do that instead of using the SMTP 
class in direct delivery mode.

For newsletters I only use the sub class to deliver via qmail-queue 
because those messages are not urgent. The advantage of using 
qmail-queue is that it can run many tens of simultaneous deliveries 
calling qmail-remote. I could run qmail-remote directly from PHP, but I 
doubt it would be as efficient as qmail-queue.

Here it is the MIME composing and sending class address in case you want 
to try it yourself, as you need.

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread murugesan
Thanks for the information.
In the code you provided

if ((!$passwd) || (!$username)) // user hasnt logged in
 {
  .

Actually I have implemented this in a separate page.

That is upon sign up of the form in the index page
I call a new page auth.php
In that file
I have done this authentication and called the function
header (Location: /main.php?empid=$empidpwd=$pwd);

Actually when passing this URL the password appears in the address bar.
How to over come this? It will be very much usefull if I get the answer.

Thanks in advance
-Murugesan


-
Ok lets say you want every user to login before they can access other parts
of your site.

index.php:
?
session_name(mysessionname);
session_start();
session_register(s_authed);
$s_authed = 0; // initialize session flag

if ((!$passwd) || (!$username)) // user hasnt logged in
{
  // display login form
  ...
}
else
{
  // retrieve database username and password here
  ...
  // check if they match
  if (($db_passwd == $passwd)  ($db_username == $username))
  {
$s_authed = 1; // user has been authorised
// redirect to real page
echo 
script
  window.location='main.php'
/script;
  }
}
?

main.php:
?
session_name(mysessionname);
session_start();
if (!$s_authed) // check access
{
  // user hasnt been authorised, therefore redirect to login page
  echo 
  script
window.location='index.php'
  /script;
}
else
{
  // display page
  ...
}
?


if a user tries to access main.php directly without logging in they will be
redirected to index.php

checkout http://www.php.net/manual/en/ref.session.php for more information




 Thanks for the message.
 Can you please tell me how to do session authentication?.

 -murugesan

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



Re: [PHP] 2 questions

2003-08-25 Thread Binay Agarwal


- Original Message -
From: Thomas Hochstetter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 12:54 AM
Subject: RE: [PHP] 2 questions


 The register globals is on with the live server, and off at home (my
version
 is 4.3.2, the other is 4.1.2). does that matter?
yes, it does matter .. Show me the snippet where u regestering/getting the
session variables if possible.

 Thanks for the other tip, shall try that ...

 Thomas

 - Original Message -
 From: Thomas Hochstetter [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, August 23, 2003 5:33 PM
 Subject: [PHP] 2 questions


  Hi guys.
 
  I have two questions for you today:
 
  1. Weired login problem
  I am developinig a site for a conference where i have a login page for
  members. This page is called index.php and includes different types of
 modules,
  according to the type of user logged on. The problem is now following:
  i have a login function hidden in a class, this function registers a
bunch
  of variables. After the user has submited the details, index.php (which
 calls
  the session_start()) calls the login function. Then i check whether a
 session
  variable is present ($_SESSION['name']). If yes, we include the members
  area, otherwise we include the login table again. Now: on my test server
  (XP/Apache/php4.3.2) all is well. However, on the real server
 (Linux/Apache/php4.0.x)
  it just includes the login table anyway, even if the login was
successful.
 I
  then have to click on the menu link again to include the member script.
  Why is that?

 Check your register_globals setting in both ur test server and real server
 and let me know.

 
  2. Save a large amount of text to a file
  On the same page i have some type of cms going. The admin users can
change
  txt files which relate to text on some of the general pages. I have now
 found
  that it is only transmits a certain amount of text via GET to the
function
  that writs to the files. Is there a restriction on passing text via url?
 If yes
  (which will be the case), how could i do this otherwise?

 Use POST instead of GET method... POST method allows u to even extend the
 size of data being posted.

 Hope this helps...

 
  Thanks so long...
 
  Thomas
  P.S: this list still rocks
 
  --
  COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
  --
  1. GMX TopMail - Platz 1 und Testsieger!
  2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
  3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
 e-Post
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
 --
 1. GMX TopMail - Platz 1 und Testsieger!
 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post

 --
 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] How to open random Flash page with hyperlink?

2003-08-25 Thread Cody Phanekham
Murugesan,

I'll assume your redirecting the user to main.php because (s)he has passed the 
authentication routine... in that case just store the username and password as a 
session variable that way you wont need to pass the username and password via the url.

auth.php, [just before the call to header()]:
?
  session_register('empid');
  session_register('pwd');
  header (Location: /main.php);
?

then in main.php you need to start your session to access the session variables
?
  session_name(yoursessionname);
  session_start();
  // you now have access to $empid and $pwd
  echo bryour employee id = $empid and the password you typed was $pwd;
?


 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 15:18
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Re: [PHP] How to open random Flash page with hyperlink?
 
 
 Thanks for the information.
 In the code you provided
 
 if ((!$passwd) || (!$username)) // user hasnt logged in
  {
   .
 
 Actually I have implemented this in a separate page.
 
 That is upon sign up of the form in the index page
 I call a new page auth.php
 In that file
 I have done this authentication and called the function
 header (Location: /main.php?empid=$empidpwd=$pwd);
 
 Actually when passing this URL the password appears in the 
 address bar.
 How to over come this? It will be very much usefull if I get 
 the answer.
 
 Thanks in advance
 -Murugesan
 --
 --
 --
 --
 -
 Ok lets say you want every user to login before they can 
 access other parts
 of your site.
 
 index.php:
 ?
 session_name(mysessionname);
 session_start();
 session_register(s_authed);
 $s_authed = 0; // initialize session flag
 
 if ((!$passwd) || (!$username)) // user hasnt logged in
 {
   // display login form
   ...
 }
 else
 {
   // retrieve database username and password here
   ...
   // check if they match
   if (($db_passwd == $passwd)  ($db_username == $username))
   {
 $s_authed = 1; // user has been authorised
 // redirect to real page
 echo 
 script
   window.location='main.php'
 /script;
   }
 }
 ?
 
 main.php:
 ?
 session_name(mysessionname);
 session_start();
 if (!$s_authed) // check access
 {
   // user hasnt been authorised, therefore redirect to login page
   echo 
   script
 window.location='index.php'
   /script;
 }
 else
 {
   // display page
   ...
 }
 ?
 
 
 if a user tries to access main.php directly without logging 
 in they will be
 redirected to index.php
 
 checkout http://www.php.net/manual/en/ref.session.php for 
 more information
 
 
 
 
  Thanks for the message.
  Can you please tell me how to do session authentication?.
 
  -murugesan
 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



[PHP] (Drupal function) getting error : notice : Undefined index ?

2003-08-25 Thread fatih olcer
hi,


i have installed drupal 4.2.0 without any problems. but when i try to
connect to
my local webserver i get errors: notice : Undefined index
i couldnt  get any reply to my messages from drupal.com.

i think i have a configuration problem. but i couldn't find any
solution. i can run the same code without any problems on win98 (phpdev5
installed)
i have changed some php.ini settings like display_errors = off 
but still getting errors.


- what causes Undefined index error?
- what is the problem on function node_page() (see below) ?

i'm php newbie.  thanks for help.

op. system  :  RH9 (with apache,php on it)
drupal version :  4.2.0

thanks .
Fatih Olcer.


// here is a sample code to generate the error:
function node_page() {
global $id, $user, $or, $and;

 $op = $_POST[op]; //error line error line  error line error line  error
line
 $edit = $_POST[edit];

 if (user_access(access content)) {
   if (empty($op)) {
 $op = arg(1);
   }

   if ($op == feed) {
 node_feed();
 return;
   }

   if ($op == view) {
 $node = node_load(array(nid = arg(2), status = 1),
$_GET[revision]);
   }

   theme(header, $node-title);

   $name = module_invoke(arg(2), node, name);

   switch ($op) {
 case add:
   theme(box, t(Submit $name), node_add(arg(2)));
   break;
 case edit:
   theme(box, t(Edit $name), node_edit(arg(2)));
   break;
 case view:
   print node_show($node, arg(3));
   break;
 case t(Preview):
   $edit = node_validate($edit, $error);
   theme(box, t(Preview $name), node_preview($edit, $error));
   break;
 case t(Submit):
   theme(box, t(Submit $name), node_submit($edit));
   break;
 case t(Delete):
   theme(box, t(Delete $name), node_delete($edit));
   break;
 default:
   $result = pager_query(SELECT nid, type FROM {node} WHERE
promote = '1' AND status = '1' ORDER BY static DESC, created DESC,
variable_get(default_nodes_main, 10));

   while ($node = db_fetch_object($result)) {
 node_view(node_load(array(nid = $node-nid, type =
$node-type)), 1);
   }
   print pager_display(NULL, variable_get(default_nodes_main,
10));
   }

   theme(footer);
 }
 else {
   theme(header);
   theme(box, t(Access denied), message_access());
   theme(footer);
 }

}

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



Re: [PHP] php qmail

2003-08-25 Thread Curt Zirzow
* Thus wrote Kris Reid ([EMAIL PROTECTED]):
 Hi
 
 I'm trying to build a program using PHP to increase the performance of Qmail.
 
 I'm trying to use PHP to send an email qmail-remote which connects directly to the 
 recipients mail server.
 If this fails it will then add it to the queue normally so it can retry later.
 
 Here is what I have so far (Note this runs on the command line)
 
 function sendMail($host, $to, $from, $message) {
 
  $prog = /var/qmail/bin/qmail-remote $host $from $to;
  echo Program = $prog \r\n;
 
  $handle = popen ($prog, w);
 // fwrite($handle, $message) ;
  pclose($handle);
  }
 
 The problem I have is I don't know how to write the message.
 When you manually run qmail-remote $host $from $to
 You then have to type the message then press control + D
 Just like the standard mail function in UNIX

Actually the mail function usually uses '.' on a line by iteself to
terminate a message.

 
 How can I type Message control + D into the program ?

the '^D' character is the end of file marker on unix. it has the
ordinal value of 0x04 so you can append to your mail message
something like:

$mailmessage .= chr(4);


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] (Drupal function) getting error : notice : Undefined index ?

2003-08-25 Thread Curt Zirzow
* Thus wrote fatih olcer ([EMAIL PROTECTED]):
 hi,
 
 
 i think i have a configuration problem. but i couldn't find any
 solution. i can run the same code without any problems on win98 (phpdev5
 installed)
 i have changed some php.ini settings like display_errors = off 
 but still getting errors.

IMO, turning errors of is a bad thing, a program should run
smoothly without errors.  Although with 3rd party packages
sometimes this is hard to avoid.

 
 
 - what causes Undefined index error?

An undefined index error is caused when accessing an index that
doesnt exist, so if you have an array as follows:
  $var = array('index1' = 'value');

And you try to access:
  echo $var['index2'];

The error will get displayed.

 - what is the problem on function node_page() (see below) ?

Sorry unable to help you with this.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] How to open random Flash page with hyperlink?

2003-08-25 Thread murugesan
Really thanks for the support. It worked well.

-regards,
Murugesan

- Original Message -
From: Cody Phanekham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 25, 2003 11:06 AM
Subject: RE: [PHP] How to open random Flash page with hyperlink?


Murugesan,

I'll assume your redirecting the user to main.php because (s)he has passed
the authentication routine... in that case just store the username and
password as a session variable that way you wont need to pass the username
and password via the url.

auth.php, [just before the call to header()]:
?
  session_register('empid');
  session_register('pwd');
  header (Location: /main.php);
?

then in main.php you need to start your session to access the session
variables
?
  session_name(yoursessionname);
  session_start();
  // you now have access to $empid and $pwd
  echo bryour employee id = $empid and the password you typed was $pwd;
?


 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 15:18
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Re: [PHP] How to open random Flash page with hyperlink?


 Thanks for the information.
 In the code you provided

 if ((!$passwd) || (!$username)) // user hasnt logged in
  {
   .

 Actually I have implemented this in a separate page.

 That is upon sign up of the form in the index page
 I call a new page auth.php
 In that file
 I have done this authentication and called the function
 header (Location: /main.php?empid=$empidpwd=$pwd);

 Actually when passing this URL the password appears in the
 address bar.
 How to over come this? It will be very much usefull if I get
 the answer.

 Thanks in advance
 -Murugesan
 --
 --
 --
 --
 -
 Ok lets say you want every user to login before they can
 access other parts
 of your site.

 index.php:
 ?
 session_name(mysessionname);
 session_start();
 session_register(s_authed);
 $s_authed = 0; // initialize session flag

 if ((!$passwd) || (!$username)) // user hasnt logged in
 {
   // display login form
   ...
 }
 else
 {
   // retrieve database username and password here
   ...
   // check if they match
   if (($db_passwd == $passwd)  ($db_username == $username))
   {
 $s_authed = 1; // user has been authorised
 // redirect to real page
 echo 
 script
   window.location='main.php'
 /script;
   }
 }
 ?

 main.php:
 ?
 session_name(mysessionname);
 session_start();
 if (!$s_authed) // check access
 {
   // user hasnt been authorised, therefore redirect to login page
   echo 
   script
 window.location='index.php'
   /script;
 }
 else
 {
   // display page
   ...
 }
 ?


 if a user tries to access main.php directly without logging
 in they will be
 redirected to index.php

 checkout http://www.php.net/manual/en/ref.session.php for
 more information


 
 
  Thanks for the message.
  Can you please tell me how to do session authentication?.
 
  -murugesan




*
This e-mail, including any attachments to it, may contain confidential
and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or
disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then
delete the original e-mail.

The information contained within this e-mail may be solely the opinion of
the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to
Salmat's anti-virus systems.

For more information, visit our website at  www.salmat.com.au.

*

--
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] Unable to get the values in next page

2003-08-25 Thread murugesan
I did as what you said. But the problem now is that I am not able to get the
values in the next page.

index.php
--
session_name(mysessionname);
session_start();
---

auth.php
-
$failed=yes;
session_register('failed');
header (Location: /main.php);
-

main.php
-
echo $failed;// this is null here
-

What might be the problem ?

Thanks in advance,
Murugesan.



 Murugesan,

 I'll assume your redirecting the user to main.php because (s)he has passed
 the authentication routine... in that case just store the username and
 password as a session variable that way you wont need to pass the username
 and password via the url.

 auth.php, [just before the call to header()]:
 ?
   session_register('empid');
   session_register('pwd');
   header (Location: /main.php);
 ?

 then in main.php you need to start your session to access the session
 variables
 ?
   session_name(yoursessionname);
   session_start();
   // you now have access to $empid and $pwd
   echo bryour employee id = $empid and the password you typed was
$pwd;
 ?


  -Original Message-
  From: murugesan [mailto:[EMAIL PROTECTED]
  Sent: Monday, 25 August 2003 15:18
  To: Cody Phanekham; [EMAIL PROTECTED]
  Subject: Re: [PHP] How to open random Flash page with hyperlink?
 
 
  Thanks for the information.
  In the code you provided
 
  if ((!$passwd) || (!$username)) // user hasnt logged in
   {
.
 
  Actually I have implemented this in a separate page.
 
  That is upon sign up of the form in the index page
  I call a new page auth.php
  In that file
  I have done this authentication and called the function
  header (Location: /main.php?empid=$empidpwd=$pwd);
 
  Actually when passing this URL the password appears in the
  address bar.
  How to over come this? It will be very much usefull if I get
  the answer.
 
  Thanks in advance
  -Murugesan
  --
  --
  --
  --
  -
  Ok lets say you want every user to login before they can
  access other parts
  of your site.
 
  index.php:
  ?
  session_name(mysessionname);
  session_start();
  session_register(s_authed);
  $s_authed = 0; // initialize session flag
 
  if ((!$passwd) || (!$username)) // user hasnt logged in
  {
// display login form
...
  }
  else
  {
// retrieve database username and password here
...
// check if they match
if (($db_passwd == $passwd)  ($db_username == $username))
{
  $s_authed = 1; // user has been authorised
  // redirect to real page
  echo 
  script
window.location='main.php'
  /script;
}
  }
  ?
 
  main.php:
  ?
  session_name(mysessionname);
  session_start();
  if (!$s_authed) // check access
  {
// user hasnt been authorised, therefore redirect to login page
echo 
script
  window.location='index.php'
/script;
  }
  else
  {
// display page
...
  }
  ?
 
 
  if a user tries to access main.php directly without logging
  in they will be
  redirected to index.php
 
  checkout http://www.php.net/manual/en/ref.session.php for
  more information
 
 
  
  
   Thanks for the message.
   Can you please tell me how to do session authentication?.
  
   -murugesan

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



[PHP] RE: Unable to get the values in next page

2003-08-25 Thread Cody Phanekham
 main.php
 -
 echo $failed;// this is null here
 -

did you start the session in main.php before echo $failed;? eg
?
session_name(mysessionname);
session_start();
?


 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 16:46
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Unable to get the values in next page
 
 
 I did as what you said. But the problem now is that I am not 
 able to get the
 values in the next page.
 
 index.php
 --
 session_name(mysessionname);
 session_start();
 ---
 
 auth.php
 -
 $failed=yes;
 session_register('failed');
 header (Location: /main.php);
 -
 
 main.php
 -
 echo $failed;// this is null here
 -
 
 What might be the problem ?
 
 Thanks in advance,
 Murugesan.
 
 
 
  Murugesan,
 
  I'll assume your redirecting the user to main.php because 
 (s)he has passed
  the authentication routine... in that case just store the 
 username and
  password as a session variable that way you wont need to 
 pass the username
  and password via the url.
 
  auth.php, [just before the call to header()]:
  ?
session_register('empid');
session_register('pwd');
header (Location: /main.php);
  ?
 
  then in main.php you need to start your session to access 
 the session
  variables
  ?
session_name(yoursessionname);
session_start();
// you now have access to $empid and $pwd
echo bryour employee id = $empid and the password you typed was
 $pwd;
  ?
 
 
   -Original Message-
   From: murugesan [mailto:[EMAIL PROTECTED]
   Sent: Monday, 25 August 2003 15:18
   To: Cody Phanekham; [EMAIL PROTECTED]
   Subject: Re: [PHP] How to open random Flash page with hyperlink?
  
  
   Thanks for the information.
   In the code you provided
  
   if ((!$passwd) || (!$username)) // user hasnt logged in
{
 .
  
   Actually I have implemented this in a separate page.
  
   That is upon sign up of the form in the index page
   I call a new page auth.php
   In that file
   I have done this authentication and called the function
   header (Location: /main.php?empid=$empidpwd=$pwd);
  
   Actually when passing this URL the password appears in the
   address bar.
   How to over come this? It will be very much usefull if I get
   the answer.
  
   Thanks in advance
   -Murugesan
   --
   --
   --
   --
   -
   Ok lets say you want every user to login before they can
   access other parts
   of your site.
  
   index.php:
   ?
   session_name(mysessionname);
   session_start();
   session_register(s_authed);
   $s_authed = 0; // initialize session flag
  
   if ((!$passwd) || (!$username)) // user hasnt logged in
   {
 // display login form
 ...
   }
   else
   {
 // retrieve database username and password here
 ...
 // check if they match
 if (($db_passwd == $passwd)  ($db_username == $username))
 {
   $s_authed = 1; // user has been authorised
   // redirect to real page
   echo 
   script
 window.location='main.php'
   /script;
 }
   }
   ?
  
   main.php:
   ?
   session_name(mysessionname);
   session_start();
   if (!$s_authed) // check access
   {
 // user hasnt been authorised, therefore redirect to login page
 echo 
 script
   window.location='index.php'
 /script;
   }
   else
   {
 // display page
 ...
   }
   ?
  
  
   if a user tries to access main.php directly without logging
   in they will be
   redirected to index.php
  
   checkout http://www.php.net/manual/en/ref.session.php for
   more information
  
  
   
   
Thanks for the message.
Can you please tell me how to do session authentication?.
   
-murugesan
 


*
This e-mail, including any attachments to it, may contain confidential and/or personal 
information.
If you have received this e-mail in error, you must not copy, distribute, or disclose 
it, use or take any action 
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the 
original e-mail.

The information contained within this e-mail may be solely the opinion of the sender 
and may not necessarily 
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's 
anti-virus systems.

For more information, visit our website at  www.salmat.com.au.
*

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



php-general Digest 25 Aug 2003 06:56:24 -0000 Issue 2257

2003-08-25 Thread php-general-digest-help

php-general Digest 25 Aug 2003 06:56:24 - Issue 2257

Topics (messages 160599 through 160644):

Probably has already been asked... Remote commands
160599 by: Richard D. Marriner II

Re: Reading an MS Access Database file on *NIX platform using PHP
160600 by: Travis Kroh
160603 by: David Otton
160609 by: Giz
160614 by: Curt Zirzow
160615 by: Paul Fitzpatrick
160617 by: jabber.raditha.com
160618 by: jabber.raditha.com
160619 by: Curt Zirzow
160620 by: Curt Zirzow
160622 by: Weston Cann

Re: In need of a script
160601 by: Wouter van Vliet

script not terminating on user abort
160602 by: Dennis Jacobfeuerborn
160606 by: Curt Zirzow

php NEWBIE Question
160604 by: Dennis Dujan - Partycult.de
160607 by: Curt Zirzow
160610 by: Dennis Dujan - Partycult.de
160611 by: Dennis Dujan - Partycult.de

mail() question
160605 by: Matthias Wulkow
160608 by: Curt Zirzow
160613 by: Matthias Wulkow
160616 by: Stevie D Peele
160621 by: Alister
160625 by: Curt Zirzow

Re: Using PHP on an .html file
160612 by: Mike Migurski
160623 by: Curt Zirzow

Re: How to open random Flash page with hyperlink?
160624 by: Cody Phanekham
160636 by: murugesan
160638 by: Cody Phanekham
160642 by: murugesan

mysql_connect error
160626 by: Mjec
160627 by: John W. Holmes
160628 by: Mjec
160632 by: murugesan

php  qmail
160629 by: Kris Reid
160630 by: Manuel Lemos
160633 by: Kris Reid
160635 by: Manuel Lemos
160640 by: Curt Zirzow

Passing values from one page to another
160631 by: murugesan
160634 by: Chris Shiflett

Re: 2 questions
160637 by: Binay Agarwal

(Drupal function) getting error : notice : Undefined index ?
160639 by: fatih olcer
160641 by: Curt Zirzow

Unable to get the values in next page
160643 by: murugesan
160644 by: Cody Phanekham

Administrivia:

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

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

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


--
---BeginMessage---
I'm sure this has been asked but I need clearification.  I would like to
create a script that can run remote programs and edit remote files on Linux
(both hosts are linux).   The reason is I would like to make a web hosting
control panel using PHP that I can have my mail  dns server on one machine
and web on the other.  Is there any way possible to do this with PHP?

I searched the arhives and found something about ssh_agent but couldn't find
a lot of information from google.  Any help would be appreciated.   I have
php experience just not very much...

Anything would be appreciated!
Thank You
Richard Marriner II
---End Message---
---BeginMessage---
This is a widespread problem. One which we faced, and eventually solved by
deciding to just write the application in .NET instead.

Some links that may be helpful...
This link deals with problems trying to use PHP's built-in function
odbc_connect on a Linux box:
http://forums.devshed.com/t37357/s.html

These links mention using database functions within this PHP include
library (adodb.inc.php) and skipping ODBC altogether:
http://www.devshed.com/Server_Side/PHP/ADODB
http://php.weblogs.com/ADODB

The basic problem is trying to get something on a nix box to play nice with
Jet. We never found an elegant way of doing it. (Some brief thought was
given to writing a VB app to live on the windows box, conveniently leaving a
port open to listen for requests from our PHP script and return results.
Humorous, yet ever-so-brief thought. :)

Good luck.
-trav

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 1:55 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Reading an MS Access Database file on *NIX platform using PHP


I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site
by FTP'ing
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I
believe), so
this means COM functions aren't available. ODBC was my next
thought, but I've
never used it, and there are a few things I don't understand. Setting up a
DSN is one of them -- apparently this isn't as simple as
constructing a string,
and all the tutorials I can find seem to involve going into a
Windows control
panel and making a setting. This of course will not be possible,
since there
are no windows control panels on FreeBSD.

In short: can anyone offer any quick tips on how to use the odbc
database functions or PEAR::DB to query data from an MS Access

Re: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread murugesan
Thanks for the reply.Actually I don't know that I have to include the
start_session in every page.
I GOT it ATLAST.

Regards
-murugesan.


- Original Message -
From: Cody Phanekham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 25, 2003 12:26 PM
Subject: [PHP] RE: Unable to get the values in next page


 main.php
 -
 echo $failed;// this is null here
 -

did you start the session in main.php before echo $failed;? eg
?
session_name(mysessionname);
session_start();
?


 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 16:46
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Unable to get the values in next page


 I did as what you said. But the problem now is that I am not
 able to get the
 values in the next page.

 index.php
 --
 session_name(mysessionname);
 session_start();
 ---

 auth.php
 -
 $failed=yes;
 session_register('failed');
 header (Location: /main.php);
 -

 main.php
 -
 echo $failed;// this is null here
 -

 What might be the problem ?

 Thanks in advance,
 Murugesan.



  Murugesan,
 
  I'll assume your redirecting the user to main.php because
 (s)he has passed
  the authentication routine... in that case just store the
 username and
  password as a session variable that way you wont need to
 pass the username
  and password via the url.
 
  auth.php, [just before the call to header()]:
  ?
session_register('empid');
session_register('pwd');
header (Location: /main.php);
  ?
 
  then in main.php you need to start your session to access
 the session
  variables
  ?
session_name(yoursessionname);
session_start();
// you now have access to $empid and $pwd
echo bryour employee id = $empid and the password you typed was
 $pwd;
  ?
 
 
   -Original Message-
   From: murugesan [mailto:[EMAIL PROTECTED]
   Sent: Monday, 25 August 2003 15:18
   To: Cody Phanekham; [EMAIL PROTECTED]
   Subject: Re: [PHP] How to open random Flash page with hyperlink?
  
  
   Thanks for the information.
   In the code you provided
  
   if ((!$passwd) || (!$username)) // user hasnt logged in
{
 .
  
   Actually I have implemented this in a separate page.
  
   That is upon sign up of the form in the index page
   I call a new page auth.php
   In that file
   I have done this authentication and called the function
   header (Location: /main.php?empid=$empidpwd=$pwd);
  
   Actually when passing this URL the password appears in the
   address bar.
   How to over come this? It will be very much usefull if I get
   the answer.
  
   Thanks in advance
   -Murugesan
   --
   --
   --
   --
   -
   Ok lets say you want every user to login before they can
   access other parts
   of your site.
  
   index.php:
   ?
   session_name(mysessionname);
   session_start();
   session_register(s_authed);
   $s_authed = 0; // initialize session flag
  
   if ((!$passwd) || (!$username)) // user hasnt logged in
   {
 // display login form
 ...
   }
   else
   {
 // retrieve database username and password here
 ...
 // check if they match
 if (($db_passwd == $passwd)  ($db_username == $username))
 {
   $s_authed = 1; // user has been authorised
   // redirect to real page
   echo 
   script
 window.location='main.php'
   /script;
 }
   }
   ?
  
   main.php:
   ?
   session_name(mysessionname);
   session_start();
   if (!$s_authed) // check access
   {
 // user hasnt been authorised, therefore redirect to login page
 echo 
 script
   window.location='index.php'
 /script;
   }
   else
   {
 // display page
 ...
   }
   ?
  
  
   if a user tries to access main.php directly without logging
   in they will be
   redirected to index.php
  
   checkout http://www.php.net/manual/en/ref.session.php for
   more information
  
  
   
   
Thanks for the message.
Can you please tell me how to do session authentication?.
   
-murugesan




*
This e-mail, including any attachments to it, may contain confidential
and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or
disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then
delete the original e-mail.

The information contained within this e-mail may be solely the opinion of
the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to
Salmat's anti-virus systems.

For more 

RE: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread Cody Phanekham
NP.

You only have to start a session if you want to access any session variable. You could 
always including the code in a header.inc file that gets included in every php script, 
that way you wont forget to start the session.

 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 17:14
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Re: [PHP] RE: Unable to get the values in next page
 
 
 Thanks for the reply.Actually I don't know that I have to include the
 start_session in every page.
 I GOT it ATLAST.
 
 Regards
 -murugesan.
 
 
 - Original Message -
 From: Cody Phanekham [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, August 25, 2003 12:26 PM
 Subject: [PHP] RE: Unable to get the values in next page
 
 
  main.php
  -
  echo $failed;// this is null here
  -
 
 did you start the session in main.php before echo $failed;? eg
 ?
 session_name(mysessionname);
 session_start();
 ?
 
 
  -Original Message-
  From: murugesan [mailto:[EMAIL PROTECTED]
  Sent: Monday, 25 August 2003 16:46
  To: Cody Phanekham; [EMAIL PROTECTED]
  Subject: Unable to get the values in next page
 
 
  I did as what you said. But the problem now is that I am not
  able to get the
  values in the next page.
 
  index.php
  --
  session_name(mysessionname);
  session_start();
  ---
 
  auth.php
  -
  $failed=yes;
  session_register('failed');
  header (Location: /main.php);
  -
 
  main.php
  -
  echo $failed;// this is null here
  -
 
  What might be the problem ?
 
  Thanks in advance,
  Murugesan.
 
 
 
   Murugesan,
  
   I'll assume your redirecting the user to main.php because
  (s)he has passed
   the authentication routine... in that case just store the
  username and
   password as a session variable that way you wont need to
  pass the username
   and password via the url.
  
   auth.php, [just before the call to header()]:
   ?
 session_register('empid');
 session_register('pwd');
 header (Location: /main.php);
   ?
  
   then in main.php you need to start your session to access
  the session
   variables
   ?
 session_name(yoursessionname);
 session_start();
 // you now have access to $empid and $pwd
 echo bryour employee id = $empid and the password 
 you typed was
  $pwd;
   ?
  
  
-Original Message-
From: murugesan [mailto:[EMAIL PROTECTED]
Sent: Monday, 25 August 2003 15:18
To: Cody Phanekham; [EMAIL PROTECTED]
Subject: Re: [PHP] How to open random Flash page with hyperlink?
   
   
Thanks for the information.
In the code you provided
   
if ((!$passwd) || (!$username)) // user hasnt logged in
 {
  .
   
Actually I have implemented this in a separate page.
   
That is upon sign up of the form in the index page
I call a new page auth.php
In that file
I have done this authentication and called the function
header (Location: /main.php?empid=$empidpwd=$pwd);
   
Actually when passing this URL the password appears in the
address bar.
How to over come this? It will be very much usefull if I get
the answer.
   
Thanks in advance
-Murugesan
--
--
--
--
-
Ok lets say you want every user to login before they can
access other parts
of your site.
   
index.php:
?
session_name(mysessionname);
session_start();
session_register(s_authed);
$s_authed = 0; // initialize session flag
   
if ((!$passwd) || (!$username)) // user hasnt logged in
{
  // display login form
  ...
}
else
{
  // retrieve database username and password here
  ...
  // check if they match
  if (($db_passwd == $passwd)  ($db_username == $username))
  {
$s_authed = 1; // user has been authorised
// redirect to real page
echo 
script
  window.location='main.php'
/script;
  }
}
?
   
main.php:
?
session_name(mysessionname);
session_start();
if (!$s_authed) // check access
{
  // user hasnt been authorised, therefore redirect to 
 login page
  echo 
  script
window.location='index.php'
  /script;
}
else
{
  // display page
  ...
}
?
   
   
if a user tries to access main.php directly without logging
in they will be
redirected to index.php
   
checkout http://www.php.net/manual/en/ref.session.php for
more information
   
   


 Thanks for the message.
 Can you please tell me how to do session authentication?.

 -murugesan
 
 
 
 **
 **
 *
 This 

[PHP] Use PHP or MySQL

2003-08-25 Thread Sid
Hello,

This question has been lingering in my mind for some time -
Say we have a function such as MD5, which is available on both PHP and MySQL? Which is 
faster - the PHP version or the MySQL one. Have any benchmarks been made on this? We 
can use the same question for say... arithmetic operations, string contentation...

Thanks in advance.

- Sid 


[PHP] include () problems

2003-08-25 Thread Mjec
Hi,

When I run the line:

include (fnord.php);

with the file looking like:

?php
define (fnord_included, true);
function fnord ($arg = true) {

// 450 lines
return $msg;

}
?

it prints out the return of fnord() (i.e. $msg).  I've checked, and there's
no echo or print statemetns anywhere...

Oh, yeah, FYI, the pattern goes like this:

file: index.php
?php include (standard.php); /* rest of page */ ?
file: standard.php
?php /* a few defines */ include(fnord.php); /* rest of stuff */ header
(Content-type: text/html; encoding=utf-8); ?

and it prints it right up the top of index.php, causing an error with the
header statement (although it says the error is in fnord.php - which
contains NO header statemtns).

ideas?

Regards,

mjec

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-25 Thread Ernest E Vogelsinger
At 03:18 25.08.2003, Weston Cann said:
[snip]
I share a low regard for Access, and I've got a set of standard 
forms/code I use to set up a nice interface to MySQL, and I showed it to 
my friend. He likes that, but there's a problem:

He wants to be able to make changes offline, and then sync up.

This isn't an uncommon desire... I've run into people wanting to do this 
before (with Excel spreadsheets, no less).  And in fact, it's probably 
the most convenient way of doing things, as long as they're warned about 
certain dangers (overwrites from competing unsynced database files).  
There's a certain cumbersome nature about web forms and the time delay 
involved in HTTP transactions.

So anyway, that's the motivation for using Access here.
[snip] 

You could do that without too much effort. Export the data to be synced
from MS Access to a CSV style export format, upload it to the server and
process it. There are a couple of examples how to handle CSV style data on
SourceForge, I believe.


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

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



[PHP] php5 and mysql

2003-08-25 Thread Harry Wiens
i've got a wamp with php5. is there any possibility to activate or
reinstall, etc. the mysql extension?

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



[PHP] Window.status message

2003-08-25 Thread murugesan
Hello all,
I have  a proble in showing the window message

[snip]
echo a class=MEDIUMFONTB href='/list.php
onmouseover=\javascript:window.status='hai'\ Click here /a;

Here on mouse over it is not displaying hai message in the status bar.
Instead when I move the mouse on the link and then after moving the mouse
apart from the link it displays the hai message in the status bar.
What might be the problem?

-murugesan

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



[PHP] window.status

2003-08-25 Thread murugesan
Hello all,
I have cleared the stage of changing the window status on mouse over
and on mouse out.
echo a href='/list.php'  onmouseover=\window.status='  '; return true;\
onmouseout=\window.status='  '; return true;\Click here/a;
When I keep on pressing my left mouse button it is displaying the URL in the
status bar.
How to remove the status?
Any one there to help me?

-Murugesan

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



Re: [PHP] RE: Unable to get the values in next page

2003-08-25 Thread murugesan
 I thought of including the script in all the files.Thanks for the message.

Regards,
Murugesan

- Original Message -
From: Cody Phanekham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 25, 2003 12:50 PM
Subject: RE: [PHP] RE: Unable to get the values in next page


NP.

You only have to start a session if you want to access any session variable.
You could always including the code in a header.inc file that gets included
in every php script, that way you wont forget to start the session.

 -Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
 Sent: Monday, 25 August 2003 17:14
 To: Cody Phanekham; [EMAIL PROTECTED]
 Subject: Re: [PHP] RE: Unable to get the values in next page


 Thanks for the reply.Actually I don't know that I have to include the
 start_session in every page.
 I GOT it ATLAST.

 Regards
 -murugesan.


 - Original Message -
 From: Cody Phanekham [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, August 25, 2003 12:26 PM
 Subject: [PHP] RE: Unable to get the values in next page


  main.php
  -
  echo $failed;// this is null here
  -

 did you start the session in main.php before echo $failed;? eg
 ?
 session_name(mysessionname);
 session_start();
 ?


  -Original Message-
  From: murugesan [mailto:[EMAIL PROTECTED]
  Sent: Monday, 25 August 2003 16:46
  To: Cody Phanekham; [EMAIL PROTECTED]
  Subject: Unable to get the values in next page
 
 
  I did as what you said. But the problem now is that I am not
  able to get the
  values in the next page.
 
  index.php
  --
  session_name(mysessionname);
  session_start();
  ---
 
  auth.php
  -
  $failed=yes;
  session_register('failed');
  header (Location: /main.php);
  -
 
  main.php
  -
  echo $failed;// this is null here
  -
 
  What might be the problem ?
 
  Thanks in advance,
  Murugesan.
 
 
 
   Murugesan,
  
   I'll assume your redirecting the user to main.php because
  (s)he has passed
   the authentication routine... in that case just store the
  username and
   password as a session variable that way you wont need to
  pass the username
   and password via the url.
  
   auth.php, [just before the call to header()]:
   ?
 session_register('empid');
 session_register('pwd');
 header (Location: /main.php);
   ?
  
   then in main.php you need to start your session to access
  the session
   variables
   ?
 session_name(yoursessionname);
 session_start();
 // you now have access to $empid and $pwd
 echo bryour employee id = $empid and the password
 you typed was
  $pwd;
   ?
  
  
-Original Message-
From: murugesan [mailto:[EMAIL PROTECTED]
Sent: Monday, 25 August 2003 15:18
To: Cody Phanekham; [EMAIL PROTECTED]
Subject: Re: [PHP] How to open random Flash page with hyperlink?
   
   
Thanks for the information.
In the code you provided
   
if ((!$passwd) || (!$username)) // user hasnt logged in
 {
  .
   
Actually I have implemented this in a separate page.
   
That is upon sign up of the form in the index page
I call a new page auth.php
In that file
I have done this authentication and called the function
header (Location: /main.php?empid=$empidpwd=$pwd);
   
Actually when passing this URL the password appears in the
address bar.
How to over come this? It will be very much usefull if I get
the answer.
   
Thanks in advance
-Murugesan
--
--
--
--
-
Ok lets say you want every user to login before they can
access other parts
of your site.
   
index.php:
?
session_name(mysessionname);
session_start();
session_register(s_authed);
$s_authed = 0; // initialize session flag
   
if ((!$passwd) || (!$username)) // user hasnt logged in
{
  // display login form
  ...
}
else
{
  // retrieve database username and password here
  ...
  // check if they match
  if (($db_passwd == $passwd)  ($db_username == $username))
  {
$s_authed = 1; // user has been authorised
// redirect to real page
echo 
script
  window.location='main.php'
/script;
  }
}
?
   
main.php:
?
session_name(mysessionname);
session_start();
if (!$s_authed) // check access
{
  // user hasnt been authorised, therefore redirect to
 login page
  echo 
  script
window.location='index.php'
  /script;
}
else
{
  // display page
  ...
}
?
   
   
if a user tries to access main.php directly without logging
in they will be
redirected to index.php
   
checkout 

[PHP] Problem with date('w')

2003-08-25 Thread BEOI 7308
Hi

I have a problem with the date function

?
 $theday = date(Y-m-d, time());
  echo date((w), $theday);
?

should print 1 if today is monday, 2 if today is tuesday ...
though it's printing 4 and today is monday !

any idea ?

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

[PHP] Unix end of line versus windows end of line

2003-08-25 Thread Bohdan Blaha
Hi,

I use PHP with apache on two systems..
(linux and windows)

when I use PHP on linux, it is ok.. I get Unix end of line, when I write to the file 
with fwrite function...
when I run the same script on windows machine, I get Unix end of line too, but I need 
there windows end of line,...

is it configuration of php.ini?? or how can I set it???

thx for help
BB


---
Odchoz zprva neobsahuje viry.
Zkontrolovno antivirovm systmem AVG (http://www.grisoft.cz).
Verze: 6.0.512 / Virov bze: 309 - datum vydn: 19.8.2003

Re: [PHP] Unable to get the values in next page

2003-08-25 Thread murugesan
Thanks for the help.
I got it worked. The mistake I did was that I failed to call session_start()
in the next page.

-Murugesan
- Original Message -
From: Burhan [EMAIL PROTECTED]
To: murugesan [EMAIL PROTECTED]
Sent: Monday, August 25, 2003 3:29 PM
Subject: Re: [PHP] Unable to get the values in next page


 Quoting murugesan [EMAIL PROTECTED]:

 [ trim ]

  main.php
  -
  echo $failed;// this is null here
  -

 Try echo $_SESSION['failed'];

 --
 Burhan
 phplist[at]meidomus[dot]com
 http://www.meidomus.com


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



[PHP] [Newbie Guide] For the benefit of new members

2003-08-25 Thread tech
=
This message is for the benefit of new subscribers and those new to PHP.  
Those who  do not want to be bothered just filter out the [Newbie Guide] 
mails. Please feel free to add more points and send to the list.
==
1. If you have any queries/problems about PHP try http://www.php.net/manual/en 
first. You can download a copy and use it offline also.

2. If you can not get answer here try http://www.google.com next. Try 
searching for php YOUR QUERY and you may be lucky to get an answer within 
the first 10 results.

3. Glancing through the list archive at 
http://marc.theaimsgroup.com/?l=php-general , you can find many of the 
common topics discussed repeatedly and can get your answer from those 
discussions. 

4. If you are stuck with a script and do not understand what is wrong, instead 
of posting the whole script, try doing some research yourself. One useful 
trick is to print the variable/sql query using print or echo command and 
check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts (following 
steps 1,2  3) and ask for help in the list.

5. Provide a clear descriptive subject line. Avoid general subjects like 
Help!!, A Question etc. 

6. When you want to start a new topic, open a new mail and enter the mailing 
list address [EMAIL PROTECTED] instead of replyting to an existing 
thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes 
place BEFORE the output reaches the client. Therefore, it is not possible to 
access the users'  computer related information (OS, screen size etc) using 
PHP. You need to go for Java Script and ask the question in a Java Script 
list.

Hope you have a good time programming with PHP.

Best regards,

-- 
Ma Siva Kumar,

INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY
BSG LeatherLink,
Chennai.
Ph: +91 44 55191757
URL : http://www.leatherlink.net

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



RE: [PHP] CMS question.

2003-08-25 Thread Jay Blanchard
[snip]
I have a friend who have paid a developper to build him a CMS. This
honest 
programmer did that (supposedly developped it on his own), encoded the
CMS 
with Ioncube and did some other unethical activities as well. To make a
long 
story short, I have read some articles about decoding and cracking the
source 
/ reverse engineering, and it looks like it is time consuming and also 
illegal.
[/snip]

What makes you think that the developer did something unethical? 

[snip]
I have taken snapshots of the CMS and put them available to whoever is 
interested in giving me a hand to see if this CMS is an open source one?
note the php files: categories_list.php, content_list.php and 
content_edit.php.
[/snip]

I have seen those small icons used by numerous developers, but I don't
know if they are available for uncredited or uncompensated works. Other
than that those screenshots look like dozens of packages I have seen.

[snip]
the CM is also capable to upload in batch... ?
[/snip]

Capable to upload what in a batch?

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