php-windows Digest 18 Apr 2007 03:58:56 -0000 Issue 3198

Topics (messages 27705 through 27715):

Re: Firefox versus IE
        27705 by: Gustav Wiberg
        27706 by: Styve Couture
        27707 by: Gustav Wiberg
        27708 by: Mikael Grön
        27709 by: Alf Stockton
        27710 by: Stut
        27711 by: Alf Stockton

post thru fsockopen
        27712 by: Joakim Ling
        27713 by: James Crow
        27715 by: Manuel Lemos

Re: [PHP] Re: Problems when trying to use ibm_db2 extension
        27714 by: Richard Lynch

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

-----Original Message-----
From: Alf Stockton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 17, 2007 12:56 PM
To: php windows
Subject: [PHP-WIN] Firefox versus IE

I have a web page that works perfectly with Firefox but fails with IE.
Please tell me what needs fixing.
I have extracted the bits I think are relavent as follows:-

<form name = 'SelectEvent' ID='SelectEvent' method='get' 
action='AdjustmentReport.php'>

and

<BUTTON TYPE='submit'>Submit</BUTTON>
if (isset($HTTP_REFERER))
     {
     echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";
     } else {
     echo "<a href='javascript:history.back()'><BUTTON 
TYPE='submit'>Back</BUTTON></a>";
     }

neither the submit nor the back buttons work in IE but both work fine in 
Firefox.
Javascript is enabled in both browsers.

-- 
Regards,
Alf Stockton            www.stockton.co.za

Clothes make the man.  Naked people have little or no influence on society.
                -- Mark Twain
My email disclaimer is available at www.stockton.co.za/disclaimer.html

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



Try using " instead of '

Best regards
/Gustav Wiberg
HMN Konsult
Sweden
http://www.hmn.se/

--- End Message ---
--- Begin Message ---
As in the html4 spec, you should have an attribute name for your button. See
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#control-name


-----Message d'origine-----
De : Alf Stockton [mailto:[EMAIL PROTECTED] 
Envoyé : 17 avril 2007 06:56
À : php windows
Objet : [PHP-WIN] Firefox versus IE

I have a web page that works perfectly with Firefox but fails with IE.
Please tell me what needs fixing.
I have extracted the bits I think are relavent as follows:-

<form name = 'SelectEvent' ID='SelectEvent' method='get' 
action='AdjustmentReport.php'>

and

<BUTTON TYPE='submit'>Submit</BUTTON>
if (isset($HTTP_REFERER))
     {
     echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";
     } else {
     echo "<a href='javascript:history.back()'><BUTTON 
TYPE='submit'>Back</BUTTON></a>";
     }

neither the submit nor the back buttons work in IE but both work fine in 
Firefox.
Javascript is enabled in both browsers.

-- 
Regards,
Alf Stockton            www.stockton.co.za

Clothes make the man.  Naked people have little or no influence on society.
                -- Mark Twain
My email disclaimer is available at www.stockton.co.za/disclaimer.html

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

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

-----Original Message-----
From: Alf Stockton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 17, 2007 12:56 PM
To: php windows
Subject: [PHP-WIN] Firefox versus IE

I have a web page that works perfectly with Firefox but fails with IE.
Please tell me what needs fixing.
I have extracted the bits I think are relavent as follows:-

<form name = 'SelectEvent' ID='SelectEvent' method='get' 
action='AdjustmentReport.php'>

and

<BUTTON TYPE='submit'>Submit</BUTTON>
if (isset($HTTP_REFERER))
     {
     echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";
     } else {
     echo "<a href='javascript:history.back()'><BUTTON 
TYPE='submit'>Back</BUTTON></a>";
     }

neither the submit nor the back buttons work in IE but both work fine in 
Firefox.
Javascript is enabled in both browsers.

-- 
Regards,
Alf Stockton            www.stockton.co.za

Clothes make the man.  Naked people have little or no influence on society.
                -- Mark Twain
My email disclaimer is available at www.stockton.co.za/disclaimer.html

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


One more thing

BUTTON TYPE='submit'

...

Try using input type="submit" instead :-)

Best regards
/Gustav Wiberg
HMN Konsult
Sweden
http://www.hmn.se/


