php-windows Digest 25 Apr 2001 09:28:09 -0000 Issue 563

Topics (messages 7031 through 7040):

IRC Clients
        7031 by: Leo Hansson
        7032 by: Plutarck

Re: php postgres module for windows 2000
        7033 by: Yasuo Ohgaki

YapBB
        7034 by: Manesh

Errors Help!
        7035 by: Manesh

CGI & ISAPI mode problem
        7036 by: Gu Weidong-a1923c

socket API
        7037 by: Sam

MYSQL Help
        7038 by: edwin
        7040 by: Johannes Janson

Sessions
        7039 by: Roman Lichszteld

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]


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


Greetings.
I'm looking for information about how to interface IRC with PHP.
Information, links, hints about where to start and problems that may occur,
and such  is very welcome.

Thanks in advance.
Leo Hansson






Highly reccommended is the book Web Application Development with PHP 4.0.
It's sitting on my computer tower next to me at this very moment.

In Chapter 3 they walk through the development of a program called phpChat,
and they include the full source code to it on the accompanying CDROM.
Search around for phpChat and you can probably get it that way too.

It's a program which interfaces with phpIRC, gettable from phpwizard.net. I
can think of no reason to use anything but phpIRC, unles you _really_ like
reinventing the wheel :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""Leo Hansson"" <[EMAIL PROTECTED]> wrote in message
9c4taf$t9p$[EMAIL PROTECTED]">news:9c4taf$t9p$[EMAIL PROTECTED]...
> Greetings.
> I'm looking for information about how to interface IRC with PHP.
> Information, links, hints about where to start and problems that may
occur,
> and such  is very welcome.
>
> Thanks in advance.
> Leo Hansson
>
>
>
> --
> 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]
>






"Patrick Dunford" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On 24 Apr 2001 02:00:33 -0700 AD in php.windows, Yasuo Ohgaki said:
>
> >I also would like to have php_pgsql.dll compiled with libpq 7.1, if anyone
> >know/compiled php_pgsql.dll with 7.1 libpq.
> >Could you tell where to get it?
> >
> >Anyway, answer to question. If you get binary from www.php4win.de, it comes
with
> >php_pgsql.dll compiled with libpq 7.0.
> >It does not support pg_cmdtuples(). If you are using PostgreSQL 7.1, you'll
get
> >error message telling there is no error from pg_errormessage().
>
> Yes however Postgresql itself (a separate product) is not available compiled
> for Windows 2000.

We can compile/runs PostgreSQL for/under Windows, read INSTALL text in source
dist. (There might be compiled binary somewhere)  We still can use PostgreSQL
under Windows, just connect to server where ever it is.

Regards,
--
Yasuo Ohgaki




When i try and use it i get this, i have one the databse in MySql!



Warning: Undefined variable: NODB in include/global.php on line 871

Warning: Use of undefined constant DB_HOST - assumed 'DB_HOST' in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 21

Warning: Use of undefined constant DB_LOGIN - assumed 'DB_LOGIN' in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 22

Warning: Use of undefined constant DB_PASSWORD - assumed 'DB_PASSWORD' in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 23

Warning: Use of undefined constant DB_NAME - assumed 'DB_NAME' in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 24

Warning: Use of undefined constant DB_T_SESSION - assumed 'DB_T_SESSION' in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 25

Warning: Use of undefined constant DB_T_USER_VARS - assumed 'DB_T_USER_VARS'
in C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 26

Warning: Undefined variable: ses_db_hand in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 28

Warning: Undefined variable: s_PHPversion in
C:\Inetpub\wwwroot\YapBB/include/yapbb_session.php on line 28

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 203

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 51

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 63

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 74

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 75

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 99

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 51

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 63

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 74

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 75

Warning: Undefined variable: sid in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 241

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 51

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 63

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 74

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 75

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 99

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 106

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 109

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 263

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 268

Warning: Cannot add header information - headers already sent by (output
started at include/global.php:871) in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 273

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 88

Warning: Undefined index: yapbbcookie in include/global.php on line 908

Warning: Cannot add header information - headers already sent by (output
started at include/global.php:871) in include/global.php on line 932

Warning: Cannot add header information - headers already sent by (output
started at include/global.php:871) in include/global.php on line 933

Warning: Undefined variable: cfgTemplateOpenTag in include/global.php on
line 1022

Warning: Undefined variable: s_PHPversion in
C:\Inetpub\wwwroot\YapBB/include/yapbb_session.php on line 139

