PHP

From Hostek.com Wiki
Revision as of 10:56, 5 March 2013 by Carlb (Talk | contribs)

Jump to: navigation, search


Do you support PHP?

Yes, we support PHP on all of our Windows and Linux hosting servers.

Can I view the PHP configuration for my site?

Yes, to do this you'll just need to create a .php file with the following code and browse to the file:

<?php phpinfo(); ?>

Do you support cURL in PHP?

Yes, we support cURL.

mhash - Is the mhash library supported?

Yes, the mhash libary is supported with PHP.

How can I use PHP to have a form email me the results?

Here is a sample PHP script that uses submitted form information to send an email:

<?
if ($HTTP_POST_VARS['to'] && $HTTP_POST_VARS['from']) {
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$HTTP_POST_VARS['from']." <".$HTTP_POST_VARS['from'].">\r\n";
$headers .= "To: ".$HTTP_POST_VARS['to']." <".$HTTP_POST_VARS['to'].">\r\n";
$headers .= "Reply-To: ".$HTTP_POST_VARS['from']." <".$HTTP_POST_VARS['from'].">\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: A Server";
mail($HTTP_POST_VARS['to'], $HTTP_POST_VARS['subject'], $HTTP_POST_VARS['body'], $headers); echo
"Mail sent to ".$HTTP_POST_VARS['to'].".
\n";
}
?>