php-windows Digest 11 Oct 2002 21:40:14 -0000 Issue 1383

Topics (messages 16331 through 16344):

Re: Creating files with PHP - need help
        16331 by: Uttam

Re: works on one server and not another
        16332 by: Uttam
        16335 by: toby z
        16337 by: Tim Blackwell

Re: Rows of data all the same
        16333 by: Uttam
        16336 by: Douglas F. Keim
        16339 by: Douglas F. Keim

Re: Security and File System Access
        16334 by: Matt Kynaston

Timeout
        16338 by: Chevalier, Arthur

Win nt logon user how to ?
        16340 by: Daniel Masson
        16343 by: Mikey

=.jpg file from another URL=
        16341 by: Anthony Ritter

Mssql how to ??
        16342 by: Daniel Masson

Re: passing variables part 2
        16344 by: db

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 ---
long file or folder names like "Program files" have equivalent short names.
It is most probably
"c:\progra~1" for "C:\Program Files".  To see the short name, right click on
the folder or file and in the properties, check the MS-DOS name.

so your path can be like "C:/progra~1/apache~1/htdocs/abc.txt"

regds,

-----Original Message-----
From: Aidal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 13:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Creating files with PHP - need help


If I use full path I get in trouble with spaces in the path like
"c:\program
files\Apache ...", in this case the path would be "c:\program" due to
the
space in the path.
Of cause I could make a new dir on C like "c:\articles" to work around
this,
but if I could get the files into a sub folder of http-server-root that
would be prefered.

"Luis Moreira" <[EMAIL PROTECTED]> wrote in message
00d901c26f78$67228770$5a655080@lamoreira2000">news:00d901c26f78$67228770$5a655080@lamoreira2000...
When you refer to a ROOT; to create a file, you are not referring to the
MACHINE's root, but to the FILE SYSTEM ROOT.
That is why the file goes to HTDOCS.
Try creating the file using an ABSOLUTE PATH, e.g
"c:\Docs\example-dir\54.txt"

Regards,
Luis

----- Original Message -----
From: "Sviss" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 08, 2002 9:46 PM
Subject: [PHP-WIN] Creating files with PHP - need help


> Hi NG.
>
> I'm having problems creating files at a certain location.
> If I attemt to create a file it gets created in the rootdir (htdocs)
even
> though I add a path infront of the file name. I've tried severel ways
of
> adding a path but nothing works.
>
> eksample: "/nef/articles/54.txt"
>
> File 54.txt gets created but not at the intented location, instead it
gets
> created in htdocs.
>
> Can anyone help me by telling me how I'm suppose to do this?
> I'm running PHP on Win98 with Apache.
>
> ~ Sviss
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--- End Message ---
--- Begin Message ---
is the register_globals setting in php.ini is same in both the machines?

i think u need to use $_POST[name] instead of $name...

regds,

-----Original Message-----
From: Tim Blackwell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 18:46
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] works on one server and not another


below is the html form and php file that inserts the info into the
database.

for some reason it's not passing the data from the form to the php
script
and i'm getting undefined variables.  it ends up just inserting a blank
record into the database.

these are the errors i get?

Notice: Undefined variable: name in e:\web\addtutorial.php on line 26

Notice: Undefined variable: date in e:\web\addtutorial.php on line 26

Notice: Undefined variable: max in e:\web\addtutorial.php on line 26

Notice: Undefined variable: room in e:\webaddtutorial.php on line 26

Notice: Undefined variable: tutdesc in e:\web\addtutorial.php on line 26

Notice: Undefined variable: name in e:\web\addtutorial.php on line 31
___________________________________________________________
<html>
<head>
</head>

<body>

  <h1>Add a tutorial</h1>

  <form action="addtutorial.php" method="post" onsubmit="return
FrontPage_Form1_Validator(this)" language="JavaScript"
name="FrontPage_Form1">
    <table border=0 height="133" width="800" style="border-collapse:
collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
      <tr>
        <td height="17" width="160">Tutorial</td><td height="17"