--- End Message ---
--- Begin Message ---
As Gustav Wiberg said, try using double quotes (") instead of single (')...
Also, I've never used the html element <button>... Try this instead:

<form name="SelectEvent' ID="SelectEvent" method="get" action="AdjustmentReport.php">

and

<input type="submit" value="Submit" />
<?php if (isset($HTTP_REFERER)):
echo "<input type=\"button\" onClick=\"window.location='".$HTTP_REFERER."'\" value=\"Back\" />";
else:
echo "<input type=\"button\" onClick=\"history.back();\" value=\"Back\">";
endif; ?>

And don't forget the </form> ... :)


For me that works fine in all browsers I've tried.

Mike


Alf Stockton skrev:
I have a web page that works perfectly with Firefox but fails with IE.
Please tell me what needs fixing.
I have extracted the bits I think are relavent as follows:-

<form name = 'SelectEvent' ID='SelectEvent' method='get' action='AdjustmentReport.php'>

and

<BUTTON TYPE='submit'>Submit</BUTTON>
if (isset($HTTP_REFERER))
    {
echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";
    } else {
echo "<a href='javascript:history.back()'><BUTTON TYPE='submit'>Back</BUTTON></a>";
    }

neither the submit nor the back buttons work in IE but both work fine in Firefox.
Javascript is enabled in both browsers.


--- End Message ---
--- Begin Message ---
Gustav Wiberg wrote:
> Try using input type="submit" instead  :-)

I tried the above but it still does not work.

--
Regards,
Alf Stockton            www.stockton.co.za

Q:      What do you get when you cross the Godfather with an attorney?
A:      An offer you can't understand.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

--- End Message ---
--- Begin Message ---
Alf Stockton wrote:
    echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";

echo '<input type="button" onclick="location.href = \''.$HTTP_REFERER.'\';" value="Back" />';

echo "<a href='javascript:history.back()'><BUTTON TYPE='submit'>Back</BUTTON></a>";

echo '<input type="button" onclick="history.back();" value="Back" />';

I suggest a book on HTML for beginners.

-Stut

--- End Message ---
--- Begin Message ---
Stut wrote:
Alf Stockton wrote:
echo "<a href='$HTTP_REFERER'><BUTTON TYPE='submit'>Back</BUTTON></a>";

echo '<input type="button" onclick="location.href = \''.$HTTP_REFERER.'\';" value="Back" />';

echo "<a href='javascript:history.back()'><BUTTON TYPE='submit'>Back</BUTTON></a>";

echo '<input type="button" onclick="history.back();" value="Back" />';

I suggest a book on HTML for beginners.

Thank you. Solved.

--
Regards,
Alf Stockton            www.stockton.co.za

You will gain money by a fattening action.
My email disclaimer is available at www.stockton.co.za/disclaimer.html

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

Im tring to send a file  with a php script, Im using php 5.2 on a Win
2003 server. At the other end I just save the file and process the data
and print the result, then fetch the output and write a report. But this
doesn't work, any one got an idea? The file never get to the other end?
When I do a var_export($_POST) is empty.


This is the code I use:
function postFile($file,$host,$path)
{
$remote_page = "http://".$host.$path;
$boundary =
"---------------------------".substr(md5(rand(0,32000)),0,10);

// read the file
$fp = @fopen($file,"r");
if (!$fp) die ("Cannot read $file !!");
$content_file = fread($fp,filesize($file));
fclose($fp);

// define HTTP POST DATA
$data = "--$boundary\n".
"Content-Disposition: form-data; name=\"file\"; filename=\"$file\"\n".
"Content-Type: application/octet-stream\n\n$content_file".
"--$boundary--\r\n\r\n";

$msg = "POST $remote_page HTTP/1.0\n".
"Content-Type: multipart/form-data; boundary=$boundary\n".
"Content-Length: ".strlen($data)."\r\n\r\n";

// Open socket connection ...
$f = fsockopen($host,80, $errno, $errstr, 30);
if ($f)
{

// Send the data
fputs($f,$msg.$data);

// retrieve the response
$result="";

while (!feof($f)) {
$result.=fread($f,1024);
}

fclose($f);
// write the response (if needed)
return $result;
} else {
die ("Cannot connect !!!");
}
}

