PHP

From Hostek.com Wiki
Jump to: navigation, search


Do you support PHP?

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

PHP Versions

We support all of the current PHP versions on both our Windows and Linux servers. This includes PHP versions 5.3, 5.4, 5.5 and 5.6. Our control panels allow you to choose which version of PHP you would like to use for your site.

How to Change PHP Version

PHP Version - Windows

Once logged into the control panel, click on "PHP Settings" icon under "Website Settings".

PHP Version - Linux

Login to cPanel and click on "Select PHP Version" under "Software and Services". Choose the version from the drop-down menu and click on "Set as current"


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.

magic-quotes - How can I disable magic-quotes?

To disable magic_quotes you will need to change the following lines in your php.ini from:

;magic_quotes_gpc = Off
;magic_quotes_runtime = Off 

To:

magic_quotes_gpc = Off
magic_quotes_runtime = Off 

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:

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