php-install Digest 7 Mar 2003 20:15:10 -0000 Issue 1281
Topics (messages 10309 through 10312):
I need help with some php code please
10309 by: Stephen K Knight
10312 by: Frank
Cannot connect PostgreSQL 7.3.1. Using PHP thru...
10310 by: Patrick LOK
10311 by: Patrick LOK
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 am trying to upload an image to my webserver. This is the PHP page that
is called from my html page. I am trying to upload the image to my folder
called "logos" the direct link would be: C:\Program Files\Apache
Group\Apache2\htdocs\logos I am not sure what I am doing wrong in the code
below. Can someone please look and help me so that I can upload the image
to that folder.
Thank you!
In Kindness
Stephen K Knight
<?
if(!empty($userfile))
{
$abpath = "/logos/" . $newname;
echo "FileUpload2.php";
echo $username;
echo $newname;
echo $abpath;
//copy the file
// copy($userfile, "$abpath");
//destroy the uploaded file
// unlink($userfile);
// write javascript to store the newname
// echo "<script language='javascript'>\n";
// echo "newname = '" . $newname . "';\n";
// echo "</script>\n";
}
--- End Message ---
--- Begin Message ---
When you to do the image from php, you put a name to file? if is this, not
put name file to out from php, call directly to page php, so not make a file
temporal, generality when is use a file temporal to imagen in php, not
update inmediate the change.
look.
Frank.-
ps: to more information, write me in spanish and I help you more.
"Stephen K Knight" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> I am trying to upload an image to my webserver. This is the PHP page that
> is called from my html page. I am trying to upload the image to my folder
> called "logos" the direct link would be: C:\Program Files\Apache
> Group\Apache2\htdocs\logos I am not sure what I am doing wrong in the
code
> below. Can someone please look and help me so that I can upload the image
> to that folder.
>
> Thank you!
> In Kindness
> Stephen K Knight
>
>
> <?
>
> if(!empty($userfile))
> {
> $abpath = "/logos/" . $newname;
>
> echo "FileUpload2.php";
> echo $username;
> echo $newname;
> echo $abpath;
>
> //copy the file
> // copy($userfile, "$abpath");
>
> //destroy the uploaded file
> // unlink($userfile);
>
> // write javascript to store the newname
> // echo "<script language='javascript'>\n";
> // echo "newname = '" . $newname . "';\n";
> // echo "</script>\n";
> }
>
--- End Message ---
--- Begin Message ---
I have the following setups:
*PostgreSql 7.3.1 and MSSQL on Win2k server (A)
*Apache 1.3.x + PHP 4.3.1.1(using CGI & loaded w/ php_pgsql.dll) + ODBC for
PostgreSql v7.02.00.05 on Win2K server (B)
I tried to use phppgadmin 2.4.2 and odbc for postgresql to connect
PostgreSql in (A) but both connection failed!
Can somebody give me some advices?
Can PHP access remote DB server?
Can ODBC for PostgreSql access remote DB server?
Best regards
./pl
Using PHPPGADMIN 2.4.2 to administer but it says "Wrong username/password.
Access denied".
The following is logged on psqlodbc_xxxx.log:
DSN info:
DSN='PostgreSQL',server='192.168.1.16',port='5432',dbase='tet',user='adminis
trator',passwd=''
onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
conn_settings='',conn_encoding='OTHER'
translation_dll='',translation_option=''
I wrote a simple php program in (B) to connect to server (A) using odbc for
postgresql but the connection failed!
<?php
$rtn = odbc_connect("PostgreSql","administrator","");
$cur=odbc_exec($rtn,"select d_base, high_jrnal from salfmsc");
while(odbc_fetch_row($cur)){
$fld1=odbc_result($cur,1);
$fld2=odbc_result($cur,2);
echo $fld1;
echo ("-");
echo $fld2;
echo ("<p>");
}
echo odbc_close($rtn);
?>
BUT Warning is returned.
Warning: SQL error: Could not connect to the server; Could not connect to
remote socket., SQL state 08001 in SQLConnect in
d:\tmp\webcodetest\mstest.php on line 3
The following is logged on psqlodbc_xxxx.log:
DSN info:
DSN='PostgreSql',server='192.168.1.16',port='5432',dbase='tet',user='adminis
trator',passwd=''
onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
conn_settings='',conn_encoding='OTHER'
translation_dll='',translation_option=''
conn = 15742608, PGAPI_Connect(DSN='PostgreSql', UID='teter', PWD='')
Global Options: Version='07.02.0005', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=0
text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1 NAMEDATALEN=64
extra_systable_prefixes='dd_;', conn_settings=''
conn_encoding='OTHER'
CONN ERROR: func=PGAPI_Connect, desc='Error on CC_connect', errnum=101,
errmsg='Could not connect to the server'
------------------------------------------------------------
henv=15742552, conn=15742608, status=0, num_stmts=16
sock=15753592, stmts=15761872, lobj_type=-999
---------------- Socket Info -------------------------------
socket=-1, reverse=0, errornumber=4, errormsg='Could not connect
to remote socket.'
buffer_in=15753664, buffer_out=15757768
buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0
--- End Message ---
--- Begin Message ---
tcpip_socket is enabled!
access to postgresql is granted; ip-address is added to pg_hba.conf - METHOD
= trust
./pl
"Patrick Lok" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have the following setups:
> *PostgreSql 7.3.1 and MSSQL on Win2k server (A)
> *Apache 1.3.x + PHP 4.3.1.1(using CGI & loaded w/ php_pgsql.dll) + ODBC
for
> PostgreSql v7.02.00.05 on Win2K server (B)
>
> I tried to use phppgadmin 2.4.2 and odbc for postgresql to connect
> PostgreSql in (A) but both connection failed!
>
> Can somebody give me some advices?
> Can PHP access remote DB server?
> Can ODBC for PostgreSql access remote DB server?
>
> Best regards
> ./pl
>
>
>
> Using PHPPGADMIN 2.4.2 to administer but it says "Wrong
username/password.
> Access denied".
>
> The following is logged on psqlodbc_xxxx.log:
> DSN info:
>
DSN='PostgreSQL',server='192.168.1.16',port='5432',dbase='tet',user='adminis
> trator',passwd=''
>
> onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
> conn_settings='',conn_encoding='OTHER'
> translation_dll='',translation_option=''
>
>
> I wrote a simple php program in (B) to connect to server (A) using odbc
for
> postgresql but the connection failed!
>
> <?php
> $rtn = odbc_connect("PostgreSql","administrator","");
> $cur=odbc_exec($rtn,"select d_base, high_jrnal from salfmsc");
> while(odbc_fetch_row($cur)){
> $fld1=odbc_result($cur,1);
> $fld2=odbc_result($cur,2);
> echo $fld1;
> echo ("-");
> echo $fld2;
> echo ("<p>");
> }
> echo odbc_close($rtn);
> ?>
>
> BUT Warning is returned.
> Warning: SQL error: Could not connect to the server; Could not connect to
> remote socket., SQL state 08001 in SQLConnect in
> d:\tmp\webcodetest\mstest.php on line 3
>
> The following is logged on psqlodbc_xxxx.log:
> DSN info:
>
DSN='PostgreSql',server='192.168.1.16',port='5432',dbase='tet',user='adminis
> trator',passwd=''
>
> onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
> conn_settings='',conn_encoding='OTHER'
> translation_dll='',translation_option=''
> conn = 15742608, PGAPI_Connect(DSN='PostgreSql', UID='teter', PWD='')
> Global Options: Version='07.02.0005', fetch=100, socket=4096,
> unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
> disable_optimizer=1, ksqo=1, unique_index=1,
> use_declarefetch=0
> text_as_longvarchar=1, unknowns_as_longvarchar=0,
> bools_as_char=1 NAMEDATALEN=64
> extra_systable_prefixes='dd_;', conn_settings=''
> conn_encoding='OTHER'
> CONN ERROR: func=PGAPI_Connect, desc='Error on CC_connect', errnum=101,
> errmsg='Could not connect to the server'
> ------------------------------------------------------------
> henv=15742552, conn=15742608, status=0, num_stmts=16
> sock=15753592, stmts=15761872, lobj_type=-999
> ---------------- Socket Info -------------------------------
> socket=-1, reverse=0, errornumber=4, errormsg='Could not
connect
> to remote socket.'
> buffer_in=15753664, buffer_out=15757768
> buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0
>
>
--- End Message ---