Warning: Undefined variable: debug in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 138

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\wwwroot\YapBB/include/sqlsession.php on line 142

Warning: Undefined variable: cfgServerPort in
C:\Inetpub\wwwroot\YapBB/include/class_sql.php on line 29

Invalid SQL-query:


INSERT INTO forum_useronline (userid, date, ip) VALUES (0, 988159485,
'24.42.245.225')
MySQL said: Table 'yapbb.forum_useronline' doesn't exist





I get these on somthing else, BTW i have download there BB and they should
work


Warning: Undefined variable: realm in c:\inetpub\wwwroot\f\install-95.php on
line 4

Warning: Use of undefined constant dbhost - assumed 'dbhost' in
c:\inetpub\wwwroot\f\install-95.php on line 12

Warning: Undefined variable: dbhost in c:\inetpub\wwwroot\f\install-95.php
on line 12

Warning: Use of undefined constant dbuser - assumed 'dbuser' in
c:\inetpub\wwwroot\f\install-95.php on line 13

Warning: Undefined variable: dbuser in c:\inetpub\wwwroot\f\install-95.php
on line 13

Warning: Use of undefined constant dbpass - assumed 'dbpass' in
c:\inetpub\wwwroot\f\install-95.php on line 14

Warning: Undefined variable: dbpass in c:\inetpub\wwwroot\f\install-95.php
on line 14

Warning: Use of undefined constant dbname - assumed 'dbname' in
c:\inetpub\wwwroot\f\install-95.php on line 15

Warning: Undefined variable: dbname in c:\inetpub\wwwroot\f\install-95.php
on line 15

Warning: Undefined variable: submit in c:\inetpub\wwwroot\f\install-95.php
on line 34

----------------------------------------------------------------------------
--------------------------------------------
My install-05.php looks like this
----------------------------------------------------------------------------
--------------------------------------------

<?
$version = ".95";

if (!$realm)
        $realm = "default";
/*
if (($realm)&&(file_exists("realm.$realm.php")))
        include "realm.$realm.php";
else
        include "realm.default.php";
*/
$config[dbhost]=$dbhost;
$config[dbuser]=$dbuser;
$config[dbpass]=$dbpass;
$config[dbname]=$dbname;

include 'funcs.mysql.php';

function check_table_existence($table){
        global $config;

        if (db_numrows_all($table) > 0){

                return TRUE;

        } else {

                return FALSE;

        }

}

