Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php and ssl ?

Status
Not open for further replies.

Moez

Technical User
Jul 3, 2001
53
FR
Hi

Maybe someone can tell me, how can i redirect my website members to an https page ?
And, is it possible with php, to send a fax instead of an email, when the user submit his form ? In my mind, it depend of the ISP !!!

Thanks for answer .
Moez
 
header ("Location:
Will perform the redirection. But your script must output nothing before it issues that command, as headers must be sent before content.

PHP does not have intrinsic functions for sending faxes; however it can run external programs. If your server has software installed for sending faxes from a command line, it should not be a problem. ______________________________________________________________________
TANSTAAFL!
 
Pleasy, could you explain me what do you mean by "your script must output nothing before it issues that command, as headers must be sent before content" !?

Thanks
 
it means no spaces, or any other html output to the browser before the header code is executed or there will be an error Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Moez:

HTML is sent via HTTP. An HTTP communication consists of two parts: a part containing headers and a part containing content. When an HTTP communcation takes place, either from the client to the server (a request) or from the server to the client (a response), the headers are sent, then a blank line, then the content.

The header part must be sent first -- it's part of the HTTP spec. If at any time your script produces content-type output (basically anything not in HTTP headers), PHP assumes you're finished sending headers. It then sends that required blank line, then your content. If you then try to send more headers, you have violated the HTTP spec, and PHP will complain about it.

Content output includes but is not limited to anything from a print, echo, or print_r statement, and anything (including blank lines) that appears outside a PHP script outside the &quot;<?php...?>&quot; tags.

Content also includes any error or warning messages PHP itself generates and outputs. If your script generates a warning before hitting some statement that generates HTTP headers, you will see two messages: the script warning, and then an error telling you that your script tried to output headers after content output had begun. In that case, fix the first problem, and the second one will likely go away, too.

There is a way around this limitation -- output buffering. PHP can be configured to collect all output and send it all at once. It's more resource intensive and slows down your script, but it allows you to issue header() statements at any time. For more information, please read Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top