width="640">
        <input type="text" name="name" size="20"><br></td>
      </tr>
      <tr>
        <td height="17" width="160"></td><td height="17" width="640">
        </td>
      </tr>
      <tr>
        <td height="17" width="160"></td>
        <td height="17" width="640">
        </td>
      </tr>
      <tr>
        <td height="17" width="800" colspan="2">
        </td>
      </tr>
      <tr>
        <td height="1" width="160"></td>
        <td height="1" width="640">
        </td>
      </tr>
      <tr><td colspan=2 height="26" width="800">&nbsp;</td></tr>
      <tr><td colspan=2 height="26" width="800"><input type=submit
value="Submit"></td></tr>
    </table>
  </form>
</body>
</html></textarea>

________________________________________________________________________
_

<html>
<head>
  <title>Add Tutorial to database</title>
</head>
<body>
<h1>Add Tutorial</h1>
<?
  if (!$name)
  {
     echo "You have not entered all the required details.<br>"
          ."Please go back and try again.";
     exit;
  }

   $db = mysql_pconnect("localhost", "", "");

  if (!$db)
  {
     echo "Error: Could not connect to database.  Please try again
later.";
     exit;
  }

   mysql_select_db("quick");
   $query = "insert into quickie values ('".$name."')";
   $result = mysql_query($query);

   if ($result)
 {
    echo  "$name has been added to the tutorial database";
 }
   else
 {
   echo "you screwed up, fix the database    ";

}
?>

</body>
</html>
___________________________________________________________

"Toby z" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hay tim
>
> y doesnt it work ?????
> vat error do u get
>
> its really strange coz i ve XP at my home n win2k pro
> at my workplace and  all the code i bring from home
> vorks on my vrkplace machine
>
> do do lemme no bout any errors i MIGHT b able to help
>
> goodluck
>
> toby....
>
> --- Tim Blackwell <[EMAIL PROTECTED]> wrote: >
> this works on a windows XP machine i have but when i
> > put it on a w2kserver
> > it doesn't work?
> >
> >
> > <html>
> >
> > <body>
> >
> > <?
> >
> >   @ $db = mysql_pconnect("localhost", "", "");
> >
> >    mysql_select_db("database_name");
> >    $query = "insert into table_name values
> > ('".$name."')";
> >    $result = mysql_query($query);
> >
> > ?>
> >
> > </body>
> > </html>
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com



--- End Message ---
--- Begin Message ---
ya tim uttam s right
check ur register globals on both ur machinez

n anothr thing to be checked
make sure the table fields u r giving in ur query r
the same as those in the db (i screwup alot vid this
:$) 

n anothr good programmin practice tip bonus
make a file with connection to db n the user n include
it in all the other file will save u some time ;)

luck .....

toby ......

