php-windows Digest 26 Jun 2008 09:47:17 -0000 Issue 3496

Topics (messages 28971 through 28981):

Re: IE/ IIS / PHP - Form posted twice in case of redirection
        28971 by: Dan Shirah
        28972 by: Sukhwinder Singh
        28975 by: Sukhwinder Singh
        28976 by: Dan Shirah
        28977 by: Sukhwinder Singh
        28978 by: Sukhwinder Singh
        28979 by: Sukhwinder Singh
        28980 by: Sukhwinder Singh

php-config script is missing from the installer
        28973 by: Zoltan Boszormenyi
        28974 by: Elizabeth M Smith

Re: Problem with Oracle and some other extensions on IIS Server
        28981 by: Tim

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 ---
>
> Sukhwinder,

I would suggest trying something simple like adding a variable to see if
your page posted. Then, if it has run a simple Javascript function to
redirect your page.

<head>
<script language="JavaScript">
<!--
function redirect() {
   location.replace(http://URL);
}
//-->
</script>
</head>
<?php
 $redirect = $_POST['redirect'];
if ($redirect == "Y") { ?>
<body onload="redirect()">
<?php } else { ?>
<body>
<?php } ?>
<form name="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<input type="hidden" name="redirect" value="Y">
<ALL YOUR OTHER FORM DATA HERE>
<input type="submit" name="Submit" value="Submit">
</body>

So, by default the value of $redirect will be "".  Once you put data into
your form and submit it, the value of $redirect will be "Y" in which case
the Javascript function will be called and send you to your other page.

Hopefully that helps.

Dan

--- End Message ---
--- Begin Message ---
Hello Dan,

Thank you very much for your suggestion.

There are workarounds but I am trying to find out why it is happening.

I think not many use IIS and PHP for development or hosting and I was trying to find if anyone else too faced this problem and could find out why it was happening.

Sukhwinder Singh

----- Original Message ----- From: "Dan Shirah" <[EMAIL PROTECTED]>
To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2008 6:11 PM
Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of redirection


>
Sukhwinder,

I would suggest trying something simple like adding a variable to see if
your page posted. Then, if it has run a simple Javascript function to
redirect your page.

<head>
<script language="JavaScript">
<!--
function redirect() {
  location.replace(http://URL);
}
//-->
</script>
</head>
<?php
$redirect = $_POST['redirect'];
if ($redirect == "Y") { ?>
<body onload="redirect()">
<?php } else { ?>
<body>
<?php } ?>
<form name="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<input type="hidden" name="redirect" value="Y">
<ALL YOUR OTHER FORM DATA HERE>
<input type="submit" name="Submit" value="Submit">
</body>

So, by default the value of $redirect will be "".  Once you put data into
your form and submit it, the value of $redirect will be "Y" in which case
the Javascript function will be called and send you to your other page.

Hopefully that helps.

Dan



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

Even this didn't work. It seems IE just posts twice the same form on its own
and redirect is blank both times.

Is there any utility to debug what database is being passed around like
avaiable in firefox
Sukhwinder Singh



----- Original Message ----- From: "Dan Shirah" <[EMAIL PROTECTED]>
To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2008 6:11 PM
Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of redirection


>
Sukhwinder,

I would suggest trying something simple like adding a variable to see if
your page posted. Then, if it has run a simple Javascript function to
redirect your page.

<head>
<script language="JavaScript">
<!--
function redirect() {
  location.replace(http://URL);
}
//-->
</script>
</head>
<?php
$redirect = $_POST['redirect'];
if ($redirect == "Y") { ?>
<body onload="redirect()">
<?php } else { ?>
<body>
<?php } ?>
<form name="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<input type="hidden" name="redirect" value="Y">
<ALL YOUR OTHER FORM DATA HERE>
<input type="submit" name="Submit" value="Submit">
</body>

So, by default the value of $redirect will be "".  Once you put data into
your form and submit it, the value of $redirect will be "Y" in which case
the Javascript function will be called and send you to your other page.

Hopefully that helps.

Dan




--- End Message ---
--- Begin Message ---
Are you sure it's not something in your code?

I am also using IE/IIS/PHP and I have a form that on submission closes the
page and opens up a new window displaying "Your data has been saved" and it
does not create 2 rows in my MSSQL database.

Dan

--- End Message ---
--- Begin Message --- If it was something in the code then then it would happen for ever browser / server combination. not just IE/IIS/PHP.

This is what making me mad.

I have been doing this php stuff for more than 5 years now.

Still trying to figure if it is really something in code which makes IE unhappy.


Sukhwinder Singh

----- Original Message ----- From: Dan Shirah
To: Sukhwinder Singh
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2008 1:31 AM
Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of redirection


Are you sure it's not something in your code?

I am also using IE/IIS/PHP and I have a form that on submission closes the page and opens up a new window displaying "Your data has been saved" and it does not create 2 rows in my MSSQL database.

Dan
--- End Message ---
--- Begin Message ---
I just verified that the form is infact posted twice (by IE) by using session 
variable.

When form is posted I set a session variable after doing the import and at 
start of the same import script I check if the form has been already posted 
from session variable and if the form has already been posted just return to 
some other page which unsets that session variable.

But still I want to find the cause of the problem.


  ----- Original Message ----- 
  From: Dan Shirah 
  To: Sukhwinder Singh 
  Cc: [EMAIL PROTECTED] 
  Sent: Thursday, June 26, 2008 1:31 AM
  Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of 
redirection


  Are you sure it's not something in your code?

  I am also using IE/IIS/PHP and I have a form that on submission closes the 
page and opens up a new window displaying "Your data has been saved" and it 
does not create 2 rows in my MSSQL database.

  Dan

--- End Message ---
--- Begin Message ---
I think this must be some kind of PHP ISAPI or IE bug.

If I replace this:

header('Location:'. $url);
exit;

WIth

echo "<script language='javascript'>\n";
echo "location.replace('$url');\n";
echo "</script>";

Then the double post does NOT HAPPEN.


----- Original Message ----- From: Dan Shirah
To: Sukhwinder Singh
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2008 1:31 AM
Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of redirection


Are you sure it's not something in your code?

I am also using IE/IIS/PHP and I have a form that on submission closes the page and opens up a new window displaying "Your data has been saved" and it does not create 2 rows in my MSSQL database.

Dan
--- End Message ---
--- Begin Message --- My application is using all sorts of libraries, from pear db, quickform to smarty. So it was difficult for me to provide the sample code.

Now I have just created a simple upload file (please copy and paste from below). Which does nothing but logs the access to find out about double post.

I had tried many different php versions and all produced same problem. Let me know what you find out. If you'll upload a small text file you'll see that there are two entries in log file for one access.

The platform to test is IIS (ISAPI) php 5 and Internet explorer 6. (IE 7 may not post values twice but it will display some page not found error.)



<?php
set_time_limit ( 300);

if (@$_POST['submitted'] == 'yes')
{
$csv_file = $_FILES['csv_file'];
if ($csv_file['size'] > 0)
{
 $fp = fopen('access.txt', 'a');
 fwrite($fp, 'Accessed at '. date('d-m-y H:i:s u'). "\r\n");
 fclose($fp);

 header('Location:http://www.google.com');
 exit;

}
else if ($csv_file['error'] == UPLOAD_ERR_FORM_SIZE || $csv_file['error'] == UPLOAD_ERR_INI_SIZE)
{
 $error = "File size exceeds max allowed size of whatever";

}
else
{
 $error = "There was error in uploading your file.";

}

}

?>
<html>
<head>
<title>
test
</title>
</head>
<body>
<?php
if (isset($error))
{
echo "<B>$error</B>";
}
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="csv_file" />
<input type="hidden" name="submitted" value="yes" />
<input type="submit" value="Submit" />
</form>
</body>
</html>




----- Original Message ----- From: Dan Shirah
To: Sukhwinder Singh
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2008 1:31 AM
Subject: Re: [PHP-WIN] IE/ IIS / PHP - Form posted twice in case of redirection


Are you sure it's not something in your code?

I am also using IE/IIS/PHP and I have a form that on submission closes the page and opens up a new window displaying "Your data has been saved" and it does not create 2 rows in my MSSQL database.

Dan
--- End Message ---
--- Begin Message ---
Hi,

I need to port a library that has several language bindings, PHP among them.
Of course the software was written on Linux, hence it uses autotools and
pgkconfig.
I can use MinGW/MSYS and GnuWin32 parts to compile most of the software
but the PHP binding looks for the configuration via the php-config script.
Which is missing from the official www.php.net installer.
Is there another package that I need to install besides
http://www.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror
to get the php-config script?

Thanks in advance,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/



--- End Message ---
--- Begin Message ---
Zoltan Boszormenyi wrote:
> Hi,
> 
> I need to port a library that has several language bindings, PHP among them.
> Of course the software was written on Linux, hence it uses autotools and
> pgkconfig.
> I can use MinGW/MSYS and GnuWin32 parts to compile most of the software
> but the PHP binding looks for the configuration via the php-config script.
> Which is missing from the official www.php.net installer.
> Is there another package that I need to install besides
> http://www.php.net/get/php-5.2.6-win32-installer.msi/from/a/mirror
> to get the php-config script?
> 
> Thanks in advance,
> Zoltán Böszörményi
> 

Unfortunately, you can't compile PHP or any PHP extensions for windows
with mingw or msys - not only is autotools not supported for windows but
 the mingw compiler is not supported.

You can compile the libraries as dll, create MS compatible import libs,
and then use MS compilers to do the actual PHP extension if you want to
do windows support.

Thanks,
Elizabeth Smith

--- End Message ---
--- Begin Message ---
Hi again,

I did request for oracle instant client setup and i sent the url (http://www.oracle.com/technology/pub/notes/technote_php_instant.html) with my request. Just a minute ago i get a mail that they said "setup is complete" but i still get same error.

As i said i can't reach to the server remotely. I just have ftp password.

This isn't my job (install programs and setting up a server) but there is too silly management for this. If you can suggest anything else that can help i'd really glad.

Elizabeth M Smith wrote:
Tim wrote:
Hi,

My problem is very simple but i can't handle it. I'm LAMP developer by the
way. I have not much knowledge on IIS server with PHP,

Anyway, i can't load php_oci8.dll and some other DLLs. Error message always
same;

PHP Warning: PHP Startup: Unable to load dynamic library
'c:\PHP\ext\php_oci8.dll' - The specified procedure could not be found. in
Unknown on line 0

but location for php_oci8.dll is right and the file exist. Also the file is
not readonly or sys file. Just an archive file like other extensions.

I try to copy the file to winnt folder, system32 folder and adding the
paths
(c:/php and c:/php/ext/) to system envrionment variables.

I must solve this problem til morning. Please help.

P.S. : I'm not the admin of this server. I just request and they will do.

--
Tim

The problem isn't that php_oci8.dll wasn't loading - otherwise you'd be
getting a different error.  What the "specified procedure could not be
found" means is that the oci8 PHP extension can't find your oracle
client libraries.  If you want to talk to oracle server you have to
install and configure the client libraries on the machine, which is
something I haven't bothered with so I can't help there.  Oracle has
good documentation on how to do this.

Thanks,
Elizabeth Smith

--- End Message ---

Reply via email to