php-windows Digest 23 Sep 2004 02:40:29 -0000 Issue 2406
Topics (messages 24616 through 24636):
Re: Installation Woes.
24616 by: trlists.clayst.com
24619 by: Mikey
24634 by: Jim Bailey
24636 by: Tom Rawson
Strange result returned from Oracle
24617 by: Mikey
24618 by: Mikey
24620 by: Mikey
24621 by: Francesco
Date Formatting
24622 by: Ron.Herhuth.tatumpartners.com
24623 by: Asendorf, John
24624 by: Asendorf, John
24625 by: Gryffyn, Trevor
invalid function: mysql_connect
24626 by: Catapult Webmaster
24629 by: Janet Valade
Re: INCLUDE ASP does Not Work! for PHP - 4.3.4
24627 by: DvDmanDT
24628 by: DvDmanDT
PHP_JAVA.DLL
24630 by: Wolfgang Vogel
24632 by: Wolfgang Vogel
24633 by: Vail, Warren
PHP_JAVA.DLL in PHP5.0.1
24631 by: Wolfgang Vogel
PHP Image creation
24635 by: Riaan Stander
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 ---
On 22 Sep 2004 Jim Bailey wrote:
> I navigate to http://127.0.0.1/ and I get the default apache page.
>
> I navigate to http://127.0.0.1/test.php and get the following error message
Sounds like you need to set DocumentRoot, or move your file to wherever
DocumentRoot points.
--
Tom
--- End Message ---
--- Begin Message ---
[snip]
> I appended the following lines to httpd.conf
> ScriptAlias /php4/ "E:/Programs/PHP4.3.8/"
>
> AddType application/x-httpd-php4 .php4 .phtml .php
>
> Action application/x-httpd-php4 "php.exe"
Shouldn't this line have the full path to php.exe?
Only a guess...HTH
Mikey
--- End Message ---
--- Begin Message ---
No, DocumentRoot is set in httpd.conf?
Jim Bailey
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 22 Sep 2004 Jim Bailey wrote:
>
> > I navigate to http://127.0.0.1/ and I get the default apache page.
> >
> > I navigate to http://127.0.0.1/test.php and get the following error
message
>
> Sounds like you need to set DocumentRoot, or move your file to wherever
> DocumentRoot points.
>
> --
> Tom
--- End Message ---
--- Begin Message ---
On 22 Sep 2004 Jim Bailey wrote:
> No, DocumentRoot is set in httpd.conf?
Hmmm, I'm confused, was that a question or a statement???
Are you trying to run PGP as CGI or via SAPI (Apache module)?
--
Tom
--- End Message ---
--- Begin Message ---
Hi NG,
I wonder if anyone has encountered any problems with values returned from an
Oracle SQL query, more specifically when the result set is empty? I have
the following code:
$sql = "SELECT \"irpUser\" FROM tblUsers WHERE
\"swmEmail\"='{$_POST['swmEmail']}'";
$sth = ociparse ($conn, $sql)
or die ("Couldn't parse SQL: $sql<br>\n");
ociexecute ($sth)
or die ("Couldn't execute SQL: $sql<br>\n");
ocifetchinto ($sth, $usr, OCI_ASSOC);
if ($usr['irpUser'] == "")
{
// Do stuff here
}
else
{
//Something else
}
Now, when the query brings back a record everything works fine, but when the
query returns nothing (i.e. brand new user) it still goes to the else branch
of the code. I have echo'ed $usr to the screen and it contains the string
"SYSTEM". Now as far as my code goes I don;t think this is too much of a
problem as I can just check for this string (normal values are integer), but
I can find no reference to this behaviour in the docs and would like to know
what is causing this return value. Any ideas?
Mikey
---
Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
Hmmm, I just tried testing for the "SYSTEM" string and it still falls
through to the else branch - any help would be extremely grateful now :-)
Mikey
---
Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
Ooops! Ignore this post, but not the first...
----- Original Message -----
From: "Mikey" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 22, 2004 1:44 PM
Subject: Re: Strange result returned from Oracle
> Hmmm, I just tried testing for the "SYSTEM" string and it still falls
> through to the else branch - any help would be extremely grateful now :-)
>
> Mikey
> ---
> Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
Mikey,
I would put the if condition (or a while loop, if you are retrieving more
than 1 row) around the ocifetchinto, and not after that, as in your code.
Here is how I would write it (off my head, not tested):
$sql = "SELECT \"irpUser\" FROM tblUsers WHERE
\"swmEmail\"='{$_POST['swmEmail']}'";
$sth = ociparse ($conn, $sql) or die ("Couldn't parse SQL: $sql<br>\n");
ociexecute ($sth) or die ("Couldn't execute SQL: $sql<br>\n");
if (ocifetchinto ($sth, $usr, OCI_ASSOC)) {
// Do stuff here with $usr['irpUser']
}
else {
// No rows returned here
}
HTH
Francesco
--------------------------
"Mikey" <[EMAIL PROTECTED]> wrote:
>I have
> the following code:
>
> $sql = "SELECT \"irpUser\" FROM tblUsers WHERE
> \"swmEmail\"='{$_POST['swmEmail']}'";
> $sth = ociparse ($conn, $sql)
> or die ("Couldn't parse SQL: $sql<br>\n");
> ociexecute ($sth)
> or die ("Couldn't execute SQL: $sql<br>\n");
> ocifetchinto ($sth, $usr, OCI_ASSOC);
> if ($usr['irpUser'] == "")
> {
> // Do stuff here
> }
> else
> {
> //Something else
> }
>
> Now, when the query brings back a record everything works fine, but when
the
> query returns nothing (i.e. brand new user) it still goes to the else
branch
> of the code. I have echo'ed $usr to the screen and it contains the string
> "SYSTEM". Now as far as my code goes I don;t think this is too much of a
> problem as I can just check for this string (normal values are integer),
but
> I can find no reference to this behaviour in the docs and would like to
know
> what is causing this return value. Any ideas?
>
> Mikey
> ---
> Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
I see in the manual about how to format the current date using the date()
function...but my question is...I have the date in this format:
Sep 12 2004 2:16AM
And I needed it formatted as:
09/12/2004 (I don't need the time)
How do I go about doing that?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
You are looking for the strtotime function...
$original_date = "Sep 12 2004 2:16AM";
$reformat = date ( "m/d/Y" , strtotime ($original_date) );
echo $reformat;
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Date Formatting
I see in the manual about how to format the current date using the date()
function...but my question is...I have the date in this format:
Sep 12 2004 2:16AM
And I needed it formatted as:
09/12/2004 (I don't need the time)
How do I go about doing that?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
You are looking for the strtotime() function.
$original_date = "Sep 12 2004 2:16AM";
$reformat = date ( "m/d/Y" , strtotime ($original_date) );
echo $reformat;
John
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 9:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Date Formatting
I see in the manual about how to format the current date using the date()
function...but my question is...I have the date in this format:
Sep 12 2004 2:16AM
And I needed it formatted as:
09/12/2004 (I don't need the time)
How do I go about doing that?
Thanks,
Ron
--- End Message ---
--- Begin Message ---
I know a lot of people will recommend using strtotime() to convert it to
a unix timestamp, then use date() to format that:
Date("m/d/Y",strtotime("Sep 12 2004 2:16AM"))
That may work.. I have an inherent distrust of functions that use too
much logic that isn't apparent to me, so I don't use strtotime() hoping
to avoid it misinterpreting the date/time string I'm giving it. I
prefer full control.
I'd do it the hard way just to have confidence in the results (there's
probably a better "hard way" as well, but here's the quick and dirty):
<?php
$months =
array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Au
g"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
$origdate = "Sep 12 2004 2:16AM";
List($textmonth,$day,$year,$time) = explode(" ",$origdate);
$newdate = Date("m/d/Y",mktime(0,0,0,$months[$textmonth],$day,$year);
?>
But that's just one way to skin this cat.
-TG
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 22, 2004 9:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Date Formatting
>
>
>
> I see in the manual about how to format the current date
> using the date()
> function...but my question is...I have the date in this format:
> Sep 12 2004 2:16AM
>
> And I needed it formatted as:
> 09/12/2004 (I don't need the time)
>
> How do I go about doing that?
>
> Thanks,
> Ron
>
>
>
>
>
>
--- End Message ---
--- Begin Message ---
hi!
i would just like to ask if i have missed anything in the installation (e.g.
configuration for MySQL connectivity) because the ff. piece of code always returns
"Fatal error: Call to undefined function mysql_connect() in
F:\xitami\catapult\index.php on line 13."
This is the part of my code that's causing the error (the whole file is saved as
test.php):
<?php
$user = "";
$pswd = "";
$link = mysql_connect("localhost", $user, $pswd);
if (! $link)
die("Could not connect to MySQL.");
print "Successfully connected to the server.<br>";
mysql_close($link);
?>
Quick info on my current environment:
OS: Win XP SP1, MySQL ver 4.0.20d, PHP 5.0.1, Xitami 2.5b4
However, I would like to inform you that the ff. works (saved as php_set.php):
<?php
phpinfo();
?>
... as well as connecting to MySQL through the command prompt (i am able to
create/update/select databases)...
thanks very much for all the help.
regards,
may
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- End Message ---
--- Begin Message ---
Catapult Webmaster wrote:
i would just like to ask if i have missed anything in the installation (e.g. configuration for MySQL connectivity) because the ff. piece of code always returns "Fatal error: Call to undefined function mysql_connect() in F:\xitami\catapult\index.php on line 13."
This is the part of my code that's causing the error (the whole file is saved as test.php):
<?php
$user = "";
$pswd = "";
$link = mysql_connect("localhost", $user, $pswd);
if (! $link)
die("Could not connect to MySQL.");
print "Successfully connected to the server.<br>";
mysql_close($link);
?>
Quick info on my current environment:
OS: Win XP SP1, MySQL ver 4.0.20d, PHP 5.0.1, Xitami 2.5b4
However, I would like to inform you that the ff. works (saved as php_set.php):
<?php
phpinfo();
?>
... as well as connecting to MySQL through the command prompt (i am able to create/update/select databases)...
Does the phpinfo() output show that MySQL support is activated? If not,
perhaps you need to uncomment the line
;extension=php_mysql.dll
(remove the ;) in your php.ini file. You may need to restart your web
server after changing the line.
Janet
--- End Message ---
--- Begin Message ---
It's not.. It exists in other SAPIs as well unless I'm misstaken (there was
discussion on it anyway), including ISAPI which IIS uses unless PHP is
installed as cgi.. Not sure at all about this though..
--
// DvDmanDT
MSN: dvdmandt�hotmail.com
Mail: dvdmandt�telia.com
"Mikey" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> virtual is an Apache specific function, and AFAIK they haven't put ASP
> support into Apache yet. Let's hope they never do ;-)
>
> ----- Original Message -----
> From: "Dvdmandt" <[EMAIL PROTECTED]>
> Newsgroups: php.windows
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, September 18, 2004 9:51 PM
> Subject: Re: [PHP-WIN] INCLUDE ASP does Not Work! for PHP - 4.3.4
>
>
> > I'd lookup virtual()...
> >
> > --
> > // DvDmanDT
> > MSN: dvdmandt�hotmail.com
> > Mail: dvdmandt�telia.com
> > "Trevor Gryffyn" <[EMAIL PROTECTED]> skrev i meddelandet
> >
>
news:[EMAIL PROTECTED]
> > The problem is that the web server looks at the file type and determines
> > what to do with it before it sends anything to the web browser.
> >
> > Your .PHP file is being sent to a PHP interpreter which outputs certain
> > things that get sent to the browser. What's going to happen in this
> > case is that ASP code is going to be inserted, sent to the PHP
> > interpreter and nothing's going to happen.... Or if you have your PHP
> > set up to see <% %> as PHP, then you'll probably get some kind of
> > unknown function error.
> >
> > The reason the .HTM file works ok is that HTML is passed straight
> > through the PHP interpreter to the browser.
> >
> >
> > What you'd have to do is maybe use an IFRAME (HTML) and put the poll.asp
> > in that so the web server is pulling a .ASP file without anything else,
> > therefore interpreting it as an ASP file.
> >
> > Does any of that make sense?
> >
> > -TG
> >
> > > -----Original Message-----
> > > From: Raj Gopal [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, September 16, 2004 5:19 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] INCLUDE ASP does Not Work! for PHP - 4.3.4
> > >
> > >
> > > Hi All,
> > >
> > > I have included a ASP file in a PHP script as follows
> > >
> > > <? include 'poll.asp' ?>
> > >
> > > and it does not work!
> > >
> > > whereas <? include 'AA.htm' ?> works fine
> > >
> > > Appreciate your help for any workarounds or Syntax issues
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
--- End Message ---
--- Begin Message ---
Sorry, I was misstaken.. It's nsapi that has a virtual, which is however
called nsapi_virtual.. Also, there are several ASP for Apache projects..
Someone mentioned the one from sun. There's also one named iASP.. And
OpenASP, mod_vb and Apache::ASP (ASP with Perl syntax).. For ASP.NET there
is also mod_mono..
--
// DvDmanDT
MSN: dvdmandt�hotmail.com
Mail: dvdmandt�telia.com
"Dvdmandt" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> It's not.. It exists in other SAPIs as well unless I'm misstaken (there
was
> discussion on it anyway), including ISAPI which IIS uses unless PHP is
> installed as cgi.. Not sure at all about this though..
>
> --
> // DvDmanDT
> MSN: dvdmandt�hotmail.com
> Mail: dvdmandt�telia.com
> "Mikey" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > virtual is an Apache specific function, and AFAIK they haven't put ASP
> > support into Apache yet. Let's hope they never do ;-)
> >
> > ----- Original Message -----
> > From: "Dvdmandt" <[EMAIL PROTECTED]>
> > Newsgroups: php.windows
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, September 18, 2004 9:51 PM
> > Subject: Re: [PHP-WIN] INCLUDE ASP does Not Work! for PHP - 4.3.4
> >
> >
> > > I'd lookup virtual()...
> > >
> > > --
> > > // DvDmanDT
> > > MSN: dvdmandt�hotmail.com
> > > Mail: dvdmandt�telia.com
> > > "Trevor Gryffyn" <[EMAIL PROTECTED]> skrev i meddelandet
> > >
> >
>
news:[EMAIL PROTECTED]
> > > The problem is that the web server looks at the file type and
determines
> > > what to do with it before it sends anything to the web browser.
> > >
> > > Your .PHP file is being sent to a PHP interpreter which outputs
certain
> > > things that get sent to the browser. What's going to happen in this
> > > case is that ASP code is going to be inserted, sent to the PHP
> > > interpreter and nothing's going to happen.... Or if you have your PHP
> > > set up to see <% %> as PHP, then you'll probably get some kind of
> > > unknown function error.
> > >
> > > The reason the .HTM file works ok is that HTML is passed straight
> > > through the PHP interpreter to the browser.
> > >
> > >
> > > What you'd have to do is maybe use an IFRAME (HTML) and put the
poll.asp
> > > in that so the web server is pulling a .ASP file without anything
else,
> > > therefore interpreting it as an ASP file.
> > >
> > > Does any of that make sense?
> > >
> > > -TG
> > >
> > > > -----Original Message-----
> > > > From: Raj Gopal [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, September 16, 2004 5:19 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP-WIN] INCLUDE ASP does Not Work! for PHP - 4.3.4
> > > >
> > > >
> > > > Hi All,
> > > >
> > > > I have included a ASP file in a PHP script as follows
> > > >
> > > > <? include 'poll.asp' ?>
> > > >
> > > > and it does not work!
> > > >
> > > > whereas <? include 'AA.htm' ?> works fine
> > > >
> > > > Appreciate your help for any workarounds or Syntax issues
> > > >
> > > > --
> > > > PHP Windows Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
--- End Message ---
--- Begin Message ---
Hi NG,
can someone please give me a hint, how to activate the java extension on
php5.0.1,apache2.0.x and windows2000 server?
thanks
Wolfgang Vogel
--- End Message ---
--- Begin Message ---
Hi NG,
can someone give me a hint, how to activate the php_java.dll extension in
PHP5.0.1 on a Windows 2000 Server installation ?
thanks
Wolfgang Vogel
--- End Message ---
--- Begin Message ---
If it's not already loaded you should be able to dynamically load it, if the
library is available (lots of clues in phpinfo();
http://us2.php.net/manual/en/function.dl.php
You can test to see if function is loaded by;
http://www.php.net/manual/en/function.function-exists.php
Good luck,
Warren Vail
-----Original Message-----
From: Wolfgang Vogel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 6:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP_JAVA.DLL
Hi NG,
can someone give me a hint, how to activate the php_java.dll extension in
PHP5.0.1 on a Windows 2000 Server installation ?
thanks
Wolfgang Vogel
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi NG,
can someone give me a hint, how to activate the java extension in PHP5.0.1
on a Windows 2000 Server with apachw 2.x
thanks
Wolfgang Vogel
--- End Message ---
--- Begin Message ---
Hi
I'm using the GD library to create images from data in a database.
Currently I call a php page as my image source and all the code for the
image generation is in this page, eg: <img src="image.php">
Is there any way you can do the same thing but just calling a function
in the current php file, rather than having to create the extra
image.php file. If you have a look of the output of phpinfo the zend
logo seems to be generated in such a way.
Thanks,
Riaan Stander
--- End Message ---