--- End Message ---
--- Begin Message ---
On Tuesday 17 April 2007 10:46:58 Joakim Ling wrote:
> Hi there
>
> Im tring to send a file  with a php script, Im using php 5.2 on a Win
> 2003 server. At the other end I just save the file and process the data
> and print the result, then fetch the output and write a report. But this
> doesn't work, any one got an idea? The file never get to the other end?
> When I do a var_export($_POST) is empty.
>
>
> This is the code I use:
> function postFile($file,$host,$path)
> {
> $remote_page = "http://".$host.$path;
> $boundary =
> "---------------------------".substr(md5(rand(0,32000)),0,10);
>
> // read the file
> $fp = @fopen($file,"r");
> if (!$fp) die ("Cannot read $file !!");
> $content_file = fread($fp,filesize($file));
> fclose($fp);
>
> // define HTTP POST DATA
> $data = "--$boundary\n".
> "Content-Disposition: form-data; name=\"file\"; filename=\"$file\"\n".
> "Content-Type: application/octet-stream\n\n$content_file".
> "--$boundary--\r\n\r\n";
>
> $msg = "POST $remote_page HTTP/1.0\n".
> "Content-Type: multipart/form-data; boundary=$boundary\n".
> "Content-Length: ".strlen($data)."\r\n\r\n";
>
> // Open socket connection ...
> $f = fsockopen($host,80, $errno, $errstr, 30);
> if ($f)
> {
>
> // Send the data
> fputs($f,$msg.$data);
>
> // retrieve the response
> $result="";
>
> while (!feof($f)) {
> $result.=fread($f,1024);
> }
>
> fclose($f);
> // write the response (if needed)
> return $result;
> } else {
> die ("Cannot connect !!!");
> }
> }

If you can use file_get_contents() with the allow_url_fopen = yes directive in 
php.ini it would be easier.
From http://us2.php.net/manual/en/wrappers.http.php :
<?php

$postdata = http_build_query(
    array(
        'var1' => 'some content',
        'var2' => 'doh'
    )
);

$opts = array('http' =>
    array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);

$context  = stream_context_create($opts);

$result = file_get_contents('http://example.com/submit.php', false, $context);

?>

I have done something similar except I used the $_REQUEST variable in the 
remote script rather than doing a POST. I had just a small amount of data to 
pass so $_REQUEST worked for me.

On Windows with PHP4 I had to do some tricks to get this type of thing to 
work. On Linux with PHP5 it worked flawlessly.

Thanks,
James

-- 
James Crow

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

on 04/17/2007 11:46 AM Joakim Ling said the following:
> Hi there
> 
> Im tring to send a file  with a php script, Im using php 5.2 on a Win
> 2003 server. At the other end I just save the file and process the data
> and print the result, then fetch the output and write a report. But this
> doesn't work, any one got an idea? The file never get to the other end?
> When I do a var_export($_POST) is empty.

Couldn't that be because you should be checking $_FILES instead of $_POST?

Anyway, I use this HTTP client class and it supports file uploading easily.

http://www.phpclasses.org/httpclient

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
On Tue, April 17, 2007 1:21 am, Leo Jokinen wrote:
> Problem solved:
> I restarted my computer and after that apache loaded ibm_db2
> extension.
>
> My conclusion:
> 1. When you add some extensions to php.ini, you need to restart
> windows
> in order to get those extensions available through apache
> 2. However, those extensions are instantly available if you use php
> command line interface
>
> Anyone disagree?

Technically, yes. :-)

If you are using CGI, you don't need a re-start, as the CGI is a new
process each time, and loads php.ini on each page hit.

If you are using Apache, in theory, you'd only need to re-start
Apache, as that reloads the php.ini, or maybe even send it some kind
of signal to re-load its configuration files, which *might* include
php.ini

If you are using FCGI, I presume you'd only need to re-start FCGI, as
that will re-load the php.ini there.

If you are using IIS, you'll have to restart every 24 hours anyway, so
what's it matter?

However, Windows being Windows, there might be caching of the files by
the OS which has to be cleared out, or some other weird thing going
on, so just reboot anyway, cuz it's Windows.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---

Reply via email to