--- Uttam <[EMAIL PROTECTED]> wrote: > is the
register_globals setting in php.ini is same
> in both the machines?
> 
> i think u need to use $_POST[name] instead of
> $name...
> 
> regds,
> 
> -----Original Message-----
> From: Tim Blackwell
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 18:46
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] works on one server and not
> another
> 
> 
> below is the html form and php file that inserts the
> info into the
> database.
> 
> for some reason it's not passing the data from the
> form to the php
> script
> and i'm getting undefined variables.  it ends up
> just inserting a blank
> record into the database.
> 
> these are the errors i get?
> 
> Notice: Undefined variable: name in
> e:\web\addtutorial.php on line 26
> 
> Notice: Undefined variable: date in
> e:\web\addtutorial.php on line 26
> 
> Notice: Undefined variable: max in
> e:\web\addtutorial.php on line 26
> 
> Notice: Undefined variable: room in
> e:\webaddtutorial.php on line 26
> 
> Notice: Undefined variable: tutdesc in
> e:\web\addtutorial.php on line 26
> 
> Notice: Undefined variable: name in
> e:\web\addtutorial.php on line 31
>
___________________________________________________________
> <html>
> <head>
> </head>
> 
> <body>
> 
>   <h1>Add a tutorial</h1>
> 
>   <form action="addtutorial.php" method="post"
> onsubmit="return
> FrontPage_Form1_Validator(this)"
> language="JavaScript"
> name="FrontPage_Form1">
>     <table border=0 height="133" width="800"
> style="border-collapse:
> collapse" bordercolor="#111111" cellpadding="0"
> cellspacing="0">
>       <tr>
>         <td height="17" width="160">Tutorial</td><td
> height="17"
> width="640">
>         <input type="text" name="name"
> size="20"><br></td>
>       </tr>
>       <tr>
>         <td height="17" width="160"></td><td
> height="17" width="640">
>         </td>
>       </tr>
>       <tr>
>         <td height="17" width="160"></td>
>         <td height="17" width="640">
>         </td>
>       </tr>
>       <tr>
>         <td height="17" width="800" colspan="2">
>         </td>
>       </tr>
>       <tr>
>         <td height="1" width="160"></td>
>         <td height="1" width="640">
>         </td>
>       </tr>
>       <tr><td colspan=2 height="26"
> width="800">&nbsp;</td></tr>
>       <tr><td colspan=2 height="26"
> width="800"><input type=submit
> value="Submit"></td></tr>
>     </table>
>   </form>
> </body>
> </html></textarea>
> 
>
________________________________________________________________________
> _
> 
> <html>
> <head>
>   <title>Add Tutorial to database</title>
> </head>
> <body>
> <h1>Add Tutorial</h1>
> <?
>   if (!$name)
>   {
>      echo "You have not entered all the required
> details.<br>"
>           ."Please go back and try again.";
>      exit;
>   }
> 
>    $db = mysql_pconnect("localhost", "", "");
> 
>   if (!$db)
>   {
>      echo "Error: Could not connect to database. 
> Please try again
> later.";
>      exit;
>   }
> 
>    mysql_select_db("quick");
>    $query = "insert into quickie values
> ('".$name."')";
>    $result = mysql_query($query);
> 
>    if ($result)
>  {
>     echo  "$name has been added to the tutorial
> database";
>  }
>    else
>  {
>    echo "you screwed up, fix the database    ";
> 
> }
> ?>
> 
> </body>
> </html>
>
___________________________________________________________
> 
> "Toby z" <[EMAIL PROTECTED]> wrote in message
>
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > hay tim
> >
> > y doesnt it work ?????
> > vat error do u get
> >
> > its really strange coz i ve XP at my home n win2k
> pro
> > at my workplace and  all the code i bring from
> home
> > vorks on my vrkplace machine
> >
> > do do lemme no bout any errors i MIGHT b able to
> help
> >
> > goodluck
> >
> > toby....
> >
> > --- Tim Blackwell <[EMAIL PROTECTED]>
> wrote: >
> > this works on a windows XP machine i have but when
> i
> > > put it on a w2kserver
> > > it doesn't work?
> > >
> > >
> > > <html>
> > >
> > > <body>
> > >
> > > <?
> > >
> > >   @ $db = mysql_pconnect("localhost", "", "");
> > >
> > >    mysql_select_db("database_name");
> > >    $query = "insert into table_name values
> > > ('".$name."')";
> > >    $result = mysql_query($query);
> > >
> > > ?>
> > >
> > > </body>
> > > </html>
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> http://www.php.net/unsub.php
> 
=== message truncated === 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
thanks A LOT Uttam, it was the register globals.


