php-windows Digest 23 Mar 2004 00:50:20 -0000 Issue 2177
Topics (messages 23216 through 23233):
Re: The specified CGI application misbehaved by not returning acomplete set of HTTP
headers.
23216 by: DvDmanDT
23222 by: Svensson, B.A.T. (HKG)
Re: Slash problem in link
23217 by: Harpreet
23218 by: Luis Moreira
MySQL query to generate Array
23219 by: Tony Devlin
23225 by: Luis Moreira
23227 by: trystano.aol.com
23228 by: Tony Devlin
23229 by: trystano.aol.com
Submitting forms
23220 by: Gerardo Rojas
Major apache start error!!
23221 by: Matt Gagné
23230 by: Matt Gagné
back slash issue
23223 by: Ron.Herhuth.tatumpartners.com
23224 by: David Felton
23226 by: Luis Moreira
Re: PHP WINDOWS 2000 Testing Oracle DB with PHP
23231 by: Thierry B.
Re: php5isapi.dll not handling MySQL
23232 by: Thierry B.
Replicating Double quotes
23233 by: trystano.aol.com
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 ---
I would suspect popen() happends to output STDERR, and that dir returns some
STDERR when no files are found, or when the argument is invalid.. And if so,
the STDERR message would get output directly to the webserver, and if it
contains two newlines (which it does really I think), the webserver wouldn't
get a complete set of headers (which it's complaining about)...
Add this at the end of your command: 2 > &1, like this:
$ListDir = "dir $Dir\\*.$pattern 2>&1";
Also, I think this would be even better:
$ListDir = "dir \"$Dir\\*.$pattern\" 2>&1";
Happy coding!
--
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"B.A.T. Svensson" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> I am curious about why the following error:
>
>
> "The specified CGI application misbehaved by not returning a complete
> set of HTTP headers."
>
> is generated while trying to read data from an empty pipe.
>
>
>
> **********************************************************
>
> DISCUSSION:
>
> I have an (working) application that renders an out put in
> side a table based on the menu selection the user does.
>
> Basically the web pages is organized as such:
>
> +-----------+
> | PAGE HEAD |
> +-+---------+
> |M| |
> |E| OUTPUT |
> |N| VIEW |
> |U| |
> . . .
> . . .
> . . .
> +-+---------+
> | PAGE FOOT |
> +-----------+
>
>
>
> Now, if I select a certain menu choices, and the system is in a
> certain state (will soon explain this) then the CGI error "The
> specified CGI application misbehaved by not returning a complete
> set of HTTP headers." occurs.
>
> What trigger then the error then, well, it is derived from a
> function like this:
>
> (This function will output its display data the "OUTPUT VIEW".)
>
> function ug_show_files($Dir, $pattern, $Message)
> {
> print "<pre>$Message\r\n";
>
> $ListDir = "dir $Dir\\*.$pattern";
> if ($pipe = popen($ListDir, "r")) {
>
> while (!feof($pipe)) {
> $line = trim(fgets($pipe));
> print "$line\n";
> }
>
> pclose($pipe);
> }
>
print"<pre>";
> return "ok";
> }
>
> The above code list a given directory based on $pattern.
> However whenever no files are found, then the above CGI error
> is generated - but never if there is a content found. I was a
> bit confused about this, since the only difference is that the
> directory listing does not generate an output, so in my point
> of view it should work, but it did not.
>
>
> I boiled down the problem to be related with fgets() - the error
> occurs when the directory listing does not return anything, so I
> thought I would be able to get rid of the error by writing the code
> like this instead:
>
> function ug_show_files($Dir, $pattern, $Message)
> {
> print "<pre>$Message\r\n";
>
> $ListDir = "dir $Dir\\*.$pattern";
> if ($pipe = popen($ListDir, "r")) {
>
> $a = fgets($pipe)
> while (!feof($pipe)) {
> $line = trim($a);
> print "$line\n";
> $a = fgets($pipe);
> }
> pclose($pipe);
> }
>
print"<pre>";
> return "ok";
> }
>
>
> However the error persisted whenever the directory list
> was empty so I changed the code to look like this:
>
> function ug_show_files($Dir, $pattern, $Message)
> {
> print "<pre>$Message\r\n";
>
> $ListDir = "dir $Dir";
> if ($pipe = popen($ListDir, "r")) {
>
> while (!feof($pipe)) {
>
> $line = trim(fgets($pipe));
> if (strpos($line, ".$pattern")) {
> print "$line\n";
> }
>
> }
> pclose($pipe);
> }
>
print"<pre>";
> return "ok";
> }
>
> And after this the pages stop returning an error. Now to the
> question; why is it that fgets() generates this CGI error
> when fgets() read from an empty pipe?
--- End Message ---
--- Begin Message ---
Sounds like a resonable explanation. I'll will test your suggestion.
-----Original Message-----
From: DvDmanDT
To: [EMAIL PROTECTED]
Sent: 22-3-2004 12:44
Subject: [PHP-WIN] Re: The specified CGI application misbehaved by not
returning acomplete set of HTTP headers.
I would suspect popen() happends to output STDERR, and that dir returns
some STDERR when no files are found, or when the argument is invalid.. And
if so, the STDERR message would get output directly to the webserver, and if
it contains two newlines (which it does really I think), the webserver
wouldn't get a complete set of headers (which it's complaining about)...
--- End Message ---
--- Begin Message ---
My images folder and the login page is at the root of my main project.
f:/inetpub/wwwroot/project/login.php
f:/inetpub/wwwroot/project/images\onlylogo.gif"
The link <IMG src="images/onlylogo.gif"> works in the login.php at home
but <IMG src="/images/onlylogo.gif"> does not work
Customers path is
C:\project\servicepack\WebPages\login.php
C:\project\servicepack\WebPages\images\onlylogo.gif"
The link <IMG src="/images/onlylogo.gif"> works in the login.php
but <IMG src="images/onlylogo.gif"> does not work
I am running php on IIS customer is PHP on Apache. Do i need to change any
php setting in ini file
Thanks
Regards,
Harpreet
-----Original Message-----
From: Student [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 21, 2004 4:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Slash problem in link
I think its better to have the image folder in the root directory eg
www.website.com/image and then have the code as <img
src="/image/website.png" />. That way, it would be able to access the image
from anyway in your web site...(I Think)
"Paul Brownsea" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Sunday 21 March 2004 05:33, Harpreet wrote:
> I am having a weird problem. I am not sure if this is a php problme or
> plain html problme but see if anyone can help.
>
> I have a page called login.php. It has the following image link. It
works
> at home fine when i put the link as below
>
> <IMG src="images/onlylogo.gif">
>
> We tried putting the same page on another customer and it wont show. We
put
> a slash in the front of image and it worked and we can view the image.
<IMG
> src="/images/onlylogo.gif">
>
> But the slash does not work at home on my machine.
>
> When do we have to use the slash and when not ...how can we tell
>
> please help
With the "/" you are delcaring that the image is in the directory
"images",
relative to the server root (maybe "c:\program
files\apache\htdocs\images\onlylogo.gif" giving a webaddress of
"http://www.mywebsite.com/images/onlylogo.gif"). Whereas without the "/"
you
are declaring that the image is in the "images" directory, relative to the
PHP script (or HTML page) (maybe "c:\program
files\apache\htdocs\MYWEBSITE\images\onlylogo.gif" giving
"http://www.mywebsite.com/MYWEBSITE/images/onlylogo.gif"). So I think it
is
just a HTML problem.
--- End Message ---
--- Begin Message ---
This is not PHP related...
What is your server, IIS or Apache ?
If it is Apache, do you have ALIAS ?
It is different to alias /images (with trailing slash) and
images (WITHOUT trailing slash), you know ?
Luis
----- Original Message -----
From: "Harpreet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 2:36 PM
Subject: RE: [PHP-WIN] Slash problem in link
> My images folder and the login page is at the root of my main project.
>
> f:/inetpub/wwwroot/project/login.php
> f:/inetpub/wwwroot/project/images\onlylogo.gif"
>
> The link <IMG src="images/onlylogo.gif"> works in the login.php at home
> but <IMG src="/images/onlylogo.gif"> does not work
>
> Customers path is
> C:\project\servicepack\WebPages\login.php
> C:\project\servicepack\WebPages\images\onlylogo.gif"
>
> The link <IMG src="/images/onlylogo.gif"> works in the login.php
> but <IMG src="images/onlylogo.gif"> does not work
>
> I am running php on IIS customer is PHP on Apache. Do i need to change any
> php setting in ini file
> Thanks
>
> Regards,
> Harpreet
>
>
>
>
>
>
>
> -----Original Message-----
> From: Student [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 21, 2004 4:11 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Slash problem in link
>
>
> I think its better to have the image folder in the root directory eg
> www.website.com/image and then have the code as <img
> src="/image/website.png" />. That way, it would be able to access the
image
> from anyway in your web site...(I Think)
>
> "Paul Brownsea" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> On Sunday 21 March 2004 05:33, Harpreet wrote:
> > I am having a weird problem. I am not sure if this is a php problme or
> > plain html problme but see if anyone can help.
> >
> > I have a page called login.php. It has the following image link. It
> works
> > at home fine when i put the link as below
> >
> > <IMG src="images/onlylogo.gif">
> >
> > We tried putting the same page on another customer and it wont show.
We
> put
> > a slash in the front of image and it worked and we can view the image.
> <IMG
> > src="/images/onlylogo.gif">
> >
> > But the slash does not work at home on my machine.
> >
> > When do we have to use the slash and when not ...how can we tell
> >
> > please help
>
> With the "/" you are delcaring that the image is in the directory
> "images",
> relative to the server root (maybe "c:\program
> files\apache\htdocs\images\onlylogo.gif" giving a webaddress of
> "http://www.mywebsite.com/images/onlylogo.gif"). Whereas without the "/"
> you
> are declaring that the image is in the "images" directory, relative to
the
> PHP script (or HTML page) (maybe "c:\program
> files\apache\htdocs\MYWEBSITE\images\onlylogo.gif" giving
> "http://www.mywebsite.com/MYWEBSITE/images/onlylogo.gif"). So I think it
> is
> just a HTML problem.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
How do you setup a mysql query to generate an array?
I want to take URL and URLName from a database and use it to create an array
called links.
I know how to do the array and the mysql seperately, I don't know how to
make the results of
the mysql become the key=>value pairs in the array.
Any help is appreciated
--Tony
--- End Message ---
--- Begin Message ---
Try something like this (UNTESTED)
// array1 is temporary array
// array2 is the one to fill with query results
$array1= array("URL"=>"nul","URLN"=>"nul");
$array2= array(
1=>array("URL"=>"","URLN" => "")
);
// $n is counter of registers
// begin mysql query
// foreach element
// $row[0] is URL
// $row[1] is URLN
if ($n==0) {
$array2[1]["URL"] = $row[0];
$array2[1]["URLN"] = $row[1];
} else
{
$array2[1]["URL"] = $row[0];
$array2[1]["URLN"] = $row[1];
array_push ($array2,$array1[1]);
}
// end foreach
// Example
// $array2[10]["URL"] now contains the 10th URL value
// $array2[10]["URLN"] now contains the 10th URLN value
----- Original Message -----
From: "Tony Devlin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 3:04 PM
Subject: [PHP-WIN] MySQL query to generate Array
How do you setup a mysql query to generate an array?
I want to take URL and URLName from a database and use it to create an array
called links.
I know how to do the array and the mysql seperately, I don't know how to
make the results of
the mysql become the key=>value pairs in the array.
Any help is appreciated
--Tony
--- End Message ---
--- Begin Message ---
Are you trying to create a breadcrumb trial?
Tryst
--- End Message ---
--- Begin Message ---
Something of that sort.
What I'm trying to do is dynamically create links on a site.
[Home] [Page1] [Page2] etc.
The array would look something like
array("Home" => "index.php", "Page1" => "Page1.php");
The site is dynamically created. The user is able to create
and edit new pages and thus add new links to the link list.
I suppose I could do it without an array, but I figured an
array would allow for much cleaner code.
Ideas?
--Tony
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 22, 2004 11:58 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] MySQL query to generate Array
Are you trying to create a breadcrumb trial?
Tryst
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Check out my thread on a similar issue...
http://www.sitepoint.com/forums/showthread.php?t=158703
Tryst
--- End Message ---
--- Begin Message ---
I've noticed that when you want to submit a form using the MyForm.submit(); method.
This fails when the file is named *.php, but when it's name *.htm it works fine.
Anybody have a workaround for this? I want to submit the form on the onChange event
of an element within the form.
--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hey all! First post to this forum! Woo Hoo!
Anyway, here's the poop. With Apache 1.3.14 for windows (php said working
with Apache2 was experimental so I went with version that was not) and php
4.3.4 for win and I have these lines enabled in the httpd.conf (as per php
install.txt):
LoadModule php4_module modules/php4apache.dll
AddType application/x-httpd-php .php
I get this error when restarting the apache service:
"The procedure entry point add_property_string_ex could not be located in
the dynamic link library php4ts.dll."
What did I miss? Or forget to do? And if nothing, what is the fix/work
around?
--
Matt
--------------------------
La Croix Technologies
--- End Message ---
--- Begin Message ---
Sorry, forgot to mention that I am on WinXP Pro
Matt
"Matt Gagné" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all! First post to this forum! Woo Hoo!
>
> Anyway, here's the poop. With Apache 1.3.14 for windows (php said working
> with Apache2 was experimental so I went with version that was not) and php
> 4.3.4 for win and I have these lines enabled in the httpd.conf (as per php
> install.txt):
>
> LoadModule php4_module modules/php4apache.dll
> AddType application/x-httpd-php .php
>
> I get this error when restarting the apache service:
>
> "The procedure entry point add_property_string_ex could not be located in
> the dynamic link library php4ts.dll."
>
> What did I miss? Or forget to do? And if nothing, what is the fix/work
> around?
> --
> Matt
> --------------------------
> La Croix Technologies
--- End Message ---
--- Begin Message ---
I have a situation where I need to use backslashes as part of the string:
$errorCode = $TK->OpenOutputFile("D:\public\k1\compiledCIO\$filename");
Obviously in the above example the backslash terminates the following
character which causes a problem. I have tried several different
arrangements and each time something occurs that causes problems with the
string. Any suggestions??
Thanks,
Ron
--- End Message ---
--- Begin Message ---
Try:
$errorCode = $TK->OpenOutputFile("D:\\public\\k1\\compiledCIO\\$filename");
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 22 March 2004 4:32
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] back slash issue
I have a situation where I need to use backslashes as part of the string:
$errorCode = $TK->OpenOutputFile("D:\public\k1\compiledCIO\$filename");
Obviously in the above example the backslash terminates the following
character which causes a problem. I have tried several different
arrangements and each time something occurs that causes problems with the
string. Any suggestions??
Thanks,
Ron
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************
--- End Message ---
--- Begin Message ---
Escape the backslash before using it
$errorCode = $TK->OpenOutputFile("D:\\public\k1\\compiledCIO\\$filename");
Luis
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 4:32 PM
Subject: [PHP-WIN] back slash issue
>
> I have a situation where I need to use backslashes as part of the string:
>
> $errorCode = $TK->OpenOutputFile("D:\public\k1\compiledCIO\$filename");
>
> Obviously in the above example the backslash terminates the following
> character which causes a problem. I have tried several different
> arrangements and each time something occurs that causes problems with the
> string. Any suggestions??
>
> Thanks,
> Ron
>
>
>
>
>
>
--- End Message ---
--- Begin Message ---
You gave permissions on c:\php, but not on 'c:\WinNt\System32\ (access
denied). By the way, you can leave extensions files where the are
(c:\php\extensions) and add this path tou your system path.
--
Click below to answer / cliquez ci dessous pour me repondre
http://cerbermail.com/?MQkxTL4vUP
"Raj Gopal" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Hi All,
>
> I was trying to query Oracle from PHP.
>
> The Environment: Windows 2000, Oracle 9i, IIS 5, PHP 4.3.4
>
> Built a PHP file and it works from the command prompt like C:/PHP >php
> -f c:\test\Hello.php
> I have enabled the extension extension=php_oci8.dll
> and also given r, rx permissions for the Internet Guest Account on
> C:\PHP
>
> And I still get the following error when I try from the Browser
>
> Fatal error: Call to undefined function: ocilogon() in
> C:\Test\hello.php on line 8
> PHP Warning: Unknown(): Unable to load dynamic library
> 'c:\WinNt\System32\php_oci8.dll' - Access is denied. in Unknown on line
> 0
>
> Appreciate U r Help!!
--- End Message ---
--- Begin Message ---
MySql libraries are not built in php anymore (5+), since there is now two
libraries, one that handle Mysql 3 and early 4, and a new one for 4 and +.
TB
--
Click below to answer / cliquez ci dessous pour me repondre
http://cerbermail.com/?MQkxTL4vUP
"Don McFarland" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Im using PHP version Version 5.0.0b4 on XP-Pro (php5isapi.dll) running
> IIS 5.1 and have gotten the SQLite to work nicely. However, the when
> trying to use an up-and-running MySQL server, the script is always
> cut-off at the start with the error "Call to undefined function
> mysql_connect" even though I have the MySQL support enabled in the
> php.ini file (uncommented the "extension=php_mysql.dll" line), and have
> made sure to have the 2 related DLLs (php_mysql.dll and libmysql.dll)
> installed in the correct directories. Also, the function call to
> mysql_connect has the correct parameters (which is not relevant due to
> the error message).
>
> Unless the error message is erroneous, the result of my setup implies
> that php5isapi.dll is not able to deal with MySQL queries. If anyone
> knows if/how php5isapi.dll can handle MySQL queries, it would be greatly
> appreciated if you could let me know how.
>
> Sincerely,
>
> Don
--- End Message ---
--- Begin Message ---
Hi all,
I have a problem in that when I am retrieving data from MySQL that containes
double quotes, the double quotes gets repeat, and also the string that does
contain double quotes gets double quotes added to the begin and end of it For
example I get the following:
"16"" Manikin"
>From what should be the following
16" Manikin
Wh I inserted the data into the database I used the 'addslashes' function.
Even when I use the 'stripslashes' the output is still the same.
Anyone have any clues? :-s
Cheers
Tryst
--- End Message ---