php-windows Digest 17 Jan 2005 07:30:31 -0000 Issue 2538
Topics (messages 25345 through 25349):
error_log ignoring \ (like \n)
25345 by: Peter Ford
No communication between PHP 5.0.3 +MySQL 4.1.9 on Windows XP Pro
25346 by: J A Brown
25348 by: Shrock, Court
Re: including an HTML file
25347 by: The Disguised Jedi
Newbie question: convert string to int
25349 by: Louis Young
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 just used WAMP5 to install apache 1.3.33 and php 4.3.10 on Windows XP.
All is good except that when i do a:
error_log("this\nis\na\ntest");
the output in the error.log looks like:
[Sat Jan 15 11:24:51 2005] [error] this\nis\na\ntest
If i run the same on other servers it comes out like:
[Sat Jan 15 11:24:51 2005] [error] this
is
a
test
Any ideas why???
--- End Message ---
--- Begin Message ---
Will somebody please help me!!!
I'm trying to set up my web server for PHP and MySQL. I've installed PHP
5.0.3 and it works fine.
I've installed MySQL 4.1.9 and it works fine.
BUT, I can't access MySQL from PHP. I have put the php_mysqli.dll and
libmysql.dll in the C:\PHP folder, removed the ';' from the beginning of the
extension=php_mysqli.dll line in php.ini, but I just can't get the two
talking to one another.
I just get the following message:
Fatal error: Call to undefined function mysqli_connect() in
c:\Inetpub\wwwroot\stmary1\administration\handle_rotas.php on line 30
In my php file, line 30 reads:
$connection = mysqli_connect($host,$user,$password);
with each variable being defined already.
I'm using IIS 5 as my webserver.
Please can somebody help.
James Brown
--- End Message ---
--- Begin Message ---
"Call to undefined function" always means that the function is not available
to php. Have you verified that PHP is actually loading the .dll's -- call
phpinfo().
What you don't say is whether or not you are using ISAPI for CGI. Besides
that, extension dll's are normally located in the "extensions" subdirectory
of your PHP folder, not the base PHP directory. Check your php.ini and
verify that the extension_dir setting is the full path to the "extensions"
directory (*not* "./").
-----Original Message-----
From: J A Brown [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 16, 2005 10:40 AM
To: [email protected]
Subject: [PHP-WIN] No communication between PHP 5.0.3 +MySQL 4.1.9 on
Windows XP Pro
Will somebody please help me!!!
I'm trying to set up my web server for PHP and MySQL. I've installed PHP
5.0.3 and it works fine. I've installed MySQL 4.1.9 and it works fine. BUT,
I can't access MySQL from PHP. I have put the php_mysqli.dll and
libmysql.dll in the C:\PHP folder, removed the ';' from the beginning of the
extension=php_mysqli.dll line in php.ini, but I just can't get the two
talking to one another.
I just get the following message:
Fatal error: Call to undefined function mysqli_connect() in
c:\Inetpub\wwwroot\stmary1\administration\handle_rotas.php on line 30
In my php file, line 30 reads:
$connection = mysqli_connect($host,$user,$password);
with each variable being defined already.
I'm using IIS 5 as my webserver.
Please can somebody help.
James Brown
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Well, fread reads the entire file, and we need to check the lines to
see if they contain our tag, and so that is why i used fgets. fread
also puts the entire file into RAM, and that can cause memory problems
with large files. But, I forgot a few pieces of my function, so I'm
adding a better version.
<?php
$filename = 'ourfile.html';
$tag = '<BODY>';
$closing_tag = '</BODY>';
function insert_html($filename, $tag, $closing_tag) {
//Open the HTML file
$handle = fopen($filename, 'r');
$i = 0;
//As long as the file reader isn't at the end of the file, keep looping
through
while (!feof($handle)) {
//Read through our file in 4MB chunks, or by line, whichever
comes first...
$buffer = fgets($handle, 4096);
//Search our buffer for the tag. If it is there, we tell the
rest
of the program to start saving out the text...
if (strstr($buffer, $tag) == $tag) {
$save = true;
}
if ($save == true) {
$file[$i] = $buffer;
$i++;
}
if (strstr($buffer, $closing_tag) == $closing_tag) {
$save = false;
}
}
//Put the data all together, and send it back...
while (current($file)) {
$data .= '
' . current($file);
}
return $data;
}
?>
I forgot to add the part that tells it to check for when to stop
saving. This should suit your needs Gaetono, let me know if it
doesn't work right!
--
The Disguised Jedi
[EMAIL PROTECTED]
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"
Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free
--- End Message ---
--- Begin Message ---
Hi there
What's the function to convert a string to an int.
Cheers
Louis
--- End Message ---