php-windows Digest 17 Jan 2005 21:17:31 -0000 Issue 2539
Topics (messages 25350 through 25360):
Re: Newbie question: convert string to int
25350 by: graeme
25351 by: Rasmus Lerdorf
Memory error
25352 by: Louis Young
Re: Change Excel spreadsheet
25353 by: GkE
Anybody know a good javascript newsgroup
25354 by: Ross Hulford
25359 by: trystano.aol.com
Trouble opening excel workbook
25355 by: Louis Young
PHP MS-DOS
25356 by: Shawn McKenzie
PHP 5.0.3 and Oracle on Windows/Apache2
25357 by: Chaun Keating
25358 by: Chaun Keating
help w/hidden fields and storing an int.
25360 by: Patrick Roane
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 ---
If you are holding a string with a valid number in it e.g. "5.7" then
the conversion is done automatically. See the manual section Language
Reference / Types / Strings / String conversion to numbers. If you are
holding a string with the number in words e.g. "Five" then you'll need
to write your own function for that.
graeme
Louis Young wrote:
Hi there
What's the function to convert a string to an int.
Cheers
Louis
--
Experience is a good teacher, but she sends in terrific bills.
Minna Antrim
--- End Message ---
--- Begin Message ---
On Mon, 17 Jan 2005, Louis Young wrote:
> What's the function to convert a string to an int.
echo (int) "123abc";
-Rasmus
--- End Message ---
--- Begin Message ---
Hi guys
Using Apache/2.0.52 with PHP 4.3.10 on Windows XP. When I try to load a
page, I get the following error message:
---------------------------
php.exe - Application Error
---------------------------
The instruction at "0x10007889" referenced memory at "0x30681876". The
memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
---------------------------
Followed by:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.
More information about this error may be available in the server error log.
------------------------------------------------------------------------
Apache/2.0.52 (Win32) Server at localhost Port 80
If I look in the apache logs, I get the following error:
[Mon Jan 17 10:18:15 2005] [error] [client 127.0.0.1] Premature end of
script headers: php.exe, referer:
http://localhost/spar/admin/rpt_electrans.php
Any ideas what could be the cause of this?
Thanks
Louis
--- End Message ---
--- Begin Message ---
If I understood your question very well, the answer is very simple. Under
file menu, simply click "Save As...", type in the new name and click Save
button.
All the best.
GKE
"Louis Young" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> What would be the best way to do the following:
>
> Open an existing Excel spreadsheet. Make some changes to it. Save it
> under a different file name.
>
> Anybody got some source or a URL?
>
> Cheers
> Louis
--- End Message ---
--- Begin Message ---
Hi,
I am working on a project and need to incorporate some javascript.
Can you point me in the right direction of a server/newsgroup?
Thanks
R.
--- End Message ---
--- Begin Message ---
There is a good forum section at www.sitepoint.com/forums
Thanks
Tryst
--- End Message ---
--- Begin Message ---
Hi there
I'm having a bit of trouble opening an Excel workbook.
The following code:
// Set the workbook to use and it's sheet
$workbook=$_GLOBALS["templatedir"]."\ElectricityTransactions.XLT";
$sheet="Sheet1";
//Instantiate the spreadsheet component.
$ex = &new COM("Excel.sheet") or Die ("Did not connect");
//$ex->Application->Visible = 1; #Uncomment to make Excel visible.
//Open the workbook that we want to use.
$wkb = $ex->application->Workbooks->Open($workbook) or Die ("Did not open");
echo "Opened workbook";
exit();
produces the following output:
Did not open
Any ideas?
Cheers
Louis
--- End Message ---
--- Begin Message ---
Is it possible to run the current win32 PHP under DOS only? I have a
bootable DOS disk with PHP and when I attempt to run it I get "This
program can not run in DOS mode.".
Is there a DOS binary???
TIA
-Shawn
--- End Message ---
--- Begin Message ---
I am having trouble logging onto Oracle via PHP on a Windows 2000 machine.
I keep getting the error:
Fatal error: Call to undefined function OCILogon() in C:\Program
Files\Apache Group\Apache2\htdocs\oraconnect.php on line 15
I seem to have everything set up correctly. I am running an Oracle 9i
client and have set up the php.ini file with "extension=php_oci8.dll"
uncommented, left ";extension=php_oracle.dll" commented. (Although I have
tried various combinations of these two. Also I have set the "extension_dir
= C:\Program Files\PHP\ext" correctly and noted that php_oci8.dll and
php_oracle.dll exist there.
Now here is where it gets really weird and I could use some help:
It works fine from the command line:
I type "php oraconnect.php" for the following code:
<?php
//putenv("ORACLE_SID=TESTDB");
//putenv("ORACLE_HOME=C:/oracle/ora92");
//putenv("TNS_ADMIN=C:/oracle/ora92/network/admin");
$username = "SCOTT";
$passwd = "TIGER";
//$db="(DESCRIPTION=
// (ADDRESS_LIST=
// (ADDRESS=(PROTOCOL=TCP)
// (HOST=orahostname1)(PORT=1621)
// )
// )
// (CONNECT_DATA=(SERVICE_NAME=TESTDB))
// )";
$conn = OCILogon("SCOTT","TIGER","TESTDB");
if (!$conn)
{
echo "Connection failed";
echo "Error Message: [" . OCIError($conn) . "]";
exit;
}
else
{
echo "Connected!";
}
?>
It works either way with the env_variables in the script or with them
commented out from the command line. I just can't get it to work from the
browser.
Can anyone out there help me with this one? I have some experience with
Oracle, Perl, and a little Java but not so much with PHP.
Thanks.
--- End Message ---
--- Begin Message ---
I am having trouble logging onto Oracle via PHP on a Windows 2000 machine.
I keep getting the error:
Fatal error: Call to undefined function OCILogon() in C:\Program
Files\Apache Group\Apache2\htdocs\oraconnect.php on line 15
I seem to have everything set up correctly. I am running an Oracle 9i
client and have set up the php.ini file with "extension=php_oci8.dll"
uncommented, left ";extension=php_oracle.dll" commented. (Although I have
tried various combinations of these two. Also I have set the "extension_dir
= C:\Program Files\PHP\ext" correctly and noted that php_oci8.dll and
php_oracle.dll exist there.
Now here is where it gets really weird and I could use some help:
It works fine from the command line:
I type "php oraconnect.php" for the following code:
<?php
//putenv("ORACLE_SID=TESTDB");
//putenv("ORACLE_HOME=C:/oracle/ora92");
//putenv("TNS_ADMIN=C:/oracle/ora92/network/admin");
$username = "SCOTT";
$passwd = "TIGER";
//$db="(DESCRIPTION=
// (ADDRESS_LIST=
// (ADDRESS=(PROTOCOL=TCP)
// (HOST=orahostname1)(PORT=1621)
// )
// )
// (CONNECT_DATA=(SERVICE_NAME=TESTDB))
// )";
$conn = OCILogon("SCOTT","TIGER","TESTDB");
if (!$conn)
{
echo "Connection failed";
echo "Error Message: [" . OCIError($conn) . "]";
exit;
}
else
{
echo "Connected!";
}
?>
It works either way with the env_variables in the script or with them
commented out from the command line. I just can't get it to work from the
browser.
Can anyone out there help me with this one? I have some experience with
Oracle, Perl, and a little Java but not so much with PHP.
Thanks.
--- End Message ---
--- Begin Message ---
I am tring to store and display the number of requests
that a user has submitted via a hidden field. I've
created a form that does a some simple addtion.
Everything works, but I need some direction as to how
I can store each number the user puts in and to
display them.
Please see below:
<?php
if ( ! isset( $_POST['number1'] ['number2'] ) ) {
$message = "Welcome to the numbers game!";
}
$number1 = (int) $_POST['number1'];
$number2 = (int) $_POST['number2'];
$result = (int) $number1 + $number2;
$num_selections = (int) $POST['num_selections'];
$num_selections++; // this is my attempt at collecting
// and displaying the numbers
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict/EN"
"http://www/w3/org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>form</title>
</head>
<body>
<h1>
<?php print $result ?>
</h1>
<form method="post" action="<?php print
$_SERVER['PHP_SELF']?>">
<p>
Type your number here: <input type="text"
name="number1" /><br />
Type your 2nd number here: <input type="text"
name="number2" /><br />
<p><input type="submit" value="submit" /></p>
<input type="hidden" name="num_selections"
value="<?php print $num_selections?>" />
</p>
</form>
</body>
</html>
thanks-
=====
----------------
"forget your lust for the rich man's gold. All that you need, is in your soul.
You can do this if you try. All that I want for you my son, is to be satisfied"
~ Lynard Skynard
--- End Message ---