php-windows Digest 8 Dec 2001 03:24:03 -0000 Issue 890

Topics (messages 10786 through 10800):

Re: PHP 4.0.6 Apache 1.3.12 Oracle 8.1.5 OCIPlogon Wind ows 2000 Server
        10786 by: Asendorf, John

Using Sessions, PHP 4.0.6, on IIS 5.0
        10787 by: Ayres, David

Trying to pass a variable through a form...
        10788 by: Bryant Brabson

Re: printing directly from php
        10789 by: Tim Foster
        10790 by: FPU.WHITES1.FRIENDSPROVIDENT.CO.UK

run a php script
        10791 by: Conover, Ryan
        10792 by: FPU.WHITES1.FRIENDSPROVIDENT.CO.UK

A referer code needed
        10793 by: Emad El-Din

session problem
        10794 by: Afan Pasalic
        10795 by: Ayres, David
        10796 by: Afan Pasalic
        10798 by: Dario Fernando Escobar R.

Has anyone gotten session_destroy() to actually work on Windows?
        10797 by: Ayres, David
        10799 by: Egil Helland

☆寻找JSP虚拟主机?看看我们为您提供什么样的服务吧
        10800 by: Today's Network

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]


----------------------------------------------------------------------
--- Begin Message ---
Actually, I'm using the ADODB class, so eventually I would be able to switch
to any database that is supported by it.  So, Robin, what are you?  A sales
rep for Borland or something  ;)?

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: Robin Bolton [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 07, 2001 2:55 AM
> To: 'Asendorf, John'; [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] PHP 4.0.6 Apache 1.3.12 Oracle 8.1.5 OCIPlogon
> Windows 2000 Server
> 
> 
> <reply all - grin>
> 
> John, might I suggest that if you are converting a database 
> from oracle
> you may want to consider a database that may more closely matches your
> previous system.
> 
> You may be familiar with a Borland InterBase, well they have an open
> source descendant named 'Firebird'.
> 
> You can check it out at: http://firebird.sourceforge.net/
> 
> And all of the PR material can be found at http://www.interbase.com,
> anything that InterBase has, Firebird has (and more).
> 
> I'd suggest you give it a quick run through, it's very easy to set up,
> and there are several free, quite good gui interfaces.
> 
> And, to top it all off... PHP 4 has full support of InterBase 6.0:
> http://www.php.net/manual/en/ref.ibase.php
> 
> 
> > -----Original Message-----
> > From: Asendorf, John [mailto:[EMAIL PROTECTED]]
> > Sent: December 6, 2001 10:42
> > To: Jozsef Szilagyi; [EMAIL PROTECTED]
> > Subject: RE: [PHP-WIN] PHP 4.0.6 Apache 1.3.12 Oracle 8.1.5 
> OCIPlogon
> > Windows 2000 Server
> > 
> > The main reason is because you're probably NOT getting a persistent
> > connection with IIS.  I've been fighting with this problem of Oracle
> for
> > so
> > long that I finally gave up on it.  I started on IIS4 but couldn't
> keep
> > the
> > server from breaking down after a couple of hours after the first
> login
> > while using the ISAPI module.  There are no persistent 
> connections as
> CGI
> > (obviously)... then I switched to Apache and had the same problem
> you're
> > describing.  The only way I was able to "fix" it was to increase the
> > timeout
> > on the Oracle side.  But, it still doesn't keep the persistent
> connection
> > open very well.
> > 
> > SO, I've ported the entire thing over to MySQL (luckily the 
> databases
> > aren't
> > too big (5 tables, 3 tiny ones and 2 big ones (40,000 and 120,000
> records
> > each).... and will be making the transfer the first of the year.
> > 
> > I tried a million different things.  What I would mostly 
> suggest is to
> use
> > the latest php 4.0.8-dev from www.php4win.com and see if some of the
> > changes
> > Thies has been working on make a difference...  he has made a number
> of
> > changes trying to combat the Oracle on Windows nightmare but I don't
> think
> > they are included in the 4.0.6 release, and whether or not they'll
> work I
> > don't know.
> > 
> > Good luck, please let me know if you have any,
> > 
> > John
> > 
> > ---------------------
> > John Asendorf - [EMAIL PROTECTED]
> > Web Applications Developer
> > http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> > Licking County, Ohio, USA
> > 740-349-3631
> > Nullum magnum ingenium sine mixtura dementiae fuit
> > 
> > 
> > > -----Original Message-----
> > > From: Jozsef Szilagyi [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, December 06, 2001 12:18 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] PHP 4.0.6 Apache 1.3.12 Oracle 8.1.5 OCIPlogon
> > > Windows 2000 Server
> > >
> > >
> > > Hello !
> > >
> > > I have a strange problem, with the combination of configuration on
> the
> > > subject.
> > > When want to use permanent connection to Oracle (OCIPlogon) the
> > > oracle sessions never end, and quiclky raise the 50 limit 
> of Oracle
> > > procesess.
> > >
> > > BUT when I use on the same machine, with the same PHP, Oracle,
> > > and the same php scripts, only i change the webserver 
> from Apache to
> > > IIS 5.0, the problem dissapeared. The IIS only open a very
> > > low number of
> > > connection
> > > and the connection time (for the second request) is much much
> > > small than
> > > the same thing under Apache.
> > >
> > > Now my question is, where is the problem ?
> > > Why with IIS is ok, and with Apache not ?
> > >
> > > SzJ.
> > >
> > >
> > >
> > >
> > > --
> > > PHP Windows 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 Windows 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]
> 
> 
--- End Message ---
--- Begin Message ---
Hello all,

I'm having some trouble using Session variables it seems with a small web
application I'm creating for time reporting.  I'm using IIS 5.0, Windows
2000 Professional.  Any reason why it wouldn't seem to be keeping session
variables?  Code is:

//check login and password
//connect and execute query
$connection = &NewADOConnection('mssql');
$connection->PConnect($servername, $userid, $password, $database) or
die("Unable to connect to your database!");
$recordset = &$connection->Execute("Select uid, uperms From tblUsers Where
uname = '$frmuser' AND upass = '$frmpass'") or die ("Error in execution of
recordset!");

//if row exists login and pass are correct
if ($recordset->RecordCount() == 1) {
        
        //initiate a session
        session_start();

        //register the user's ID and permission level
        session_register("SESSION_UID");
        session_register("SESSION_UPERMS");
        $uid = $recordset->fields["uid"];
        $uperms = $recordset->fields["uperms"];
        $SESSION_UID = $uid;
        $SESSION_UPERMS = $uperms;

        //redirect to Main Menu page
        header("Location:menu.php");

        //close connection
        $connection->Close();
        $recordset->Close();

}else{
        
        //login password check failed
        $connection->Close();
        
        //redirect to error page
        header("Location: error.php?ec=0");
        exit;
}

Whenever I print off the $recordset->RecordCount() it tells me that it's 1,
which is correct, so it should start the session and send them to menu.php.
It actually does send them to menu.php, but menu.php checks to verify the
Session like so:

<?
//check for valid user session
session_start();
if(!session_is_registered("SESSION_UID"))
{
        header("Location: error.php?ec=1");
        exit;
}
?>

And it sends them back to the error page saying they don't have the Session
(because that's what I have on my error page if ec=1).  Any suggestions?
What am I doing wrong here?  Are there settings in PHP.ini that I'm missing?
Thanks!

David
--- End Message ---
--- Begin Message ---
Your homework is finished!

TonyForm.html:
<HTML>
<FORM ACTION="Tony1.php"  METHOD="post">
Name: <INPUT TYPE="text" NAME="lname"> <br>
<INPUT TYPE="Submit"  VALUE="Go">
</FORM>
</HTML>

tony1.php
<?
 $lname = $HTTP_POST_VARS['lname'];
?>
<html>
<body>
<?
echo ("Welcome $lname");
?>
<A HREF="Tony2.php?name=<?echo($lname) ?>"> Link </A>
</body>
</html>

tony2.php
<?
 $name = $HTTP_GET_VARS['name'];
?>
<html>
<body>
<?
echo ("Hello $name");
?>
</body>
</html>

****************************************************
I'm trying to pass a variable from a form text box into a php file
(Tony1.php).

Then, I'd like to click on a link in the Tony1.php page and get the
Tony2.php page to load with the original variable -$lname - printed on the
next page (Tony2.php).

The Tony2.php loads when I click the link but the value from the variable is
not printed.

Any help would be greatly appreciated.
The code is below.
Tony Ritter
...................................


file://TonyForm.html//

<HTML>
<FORM ACTION="Tony1.php"  METHOD="get">
Name: <INPUT TYPE="text" NAME="lname"> <br>
<INPUT TYPE="Submit"  VALUE="Go">
</FORM>
</HTML>

.....................
file://Tony1.php//

<?
echo ("Welcome $lname");
?>
<A HREF="Tony2.php?name=<?echo($lname) ?>"> Link </A>


...................
file://Tony2.php//

Hello

--- End Message ---
--- Begin Message ---
Just for clarification....

Will this method allow the user to click on a link and *poof* out comes somthing out of
his/her printer?

I thought browsers couldn't do that? And if it can, what HTML (or HTTP header or 
whatever)
is actually being sent to the client.

TIM
-Stenderup's Law: The sooner you fall behind, the more time you
will have to catch up.


> -----Original Message-----
> From: Ross Fleming [mailto:[EMAIL PROTECTED]]

> php_printer.dll
>
> Chances are it is installed, but not enabled.  Check C:\php\extensions (or
> wherever you installed to) to see if it is there.  If it is then fire up
> php.ini and uncomment the line that says:
> extension=php_printer.dll
>
> You'll probably need to specify your extensions directory by putting this
> line:
> extension_dir = C:\PHP\extensions
> somewhere before the extension= lines.
>
> Ross
>
> -----Original Message-----
> From: daniel cozzolino [mailto:[EMAIL PROTECTED]]

> I would like to print directly from php to the client default printer.  i
> tried using the code example from php.net:
>
> $handle = printer_open();
> printer_write($handle, "Text to print");
> printer_close($handle);
> but get Fatal error: Call to undefined function: printer_open()
> which leads me to believe i am missing a library file. ??
> I am running IIS v5 on Win2000 with PHP v4.06
> Thanks
> Dan

--- End Message ---
--- Begin Message ---
--- Received from FPU.WHITES1 799 3703                       07-12-01 15:03       
--------

  -> [EMAIL PROTECTED]
  -> [EMAIL PROTECTED]

You are correct, this process has nothing to do with the browser.  When the print 
function
is called by the PHP script, the output will be printed on the local printer to the 
server
the PHP script is running on.  The person using their browser to activate the script 
will
only see anything if they are physically working on or near the server itself.

You cannot use this to implement a generic 'print' button for clients accessing the 
site
remotely in the normal fashion.

-Steve

------------------------------------------------------------------------------------------

From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: Fri, 7 Dec 2001 09:03:45 -0600
Subject: RE: [PHP-WIN] printing directly from php

Just for clarification....

Will this method allow the user to click on a link and *poof* out comes somthing out of
his/her printer?

I thought browsers couldn't do that? And if it can, what HTML (or HTTP header or 
whatever)
is actually being sent to the client.

TIM
-Stenderup's Law: The sooner you fall behind, the more time you
will have to catch up.


> -----Original Message-----
> From: Ross Fleming [mailto:[EMAIL PROTECTED]]

> php_printer.dll

> Chances are it is installed, but not enabled.  Check C:\php\extensions (or
> wherever you installed to) to see if it is there.  If it is then fire up
> php.ini and uncomment the line that says:
> extension=php_printer.dll

> You'll probably need to specify your extensions directory by putting this
> line:
> extension_dir = C:\PHP\extensions
> somewhere before the extension= lines.

> Ross

> -----Original Message-----
> From: daniel cozzolino [mailto:[EMAIL PROTECTED]]

> I would like to print directly from php to the client default printer.  i
> tried using the code example from php.net:

> $handle = printer_open();
> printer_write($handle, "Text to print");
> printer_close($handle);
> but get Fatal error: Call to undefined function: printer_open()
> which leads me to believe i am missing a library file. ??
> I am running IIS v5 on Win2000 with PHP v4.06
> Thanks
> Dan


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

This e-mail may contain confidential information and/or copyright
material. This e-mail is intended for the use of the addressee
only. Any unauthorised use may be unlawful.

If you receive this e-mail by mistake please advise the sender
immediately by using the reply facility in your e-mail software.

Friends Provident Marketing Group consists of the following
companies:

Friends Provident Life and Pensions Limited.
Registered number 4096141.
Friends' Provident Unit Trust Managers Limited.
Registered number 970641
FP Life Assurance Limited.
Registered number 782698
Friends Provident Pensions Limited.
Registered number 475201
Friends Ivory & Sime Managed Pensions Funds Limited.
Registered number 1020044
Registered and Head Office of each of the above companies is at Pixham End,
Dorking, Surrey RH4 1QA.
Registered in England. Incorporated companies limited by shares.
Ivory & Sime Trustlink Limited. Registered number 151198
Registered and Head Office: One Charlotte Square, Edinburgh EH2
4DZ.  Registered in Scotland. Incorporated company limited by
shares.

Companies within this Group transact life assurance, pension,
permanent health, unit trust and investment trust business

All are regulated by the Personal Investment Authority.
--- End Message ---
--- Begin Message ---
How can I run a php script from the command line?

Ryan Conover
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.pitt.edu/~rscst25/


--- End Message ---
--- Begin Message ---
--- Received from FPU.WHITES1 799 3703                    07-12-01 15:44

  -> [EMAIL PROTECTED]
  -> [EMAIL PROTECTED]

php -f (filename)

-Steve

------------------------------------------------------------------------

From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Fri, 7 Dec 2001 10:41:52 -0500
Subject: [PHP-WIN] run a php script

How can I run a php script from the command line?

Ryan Conover
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.pitt.edu/~rscst25/



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

This e-mail may contain confidential information and/or copyright
material. This e-mail is intended for the use of the addressee
only. Any unauthorised use may be unlawful.

If you receive this e-mail by mistake please advise the sender
immediately by using the reply facility in your e-mail software.

Friends Provident Marketing Group consists of the following
companies:

Friends Provident Life and Pensions Limited.
Registered number 4096141.
Friends' Provident Unit Trust Managers Limited.
Registered number 970641
FP Life Assurance Limited.
Registered number 782698
Friends Provident Pensions Limited.
Registered number 475201
Friends Ivory & Sime Managed Pensions Funds Limited.
Registered number 1020044
Registered and Head Office of each of the above companies is at Pixham End,
Dorking, Surrey RH4 1QA.
Registered in England. Incorporated companies limited by shares.
Ivory & Sime Trustlink Limited. Registered number 151198
Registered and Head Office: One Charlotte Square, Edinburgh EH2
4DZ.  Registered in Scotland. Incorporated company limited by
shares.

Companies within this Group transact life assurance, pension,
permanent health, unit trust and investment trust business

All are regulated by the Personal Investment Authority.
--- End Message ---
--- Begin Message ---
Hi
I would like to know the function written to know the URL of the page the
user's browser was previously on if the user followed a link from that page
to my php script (as "referer" in perl script)
I'm using Apache webserver on win98 OS.
If any one know the code to be written plz send it to me as soon as
possible.

Thanks a lot



--- End Message ---
--- Begin Message ---
Hi,
I'm playing with session and after
<php
session_start(); 
session_register($name);
$name="afan"; 
?>

 I'm getting this warning:

Warning: open(/tmp\sess_41d3918086b66b0e71cc6a0dc5dea344, O_RDWR) failed: m (2) in 
C:\admin\index.php on line 2

What's problem?

Thanks for any help.

Afan
--- End Message ---
--- Begin Message ---
Hello Afan,

I'm also using Sessions, but I learned that when using session_register you
don't use the normal variable syntax with the session variable, such as
($name).  Here's my code that works properly:

<?
//register the user's ID and permission level
                session_register('SESSION_UID');
                session_register('SESSION_UPERMS');
                $SESSION_UID = $uid;
                $SESSION_UPERMS = $uperms;
?>

As you can see I use session_register('variablename'), then declare the
session variables after registering them (at first they have nothing in
them, or 0, I believe.  By the way, $uid and $uperms are values I retrieved
from the database.  You can hardcode values in there accordingly.  So your
code would be:

<php
session_start(); 
session_register('name');
$name="afan"; 
?>

And that should work.  Hope this helps...

David

-----Original Message-----
From: Afan Pasalic [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 07, 2001 1:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] session problem


Hi,
I'm playing with session and after
<php
session_start(); 
session_register($name);
$name="afan"; 
?>

 I'm getting this warning:

Warning: open(/tmp\sess_41d3918086b66b0e71cc6a0dc5dea344, O_RDWR) failed: m
(2) in C:\admin\index.php on line 2

What's problem?

Thanks for any help.

Afan
--- End Message ---
--- Begin Message ---
Tanks for all of you people - that was really fast.
And problem was, as "Webmaster" said - temp directory didn't exist.

Thanks for help.

afan


----- Original Message -----
From: "Webmaster" <[EMAIL PROTECTED]>
To: "Afan Pasalic" <[EMAIL PROTECTED]>
Sent: Friday, December 07, 2001 1:08 PM
Subject: Re: [PHP-WIN] session problem


> Your tmp directory may not exist. Change the setting for session.save_path
> in the php.ini file - I used c:\windows\temp and it worked for me. I was
> getting the same error message.
> ----- Original Message -----
> From: Afan Pasalic <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 07, 2001 6:11 PM
> Subject: [PHP-WIN] session problem
>
>
> Hi,
> I'm playing with session and after
> <php
> session_start();
> session_register($name);
> $name="afan";
> ?>
>
>  I'm getting this warning:
>
> Warning: open(/tmp\sess_41d3918086b66b0e71cc6a0dc5dea344, O_RDWR) failed:
m
> (2) in C:\admin\index.php on line 2
>
> What's problem?
>
> Thanks for any help.
>
> Afan
>
>
>

--- End Message ---
--- Begin Message ---
Make sure the tmp directory is created and it has write permissions to
everybody.

bye.

_________________________________
Dario Fernando Escobar Risue駉
Webmaster Telesat S.A.
[EMAIL PROTECTED]
Cali - Valle - Colombia


----- Original Message -----
From: "Afan Pasalic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 07, 2001 1:11 PM
Subject: [PHP-WIN] session problem


Hi,
I'm playing with session and after
<php
session_start();
session_register($name);
$name="afan";
?>

 I'm getting this warning:

Warning: open(/tmp\sess_41d3918086b66b0e71cc6a0dc5dea344, O_RDWR) failed: m
(2) in C:\admin\index.php on line 2

What's problem?

Thanks for any help.

Afan


--- End Message ---
--- Begin Message ---
Okay, I'm going to throw my laptop through a window in a second!  Why won't
session_destroy() work?  I can't be the only one with this problem.  I know
the session variables exist.  I'm running PHP 4.0.6, anyone else ever have
this problem?  Please let me know if there's some sort of bug with this or
something.  Thanks!
--- End Message ---
--- Begin Message ---
On Fri, 7 Dec 2001 13:36:32 -0500, Ayres, David wrote:
>Okay, I'm going to throw my laptop through a window in a second!
>Why won't session_destroy() work?  I can't be the only one with this
>problem.
>I know the session variables exist.  I'm running PHP 4.0.6, anyone
>else ever have this problem?  Please let me know if there's some
>sort of bug with this or something.  Thanks!
>

Running 4.0.5 here, but session_destroy works just fine. Only thing
you need to do is to first initiate the session, with session_start,
probably you also want to empty up those vars with session_unset, and
the conclude the whole thing with session_destroy:

session_start();
session_unset();
session_destroy();


Works like a charm... :)

Regards,


EGil


-=//

   Egil Helland / IKON AS - MCSE, Internet, Intranet

      mailto:[EMAIL PROTECTED]      http://egil.net

                            //=-




--- End Message ---
--- Begin Message ---

寻求一个好的域名、高速稳定的JSP空间? 
那就请您来这里看看吧: 
http://www.now.net.cn 时创网络! 

☆ 率先支持JSP 及最新标准JDBC 数据库,完全解准中文及数据库中文问题 

☆ 多种动态脚本包括 ASP,PHP,CGI ,PERL5.6 ,JSP,Servlet , 
还有快速CGI ,快速PERL(fcgi)支持, PHP也带最新加速引挚! 
(详见:http://www.now.net.cn/host/) 
☆ 多种数据库支持,包括 SQL SERVER2000 MYSQL MYSQL-MAX ACESS 

☆ 独有的可视化域名服务器VDNS系统,使用能任意地建立您的子域名及子网站 
(详见:http://www.now.net.cn/support/VDNSFAQ.net 
域名注册包括 : .com .net .org .biz .info .cc .tv .sh 
.com.cn .net.cn .gov.cn .org.cn ) 

☆ 全新的企业邮件系统,超大容量、强大的功能,还有完整管理后台, 
建立您公司的企业邮局,只是几分钟的事! 
(详见:http://www.now.net.cn/email) 

我们还提供IDC、主机托管、主机租赁、企业电子邮局系统,服务更好,价格更优! 
http://idc.now.net.cn 

快到http://www.now.net.cn时创网络吧!可能会意想不到的惊喜……………………


联系人:邱小姐 黄小姐 
欢迎您访问Today's Network &lt;http://www.now.net.cn&gt; 
欢迎您致信Today's Network [EMAIL PROTECTED] 


 
--- End Message ---

Reply via email to