"Uttam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> is the register_globals setting in php.ini is same in both the machines?
>
> i think u need to use $_POST[name] instead of $name...
>
> regds,
>
> -----Original Message-----
> From: Tim Blackwell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 18:46
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] works on one server and not another
>
>
> below is the html form and php file that inserts the info into the
> database.
>
> for some reason it's not passing the data from the form to the php
> script
> and i'm getting undefined variables.  it ends up just inserting a blank
> record into the database.
>
> these are the errors i get?
>
> Notice: Undefined variable: name in e:\web\addtutorial.php on line 26
>
> Notice: Undefined variable: date in e:\web\addtutorial.php on line 26
>
> Notice: Undefined variable: max in e:\web\addtutorial.php on line 26
>
> Notice: Undefined variable: room in e:\webaddtutorial.php on line 26
>
> Notice: Undefined variable: tutdesc in e:\web\addtutorial.php on line 26
>
> Notice: Undefined variable: name in e:\web\addtutorial.php on line 31
> ___________________________________________________________
> <html>
> <head>
> </head>
>
> <body>
>
>   <h1>Add a tutorial</h1>
>
>   <form action="addtutorial.php" method="post" onsubmit="return
> FrontPage_Form1_Validator(this)" language="JavaScript"
> name="FrontPage_Form1">
>     <table border=0 height="133" width="800" style="border-collapse:
> collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
>       <tr>
>         <td height="17" width="160">Tutorial</td><td height="17"
> width="640">
>         <input type="text" name="name" size="20"><br></td>
>       </tr>
>       <tr>
>         <td height="17" width="160"></td><td height="17" width="640">
>         </td>
>       </tr>
>       <tr>
>         <td height="17" width="160"></td>
>         <td height="17" width="640">
>         </td>
>       </tr>
>       <tr>
>         <td height="17" width="800" colspan="2">
>         </td>
>       </tr>
>       <tr>
>         <td height="1" width="160"></td>
>         <td height="1" width="640">
>         </td>
>       </tr>
>       <tr><td colspan=2 height="26" width="800">&nbsp;</td></tr>
>       <tr><td colspan=2 height="26" width="800"><input type=submit
> value="Submit"></td></tr>
>     </table>
>   </form>
> </body>
> </html></textarea>
>
> ________________________________________________________________________
> _
>
> <html>
> <head>
>   <title>Add Tutorial to database</title>
> </head>
> <body>
> <h1>Add Tutorial</h1>
> <?
>   if (!$name)
>   {
>      echo "You have not entered all the required details.<br>"
>           ."Please go back and try again.";
>      exit;
>   }
>
>    $db = mysql_pconnect("localhost", "", "");
>
>   if (!$db)
>   {
>      echo "Error: Could not connect to database.  Please try again
> later.";
>      exit;
>   }
>
>    mysql_select_db("quick");
>    $query = "insert into quickie values ('".$name."')";
>    $result = mysql_query($query);
>
>    if ($result)
>  {
>     echo  "$name has been added to the tutorial database";
>  }
>    else
>  {
>    echo "you screwed up, fix the database    ";
>
> }
> ?>
>
> </body>
> </html>
> ___________________________________________________________
>
> "Toby z" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > hay tim
> >
> > y doesnt it work ?????
> > vat error do u get
> >
> > its really strange coz i ve XP at my home n win2k pro
> > at my workplace and  all the code i bring from home
> > vorks on my vrkplace machine
> >
> > do do lemme no bout any errors i MIGHT b able to help
> >
> > goodluck
> >
> > toby....
> >
> > --- Tim Blackwell <[EMAIL PROTECTED]> wrote: >
> > this works on a windows XP machine i have but when i
> > > put it on a w2kserver
> > > it doesn't work?
> > >
> > >
> > > <html>
> > >
> > > <body>
> > >
> > > <?
> > >
> > >   @ $db = mysql_pconnect("localhost", "", "");
> > >
> > >    mysql_select_db("database_name");
> > >    $query = "insert into table_name values
> > > ('".$name."')";
> > >    $result = mysql_query($query);
> > >
> > > ?>
> > >
> > > </body>
> > > </html>
> > >
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
>
>
>


--- End Message ---
--- Begin Message ---
i was also having trouble with odbc/access, may be my function can work for
you too:
try this code:

<?
 $TableName = "PUB.table1";
 $Link = odbc_connect ($DBName,$User,$Password);
 $Query = "SELECT * from $TableName";
 $Results = odbc_do($Link, $Query);
 odbctable($Results);

function odbctable($result) {
        echo "<table border=1 cellspacing=0><tr>";
        $numfields=odbc_num_fields($result);
        for ($i=1;$i<=$numfields;$i++) {
                echo "<td>".odbc_field_name($result,$i)."</td>";
        }
        echo "</tr>";
        while (odbc_fetch_into($result,$row)) {
                echo "<tr>";
                for ($i=0;$i<$numfields;$i++) {
                        echo "<td>$row[$i]</td>";
                }
                echo "</tr>";
        }
        echo "</table>";
}

?>

