php-windows Digest 30 Mar 2002 06:01:25 -0000 Issue 1069
Topics (messages 12815 through 12840):
R: [PHP-WIN] server problem?
12815 by: Alberto. Sartori
12817 by: Mihail Bota
Re: server problem?
12816 by: Xytras
Re: ASP vs PHP
12818 by: Evan
mysql_connect() doesn't like "localhost" ?!
12819 by: Firas Al-Ragom
COM/excel/graphs
12820 by: boltthrower.iol.it
Files....
12821 by: Todd WIlliamsen
12830 by: Todd WIlliamsen
R: [PHP-WIN] Files....
12822 by: Darvin Andrioli
Re: How to Pass the Username which from Windows Login
12823 by: J Wynia
12825 by: Vail, Warren
12832 by: Bossanova
Re: USING $_SESSION instead of session_register()
12824 by: Bossanova
12828 by: Bossanova
Re: using $_SESSION
12826 by: Bossanova
Re: ODBC Connection Problems
12827 by: Svensson, B.A.T. (HKG)
12833 by: Steve
Parse error when using Javascript & php?
12829 by: Todd WIlliamsen
12831 by: Ross Fleming
12834 by: Mike Flynn
12835 by: Steve
12836 by: Todd WIlliamsen
12837 by: Mike Flynn
Nead Help With A Php Script
12838 by: Alain Kumschick François Robert
RE : [PHP-WIN] mysql_connect() doesn't like "localhost" ?!
12839 by: Firas Al-Ragom
Passing an array into a COM function
12840 by: Jeff Bendixsen
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 ---
Your user got the correct permissions on the php's folder? It should be a premissions
problem...however, what kind of code did you run?
-----Messaggio originale-----
Da: Mihail Bota [mailto:[EMAIL PROTECTED]]
Inviato: venerdì 29 marzo 2002 10.21
A: [EMAIL PROTECTED]
Oggetto: [PHP-WIN] server problem?
Dear all,
I was navigating through my database remotely and suddenly the php
stopped to answer. The error I continously get is:
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
Any other kinds of pages or files (html, gif, swf) are working, so the
server is working. All the php code is there, unchanged, all the
php-related folders, .dll's, exe, ini are in their places.
Had this thing ever occured to anybody? What should I do?
I am using Win 2K and IIS 5.0, PhP 4.1.1
Thanks for your help.
Mihai
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
yes. I was navigating through the datbase and suddenly it retrieved that
kind of error.
code: queries from a mysql database. If mysql would not work, I'd get an
mysql error. instead, is behaving as if the php.exe does not find the
pages, even though the pages are there.
I have a couple of folders with php pages and none is working, either.
On Fri, 29 Mar 2002, Alberto.
Sartori wrote:
> Your user got the correct permissions on the php's folder? It should be a
>premissions problem...however, what kind of code did you run?
>
> -----Messaggio originale-----
> Da: Mihail Bota [mailto:[EMAIL PROTECTED]]
> Inviato: venerdì 29 marzo 2002 10.21
> A: [EMAIL PROTECTED]
> Oggetto: [PHP-WIN] server problem?
>
>
> Dear all,
>
> I was navigating through my database remotely and suddenly the php
> stopped to answer. The error I continously get is:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
> of HTTP headers. The headers it did return are:
>
> Any other kinds of pages or files (html, gif, swf) are working, so the
> server is working. All the php code is there, unchanged, all the
> php-related folders, .dll's, exe, ini are in their places.
>
> Had this thing ever occured to anybody? What should I do?
> I am using Win 2K and IIS 5.0, PhP 4.1.1
> Thanks for your help.
>
> Mihai
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
well. it looks like you are running PHP as a cgi
you should switch to PHP as a service, maybe it would work faster and better
and you won't get that CGi error
Xytras
----- Original Message -----
From: "Mihail Bota" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 2:20 AM
Subject: [PHP-WIN] server problem?
> Dear all,
>
> I was navigating through my database remotely and suddenly the php
> stopped to answer. The error I continously get is:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
> of HTTP headers. The headers it did return are:
>
> Any other kinds of pages or files (html, gif, swf) are working, so the
> server is working. All the php code is there, unchanged, all the
> php-related folders, .dll's, exe, ini are in their places.
>
> Had this thing ever occured to anybody? What should I do?
> I am using Win 2K and IIS 5.0, PhP 4.1.1
> Thanks for your help.
>
> Mihai
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hope this will help you:
1) Macromedia Ultradev + PHAkt extension (www.macromedia.com) $$
2) www.phpide.de
3) www.phpedit.com
4) http://dd.cron.ru/dbg (debugger)
Evan
"Ciro Martins" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi!
>
>
> I've been programming in PHP for long. But one question that always is
> coming to my mind is to know if there exists some kind of tools (like
> for SP. It exists a tool called ASPWebTools for wich it is possible to
> develop applications written in ASP and connecting with DB like SQL
> Server in an automatic way) that can help in the development of
> applications using PHP and databases. For instance, that could allow to
> develop automatically forms to connect to databases using PHP.
>
> Does anyone know any related application or tools.
> Because in ASP with that tool is more easy to develop code.
>
> Thanks in advance
>
> Ciro Martins
>
--- End Message ---
--- Begin Message ---
Hi everyone,
I've just installed Apache 1.3.24 and PHP 4.1.2 ( as a module ) and mySQL
3.23.49
on a Windows 2000 workstation. I didn't encounter any problems with the
install,
but for some strange reason whenever I use any scripts with
mysql_connect("localhost", "user", "password")
I get Warning: Can't connect to MySQL server on 'localhost' (10061) errors
Now the strange thing is that if I remove the "localhost" and replace it
with "" everything will work fine.
I've tried downgrading mySQL and PHP to several different versions with the
same results.
This isn't the first time i've installed this kind of setup on a win2k
machine,
but it's the first time I've had this problem.
Any help would be really appreciated.
Sample script :
<?php
//list_db.php
$link_id = mysql_connect("localhost", "user", "password");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);
while($db_data = mysql_fetch_row($result)) {
echo $db_data[0]. "<BR>";
$result2 = mysql_list_tables($db_data[0]);
$num_rows2 = mysql_num_rows($result2);
while($table_data = mysql_fetch_row($result2)) echo "--" .
$table_data[0]. "<BR>";
echo "==> $num_rows2 table(s) in " . $db_data[0] . "<P>";
}
?>
Resulting errors :
Warning: Can't connect to MySQL server on 'localhost' (10061) in
c:\webdev\www\index.php on line 4
Warning: MySQL Connection Failed: Can't connect to MySQL server on
'localhost' (10061) in c:\webdev\www\index.php on line 4
Warning: Supplied argument is not a valid MySQL-Link resource in
c:\webdev\www\index.php on line 5
Warning: Supplied argument is not a valid MySQL result resource in
c:\webdev\www\index.php on line 6
Warning: Supplied argument is not a valid MySQL result resource in
c:\webdev\www\index.php on line 8
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
hello,
I'm trying to draw some graphs using COM objects, but it seems I can't
set any property..
here's my script snip:
$ex = new COM("Excel.sheet") or Die ("No COM");
print("Application name: {$ex->Application->value}<br>");
print("Loaded version: {$ex->Application->version}<br>");
$wkb = $ex->Application->Workbooks->Add();
$ch = $wkb->Charts->Add;
print_r( $ch );
$ch->Activate;
$ch->hastitle = 1;
$ch->ChartTitle->Text='pippo';
$leg=$ch->Legend;
echo $leg->Height;
$leg->Height=200;
I get:
Application name: Microsoft Excel
Loaded version: 9.0
Warning: PropPut() failed: Exception occurred. Source: Microsoft Excel
Description: Unable to set the HasTitle property of the Chart class in
c:\program files\apache\htdocs\bs-test\com\exp-graph-excel.php on line
19
.....
and so on for any of the subsequent statements; (the echo $leg->Height
gives a PropGet failed..)
the HasTitle property really exists, like ChartTitle->Text, Height
etc...
I had worked with COM/Powerpoint and everything goes;
any hint?
thank you very much,
--giuseppe
--- End Message ---
--- Begin Message ---
Ok I made a content management intereface and I am trying to get it to open
write the contents then close the file, but I keep getting this error:
Warning: Wrong parameter count for fputs() in
/home/sites/site9/web/demo/cms/savenews.php on line 4
here is the code:
<?
$filename = "/home/sites/www.ktjconsulting.com/web/demo/cms/cms.htm";
$fp = @fopen("$filename", "w+") or die ("Could not open File");
fputs ("$EditorValue"); <---- LINE 4
fclose($fp);
?>
$EditorValue is the value of the form for the interface. I did check that
and seems to be ok.
When I change the $filename from absolute path to URL, nothing changes, same
error. I am getting frustrated.
--- End Message ---
--- Begin Message ---
Thanks... it works!!
"Darvin Andrioli" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > <?
> > $filename = "/home/sites/www.ktjconsulting.com/web/demo/cms/cms.htm";
> > $fp = @fopen("$filename", "w+") or die ("Could not open File");
> > fputs ("$EditorValue"); <---- LINE 4
> ^^^^^^^^^^^^^^^^^
> Is it an error in your e-mail, or really you have that code?
>
> The statement should be "fputs($fp,"$EditorValue");"
>
> Darvin
--- End Message ---
--- Begin Message ---
> <?
> $filename = "/home/sites/www.ktjconsulting.com/web/demo/cms/cms.htm";
> $fp = @fopen("$filename", "w+") or die ("Could not open File");
> fputs ("$EditorValue"); <---- LINE 4
^^^^^^^^^^^^^^^^^
Is it an error in your e-mail, or really you have that code?
The statement should be "fputs($fp,"$EditorValue");"
Darvin
--- End Message ---
--- Begin Message ---
$network = new COM("WScript.Network");
$computername = $network->ComputerName;
$username = $network->UserName;
Password can't be grabbed for fairly obvious reasons.
"Jack" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I want to prevent user to make another login before they can browse the
> Intranet, so is there anyway that php can grep the username from the
windows
> Login or Domain Login?
> Which means if a user can login to the Windows NT, then he/she will have
the
> right to browse the Intranet!
>
> Thx a lot
> Jack
> [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
Does this retrieve the userid of the machine where the web server is
running, or does it retrieve the userid of the machine where the browser is
running?
Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658
-----Original Message-----
From: J Wynia [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 8:38 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: How to Pass the Username which from Windows Login
$network = new COM("WScript.Network");
$computername = $network->ComputerName;
$username = $network->UserName;
Password can't be grabbed for fairly obvious reasons.
"Jack" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dear all
> I want to prevent user to make another login before they can browse the
> Intranet, so is there anyway that php can grep the username from the
windows
> Login or Domain Login?
> Which means if a user can login to the Windows NT, then he/she will have
the
> right to browse the Intranet!
>
> Thx a lot
> Jack
> [EMAIL PROTECTED]
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Actually it retrieves the userid of the server instead of the client's.
----- Original Message -----
From: "Vail, Warren" <[EMAIL PROTECTED]>
To: "'J Wynia'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 9:44 AM
Subject: RE: [PHP-WIN] Re: How to Pass the Username which from Windows Log
in
> Does this retrieve the userid of the machine where the web server is
> running, or does it retrieve the userid of the machine where the browser
is
> running?
>
>
> Warren Vail
> Tools, Metrics & Quality Processes
> (415) 667-7814
> Pager (877) 774-9891
> 215 Fremont 02-658
>
>
> -----Original Message-----
> From: J Wynia [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 29, 2002 8:38 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: How to Pass the Username which from Windows Login
>
>
> $network = new COM("WScript.Network");
> $computername = $network->ComputerName;
> $username = $network->UserName;
>
> Password can't be grabbed for fairly obvious reasons.
>
> "Jack" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Dear all
> > I want to prevent user to make another login before they can browse the
> > Intranet, so is there anyway that php can grep the username from the
> windows
> > Login or Domain Login?
> > Which means if a user can login to the Windows NT, then he/she will have
> the
> > right to browse the Intranet!
> >
> > Thx a lot
> > Jack
> > [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
I've tried your suggestion, and I didn't see anything but a blank page here,
although I see the session ID is passed automatically using PHPSESSID (URL
below). Is there something in php.ini that I have to modify to get this to
work? BTW, I'm running Apache 1.3.23 on Windows 2000 if that would make any
difference. Thanks.
http://localhost/reg_2.php?PHPSESSID=1b18cbc3eb64a63b4cd947f6c58201b8
----- Original Message -----
From: "Pac mon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 28, 2002 10:15 PM
Subject: Re: [PHP-WIN] HELP: USING $_SESSION instead of session_register()
> Not quite... Here's something that ought to work better for you:
>
> ----page1------
> <?
> session_start();
> if (!isset($_SESSION['foo'])) {
> $_SESSION['foo'] = "test foo";
> }
>
> ?>
> <body>
> <? echo $_SESSION['foo'] . "<br>";
> echo session_id() . "<br>";
>
> echo "<br><br>";
> ?>
> <a href="reg_2.php">reg_2.php</a>
> </body>
>
> ----page2--------
> <?
> session_start();
> ?>
> <body>
> <? print $_SESSION['foo']."<br>"; ?>
> </body>
>
>
>
>
>
>
> ----Original Message Follows----
> From: "Bossanova" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: [PHP-WIN] HELP: USING $_SESSION instead of session_register()
> Date: Thu, 28 Mar 2002 13:06:55 -0800
>
> Pardon my ignorance, I've been searching for answers for this new
$_SESSION to work to no avail. If someone can help me out by giving examples
how I can pass the session_id to the next page and access the same
$_SESSION["var"] on that page, it would be very helpful.
>
> My question is, once I set this on the 1st page:
> <?
> session_start();
> if (!isset($_SESSION["foo"])) {
> $_SESSION["foo"] = "test foo";
> }
>
> ?>
> <body>
> <? echo $_SESSION["foo"] . "<br>";
> echo session_id() . "<br>";
>
> echo "<br><br>";
> ?>
> <a href="reg_2.php?id="<? session_id(); ?>">reg_2.php</a>
> </body>
>
>
> How do I set up link to the next page, and what should I put on the next
page? Will this be correct?
>
> <?
> session_id($_GET["PHPSESSID"]);
> session_start();
> ?>
> <body>
> <? print $_SESSION["foo"]."<br>"; ?>
> </body>
>
>
> But I got this error message:
>
> Warning: Undefined index: foo in c:\phps\reg_2.php on line 6
>
> I'm new to PHP so this is also a major factor of the failure. Again,
thanks for your help.
>
>
>
> Burhan
>
>
> greg wrote:
> -------------------------------
> Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is
recommended for security and code readablity. With $_SESSION or
$HTTP_SESSION_VARS, there is no need to use
session_register()/session_unregister()/session_is_registered() functions.
Users can access session variable like a normal variable.
>
> http://www.php.net/manual/en/ref.session.php
>
>
--- End Message ---
--- Begin Message ---
I forgot to mention that I can see the session files "sess_randomnumber" in
the save.session_path file, but all those session files contain nothing (0
K). So does this tell anything at all?
----- Original Message -----
From: "Dale Heil" <[EMAIL PROTECTED]>
To: "'Bossanova'" <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 10:02 AM
Subject: RE: [PHP-WIN] HELP: USING $_SESSION instead of session_register()
> make sure in php.ini for session.save_path you have a
> hard drive path like c:\tmp instead of \tmp as shown.
> there's a note for windows users right above the setting.
>
> -----Original Message-----
> From: Bossanova [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 29, 2002 12:44 PM
> To: Pac mon; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] HELP: USING $_SESSION instead of
> session_register()
>
>
> I've tried your suggestion, and I didn't see anything but a blank page
here,
> although I see the session ID is passed automatically using PHPSESSID (URL
> below). Is there something in php.ini that I have to modify to get this to
> work? BTW, I'm running Apache 1.3.23 on Windows 2000 if that would make
any
> difference. Thanks.
>
> http://localhost/reg_2.php?PHPSESSID=1b18cbc3eb64a63b4cd947f6c58201b8
>
>
>
>
> ----- Original Message -----
> From: "Pac mon" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, March 28, 2002 10:15 PM
> Subject: Re: [PHP-WIN] HELP: USING $_SESSION instead of session_register()
>
>
> > Not quite... Here's something that ought to work better for you:
> >
> > ----page1------
> > <?
> > session_start();
> > if (!isset($_SESSION['foo'])) {
> > $_SESSION['foo'] = "test foo";
> > }
> >
> > ?>
> > <body>
> > <? echo $_SESSION['foo'] . "<br>";
> > echo session_id() . "<br>";
> >
> > echo "<br><br>";
> > ?>
> > <a href="reg_2.php">reg_2.php</a>
> > </body>
> >
> > ----page2--------
> > <?
> > session_start();
> > ?>
> > <body>
> > <? print $_SESSION['foo']."<br>"; ?>
> > </body>
> >
> >
> >
> >
> >
> >
> > ----Original Message Follows----
> > From: "Bossanova" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Subject: [PHP-WIN] HELP: USING $_SESSION instead of session_register()
> > Date: Thu, 28 Mar 2002 13:06:55 -0800
> >
> > Pardon my ignorance, I've been searching for answers for this new
> $_SESSION to work to no avail. If someone can help me out by giving
examples
> how I can pass the session_id to the next page and access the same
> $_SESSION["var"] on that page, it would be very helpful.
> >
> > My question is, once I set this on the 1st page:
> > <?
> > session_start();
> > if (!isset($_SESSION["foo"])) {
> > $_SESSION["foo"] = "test foo";
> > }
> >
> > ?>
> > <body>
> > <? echo $_SESSION["foo"] . "<br>";
> > echo session_id() . "<br>";
> >
> > echo "<br><br>";
> > ?>
> > <a href="reg_2.php?id="<? session_id(); ?>">reg_2.php</a>
> > </body>
> >
> >
> > How do I set up link to the next page, and what should I put on the next
> page? Will this be correct?
> >
> > <?
> > session_id($_GET["PHPSESSID"]);
> > session_start();
> > ?>
> > <body>
> > <? print $_SESSION["foo"]."<br>"; ?>
> > </body>
> >
> >
> > But I got this error message:
> >
> > Warning: Undefined index: foo in c:\phps\reg_2.php on line 6
> >
> > I'm new to PHP so this is also a major factor of the failure. Again,
> thanks for your help.
> >
> >
> >
> > Burhan
> >
> >
> > greg wrote:
> > -------------------------------
> > Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is
> recommended for security and code readablity. With $_SESSION or
> $HTTP_SESSION_VARS, there is no need to use
> session_register()/session_unregister()/session_is_registered() functions.
> Users can access session variable like a normal variable.
> >
> > http://www.php.net/manual/en/ref.session.php
> >
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
John,
I'm actually facing the same problem with yours and
whatever I tried doesn't seem to work now, that's why I'm still searching for
the answer and waiting for anybody to give me pointers here.
----- Original Message -----
Sent: Friday, March 29, 2002 6:20
AM
Subject: [win-apache]: using
$_SESSION
I'm using Apache-win-php4.1.3 and can't create session
variables by using session_start() and $_SESSION['.......']. I'm
new to php, please help.
Next week I tried php4.1.1 and all was working well. Now,
using php4.1.3, compiled as an Apache module and with
session.use_trans_sid=1 in php.ini, I can't redirect a page to
another and access the $_SESSION['variables'] defined in the 1st
document. All codes that were working correctly first now do
not.
es. pageone.php
<?php
session_start();
$_SESSION['var']="testsession";
header( "Location: anotherpage.php?".SID);
exit;
?>
-----
anotherpage.php
<?php
session_start();
print $_SESSION['var'];
..................
?>
N.B: I got a warning: undefined index : var; and make some
controls I noticed that $_SESSION['var'] is not set in the
anotherpage.php. And in pageone.php, $_SESSION['var'] is set as a
normal variable but not a session variable because all files
(sess_21ae6dg34............) are EMPTY.
Please help me. Thank u.
John |
|
_______________________________________________________________________________
IncrediMail - il mondo della posta elettronica
si è finalmente evoluto - Clicca
Qui
|
--- End Message ---
--- Begin Message ---
Maybe these snips could give you an hint about whats going around:
--------[snip 1]--------------------------------------------------------------
BUG: S1000 Error When Sharing Connection in Multiple Threads (Q175313)
The information in this article applies to:
Microsoft ODBC Driver for SQL Server, versions 2.0 , 3.0
Microsoft Visual C++, 32-bit Enterprise Edition, versions 5.0 , 6.0
Microsoft Visual C++, 32-bit Professional Edition, versions 5.0 , 6.0
Microsoft Visual C++, 32-bit Learning Edition, version 6.0
SYMPTOMS
When you share a CDatabase object between multiple threads and use the SQL Server
ODBC driver version 2.65.0240 or later, you
may receive the following error message:
SQLSTATE: S1000
[Microsoft][ODBC SQL Server Driver]Connection is busy with the results for
another hstmt
When you use the Microsoft Data Access Components (MDAC) 2.6 driver, you may
receive the following error message:
State:37000,Native:16909,Origin:[Microsoft][ODBC SQL Server Driver][SQL Server]
sp_cursorfetch: The cursor identifier value provided (1) is not valid
CAUSE
This error occurs because of a timing conflict in the SQL Server ODBC driver or
MDAC 2.6 driver. If two threads are in the
process of calling SQLPrepare(), followed by a
SQLExecute() call, this error may occur.
RESOLUTION
Put CRecordset::Open() calls within a critical section to guarantee that only one
thread is executing a SQL command on the
connection at a given time.
On the SQL Server back end, it is recomended that you use different CDatabase
objects for different threads.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft SQL Server driver.
MORE INFORMATION
Following is a code sample that can cause this error to occur:
Sample code
void CDBProblemDlg::OnDoDatabase()
{
//Open connection to database
m_DB.Open();
CSQLRecordSet rs(&m_DB);
StartThread(&m_DB);
if ( rs.Open(CRecordset::dynaset) )
{
.
.
.
SQLRecordSet.Close();
}
}
void StartThread(CDatabase * pDB)
{
AfxBeginThread(InitThreadProc, pDB, THREAD_PRIORITY_NORMAL);
}
UINT CDBProblemDlg::InitThreadProc( LPVOID pParam )
{
CDatabase* pDB = (CDatabase*) pParam;
if (pDB->IsOpen())
{
CSQLRecordSet SQLRecordSet(pDB);
if (SQLRecordSet.Open(CRecordset::dynaset))
{
.
.
.
SQLRecordSet.Close();
}
}
}
Published
Oct 20 1997 3:41PM
Issue Type
kbbug
Last Modifed
Jun 14 2001 10:19PM
Additional Query Words
VC++
Keywords
kbDatabase kbMFC kbODBC kbSQLServ kbVC500 kbGrpDSMDAC kbDSupport
kbGrpDSODBC
COMMENTS?
--------[end snip 1]--------------------------------------------------------------
--------[snip 2]--------------------------------------------------------------
BUG: SQLState S1000 with SQL_AUTOCOMMIT_OFF/SQLTransact (Q169469)
The information in this article applies to:
Microsoft Open Database Connectivity, versions 2.5 , 3.0
Microsoft Access 97
BUG #: 4841 (Brazos)
SYMPTOMS
If an application does the following in the Microsoft Access 7.0 or 97 version of
the ODBC drivers more than seven times
SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
SQLTransact(henv, hdbc, SQL_COMMIT);
The error generated is:
*szSqlState = "S1000", *pfNativeError = -1103,
*szErrorMsg = "[Microsoft][ODBC Microsoft Access 97 Driver] "
If the application calls SQLExecDirect with any SQL statement, the error generated
is:
szSqlState = "S1000", *pfNativeError = -1103, *pcbErrorMsg = 110
szErrorMsg="[Microsoft][ODBC Microsoft Access 97 Driver] Couldn't start
transaction; too many transactions already nested."
WORKAROUND
To work around this problem, do not set the SQL_AUTOCOMMIT option repeatedly
within a connection. The SQL_AUTOCOMMIT option is a
per-connection option. Once
this option is set, it stays valid until the connection is dropped; an ODBC
application does not have to set the option
repeatedly within a connection.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft Access ODBC driver
version 3.50.3602. We are researching this
problem and will post new information here in the
Microsoft Knowledge Base as it becomes available.
Published
Jun 5 1997 3:11PM
Issue Type
kbbug
Last Modifed
May 12 2001 1:59PM
Additional Query Words
SQLEndTran SQLSetConnectAttr
Keywords
kbprogramming
--------[end snip 2]--------------------------------------------------------------
--------[snip 3]--------------------------------------------------------------
DOCUMENT:Q175313 14-JUN-2001 [odbc]
TITLE :BUG: S1000 Error When Sharing Connection in Multiple Threads
PRODUCT :Open Database Connectivity (ODBC)
PROD/VER::2.0,3.0,5.0,6.0
OPER/SYS:
KEYWORDS:kbDatabase kbMFC kbODBC kbSQLServ kbVC500 kbGrpDSMDAC kbDSupport kbGrpDSODBC
======================================================================
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft ODBC Driver for SQL Server, versions 2.0, 3.0
- Microsoft Visual C++, 32-bit Enterprise Edition, versions 5.0, 6.0
- Microsoft Visual C++, 32-bit Professional Edition, versions 5.0, 6.0
- Microsoft Visual C++, 32-bit Learning Edition, version 6.0
-------------------------------------------------------------------------------
SYMPTOMS
========
When you share a CDatabase object between multiple threads and use the SQL
Server ODBC driver version 2.65.0240 or later, you may receive the following
error message:
SQLSTATE: S1000
[Microsoft][ODBC SQL Server Driver]Connection is busy with the results for
another hstmt
When you use the Microsoft Data Access Components (MDAC) 2.6 driver, you may
receive the following error message:
State:37000,Native:16909,Origin:[Microsoft][ODBC SQL Server Driver][SQL
Server]
sp_cursorfetch: The cursor identifier value provided (1) is not valid
CAUSE
=====
This error occurs because of a timing conflict in the SQL Server ODBC driver or
MDAC 2.6 driver. If two threads are in the process of calling SQLPrepare(),
followed by a SQLExecute() call, this error may occur.
RESOLUTION
==========
Put CRecordset::Open() calls within a critical section to guarantee that only
one thread is executing a SQL command on the connection at a given time.
On the SQL Server back end, it is recomended that you use different CDatabase
objects for different threads.
STATUS
======
Microsoft has confirmed this to be a bug in the Microsoft SQL Server driver.
MORE INFORMATION
================
Following is a code sample that can cause this error to occur:
Sample code
-----------
void CDBProblemDlg::OnDoDatabase()
{
//Open connection to database
m_DB.Open();
CSQLRecordSet rs(&m_DB);
StartThread(&m_DB);
if ( rs.Open(CRecordset::dynaset) )
{
.
.
.
SQLRecordSet.Close();
}
}
void StartThread(CDatabase * pDB)
{
AfxBeginThread(InitThreadProc, pDB, THREAD_PRIORITY_NORMAL);
}
UINT CDBProblemDlg::InitThreadProc( LPVOID pParam )
{
CDatabase* pDB = (CDatabase*) pParam;
if (pDB->IsOpen())
{
CSQLRecordSet SQLRecordSet(pDB);
if (SQLRecordSet.Open(CRecordset::dynaset))
{
.
.
.
SQLRecordSet.Close();
}
}
}
Additional query words: VC++
======================================================================
Keywords : kbDatabase kbMFC kbODBC kbSQLServ kbVC500 kbGrpDSMDAC kbDSupport
kbGrpDSODBC
Technology : kbVCsearch kbSQLServSearch kbAudDeveloper kbODBCSearch
kbODBCSQLServ200 kbODBCSQLServ300 kbVC500 kbVC600
kbVC32bitSearch kbVC500Search
Version : :2.0,3.0,5.0,6.0
Issue type : kbbug
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 2001.
--------[end snipp 3]--------------------------------------------------------------
> -----Original Message-----
> From: Robin Bolton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 10:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] ODBC Connection Problems
>
>
> I have an Access database which I made a DSN connection to.
>
> As long as the .mdb file is on the same machine as my Apache Server I can
> connect to it just fine. However, if I try to set the DSN to point to an
> .mdb file on our network (mapped to a drive letter), I get the following
> error in PHP:
>
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft
> Jet database engine cannot open the file '(unknown)'. It is already opened
> exclusively by another user, or you need permission to view its data., SQL
> state S1000 in SQLConnect in c:\www\test\odbc\odbctest3.php on line 2
>
> I know for a fact it's not open on any other machines, so it's not a sharing
> issue. Which knocks it down to either permissions or just more PHP network
> sillyness.
>
> I've tried pointing the DSN connection to the .mdb using both the mapped
> drive letter and UNC paths, same error either way.
>
> The username that I log onto my workstation with has administrative
> priveledges for both our domain, and the machine itself.
>
> Server: NT 4.0 Server
> Workstation: Win 2000, Apache, PHP 4.1.2
>
>
> Thanks,
>
> Robin Bolton
> IT / Web Developer
> Lone Pine Publishing
> [EMAIL PROTECTED]
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I have experimented with ODBC connections and had success so my guess is
you may need to check what permissions are on the said .mdb file.
Robin Bolton wrote:
>
> I have an Access database which I made a DSN connection to.
>
> As long as the .mdb file is on the same machine as my Apache Server I can
> connect to it just fine. However, if I try to set the DSN to point to an
> .mdb file on our network (mapped to a drive letter), I get the following
> error in PHP:
>
> Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft
> Jet database engine cannot open the file '(unknown)'. It is already opened
> exclusively by another user, or you need permission to view its data., SQL
> state S1000 in SQLConnect in c:\www\test\odbc\odbctest3.php on line 2
>
> I know for a fact it's not open on any other machines, so it's not a sharing
> issue. Which knocks it down to either permissions or just more PHP network
> sillyness.
>
> I've tried pointing the DSN connection to the .mdb using both the mapped
> drive letter and UNC paths, same error either way.
>
> The username that I log onto my workstation with has administrative
> priveledges for both our domain, and the machine itself.
>
> Server: NT 4.0 Server
> Workstation: Win 2000, Apache, PHP 4.1.2
>
> Thanks,
>
> Robin Bolton
> IT / Web Developer
> Lone Pine Publishing
> [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Parse error line 117... there is no line 117..hehe!! I am thinking that PHP
doesn't like IFrames, or Javascript, or maybe just me?
Here is the code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<STYLE>
BODY {margin: 0pt; padding: 0pt; border: none}
IFRAME {width: 100%; height: 100%; border: none}
</STYLE>
<SCRIPT>
// Default format is WYSIWYG HTML
var format="HTML"
// Set the focus to the editor
function setFocus() {
textEdit.focus()
}
// Execute a command against the editor
// At minimum one argument is required. Some commands
// require a second optional argument:
// eg., ("formatblock","<H1>") to make an H1
function execCommand(command) {
textEdit.focus()
if (format=="HTML") {
var edit = textEdit.document.selection.createRange()
if (arguments[1]==null)
edit.execCommand(command)
else
edit.execCommand(command,false, arguments[1])
edit.select()
textEdit.focus()
}
}
// Selects all the text in the editor
function selectAllText(){
var edit = textEdit.document;
edit.execCommand('SelectAll');
textEdit.focus();
}
function newDocument() {
textEdit.document.open()
textEdit.document.write("")
textEdit.document.close()
textEdit.focus()
}
function loadDoc(htmlString) {
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
}
// Initialize the editor with an empty document
function initEditor() {
var htmlString = parent.document.all.EditorValue.value;
textEdit.document.designMode="On"
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
textEdit.focus()
}
// Swap between WYSIWYG mode and raw HTML mode
function swapModes() {
if (format=="HTML") {
textEdit.document.body.innerText = textEdit.document.body.innerHTML
textEdit.document.body.style.fontFamily = "monospace"
textEdit.document.body.style.fontSize = "10pt"
format="Text"
}
else {
textEdit.document.body.innerHTML = textEdit.document.body.innerText
textEdit.document.body.style.fontFamily = ""
textEdit.document.body.style.fontSize =""
format="HTML"
}
// textEdit.focus()
var s = textEdit.document.body.createTextRange()
s.collapse(false)
s.select()
}
window.onload = initEditor
</SCRIPT>
<!-- Turn off the outer body scrollbars. The IFRAME editbox will display its
own scrollbars when necessary -->
<BODY SCROLL=No>
<IFRAME ID=textEdit>
<?
include "variables.php";
$connection = @mysql_connect("$dbserver", "$dbuser", "$dbpass") or
die("Couldn't connect to database");
$db = @mysql_select_db($dbname, $connection) or die("Could not select
datababse");
$sql = "SELECT id, news FROM $editortable ORDER BY id";
$result = @mysql_query($sql,$connection) or die("Could not execute query");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$news = $row['news'];
echo "$news";
?>
</IFRAME>
<script>
textEdit.focus();
</script>
</body>
</html>
--- End Message ---
--- Begin Message ---
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$news = $row['news'];
echo "$news";
?>
Spot the missing closing brace }
-----Original Message-----
From: Todd WIlliamsen [mailto:[EMAIL PROTECTED]]
Sent: 29 March 2002 18:31
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Parse error when using Javascript & php?
Parse error line 117... there is no line 117..hehe!! I am thinking that PHP
doesn't like IFrames, or Javascript, or maybe just me?
Here is the code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<STYLE>
BODY {margin: 0pt; padding: 0pt; border: none}
IFRAME {width: 100%; height: 100%; border: none}
</STYLE>
<SCRIPT>
// Default format is WYSIWYG HTML
var format="HTML"
// Set the focus to the editor
function setFocus() {
textEdit.focus()
}
// Execute a command against the editor
// At minimum one argument is required. Some commands
// require a second optional argument:
// eg., ("formatblock","<H1>") to make an H1
function execCommand(command) {
textEdit.focus()
if (format=="HTML") {
var edit = textEdit.document.selection.createRange()
if (arguments[1]==null)
edit.execCommand(command)
else
edit.execCommand(command,false, arguments[1])
edit.select()
textEdit.focus()
}
}
// Selects all the text in the editor
function selectAllText(){
var edit = textEdit.document;
edit.execCommand('SelectAll');
textEdit.focus();
}
function newDocument() {
textEdit.document.open()
textEdit.document.write("")
textEdit.document.close()
textEdit.focus()
}
function loadDoc(htmlString) {
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
}
// Initialize the editor with an empty document
function initEditor() {
var htmlString = parent.document.all.EditorValue.value;
textEdit.document.designMode="On"
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
textEdit.focus()
}
// Swap between WYSIWYG mode and raw HTML mode
function swapModes() {
if (format=="HTML") {
textEdit.document.body.innerText = textEdit.document.body.innerHTML
textEdit.document.body.style.fontFamily = "monospace"
textEdit.document.body.style.fontSize = "10pt"
format="Text"
}
else {
textEdit.document.body.innerHTML = textEdit.document.body.innerText
textEdit.document.body.style.fontFamily = ""
textEdit.document.body.style.fontSize =""
format="HTML"
}
// textEdit.focus()
var s = textEdit.document.body.createTextRange()
s.collapse(false)
s.select()
}
window.onload = initEditor
</SCRIPT>
<!-- Turn off the outer body scrollbars. The IFRAME editbox will display its
own scrollbars when necessary -->
<BODY SCROLL=No>
<IFRAME ID=textEdit>
<?
include "variables.php";
$connection = @mysql_connect("$dbserver", "$dbuser", "$dbpass") or
die("Couldn't connect to database");
$db = @mysql_select_db($dbname, $connection) or die("Could not select
datababse");
$sql = "SELECT id, news FROM $editortable ORDER BY id";
$result = @mysql_query($sql,$connection) or die("Could not execute query");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$news = $row['news'];
echo "$news";
?>
</IFRAME>
<script>
textEdit.focus();
</script>
</body>
</html>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Anything outside of the <?php ?> tags doesn't affect PHP one way or the
other, as long as it doesn't contain any of the strings like <?php, ?> etc
that turn PHP parsing on and off. So I don't think the JavaScript or
IFrames would affect it.
-Mike
At 12:31 PM 3/29/2002 -0600, Todd WIlliamsen wrote:
>Parse error line 117... there is no line 117..hehe!! I am thinking that PHP
>doesn't like IFrames, or Javascript, or maybe just me?
>
>Here is the code:
>
><? include "variables.php"; $connection = @mysql_connect("$dbserver",
>"$dbuser", "$dbpass") or die("Couldn't connect to database"); $db =
>@mysql_select_db($dbname, $connection) or die("Could not select
>datababse"); $sql = "SELECT id, news FROM $editortable ORDER BY id";
>$result = @mysql_query($sql,$connection) or die("Could not execute
>query"); while ($row = mysql_fetch_array($result)) { $id = $row['id'];
>$news = $row['news']; echo "$news"; ?>
--- End Message ---
--- Begin Message ---
Try reading your script backwards....its probably a very simple
something you would not spend .02 secs on syntax error (had that exact
scenario happen enough times) :)
Todd Williamsen wrote:
>
> Parse error line 117... there is no line 117..hehe!! I am thinking that PHP
> doesn't like IFrames, or Javascript, or maybe just me?
>
> Here is the code:
>
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>
> </head>
> <STYLE>
> BODY {margin: 0pt; padding: 0pt; border: none}
> IFRAME {width: 100%; height: 100%; border: none}
> </STYLE>
> <SCRIPT>
> // Default format is WYSIWYG HTML
> var format="HTML"
>
> // Set the focus to the editor
> function setFocus() {
> textEdit.focus()
> }
>
> // Execute a command against the editor
> // At minimum one argument is required. Some commands
> // require a second optional argument:
> // eg., ("formatblock","<H1>") to make an H1
>
> function execCommand(command) {
> textEdit.focus()
> if (format=="HTML") {
> var edit = textEdit.document.selection.createRange()
> if (arguments[1]==null)
> edit.execCommand(command)
> else
> edit.execCommand(command,false, arguments[1])
> edit.select()
> textEdit.focus()
> }
> }
>
> // Selects all the text in the editor
> function selectAllText(){
>
> var edit = textEdit.document;
>
> edit.execCommand('SelectAll');
> textEdit.focus();
>
> }
>
> function newDocument() {
> textEdit.document.open()
> textEdit.document.write("")
> textEdit.document.close()
> textEdit.focus()
> }
>
> function loadDoc(htmlString) {
> textEdit.document.open()
> textEdit.document.write(htmlString)
> textEdit.document.close()
> }
> // Initialize the editor with an empty document
> function initEditor() {
> var htmlString = parent.document.all.EditorValue.value;
> textEdit.document.designMode="On"
> textEdit.document.open()
> textEdit.document.write(htmlString)
> textEdit.document.close()
> textEdit.focus()
> }
>
> // Swap between WYSIWYG mode and raw HTML mode
> function swapModes() {
> if (format=="HTML") {
> textEdit.document.body.innerText = textEdit.document.body.innerHTML
> textEdit.document.body.style.fontFamily = "monospace"
> textEdit.document.body.style.fontSize = "10pt"
> format="Text"
> }
> else {
> textEdit.document.body.innerHTML = textEdit.document.body.innerText
> textEdit.document.body.style.fontFamily = ""
> textEdit.document.body.style.fontSize =""
> format="HTML"
> }
> // textEdit.focus()
> var s = textEdit.document.body.createTextRange()
> s.collapse(false)
> s.select()
> }
>
> window.onload = initEditor
>
> </SCRIPT>
> <!-- Turn off the outer body scrollbars. The IFRAME editbox will display its
> own scrollbars when necessary -->
> <BODY SCROLL=No>
>
> <IFRAME ID=textEdit>
> <?
> include "variables.php";
> $connection = @mysql_connect("$dbserver", "$dbuser", "$dbpass") or
> die("Couldn't connect to database");
> $db = @mysql_select_db($dbname, $connection) or die("Could not select
> datababse");
> $sql = "SELECT id, news FROM $editortable ORDER BY id";
> $result = @mysql_query($sql,$connection) or die("Could not execute query");
> while ($row = mysql_fetch_array($result)) {
> $id = $row['id'];
> $news = $row['news'];
> echo "$news";
> ?>
> </IFRAME>
> <script>
> textEdit.focus();
> </script>
>
> </body>
> </html>
--- End Message ---
--- Begin Message ---
DOH!! Thanks ross
Umm... Now I cannot get the value of $news to display in the IFRAME... I
used value="<? Echo "$news"; ?>, that didn't work
Then I put
<? Echo "$news"; ?> between the <iframe> tags, that didn't work either
Any suggestions?
-----Original Message-----
From: Ross Fleming [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 1:05 PM
To: Todd WIlliamsen; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Parse error when using Javascript & php?
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$news = $row['news'];
echo "$news";
?>
Spot the missing closing brace }
-----Original Message-----
From: Todd WIlliamsen [mailto:[EMAIL PROTECTED]]
Sent: 29 March 2002 18:31
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Parse error when using Javascript & php?
Parse error line 117... there is no line 117..hehe!! I am thinking that
PHP
doesn't like IFrames, or Javascript, or maybe just me?
Here is the code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<STYLE>
BODY {margin: 0pt; padding: 0pt; border: none}
IFRAME {width: 100%; height: 100%; border: none}
</STYLE>
<SCRIPT>
// Default format is WYSIWYG HTML
var format="HTML"
// Set the focus to the editor
function setFocus() {
textEdit.focus()
}
// Execute a command against the editor
// At minimum one argument is required. Some commands
// require a second optional argument:
// eg., ("formatblock","<H1>") to make an H1
function execCommand(command) {
textEdit.focus()
if (format=="HTML") {
var edit = textEdit.document.selection.createRange()
if (arguments[1]==null)
edit.execCommand(command)
else
edit.execCommand(command,false, arguments[1])
edit.select()
textEdit.focus()
}
}
// Selects all the text in the editor
function selectAllText(){
var edit = textEdit.document;
edit.execCommand('SelectAll');
textEdit.focus();
}
function newDocument() {
textEdit.document.open()
textEdit.document.write("")
textEdit.document.close()
textEdit.focus()
}
function loadDoc(htmlString) {
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
}
// Initialize the editor with an empty document
function initEditor() {
var htmlString = parent.document.all.EditorValue.value;
textEdit.document.designMode="On"
textEdit.document.open()
textEdit.document.write(htmlString)
textEdit.document.close()
textEdit.focus()
}
// Swap between WYSIWYG mode and raw HTML mode
function swapModes() {
if (format=="HTML") {
textEdit.document.body.innerText = textEdit.document.body.innerHTML
textEdit.document.body.style.fontFamily = "monospace"
textEdit.document.body.style.fontSize = "10pt"
format="Text"
}
else {
textEdit.document.body.innerHTML = textEdit.document.body.innerText
textEdit.document.body.style.fontFamily = ""
textEdit.document.body.style.fontSize =""
format="HTML"
}
// textEdit.focus()
var s = textEdit.document.body.createTextRange()
s.collapse(false)
s.select()
}
window.onload = initEditor
</SCRIPT>
<!-- Turn off the outer body scrollbars. The IFRAME editbox will display
its
own scrollbars when necessary -->
<BODY SCROLL=No>
<IFRAME ID=textEdit>
<?
include "variables.php";
$connection = @mysql_connect("$dbserver", "$dbuser", "$dbpass") or
die("Couldn't connect to database");
$db = @mysql_select_db($dbname, $connection) or die("Could not select
datababse");
$sql = "SELECT id, news FROM $editortable ORDER BY id";
$result = @mysql_query($sql,$connection) or die("Could not execute
query");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$news = $row['news'];
echo "$news";
?>
</IFRAME>
<script>
textEdit.focus();
</script>
</body>
</html>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
IFrames don't use the 'value' property, so your second approach was right
-- putting the content between the iframe tags. Now, do you know that
IFrames are only supported by Internet Explorer and not Netscape
Navigator? They are used on almost *no* sites.. so you may want to
consider that before using them in your own. They aren't an accepted standard.
At any rate, putting <? echo "$news"; ?>, or more preferably, <?php echo
$news; ?>, between the <iframe> and </iframe> tags will work, assuming you
are using a browser that supports them.
Have you tried looking at the source code that is generated by the
page? That is something everyone should probably do before posting a
question to the list.
-Mike
At 02:17 PM 3/29/2002 -0600, Todd Williamsen wrote:
>DOH!! Thanks ross
>
>Umm... Now I cannot get the value of $news to display in the IFRAME... I
>used value="<? Echo "$news"; ?>, that didn't work
>
>Then I put
>
><? Echo "$news"; ?> between the <iframe> tags, that didn't work either
>
>Any suggestions?
--- End Message ---
--- Begin Message ---
Hello,
I need a php script that checks if the there is a cookie set with the users
username and if not
it brings you to an other page and telling you that you are not loged in!
thanks for any help
alain kumschick
[EMAIL PROTECTED]
http://www.kumschicknw.com
--- End Message ---
--- Begin Message ---
I figured out the problem, apparently it has nothing to do with PHP or mySQL
:-) hehe
I had installed ZoneAlarm a while back on my workstation,
and although it was deactivated it was the cause of this problem
( and many many other problems, so i'm glad that it's gone now).
Sorry for the trouble everyone, and thanks for the help.
PS bolt : it's no bother :-) but no it's not me, sorry
there aren't too many Firas' in the world though
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 29, 2002 5:51 PM
To: [EMAIL PROTECTED]
Subject: re:[PHP-WIN] mysql_connect() doesn't like "localhost" ?!
Hello Firas,
I think it could be an OS installation problem
did you try simply pinging localhost? (from the command line)
does it work replacing it with 127.0.0.1 in the mysql_connect?
just some ideas..
PS
sorry for bothering, I had a collegue working in Comitsiel named Firas,
is it you?
List: php-windows
Subject: [PHP-WIN] mysql_connect() doesn't like "localhost" ?!
From: "Firas Al-Ragom" <[EMAIL PROTECTED]>
Date: 2002-03-29 13:57:49
[Download message RAW]
Hi everyone,
I've just installed Apache 1.3.24 and PHP 4.1.2 ( as a module ) and
mySQL
3.23.49
on a Windows 2000 workstation. I didn't encounter any problems with the
install,
but for some strange reason whenever I use any scripts with
mysql_connect("localhost", "user", "password")
I get Warning: Can't connect to MySQL server on 'localhost' (10061)
errors
Now the strange thing is that if I remove the "localhost" and replace it
with "" everything will work fine.
I've tried downgrading mySQL and PHP to several different versions with
the
same results.
This isn't the first time i've installed this kind of setup on a win2k
machine,
but it's the first time I've had this problem.
Any help would be really appreciated.
Sample script :
<?php
//list_db.php
$link_id = mysql_connect("localhost", "user", "password");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);
while($db_data = mysql_fetch_row($result)) {
echo $db_data[0]. "<BR>";
$result2 = mysql_list_tables($db_data[0]);
$num_rows2 = mysql_num_rows($result2);
while($table_data = mysql_fetch_row($result2)) echo "--
" .
$table_data[0]. "<BR>";
echo "==> $num_rows2 table(s) in " . $db_data
[0] . "<P>";
}
?>
Resulting errors :
Warning: Can't connect to MySQL server on 'localhost' (10061) in
c:\webdev\www\index.php on line 4
Warning: MySQL Connection Failed: Can't connect to MySQL server on
'localhost' (10061) in c:\webdev\www\index.php on line 4
Warning: Supplied argument is not a valid MySQL-Link resource in
c:\webdev\www\index.php on line 5
Warning: Supplied argument is not a valid MySQL result resource in
c:\webdev\www\index.php on line 6
Warning: Supplied argument is not a valid MySQL result resource in
c:\webdev\www\index.php on line 8
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Hi
I have an example in ASP calling a COM objectr that looks like this:
...
redim vArray(1,1)
vArray(0,0)="Name1"
vArray(1,0)="Value1"
vArray(0,1)="Name2"
vArray(1,1)="Value2"
res=obj.SomeFunction(vArray,arrRes,CInt(100))
...
So far the authors will only tell me that they use Variant arrays.
ofcousre it all starts off like:
$obj = new com("SynWeb.Application") or die("Error");
if (is_object($obj)) {
$res = $obj->ConnectToRep($repository, $server);
...
Thats all fine and works. The problem comes with invoking this
function that takes 2 arrays, Variant array to be more precise.
I tried this:
$SearchCriteria[0][0] = "Name1";
$SearchCriteria[0][1] = "Value1";
$SearchCriteria[1][0] = "Name2";
$SearchCriteria[1][1] = "Value2";
$Result = array();
$res = $obj->SomeFunction($SearchCriteria, $Result, 10);
or:
$SearchCriteria[0][0] = "Name1";
$SearchCriteria[1][0] = "Value1";
$SearchCriteria[0][1] = "Name2";
$SearchCriteria[1][1] = "Value2";
$Result = array();
$res = $obj->SomeFunction($SearchCriteria, $Result, 10);
or:
$SearchCriteria[0] = array("Name1" => "Value1");
$Result = array();
$res = $obj->SomeFunction($SearchCriteria, $Result, 10);
I get:
Warning: Invoke() failed: Exception occurred.
Source: SynWeb Description: Subscript out of range in
c:\apache\htdocs\myscript.php on line 22
plus about 50 other things I coulkd think of. Does anyone know if this
is possible with PHP and how?
BTW the ASP code does work I have had it running.
Jeff
--- End Message ---