if ($submit){

        if (file_exists("realm.$realm.php")){

                print "Error: Realm $realm already exists!";

        } else {


                $phpver = phpversion();
                $ext[ldap] = extension_loaded("ldap");
                $ext[mysql] = extension_loaded("mysql");
                $installer[ip] = getenv("REMOTE_ADDR");
                $installer[browser] = getenv("HTTP_USER_AGENT");
                $server[os] = getenv("OSTYPE");
                $server[web] = getenv("SERVER_SOFTWARE");
                $server[host] = getenv("HTTP_HOST");

                //$ext[mysql] = FALSE;
                //$phpver = "3.0.17";
                //print floor($phpver);

                if ($ext[mysql]){
                                db_connect();
                                $res_version = mysql_query("SELECT Version() as 
version");
                                $mysql = mysql_fetch_array($res_version);
                }

                print "<strong><font size='+2'>Installing electrifiedForum
$version</font></strong><br><br>";
                print "<strong>System Information</strong><br>";
                print "PHP Version: $phpver<br>";
                if (floor($phpver)<4) print "<font color=red>PHP Version Not 4.0 or
Greater</font> You may have problems<br>";
                print "MySQL Version: $mysql[version]<br>";
                if (!strstr($mysql[version],"3.23")) print "<font color=red>MySQL 
Version
Not 3.23.x</font> You may have problems<br>";
                print "Server OS: $server[os]<br>";
                print "Web Server Daemon: $server[web]<br>";
                print "Server Hostname: $server[host]<br>";

                print "<br>";
                if ($ext[mysql])
                        print "MySQL Extension Loaded<Br>";
                if ($ext[ldap])
                        print "LDAP Extension Loaded (Not yet used)<Br>";


                print "<br><hr noshade width=20% align=left>";
                print "Building MySQL Tables in database $config[dbname]...<br><br>";

                if ($ext[mysql]){
                        print "Creating forums table...";
                        if (!check_table_existence("forums")){
                                if (mysql_query("CREATE TABLE forums (
   fname varchar(20) NOT NULL,
   ftitle varchar(30) NOT NULL,
   fdesc varchar(200) NOT NULL,
   cat varchar(40) NOT NULL,
   owner varchar(100) NOT NULL,
   icon varchar(100) NOT NULL,
   options smallint(6) DEFAULT '1' NOT NULL,
   PRIMARY KEY (fname),
   UNIQUE fname (fname),
   KEY fname_2 (fname)
);")){
                                        print "Success<br>";
                                } else {
                                        print "<font color=red>Error</font><br>";
                                        $errors++;
                                }

                        mysql_query("INSERT INTO forums VALUES ('chat','Chat','A forum 
to talk
about anything and everything!','General','$adminuser','','1');");


                        } else {

                                print "<font color=red>Warning!</font> Forums table 
Already
Exists!<br>";
                                $warnings++;
                        }

                        print "Creating users table...";
                        if (!check_table_existence("fusers")){
                                if (mysql_query("CREATE TABLE fusers (
                                                        username varchar(20) NOT NULL,
                                                        password varchar(20) NOT NULL,
                                                        level smallint(6) DEFAULT '0' 
NOT NULL,
                                                        options tinyint(4) DEFAULT '0' 
NOT NULL,
   location varchar(100) NOT NULL,
   email varchar(100) NOT NULL,
   homepage varchar(200) NOT NULL,
   showemail tinyint(4) DEFAULT '0' NOT NULL,
   icq varchar(20) NOT NULL,
   showicq tinyint(4) DEFAULT '0' NOT NULL,
   aim varchar(40) NOT NULL,
   showaim tinyint(1) DEFAULT '0' NOT NULL,
   yahoo varchar(80) NOT NULL,
   showyahoo tinyint(1) DEFAULT '0' NOT NULL,
   realname varchar(100) NOT NULL,
   age smallint(6) DEFAULT '0' NOT NULL,
   birthday varchar(8) NOT NULL,
   showbirthday tinyint(4) DEFAULT '0' NOT NULL,
   gender varchar(10) NOT NULL,
   avatar varchar(60) NOT NULL,
                                                        sig text NOT NULL,
                                                        disabled tinyint(1) DEFAULT 
'0' NOT NULL,
                                                        rank smallint(6) DEFAULT '0' 
NOT NULL,
                                                        votes smallint(6) DEFAULT '0' 
NOT NULL,
                                                        PRIMARY KEY (username),
                                                        UNIQUE username (username),
                                                        KEY username_2 (username)
                                                );")){
                                        print "Success<br>";
                                } else {
                                        print "<font color=red>Error</font><br>";
                                        $errors++;
                                }

                                        mysql_query("INSERT INTO fusers VALUES ( 
'$adminuser', '$adminpass',
'10', '0', '', '', '', '0', '', '0', '', '0', '', '0', '', '', '', '0', '',
'', '', '0', '', '');");

                        } else {

                                print "<font color=red>Warning!</font> Users table 
Already Exists!<br>";
                                $warnings++;

                        }


                        print "Creating messages table...";
                        if (!check_table_existence("messages")){
                                if (mysql_query("CREATE TABLE messages (
   id smallint(6) NOT NULL auto_increment,
   fname varchar(20) NOT NULL,
   threadid smallint(6) DEFAULT '0' NOT NULL,
   threadindex smallint(6) DEFAULT '0' NOT NULL,
   poster varchar(100) NOT NULL,
   title varchar(120) NOT NULL,
   content text NOT NULL,
   icon varchar(60) NOT NULL,
   ip varchar(60) NOT NULL,
   posttime timestamp(14),
   options smallint(6) DEFAULT '1' NOT NULL,
   PRIMARY KEY (id),
   UNIQUE id (id),
   KEY forumname (fname)
);")){
                                        print "Success<br>";
                                } else {
                                        print "<font color=red>Error</font><br>";
                                        $errors++;
                                }
                                        mysql_query("INSERT INTO messages VALUES
('1','chat','0','0','$adminuser','Welcome to electrifiedForum', 'If you see
this message, electrifiedForum is properly installed and configured!!', '',
'', now(), '1')");
                        } else {
                                print "<font color=red>Warning!</font> Messages table 
Already
Exists!<br>";
                                $warnings++;
                        }
                } else {

                        print "<strong><font color=red>FATAL ERROR</font></strong>: 
Unable to
build MySQL tables: MySQL Support Not Enabled in this version of PHP<br>";
                        $errors++;
                }

   /* Now to open up the template file, parse the vars, and writeout the
realm file */

   $tf = fopen('realmtemplate.txt','r');
   $templa = fread($tf, filesize('realmtemplate.txt'));

   $data = str_replace("[%REALM-TITLE%]",$title,$templa);
   $data = str_replace("[%DB-HOST%]",$dbhost,$data);
   $data = str_replace("[%DB-USER%]",$dbuser,$data);
   $data = str_replace("[%DB-PASS%]",$dbpass,$data);
   $data = str_replace("[%DB-NAME%]",$dbname,$data);
   $data = str_replace("[%DESCRIPTION%]",$description,$data);
   $data = str_replace("[%KEYWORDS%]",$keywords,$data);

   fclose($tf);
   $rf = fopen("realm.$realm.php",'w');
   fwrite($rf,$data);
   fclose($rf);

                print "<br>";
                if (!$errors && !$warnings)
                        print "Install successful, No errors or warnings<br>";
                elseif (!$errors)
                        print "Install complete but with warnings<br>";
                else
                        print "Errors occurred during Installation.<br>";

        }

} else {
/* Installation Options Form */

?>

<form action='install-95.php?realm=<?=$realm?>' method=post>

Please fill out the form below in order to install electrifiedForum 0.95 for
realm: <?=$realm?><br>
<br>
Administrator User Name:<input type=text name=adminuser><br>
<br>
Administrator Password:<input type=text name=adminpass><br>
<br>
Title of forums:<input type="text" name=title><br>
<br>
MySQL Database Host:<input type="text" name=dbhost><br>
<br>
MySQL Database Username:<input type="text" name=dbuser><br>
<br>
MySQL Database Password:<input type="text" name=dbpass><br>
<br>
MySQL Database Name:<input type="text" name=dbname><br>
<br>
Description:<input type="text" name=description><br>
<br>
Keywords:<input type="text" name=keywords><br>

<input type=submit name=submit value='Install'>
</form>

<?

}
?>





OCI can work under ISAPI but not CGI. 
LDAP can work under CGI but not ISAPI.

My configuration:
PHP:4.0.2
OS:WIN4.0+IIS 4.0
Oracle Client:8.0.5

Any hints?

Weidong Gu







Hi,

    I can't use socket() under WIN32 php4.0.4pl1, what's wrong ??
Of cource I know how to use psockopen(), but the function
'socket_get_status'
doesn't work, so I think maybe it can work if I use socket() to create
socket...


Sam.






hi,

I got a very simple question. I have mysql under win2k and I need help
adding a new user to be able to use the database. I looked through the
manual but all the references are for *nix, can someone help me out or point
me to a place where i can read up on this??

thanks!!
edwin






hi,

the info in the manual about the command line in mysql apply also
for win2k. Assuming you have root access go to the mysql prompt
and type this:
GRANT select, insert, update, delete, WhatPrivYouWant ON YourDB.* TO
username
IDENTIFIED BY 'YourPassword';

This creates a user "username" with pasword "YourPassword" who has the
specified priviledges
on all tables in YourDB.


Johannes

""edwin"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
9c60eq$p5b$[EMAIL PROTECTED]">news:9c60eq$p5b$[EMAIL PROTECTED]...
> hi,
>
> I got a very simple question. I have mysql under win2k and I need help
> adding a new user to be able to use the database. I looked through the
> manual but all the references are for *nix, can someone help me out or
point
> me to a place where i can read up on this??
>
> thanks!!
> edwin
>
>
>
> --
> 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]
>






I use Apache server with PHP 4 installed on WinNT 4.0, session.use_trans_sid
is set to 1, I don't use cookies.

I have three pages, each looks like this:

// test1.php

<?
  require("../php/checkuser.php");

  print("Logged user: " . @$LoggedUserName . "<BR><BR>\n");

  print("<FORM action=\"../php/test2.php\" method=\"post\">\n");  // second
page has action="/php/test3.php" and so on...
  print("<INPUT type=\"submit\" name=\"Modify\" value=\"Next >>\">\n");
  print("</FORM>\n");
?>

Script "checkuser.php" simply calls "session_start()" and then check if
variable 'LoggedUserName' isn't empty - in such case user is redirected to
login page.

Firts of these pages (test1.php) is called from main menu after successfull
login.
Everything works fine: on first and second page SID is properly propagated
but on third page script 'checkuser.php' ALWAYS redirects me to login again.
Is it possible that session ID becomes invalid after third page (menu ->
test1 -> test2 -> ... )?!

Had anyone similar problem?

Regards

Roman Lichszteld
[EMAIL PROTECTED]
[EMAIL PROTECTED]





Reply via email to