php-windows Digest 4 May 2002 07:39:27 -0000 Issue 1126
Topics (messages 13508 through 13530):
Re: Why Global Variables turned off??
13508 by: Rasmus Lerdorf
IIS 3 - Beginners Installation Questions
13509 by: Charles Prettyman
13513 by: Charles Prettyman
Re: Sessions
13510 by: Peter Finch
sessions and I/O
13511 by: Raidell Avello Martínez \(CICT - UCf\)
reg exp
13512 by: Alberto. Sartori
13521 by: Scott Hurring
Same old string quote issue
13514 by: R.S. Herhuth
13515 by: George Nicolae
Shutting down Apache on Windows
13516 by: Jerry
13517 by: Dash McElroy
13518 by: Scott St. John
13519 by: Dash McElroy
Moving to non-Windows technology
13520 by: Jerry
13522 by: Steve Bradwell
File Uploader - Progress
13523 by: Arijit Chaudhuri
13524 by: Scott Carr
13525 by: Mike Flynn
13526 by: Stuart Dallas
13529 by: Jason Soza
Windows with Oracle
13527 by: Jeff Lutes
Re: PHP generation of <select> fields
13528 by: Scott Hurring
Testing...pls ignore
13530 by: theN
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 ---
You can do this with:
extract($_REQUEST, EXTR_SKIP)
However, you are making some invalid assumptions here. Script variables
get initialized after the request variables are automatically imported, so
this overwrite switch could not be a high-level php.ini switch. You can
do it with a user-space level function like extract() because in this case
you can choose when to pull the request variables into your script.
I actually prefer doing the opposite. Something like:
<?
$name = $age = $gender = true;
extract($_REQUEST, EXTR_IF_EXISTS);
?>
This fetches only the variables I have defined into the global symbol
table.
-Rasmus
On Fri, 3 May 2002, Luis Ferro wrote:
> That would be easy to solve by just adding a non_overwrite flag to the
> vars and thrus forbid the vars from get/post to override vars in the
> varspace that come from programming and not from get/post...
>
> One would keep the global vars but would also have the security of the
> existing/declared vars be protected from overwrite (only get/post vars
> would be allowed to be overwriten between page initializations)...
>
> Cheers,
> Luis Ferro
>
> Matt Parlane wrote:
>
> >Posting the variables might solve the problem in this case, but remember
> >that this is just an example, and I'm sure any creative mind could come up
> >with a whole heap of ways you could exploit something like this.
> >
> >On the other hand though, you don't have to use it. If you are confident
> >you can write an application without using the new superglobal arrays (and
> >it is conceivably possible), you can just turn register_globals on. It's
> >just a choice which was made by the PHP developers (rightly so I believe).
> >
> >Matt
> >
> >"Then" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> >>Hi
> >>
> >>At the cost of sounding dense...wouldn't POSTing the variables solve the
> >>problem. Then the user would not see them in the URL.
> >>
> >>
> >>[EMAIL PROTECTED] (Matt Parlane) wrote in
> >>[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:
> >>
> >>
> >>
> >>>Hi...
> >>>
> >>>The problem comes when you are mixing variables recieved from the HTTP
> >>>request, and your own user variables. Consider the following code:
> >>>
> >>>function authenticate_user(){
> >>> if($password == 'secret'){
> >>> $authenticated = 'yes';
> >>> }
> >>> return $authenticated;
> >>>}
> >>>
> >>>If someone passes the variable authenticated=yes in the url request
> >>>string, the user will be authenticated no matter whether their password
> >>>matches or not. This is obviously a simplified example, and I'd hope
> >>>that no programmer would ever do this, but things like have been known
> >>>to happen, and there have already been exploits for it.
> >>>
> >>>The logic behind the change is that it is really not much extra work to
> >>>type $_GET['something'] than just $something, and it is infinitely more
> >>>secure - so you should write your scripts using the $_REQUEST variables
> >>>whenever possible.
> >>>
> >>>Hope that helps...
> >>>
> >>>Matt
> >>>
> >>>"Then" <[EMAIL PROTECTED]> wrote in message
> >>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>>
> >>>
> >>>>Hi All
> >>>>
> >>>>I am a PHP newbie. I don't understand why global variables are turned
> >>>>off
> >>>>
> >>>>
> >>>by
> >>>
> >>>
> >>>>default in PHP4.2.0... something to do with security. Could some one
> >>>>
> >>>>
> >>>please
> >>>
> >>>
> >>>>help me understand how it's a security issue. Thanks
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>
> >>--
> >>Lots of Luck
> >>theN
> >>[EMAIL PROTECTED]
> >>
> >>
> >
> >
> >
> >
> >
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I am ne to PHP, and just installed in on a WinNT4 machine running IIS 3. I
have a little test page, just to validate that it's working, that should
simply echo "helloo World" (the test page described atthe beginning of every
book)
but all I get is a blank page. Viewing the page source shows all the php
script, it's just not doing anything with it.
I thought I followed the installation instructions to teh letter, but
apparently I missed something.
I did check the registry, and there is an entry for php.
Can anyone make any trouble shooting suggestions? All advice welcome.
--- End Message ---
--- Begin Message ---
I found it, never mind
If anyone else hits this, check the settings for the home directory, and
make sure that read and execute access are both allowed.
"Charles Prettyman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am ne to PHP, and just installed in on a WinNT4 machine running IIS 3.
I
> have a little test page, just to validate that it's working, that should
> simply echo "helloo World" (the test page described atthe beginning of
every
> book)
>
> but all I get is a blank page. Viewing the page source shows all the php
> script, it's just not doing anything with it.
>
> I thought I followed the installation instructions to teh letter, but
> apparently I missed something.
>
> I did check the registry, and there is an entry for php.
>
> Can anyone make any trouble shooting suggestions? All advice welcome.
>
>
--- End Message ---
--- Begin Message ---
Many thanks indeed. That did the trick. Peter Finch
"Scott Hurring" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> you have to setup the directory for sessions in your
> 'php.ini' file.
>
> It defaults to '/tmp', which is *not* a subdir, but
> a root-dir (AFAIK), so either create "C:/tmp" or
> set it to something else.
>
> ---
> Scott Hurring
> Systems Programmer
> EAC Corporation
> [EMAIL PROTECTED]
> Voice: 201-462-2149
> Fax: 201-288-1515
>
> > -----Original Message-----
> > From: Peter Finch [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 02, 2002 4:12 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] Sessions
> >
> >
> > I am learning PHP from the Greenspan and Bulger book, on a Windows
> > development system using PHP 4.1.2 and Apache. All has worked
> > fine until I
> > got to sessions. This simple program:
> > <?php
> >
> > session_start();
> >
> > ?>
> >
> > produces this output:
> >
> > Warning: open(/tmp\sess_d7e26c0283f94a430da8f7fc4138ca21,
> > O_RDWR) failed: No
> > such file or directory (2) in
> > c:\phpweb\post-march-2002-stuff\learning3.php
> > on line 2
> >
> > Warning: open(/tmp\sess_d7e26c0283f94a430da8f7fc4138ca21,
> > O_RDWR) failed: No
> > such file or directory (2) in Unknown on line 0
> >
> > Warning: Failed to write session data (files). Please verify that the
> > current setting of session.save_path is correct (/tmp) in
> > Unknown on line 0
> >
> > I have provided a directory called tmp as a sub directory of
> > the directory
> > in which the little program resides. It is not read only.
> > Phpinfo() shows
> > session.save_path as /tmp.
> >
> > Would anyone help me please?
> >
> > Peter Finch
> >
> >
> >
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
--- End Message ---
--- Begin Message ---
hi
i have 2 questions in one,
lock the folowing code:
<?php
if (session_start()) {
echo "session start ok...\n";
echo "\n";
echo "another line";
}
if (session_destroy()) {
echo "session destroyed ok...";
}
?>
print: session start ok... another line
1. Why "session destroyed ok" did not show.
2. Why whole de answer was displayed in only one line.
thanks in advance
escuse my english
RAM
--- End Message ---
--- Begin Message ---
Hi guys, I need to make a right pattern to extract only digits from a string like this:
"Hello 12 28 99 World"
Any idea? I've red lots of docs, but I'm newbie about regexp
Thanks in advance,
regards, Alb
--- End Message ---
--- Begin Message ---
Off the top of my head, try something like:
preg_match('/(\d+)/', $var, $matches);
then look what's in $matches.
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Alberto. Sartori [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 10:37 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] reg exp
>
>
> Hi guys, I need to make a right pattern to extract only
> digits from a string like this:
>
> "Hello 12 28 99 World"
>
> Any idea? I've red lots of docs, but I'm newbie about regexp
> Thanks in advance,
>
> regards, Alb
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
I'm having the problem of the quotes I have seen mentioned on this list
before but I forgot how to resolve it:
echo" <a href='#'
onclick='URlredirect('http://www.mysite.com','market')'>test link</a>";
how do I resolve the need for multiple occurances of the quotes so they
won't terminate each other?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
try:
echo" <a href='#'
onclick='URlredirect(\"http://www.mysite.com\",\"market\")'>test link</a>";
--
Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com - Professional Web Design
www.PaginiWeb.com
"R.S. Herhuth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I'm having the problem of the quotes I have seen mentioned on this list
> before but I forgot how to resolve it:
>
>
> echo" <a href='#'
> onclick='URlredirect('http://www.mysite.com','market')'>test link</a>";
>
>
> how do I resolve the need for multiple occurances of the quotes so they
> won't terminate each other?
>
> Thanks,
> Ron
--- End Message ---
--- Begin Message ---
Hello! I just setup Apache 1.3 on Win98 using Triad. Everything
works great. I am running Apache and need to know how to shut it
down properly. I can't find any instructions on this in the
documentation. There is a DOS window open that does not allow me
type anything. How should I do it?
TIA,
Jerry
--- End Message ---
--- Begin Message ---
Apache will shut down cleanly with a CTRL-C in the DOS window.
-Dash
-----Original Message-----
From: Jerry [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 11:05 AM
To: PHP Win
Subject: [PHP-WIN] Shutting down Apache on Windows
Hello! I just setup Apache 1.3 on Win98 using Triad. Everything
works great. I am running Apache and need to know how to shut it
down properly. I can't find any instructions on this in the
documentation. There is a DOS window open that does not allow me
type anything. How should I do it?
TIA,
Jerry
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Can you do a net stop apache in a command window on 98?
On Fri, 3 May 2002, Dash McElroy wrote:
> Apache will shut down cleanly with a CTRL-C in the DOS window.
>
> -Dash
>
> -----Original Message-----
> From: Jerry [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 11:05 AM
> To: PHP Win
> Subject: [PHP-WIN] Shutting down Apache on Windows
>
>
> Hello! I just setup Apache 1.3 on Win98 using Triad. Everything
> works great. I am running Apache and need to know how to shut it
> down properly. I can't find any instructions on this in the
> documentation. There is a DOS window open that does not allow me
> type anything. How should I do it?
>
> TIA,
> Jerry
>
>
--
--- End Message ---
--- Begin Message ---
No - because it is not a service. You can do an
"wherever\apache\is\bin\apache -k stop" as well.
-Dash
-----Original Message-----
From: Scott St. John [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 10:55 AM
To: Dash McElroy
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Shutting down Apache on Windows
Can you do a net stop apache in a command window on 98?
On Fri, 3 May 2002, Dash McElroy wrote:
> Apache will shut down cleanly with a CTRL-C in the DOS window.
>
> -Dash
>
> -----Original Message-----
> From: Jerry [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 11:05 AM
> To: PHP Win
> Subject: [PHP-WIN] Shutting down Apache on Windows
>
>
> Hello! I just setup Apache 1.3 on Win98 using Triad. Everything
> works great. I am running Apache and need to know how to shut it
> down properly. I can't find any instructions on this in the
> documentation. There is a DOS window open that does not allow me
> type anything. How should I do it?
>
> TIA,
> Jerry
>
>
--
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Wow, that was a very fast response and from so many people re:
shutting down Apache. Thank you all.
I have been developing Web sites with ASP and MS SQL Server. I am
so sick of Microsoft's greed for cash and power that I just had
to bail. Just an example, Visual Studio .net can be had for no
less than $1000.00. I can't stop there. MS is turning to
subscription based income for everything. They go after ANYTHING
that is making someone else money. I hate their business tactics.
Their products are bloated, and have too many security holes. It
is a great stock to own but I hate who they have become.
So, I am moving to all non-Microsoft technology. I am using
Windows and it will take some time to move to Linux. I'll
probably move one PC at a time. However, I am switching to PHP,
PERL, and MySQL. What I have found however is that doing so has
been harder than I thought it would be. The farther I get into it
the easier things are becoming. That is partly due to my
determination.
My observation and opinion is that those that use non-ms
technologies have a club of their own and while they think
Windows users should move away from Windows, they don't go to
much effort to help them make the move. Also, they are typically
more technical and thus prefer a more technical approach to
things. For example, they work from the command prompt and prefer
not to use a GUI because they feel that doing so is a much more
pure experience. I don't fault them for this. It is just a
difference. However, Windows users are used to using a GUI for
most everything. Using a command prompt is considered
unproductive to them. I have found though that there are
developers that have been addressing this issue. Luckily, I was
able to find some great tools which has made the move pretty
smooth so far.
I know there are a lot of people that are prisoners in the MS
world that would like to move to non-MS technologies but don't
see the benefits, are scared to do so, and/or just don't know
how. So, I have decided to document my experience for their
benefit. I'll either submit an article to some Web sites in hopes
that they will publish it and/or I'll put a site up just for the
cause. I think a lot more people will make the move if they see
the benefits and how easy it can be done. I'd like to hear your
comments and suggestions on the topic.
Anyway, I look forward to participating in the non-MS community!
Jerry
--- End Message ---
--- Begin Message ---
Jerry,
I was trained at a college that had little use for Microsoft products and I
feel I am all the better for it. Yes I have found that setup and
configuration of the non microsoft products may be text based, or somewhat
cryptic at first but I have found that with some, as you put it,
determination, it took a very short time to learn to navigate and update the
appropriate configuration files. As for your comments on the GUI side of
things... Keep looking, you will find a wide variety of GUI's from Linux to
php to MySQL. What is happening in this environment is you have the choice
to do it your way, either through line commands or the click of a button in
a GUI. And it gets better, not only does this non-windows technology provide
GUI's I have found that they are increadibly easy to use. A perfect example
of this is a comparison of MS SQL server front end and a popular front end
to MySQL called phpMyAdmin. If you introduce a person with intermediate
technological skills to both packages, as I have done, you will find that it
is the microsoft product that becomes cryptic and hard to understand, where
as its open source counter part is clean, straight forward and simply easier
to use.
All this aside, the greed for cash and power and the fact that their
products are simply unreliable, instead of what is just "better", is what
put me off of Microsoft.
-Steve.
-----Original Message-----
From: Jerry [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 2:53 PM
To: PHP Win
Subject: [PHP-WIN] Moving to non-Windows technology
Wow, that was a very fast response and from so many people re:
shutting down Apache. Thank you all.
I have been developing Web sites with ASP and MS SQL Server. I am
so sick of Microsoft's greed for cash and power that I just had
to bail. Just an example, Visual Studio .net can be had for no
less than $1000.00. I can't stop there. MS is turning to
subscription based income for everything. They go after ANYTHING
that is making someone else money. I hate their business tactics.
Their products are bloated, and have too many security holes. It
is a great stock to own but I hate who they have become.
So, I am moving to all non-Microsoft technology. I am using
Windows and it will take some time to move to Linux. I'll
probably move one PC at a time. However, I am switching to PHP,
PERL, and MySQL. What I have found however is that doing so has
been harder than I thought it would be. The farther I get into it
the easier things are becoming. That is partly due to my
determination.
My observation and opinion is that those that use non-ms
technologies have a club of their own and while they think
Windows users should move away from Windows, they don't go to
much effort to help them make the move. Also, they are typically
more technical and thus prefer a more technical approach to
things. For example, they work from the command prompt and prefer
not to use a GUI because they feel that doing so is a much more
pure experience. I don't fault them for this. It is just a
difference. However, Windows users are used to using a GUI for
most everything. Using a command prompt is considered
unproductive to them. I have found though that there are
developers that have been addressing this issue. Luckily, I was
able to find some great tools which has made the move pretty
smooth so far.
I know there are a lot of people that are prisoners in the MS
world that would like to move to non-MS technologies but don't
see the benefits, are scared to do so, and/or just don't know
how. So, I have decided to document my experience for their
benefit. I'll either submit an article to some Web sites in hopes
that they will publish it and/or I'll put a site up just for the
cause. I think a lot more people will make the move if they see
the benefits and how easy it can be done. I'd like to hear your
comments and suggestions on the topic.
Anyway, I look forward to participating in the non-MS community!
Jerry
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi all,
File uploads are a breeze to code in php. However, I have got a request from
a client to show the percentage uploaded or some graphic progress monitor as
the upload process is difficult to track for large files. Is there any way
of coding such a progress tracker for file uploads in php?
Regards,
Arijit Chaudhuri
--- End Message ---
--- Begin Message ---
File Uploads are a client side "post" feature, aren't they? Is there a browser
that offers this functionality?
--
Scott Carr
OpenOffice.org
Whiteboard-Doc Maintainer
http://whiteboard.openoffice.org/doc/
Quoting Arijit Chaudhuri <[EMAIL PROTECTED]>:
> Hi all,
>
> File uploads are a breeze to code in php. However, I have got a request
> from
> a client to show the percentage uploaded or some graphic progress monitor
> as
> the upload process is difficult to track for large files. Is there any way
> of coding such a progress tracker for file uploads in php?
>
> Regards,
> Arijit Chaudhuri
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
Hi Arijit,
Unfortunately, I don't think there is. The file data is sent in the
*request* for the PHP page, meaning the PHP page doesn't even get sent back
to the user until the file is done uploading. So there's not really any
choice but for the user to view the page with the upload form until the
file is done uploading.
-Mike
At 01:21 AM 5/4/02 +0530, Arijit Chaudhuri wrote:
>Hi all,
>
>File uploads are a breeze to code in php. However, I have got a request from
>a client to show the percentage uploaded or some graphic progress monitor as
>the upload process is difficult to track for large files. Is there any way
>of coding such a progress tracker for file uploads in php?
>
>Regards,
>Arijit Chaudhuri
--- End Message ---
--- Begin Message ---
On 3 May 2002 at 15:57, Mike Flynn wrote:
> At 01:21 AM 5/4/02 +0530, Arijit Chaudhuri wrote:
> >File uploads are a breeze to code in php. However, I have got a
> >request from a client to show the percentage uploaded or some graphic
> >progress monitor as the upload process is difficult to track for
> >large files. Is there any way of coding such a progress tracker for
> >file uploads in php?
>
> Unfortunately, I don't think there is. The file data is sent in the
> *request* for the PHP page, meaning the PHP page doesn't even get sent
> back to the user until the file is done uploading. So there's not
> really any choice but for the user to view the page with the upload
> form until the file is done uploading.
I've been thinking about this, and there may be a way. I don't know how PHP handles
file
uploads, but it has to be saving the file it's receiving somewhere. You could launch a
popup
window when the form is submitted. That popup goes to a page that gets the size of the
file
PHP is saving the upload to and displays it and refreshes itself periodically.
I dunno if it would work, but it's a possibility.
--
Stuart
--- End Message ---
--- Begin Message ---
It seems that something like this would work. If you can find the
temporary file while it's uploading, you could have a different script
in a new window retrieve the size of the temporary file every 5 or 10
seconds, then do some math to convert that into a percent of the total
size. The graph could simply be like a single-color GIF that had its
WIDTH= tag updated with the percentage of the upload and the actual
percentage shown underneath.
Maybe you could use $_FILES['userfile']['tmp_name'] (or $HTTP_POST_FILES
[]) for the progress reporting script?
Just my $.02 - just learning all this stuff myself!
Jason Soza
----- Original Message -----
From: "Stuart Dallas" <[EMAIL PROTECTED]>
Date: Friday, May 3, 2002 12:16 pm
Subject: Re: [PHP-WIN] File Uploader - Progress
> On 3 May 2002 at 15:57, Mike Flynn wrote:
> > At 01:21 AM 5/4/02 +0530, Arijit Chaudhuri wrote:
> > >File uploads are a breeze to code in php. However, I have got a
> > >request from a client to show the percentage uploaded or some
> graphic> >progress monitor as the upload process is difficult to
> track for
> > >large files. Is there any way of coding such a progress tracker for
> > >file uploads in php?
> >
> > Unfortunately, I don't think there is. The file data is sent in the
> > *request* for the PHP page, meaning the PHP page doesn't even
> get sent
> > back to the user until the file is done uploading. So there's not
> > really any choice but for the user to view the page with the upload
> > form until the file is done uploading.
>
> I've been thinking about this, and there may be a way. I don't
> know how PHP handles file
> uploads, but it has to be saving the file it's receiving
> somewhere. You could launch a popup
> window when the form is submitted. That popup goes to a page that
> gets the size of the file
> PHP is saving the upload to and displays it and refreshes itself
> periodically.
> I dunno if it would work, but it's a possibility.
>
> --
> Stuart
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hello,
New to the list and have a PHP-sized headache.
I'm attempting to connect to an Oracle DB and, being totally new to PHP, was
looking for a pre-built script. What I have been finding doesn't seem to
want to run. I keep getting ORA-03121 - no interface driver connected.
Below is the snippit I've been playing with:
<?php
// load enviornment variables
putenv("ORACLE_SID=PROD");
putenv("ORACLE_HOME=C:\ORAWIN95");
// create connection
$conn = Ora_Logon("uid", "password")
or die("Couldn't logon.");
// create SQL statement
$sql = "SELECT CUSTOMER_ORDER_TAB.CUSTOMER_NO,
CUSTOMER_ORDER_TAB.CUSTOMER_PO_NO, CUSTOMER_ORDER_TAB.DATE_ENTERED,
CUSTOMER_ORDER_TAB.ORDER_NO, CUSTOMER_ORDER_TAB.WANTED_DELIVERY_DATE
FROM IFSAPP.CUSTOMER_ORDER_TAB CUSTOMER_ORDER_TAB
WHERE (CUSTOMER_ORDER_TAB.DATE_ENTERED=SYSDATE)";
// parse SQL statement
$sql_statement = Ora_Parse($connection,$sql)
or die("Couldn't parse statement.");
// execute SQL query
Ora_Execute($sql_statement)
or die("Couldn't execute statement.");
// get number of columns for use later
$num_columns = Ora_NumCols($sql_statement);
// start results formatting
echo "<TABLE BORDER=1>";
echo "<TR>
<TH>Customer Number</TH>
<TH>PO</TH>
<TH>Date</TH>
<TH>Oder Number</TH>
<TH>Wanted Delivery</TH>
</TR>
";
// format results by row
while (Ora_Fetch($sql_statement)) {
echo "<TR>";
for ($i = 0; $i < $num_columns; $i++) {
$column_value = Ora_Result($sql_statement,$i);
echo "<TD>$column_value</TD>";
}
echo "</TR>";
}
echo "</TABLE>";
// free resources and close connection
Ora_FreeStatement($sql_statement);
Ora_Logoff($connection);
?>
TIA for any assistance,
Jeff Lutes
I.S. Support Specialist
MOUS Word/Excel Expert
Hopkins Mfg. Corp.
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--- End Message ---
--- Begin Message ---
If anyone's interested, i've posted up a very simple
HTML class i wrote to handle form elements.
http://furt.com/code/php/html_class/
It'll do what you're looking for:
$html = new Html();
for ($i=0; $i<=12; $i++)
$all_months[ date("m",mktime(0,0,0,$i)) ] =
date("F",mktime(0,0,0,$i));
print $html->select('form[months]', $all_months, date("m"));
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Dash McElroy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 02, 2002 6:45 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-WIN] Re: PHP generation of <select> fields
>
>
> It's been a while since I've done a 'for' statement...
>
> Here's my new working code:
>
> <?php
> for ($i=01;$i<=12;$i++) {
> if($i == date("m")) {
> $selected = " selected";
> }
> else {
> $selected = "";
> }
> print "<option
> value=\"".date("m",mktime(0,0,0,$i))."\"$selected>".date("F",m
> ktime(0,0,0,$i
> ))."</option>\n";
> }
> ?>
>
> I found that you have to put quotes around the date() paramaters (like
> date("m") instead of date(m)) or PHP will put an error message in your
> error.log file in Apache (2.0.35/php4.2.0). Here's the message:
>
> PHP Notice: Use of undefined constant m - assumed 'm' in C:\Program
> Files\Apache Group\Apache2\htdocs\select.php on line 3
>
> My error log was huge because of this (and the failed first
> attempt of this
> code).
>
> -Dash
>
> -----Original Message-----
> From: George Nicolae [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 02, 2002 3:19 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: PHP generation of <select> fields
>
>
> you make two mistakes. let's see the correct code:
>
> for ($i=1;$i<=12;$i++)
> {
> if($i == date(m))
> //first here ^^^ (must be == not just one "=")
> {
> $selected = " selected";
> }
> //here is the second: if $selected ="selected" for $i=4 (may)
> $i will be
> remain selected for all month > then may
> //you need the following line to correct this problem.
> else $selected="";
> print "<option
> value=\"".date(m,mktime(0,0,0,$i))."\"$selected>".date(F,mktim
> e(0,0,0,$i))."
> </option>\n";
> }
>
>
> --
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___________________
> PaginiWeb.com - Professional Web Design
> www.PaginiWeb.com
>
>
> "Dash McElroy" <[EMAIL PROTECTED]> wrote in message
> ABA3F1F1A223D411BE6C006008A6F7E23E6425@MSX1-PTON">news:ABA3F1F1A223D411BE6C006008A6F7E23E6425@MSX1-PTON...
> > I am trying to use PHP to generate and automatically select
> the current
> > month in an HTML Form. Here is the code that flails:
> >
> > for ($i=01;$i<=12;$i++) {
> > if($i = date(m)) {
> > $selected = " selected";
> > }
> > print "<option
> >
> value=\"".date(m,mktime(0,0,0,$i))."\"$selected>".date(F,mktim
> e(0,0,0,$i))."
> > </option>\n";
> > }
> >
> > The output is a large amount of April's in the Select
> dropdown box - my
> > machine then goes crazy for a while whilst the hard drive
> chunks like mad.
> >
> > Thanks.
> >
> > -Dash
>
>
>
> --
> 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 ---
pls ignore this
--- End Message ---