regds,
-----Original Message-----
From: Douglas F. Keim [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 16:48
To: [EMAIL PROTECTED]
Subject: Re: Rows of data all the same


This is an update on this problem.  Direct SQL commands are working just
fine with the query, but as soon as I use the php commands it get these
results.  I have tried stepping through the rows with various odbc
commands
with similar results.  Now I am suspecting that the $Results are only
getting the first record in the table three times since there are three
records in the table.

I have tried while statements, odbc_fetch_row, next ... the list goes
on.
All I have accomplished if seeing the whole of or parts of the same
record
each time.

I just don't think the query is working in php.  And if so, I don't know
how
to verify that.

Any suggestions?

"Douglas F. Keim" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have this query that I performing on the database.
>
> Unfortunately, it is returning all the same information for all rows.
>
> The table has three rows of data in it
> Tbl_ID        Tbl_Name        Tbl_Age
> 1                    Horse                21
> 2                    Cow                  30
> 3                    Eagle                 14
>
> My php script looks like this.
> $TableName = "PUB.table1";
> $Link = odbc_connect ($DBName,$User,$Password);
> $Query = "SELECT * from $TableName";
> $Results = odbc_do($Link, $Query);
> print odbc_result_all($Results);
>
> My browser results are as follows ...
>       Tbl_ID Tbl_Name Tbl_Age
>       1 Horse 21
>       1 Horse 21
>       1 Horse 21
>
>
> I am not sure what I am doing wrong here.
>
>



--- End Message ---
--- Begin Message ---
Hi, Thanks for your input.  I have an interesting situation occurring.  I
believe that the problem lies in the query.  And in the fact that this is
odbc to a Progress database.  Just for giggles, I created an identical
MSAccess database and set it up for ODBC.  I switched the php script to look
at it and all of my querys and yours worked just fine.

Progress comes with a SQL user interface as part of their package.  When I
use it, the results are just fine.  I suspect that the problem here is the
ODBC drivers for Progress.  I will try to go after it from that point.  At
least I know that my php script and yours worked on a odbc connected
database.

Thanks again.

This is not solved but at least I have a direction to investigate.
"Uttam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i was also having trouble with odbc/access, may be my function can work
for
> you too:
> try this code:
>
> <?
>  $TableName = "PUB.table1";
>  $Link = odbc_connect ($DBName,$User,$Password);
>  $Query = "SELECT * from $TableName";
>  $Results = odbc_do($Link, $Query);
>  odbctable($Results);
>
> function odbctable($result) {
> echo "<table border=1 cellspacing=0><tr>";
> $numfields=odbc_num_fields($result);
> for ($i=1;$i<=$numfields;$i++) {
> echo "<td>".odbc_field_name($result,$i)."</td>";
> }
> echo "</tr>";
> while (odbc_fetch_into($result,$row)) {
> echo "<tr>";
> for ($i=0;$i<$numfields;$i++) {
> echo "<td>$row[$i]</td>";
> }
> echo "</tr>";
> }
> echo "</table>";
> }
>
> ?>
>
> regds,
> -----Original Message-----
> From: Douglas F. Keim [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 16:48
> To: [EMAIL PROTECTED]
> Subject: Re: Rows of data all the same
>
>
> This is an update on this problem.  Direct SQL commands are working just
> fine with the query, but as soon as I use the php commands it get these
> results.  I have tried stepping through the rows with various odbc
> commands
> with similar results.  Now I am suspecting that the $Results are only
> getting the first record in the table three times since there are three
> records in the table.
>
> I have tried while statements, odbc_fetch_row, next ... the list goes
> on.
> All I have accomplished if seeing the whole of or parts of the same
> record
> each time.
>
> I just don't think the query is working in php.  And if so, I don't know
> how
> to verify that.
>
> Any suggestions?
>
> "Douglas F. Keim" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have this query that I performing on the database.
> >
> > Unfortunately, it is returning all the same information for all rows.
> >
> > The table has three rows of data in it
> > Tbl_ID        Tbl_Name        Tbl_Age
> > 1                    Horse                21
> > 2                    Cow                  30
> > 3                    Eagle                 14
> >
> > My php script looks like this.
> > $TableName = "PUB.table1";
> > $Link = odbc_connect ($DBName,$User,$Password);
> > $Query = "SELECT * from $TableName";
> > $Results = odbc_do($Link, $Query);
> > print odbc_result_all($Results);
> >
> > My browser results are as follows ...
> >       Tbl_ID Tbl_Name Tbl_Age
> >       1 Horse 21
> >       1 Horse 21
> >       1 Horse 21
> >
> >
> > I am not sure what I am doing wrong here.
> >
> >
>
>
>


--- End Message ---
--- Begin Message ---
Here is some more information.  I have been experimenting with
MSExcel/ODBC/Progress and this works just fine.  Excel uses the same ODBC
driver that PHP should be using to access the Progress database.  So now I
am leaning towards what appears to be a problem with PHP being able to use
that driver for Progress.

How do I pass this this on to PHP?


"Uttam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i was also having trouble with odbc/access, may be my function can work
for
> you too:
> try this code:
>
> <?
>  $TableName = "PUB.table1";
>  $Link = odbc_connect ($DBName,$User,$Password);
>  $Query = "SELECT * from $TableName";
>  $Results = odbc_do($Link, $Query);
>  odbctable($Results);
>
> function odbctable($result) {
> echo "<table border=1 cellspacing=0><tr>";
> $numfields=odbc_num_fields($result);
> for ($i=1;$i<=$numfields;$i++) {
> echo "<td>".odbc_field_name($result,$i)."</td>";
> }
> echo "</tr>";
> while (odbc_fetch_into($result,$row)) {
> echo "<tr>";
> for ($i=0;$i<$numfields;$i++) {
> echo "<td>$row[$i]</td>";
> }
> echo "</tr>";
> }
> echo "</table>";
> }
>
> ?>
>
> regds,
> -----Original Message-----
> From: Douglas F. Keim [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 16:48
> To: [EMAIL PROTECTED]
> Subject: Re: Rows of data all the same
>
>
> This is an update on this problem.  Direct SQL commands are working just
> fine with the query, but as soon as I use the php commands it get these
> results.  I have tried stepping through the rows with various odbc
> commands
> with similar results.  Now I am suspecting that the $Results are only
> getting the first record in the table three times since there are three
> records in the table.
>
> I have tried while statements, odbc_fetch_row, next ... the list goes
> on.
> All I have accomplished if seeing the whole of or parts of the same
> record
> each time.
>
> I just don't think the query is working in php.  And if so, I don't know
> how
> to verify that.
>
> Any suggestions?
>
> "Douglas F. Keim" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have this query that I performing on the database.
> >
> > Unfortunately, it is returning all the same information for all rows.
> >
> > The table has three rows of data in it
> > Tbl_ID        Tbl_Name        Tbl_Age
> > 1                    Horse                21
> > 2                    Cow                  30
> > 3                    Eagle                 14
> >
> > My php script looks like this.
> > $TableName = "PUB.table1";
> > $Link = odbc_connect ($DBName,$User,$Password);
> > $Query = "SELECT * from $TableName";
> > $Results = odbc_do($Link, $Query);
> > print odbc_result_all($Results);
> >
> > My browser results are as follows ...
> >       Tbl_ID Tbl_Name Tbl_Age
> >       1 Horse 21
> >       1 Horse 21
> >       1 Horse 21
> >
> >
> > I am not sure what I am doing wrong here.
> >
> >
>
>
>


--- End Message ---
--- Begin Message ---
> Where should I look for resources related to locking down the
> security of
> PHP?  In particular can I specify directories that PHP will
> allow scripts to
> execute?  For instance can i specify that d:\domains\domain1
> can have access
> but not d:\domains\domain2 ?  This sure would be an awesome
> feature if there
> is such a feature.

Yes. Under IIS php runs as the user IUSR_[machinename], so if that user does
not have modify permissions on d:\domains\domain2 it won't be allowed to
modify files there. It's exactly as secure as Windows is :|

Not completely sure about Apache/Windows, but it's the same principle, and
you can control _web_ access within you DocumentRoot with .htaccess files.

Sounds like you should be checking out the safe_mode stuff in php.ini too.

Matt
--- End Message ---
--- Begin Message ---
Hi all,

I am experiencing a timeout issue when trying to connect/query to one of our
Sybase Databases.  I have no problems connecting/querying to all of my other
databases.  Does anyone know the parameters either in the php.ini or in the
apache httpd.conf file that I can update to eliminate this timeout issue? 

Thanks in advance,

Art    

-----------------------------------------------------------------------
Art Chevalier
Database Replication Administrator
Database Production/Support Division, Code 243
Space and Naval Warfare Systems Center, NORFOLK
1837 Morris Street
Norfolk, VA 23320-8915
Phone: (757) 443-0224
Email: [EMAIL PROTECTED]
Web: www.scn.spawar.navy.mil


--- End Message ---
--- Begin Message ---

Hey everyone, id like to know how to get the logon user in my NT domain,
i know that this can be done in ASP:
Request.Servervariables("LOGON_USER"), and gets the logged user of the
client machine, i need to do that with PHP, ... im affraid this is not
possible because, runing phpinfo() ... this variable is not on
enviroment list.
 
is it possible what i want to do ??
 
Thanks every1 !!
 
Regards
Daniel.
 


-----Mensaje original-----
De: Uttam [mailto:[EMAIL PROTECTED]] 
Enviado el: lunes, 07 de octubre de 2002 9:03
Para: 'R Strang'
CC: [EMAIL PROTECTED]
Asunto: [PHP-WIN] RE: Sending data to a script from a form


use $_GET['user'] and $_GET['address']...

output.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <?php
    echo "welcome <b>$_GET['user']</b><p>\n\n";
    echo "your address is:<p>\n\n<b>$_GET['address']</b>";
    ?>
    </body>
    </html>


regds,
-----Original Message-----
From: R Strang [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 04:12
To: [EMAIL PROTECTED]
Subject: Sending data to a script from a form


hi im having problems with running PHP4 and MySQL on Windows 98 with PWS

im using this simple script to input an name and dysplay it on another
page it was taken from a book example but i get an error

PHP Notice: Undefined variable: user in c:\Inetpub\wwwroot\output.php on
line 7 PHP                         Notice:Undefined variable: address in
c:\Inetpub\wwwroot\output.php on line 8 


input.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <form action="output.php" method="get">
    <input type="text" name="user">
    <br>
    <textarea name="address rows="5" cols="40">
    </textarea>
    <br>
    <input type="submit" value="hit it!">
    </form>
    </body>
    </html>


output.php

    <html>
    <head>
    <title></title>
    </head>
    <body>
    <?php
    print "welcome <b>$user</b><p>\n\n";
    print "your address is:<p>\n\n<b>$address</b>";
    ?>
    </body>
    </html>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
How about NT_AUTH_USER?

regards,

Mikey
"If you give someone a program, you will frustrate them for a day. If you
teach them how to program, you will frustrate them for a lifetime."

> -----Original Message-----
> From: Daniel Masson [mailto:[EMAIL PROTECTED]]
> Sent: 11 October 2002 14:56
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Win nt logon user how to ?
>
>
>
> Hey everyone, id like to know how to get the logon user in my NT domain,
> i know that this can be done in ASP:
> Request.Servervariables("LOGON_USER"), and gets the logged user of the
> client machine, i need to do that with PHP, ... im affraid this is not
> possible because, runing phpinfo() ... this variable is not on
> enviroment list.
>
> is it possible what i want to do ??
>
> Thanks every1 !!
>
> Regards
> Daniel.
>
>
>
> -----Mensaje original-----
> De: Uttam [mailto:[EMAIL PROTECTED]]
> Enviado el: lunes, 07 de octubre de 2002 9:03
> Para: 'R Strang'
> CC: [EMAIL PROTECTED]
> Asunto: [PHP-WIN] RE: Sending data to a script from a form
>
>
> use $_GET['user'] and $_GET['address']...
>
> output.php
>
>     <html>
>     <head>
>     <title></title>
>     </head>
>     <body>
>     <?php
>     echo "welcome <b>$_GET['user']</b><p>\n\n";
>     echo "your address is:<p>\n\n<b>$_GET['address']</b>";
>     ?>
>     </body>
>     </html>
>
>
> regds,
> -----Original Message-----
> From: R Strang [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 04:12
> To: [EMAIL PROTECTED]
> Subject: Sending data to a script from a form
>
>
> hi im having problems with running PHP4 and MySQL on Windows 98 with PWS
>
> im using this simple script to input an name and dysplay it on another
> page it was taken from a book example but i get an error
>
> PHP Notice: Undefined variable: user in c:\Inetpub\wwwroot\output.php on
> line 7 PHP                         Notice:Undefined variable: address in
> c:\Inetpub\wwwroot\output.php on line 8
>
>
> input.php
>
>     <html>
>     <head>
>     <title></title>
>     </head>
>     <body>
>     <form action="output.php" method="get">
>     <input type="text" name="user">
>     <br>
>     <textarea name="address rows="5" cols="40">
>     </textarea>
>     <br>
>     <input type="submit" value="hit it!">
>     </form>
>     </body>
>     </html>
>
>
> output.php
>
>     <html>
>     <head>
>     <title></title>
>     </head>
>     <body>
>     <?php
>     print "welcome <b>$user</b><p>\n\n";
>     print "your address is:<p>\n\n<b>$address</b>";
>     ?>
>     </body>
>     </html>
>
>
> --
> 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 ---
The following script picks up single .jpg image of a doppler weather map
from another URL:
.......................................
<?
$theURL="http://image.weather.com/web/radar/us_har_closeradar_medium_usen.jp
g";
if(!($fp=fopen($theURL, "r")))
 {
  print("Could not open the URL.");
  exit;
 }
$contents=fread($fp,1000000);
print($contents);
fclose($fp);
?>
......................................

However, when I try to insert the HTML tages into the script like:

......................................................
<HTML>
<HEAD>
<BODY>
This is a map.
<?
$theURL="http://image.weather.com/web/radar/us_har_closeradar_medium_usen.jp
g";
if(!($fp=fopen($theURL, "r")))
 {
  print("Could not open the URL.");
  exit;
 }
$contents=fread($fp,1000000);
print($contents);
fclose($fp);
?>
</BODY>
</HTML>
..........................................................

I get the following:
JFIF 1034364214C
2!=,.$2I@LKG@FEPZsbPUmVEFd^emw{,N`-O}-s~|C;!!;|SFS
||||||||||||||||||||||||||||||||||||||||||||||||||)"
H!1A"Qaq#2'BR3$br45CSs'
"DTt,cf*!1AQ"aq2B'
?z_Y<Mm L?W"-Oxx'~~?|s
y7þ?xb۰,}`!W-$gN&jI'ZTѶSD
Q-y+Q>_L{M2Iԍ3q!
etc. etc...

I would like to insert additional text copy with this map - is this
possible?

Thanking all in advance.
Tony Ritter




--- End Message ---
--- Begin Message ---
Hi there ...

I need to work php and mssql my version is 4.1.2 and on IIS, i figured
out that to work i need de client tools instaled and add
extension=php_mssql.dll in ini file, where do i get php_mssql.dll , or
what is the right procedure to have mssql support ??? I have no clue ..


THANKX !! Any help would be very helpful



Cordialmente
Daniel Massn => Ingeniero de desarollo
[EMAIL PROTECTED]
www.imagine.com.co
Tels: (57)(1) 2182064 - 6163218
Bogot - Colombia
------------------------------------------------------------------------
- Soluciones web para internet e intranet
- Asesora y Soporte Tcnico
- Licenciamiento de Software 
 



--- End Message ---
--- Begin Message ---
another roadblock: how would you pass a variable containing a path like
$i="C:/pics/albums/album1"?  is it possible?

thanks.


"Db" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> this is a follow-up question to my question about passing a variable
through
> a link  ie,
>
>     echo "<a href='passtest.php?i={$i}'>Press to continue</a>";
>
> how would i go about passing more than one variable, say $i and $j?
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.394 / Virus Database: 224 - Release Date: 10/3/2002
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.401 / Virus Database: 226 - Release Date: 10/9/2002


--- End Message ---

Reply via email to