php-windows Digest 26 Jun 2002 22:27:13 -0000 Issue 1212
Topics (messages 14418 through 14429):
Interbase on IIS with php 4.21
14418 by: Saci
Self Answer
14419 by: Saci
fsockopen and HTTP/1.1???
14420 by: Alex Elderson
Re: php Expanding Menu System Wanted
14421 by: Asendorf, John
Re: Using Bzip2 to create an archive... SECOND REQUEST
14422 by: Mikey
file_exists()
14423 by: Anthony Ritter
14424 by: Eugenio Tacchini
PHP Newbie: Needs help with dbase extensions
14425 by: Tony Tzankoff
Re: Newbye question
14426 by: Scott Hurring
file upload woes...
14427 by: Nicholas Stuart
Re: file upload woes...(solved)
14428 by: Nicholas Stuart
php error logging
14429 by: Joris Pinnoo
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 have Interbase (Firebird) installed and working
When i try to connect using PHP4.21 (Installed with autoinstaler)
<?php
$dbh =
ibase_connect('D:\_FireData\dados.gdb','SYSDBA','masterkey','ISO8859_1',0,1)
;
?>
I receive the folowing message
Fatal error: Call to undefined function: ibase_connect() in
d:\inetpub\wwwroot\impac\php\teste16.php on line 7
Why the ibase)connect() function is undefined ?
How can I install then ?
--- End Message ---
--- Begin Message ---
I downloaded
http://www.php.net/do_download.php?download_file=php-4.2.1-installer.exe
Then extracted all file form extensions folder and copy to c:\php\extensions
And added this to php .ini
; Directory in which the loadable extensions (modules) reside.
extension_dir = c:\php\extensions\
extension=php_interbase.dll
Now the error is cleared , ( new ones aper but is out of this matter).
--- End Message ---
--- Begin Message ---
Hi,
I build a few functions to open webpages on the internet.
But it doesn't work very well, the first page is good the second page isn't good.
The output of this script will be somthing like this:
open connection to webapps.hardinxveld.netflex.nl oke
get / done
get / failt
Closing connection to webapps.hardinxveld.netflex.nl oke
The problem is the "Connection: Close\n\n" header. The webserver close the connection
after the first request, if i remove
the "Connection: Close\n\n" header the first fgets($web_conn, 128) command will never
ends.
It's running on winXP apache 2.0.36 PHP 4.2.1 (test server) from the shell
What to do?
Alex Elderson
<?php
$crlf = "\r\n";
$address = "www.mp3.com";
$url = "/";
print "open connection to " . $address . " ";
if (!$web_conn = web_open($address)) {
print "failt" . $crlf . $crlf;
} else {
print "oke" . $crlf . $crlf;
print " get " . $url . " ";
if ($data = web_read($web_conn, $address, $url)) {
print "done" . $crlf;
} else {
print "failt" . $crlf;
}
print " get " . $url . " ";
if ($data = web_read($web_conn, $address, $url)) {
print "done" . $crlf;
} else {
print "failt" . $crlf;
}
print "\nClosing connection from " . $address . " ";
if (web_close($web_conn)) {
print "oke" . $crlf . $crlf . $crlf;
} else {
print "failt" . $crlf . $crlf . $crlf;
}
}
function web_open($address, $port = 80) {
return fsockopen($address, $port);
}
function web_close($web_conn) {
if ($web_conn) {
return fclose($web_conn);
} else {
return FALSE;
}
}
function web_read($web_conn, $address, $url = '/', $post = false, $cookie = false) {
$ret = '';
if ($web_conn) {
/* Success. Now check to see the type of request */
if ($post) {
$request = "POST $url HTTP/1.1\n";
$request .= "Host: $address\n";
$request .= "Content-Length: " . strlen( $post )."\n";
$request .= "Content-Type:application/x-www-form-urlencoded\n";
if ($cookie) $request .= "Cookie: $cookie\n";
$request .= "Connection: Close\n\n";
$request .= $post;
} else {
$request = "GET $url HTTP/1.1\n";
$request .= "Host: $address\n";
$request .= "Content-Type: text/html\n";
if ($cookie) $request .= "Cookie: $cookie\n";
$request .= "Connection: Close\n\n";
}
$return = '';
/* Write the Request */
fputs ($web_conn, $request);
/* Get the response */
while (!feof($web_conn)) {
$ret .= fgets($web_conn, 128);
}
}
return $ret;
}
?>
--- End Message ---
--- Begin Message ---
If you want what I created (you can see it in action at www.lcounty.com) I'd
be happy to send you the files. It's fairly simple and could be altered
very easily to fit your needs. The menus are created on the fly from an
include file...
Once you've checked it out, let me know if it's what you're looking for.
John
---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
> -----Original Message-----
> From: James Mansfield [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 6:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] php Expanding Menu System Wanted
>
>
> Hi there
>
> I want to create a very basic menu system in php that I can
> include on all
> pages of my site and by changing one external file be able to
> change the
> navigation on all pages. The navigation will only have two
> levels. There
> should be an easy way for the navigation to know what page it
> is on and be
> expanded to the relevant section (ie every page has a unique
> name in it that
> the menu retrieves??). The navigation will use images and I
> want it to be
> able to highlight (image swap) the current page in the
> navigation. Every
> click will take a user somwhere...ie in the nav below if I
> click nav item
> two it will take me to that page and the sub nav of this
> section will be
> open.
>
> nav item one
> subnav1
> *subnav2*
> subnav3
> nav item two
> nav item three
>
> I do not need or want to use frames if you need to know that.
>
> I am sure there are probably lots of these menu systems out
> there but as I
> do not reall y know where to look your input would be very
> grateful....thanks in advance...James
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
OK, as I said - I have already read this - if you can find where it shows
how to create an *archive* within this compressed file, please let me
know...
Mikey
> -----Original Message-----
> From: Dash McElroy [mailto:[EMAIL PROTECTED]]
> Sent: 25 June 2002 23:24
> To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Subject: RE: [PHP-WIN] Using Bzip2 to create an archive... SECOND
> REQUEST
>
>
> http://www.php.net/manual/en/ref.bzip2.php
>
> In particular, look at bzopen() and bzclose(), as well as bzread().
>
> -Dash
>
> -----Original Message-----
> From: Mikey [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 3:23 PM
> To: [EMAIL PROTECTED]
> Subject: FW: [PHP-WIN] Using Bzip2 to create an archive... SECOND REQUEST
>
>
>
>
> > -----Original Message-----
> > From: Mikey [mailto:[EMAIL PROTECTED]]
> > Sent: 24 June 2002 18:42
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] Using Bzip2 to create an archive...
> >
> >
> > Hi there!
> >
> > I was wondering if anyone here had used the bzip functions to create an
> > archive? The documentation shows only how to compress strings,
> yet I want
> > to create an archive similar to the HTML documentation available from
> > php.net
> >
> > TIA,
> >
> > mikey
> >
> >
> > --
> > 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 have a question about the PHP function file_exists():
This is taken from a textbook entitled "PHP Professional Projects" by
Wilfred, Gupta, Bhatnagar (Premier Press 2002 - ISBN1-931841-53-5) on page
261 under the chapter titled "Handling Files".
The authors write...
"Consider the following code to understand the file_exists() function.
<?
if (!(file_exists("data.dat")))
{
echo "The file exists";
}
else
{
echo "The file does not exist.";
}
"In the above code, the existence of the file data.dat is being verified
with the help of the statement if (file_exists("data.dat")).
[End of quote]
.............................
What I don't understand is why the author(s) have put the negation symbol of
!
in the preceding code.
It would seem to follow that in plain English that the above code statement
would read as...
If the file data.dat does *not* exist - then execute the following
condition which will print to the browser:
"The File exists."
Huh?
Please advise.
Thank you.
Tony Ritter
--- End Message ---
--- Begin Message ---
At 10.25 26/06/2002 -0500, Anthony Ritter wrote:
>I have a question about the PHP function file_exists():
>
>This is taken from a textbook entitled "PHP Professional Projects" by
>Wilfred, Gupta, Bhatnagar (Premier Press 2002 - ISBN1-931841-53-5) on page
>261 under the chapter titled "Handling Files".
>
>The authors write...
>
>"Consider the following code to understand the file_exists() function.
>
><?
>if (!(file_exists("data.dat")))
> {
> echo "The file exists";
> }
>else
> {
> echo "The file does not exist.";
> }
I think it could be a mistake by the author.
Eugenio.
--- End Message ---
--- Begin Message ---
Hello one and all...
I am a PHP newbie who needs a little help with installing dbase extensions
on Windows 98. I took a look around on php.net and saw that everybody seems
to have uncommented the "extension-php_dbase.dll" line from the php.ini
file. Well, I did that...but something tells me there is more to the picture
than meets my untrained PHP-related eye. Further instructions state that I
have to recompile PHP with the "--enable-dbase" option, but it says that the
API numbers do not match. Did I type something wrong? What can I do to fix
this?
Please help. Thank you. :o)
Tony Tzankoff
http://www.tzankoff.com
========================================
--- End Message ---
--- Begin Message ---
Yiss. php.ini, look for "error_reporting"
i suspect that yours is set to the (default) of:
"error_reporting = E_ALL"
and the ISP's is set to something a bit more terse, like:
"error_reporting = E_ALL & ~E_NOTICE"
Notices are great for debugging and developing code,
so i suggest you keep them turned ON for local dev,
but it's harmless to turn them off.
--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Saci" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Cristian
>
> I tried your code , and receive the folowing message
>
> Notice: Undefined index: texto in d:\inetpub\wwwroot\impac\php\teste03.php
> on line 5
>
>
> I guess my problem is regarding configuration, to help here is my php.ini
>
> [PHP]
>
> engine = On
> short_open_tag = On
> asp_tags = on
> precision = 12
> y2k_compliance = Off
> output_buffering = Off
> output_handler =
> unserialize_callback_func=
> zlib.output_compression = Off
> implicit_flush = Off
> allow_call_time_pass_reference = On
> safe_mode = Off
> safe_mode_gid = Off
> safe_mode_include_dir =
> safe_mode_exec_dir =
> safe_mode_allowed_env_vars = PHP_
> safe_mode_protected_env_vars = LD_LIBRARY_PATH
> disable_functions =
>
> highlight.string = #CC0000
> highlight.comment = #FF9900
> highlight.keyword = #006600
> highlight.bg = #FFFFFF
> highlight.default = #0000CC
> highlight.html = #000000
>
> expose_php = On
> max_execution_time = 30 ; Maximum execution time of each script, in
> seconds
> memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
>
> error_reporting = E_ALL; display all errors, warnings and notices
> display_errors = On
> display_startup_errors = Off
> log_errors = Off
> track_errors = Off
> warn_plus_overloading = Off
> variables_order = "GPCSE"
> register_globals = On
> register_argc_argv = On
> post_max_size = 8M
> gpc_order = "GPC"
> magic_quotes_gpc = On
> magic_quotes_runtime = Off
> magic_quotes_sybase = Off
> auto_prepend_file =
> auto_append_file =
> default_mimetype = "text/html"
> doc_root =
> user_dir =
> extension_dir = ./
> enable_dl = On
> cgi.force_redirect = 0
> file_uploads = On
> upload_tmp_dir = C:\PHP\uploadtemp ; temporary directory for HTTP uploaded
> files (will use system default if not specified)
> upload_max_filesize = 2M
>
>
>
>
> ;;;;;;;;;;;;;;;;;;;
> ; Module Settings ;
> ;;;;;;;;;;;;;;;;;;;
>
> [Syslog]
> define_syslog_variables = Off
>
> [mail function]
> SMTP = 192.168.1.101 ; for Win32 only
> sendmail_from = [EMAIL PROTECTED] ; for Win32 only
>
> [Java]
>
> [SQL]
> sql.safe_mode = Off
>
> [ODBC]
> odbc.allow_persistent = On
> odbc.check_persistent = On
> odbc.max_persistent = -1
> odbc.max_links = -1
> odbc.defaultlrl = 4096
> odbc.defaultbinmode = 1
>
> [MySQL]
> mysql.allow_persistent = On
> mysql.max_persistent = -1
> mysql.max_links = -1
> mysql.default_port =
> mysql.default_socket =
> mysql.default_host =
> mysql.default_user =
> mysql.default_password =
>
> [mSQL]
> msql.allow_persistent = On
> msql.max_persistent = -1
> msql.max_links = -1
>
> [PostgresSQL]
> pgsql.allow_persistent = On
> pgsql.auto_reset_persistent = Off
> pgsql.max_persistent = -1
> pgsql.max_links = -1
>
> [Sybase]
> sybase.allow_persistent = On
> sybase.max_persistent = -1
> sybase.max_links = -1
> sybase.min_error_severity = 10
> sybase.min_message_severity = 10
> sybase.compatability_mode = Off
>
> [Sybase-CT]
> sybct.allow_persistent = On
> sybct.max_persistent = -1
> sybct.max_links = -1
> sybct.min_server_severity = 10
> sybct.min_client_severity = 10
>
> [bcmath]
> bcmath.scale = 0
>
> [browscap]
>
> [Informix]
> ifx.default_host =
> ifx.default_user =
> ifx.default_password =
> ifx.allow_persistent = On
> ifx.max_persistent = -1
> ifx.max_links = -1
> ifx.textasvarchar = 0
> ifx.byteasvarchar = 0
> ifx.charasvarchar = 0
> ifx.blobinfile = 0
> ifx.nullformat = 0
>
> [Session]
> session.save_handler = files
> session.save_path = C:\PHP\sessiondata ; argument passed to save_handler
> session.use_cookies = 1
> session.name = PHPSESSID
> session.auto_start = 0
> session.cookie_lifetime = 0
> session.cookie_path = /
> session.cookie_domain =
> session.serialize_handler = php
> session.gc_probability = 1
> session.gc_maxlifetime = 1440
> session.referer_check =
> session.entropy_length = 0
> session.entropy_file =
> session.cache_limiter = nocache
> session.cache_expire = 180
> session.use_trans_sid = 1
> url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
>
> [MSSQL]
> mssql.allow_persistent = On
> mssql.max_persistent = -1
> mssql.max_links = -1
> mssql.min_error_severity = 10
> mssql.min_message_severity = 10
> mssql.compatability_mode = Off
>
>
> [Ingres II]
> ingres.allow_persistent = On
> ingres.max_persistent = -1
> ingres.max_links = -1
> ingres.default_database =
> ingres.default_user =
> ingres.default_password =
>
> [Verisign Payflow Pro]
> pfpro.defaulthost = "test-payflow.verisign.com"
> pfpro.defaultport = 443
> pfpro.defaulttimeout = 30
>
> [Sockets]
> sockets.use_system_read = On
>
>
>
>
>
--- End Message ---
--- Begin Message ---
Hello and good day all. I am having problems trying to upload files
through php. Followed the online manual and the uploading appears to work
fine for small text files. But when I go to try and upload say an mp3 it
doesnt work. It just spits back the error:Warning: Unable to open '' for reading: No
such file or directory in
/mnt/Dell/mget/index.php on line 20File upload failed!
And there is no local file name so it never gets upload! =\ I made sure
that my size limits were well above what was needed just incase, but still
no luck.
Thanks for the help.
-Nick
--- End Message ---
--- Begin Message ---
DUH! never mind the newb over in the corner!
Changed the wrong max file size setting. Oh well...live and learn!
Nicholas Stuart said:
> Hello and good day all. I am having problems trying to upload files
> through php. Followed the online manual and the uploading appears to
> work fine for small text files. But when I go to try and upload say an
> mp3 it doesnt work. It just spits back the error:Warning: Unable to
> open '' for reading: No such file or directory in
> /mnt/Dell/mget/index.php on line 20File upload failed!
>
> And there is no local file name so it never gets upload! =\ I made
> sure that my size limits were well above what was needed just incase,
> but still no luck.
> Thanks for the help.
> -Nick
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
in php.ini my error_log directive has a specific value : c:\php\error.log
so all the errors are logged in one file.
how do you make multiple log-files? each file containing the errors from one
specific website.
any ideas?
thanks,
Joris Pinnoo
--- End Message ---