Difference between revisions of "PHP"
(5 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
==Do you support PHP?== | ==Do you support PHP?== | ||
Yes, we support PHP on all of our Windows and Linux hosting servers. | 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?== | ==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: | Yes, to do this you'll just need to create a .php file with the following code and browse to the file: | ||
− | < | + | <syntaxhighlight lang="php"><?php phpinfo(); ?></syntaxhighlight> |
==Do you support cURL in PHP?== | ==Do you support cURL in PHP?== | ||
Line 14: | Line 23: | ||
==mhash - Is the mhash library supported?== | ==mhash - Is the mhash library supported?== | ||
Yes, the mhash libary is supported with PHP. | 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: | ||
+ | |||
+ | <pre> | ||
+ | ;magic_quotes_gpc = Off | ||
+ | ;magic_quotes_runtime = Off | ||
+ | </pre> | ||
+ | |||
+ | '''To:''' | ||
+ | |||
+ | <pre> | ||
+ | magic_quotes_gpc = Off | ||
+ | magic_quotes_runtime = Off | ||
+ | </pre> | ||
==How can I use PHP to have a form email me the results?== | ==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: | Here is a sample PHP script that uses submitted form information to send an email: | ||
− | + | <syntaxhighlight lang="php"><?php | |
− | if ($ | + | if ($_POST['to'] && $_POST['from']) { |
$headers .= "MIME-Version: 1.0\r\n"; | $headers .= "MIME-Version: 1.0\r\n"; | ||
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; | $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; | ||
− | $headers .= "From: ".$ | + | $headers .= "From: ".$_POST['from']." <".$_POST['from'].">\r\n"; |
− | $headers .= "To: ".$ | + | $headers .= "To: ".$_POST['to']." <".$_POST['to'].">\r\n"; |
− | $headers .= "Reply-To: ".$ | + | $headers .= "Reply-To: ".$_POST['from']." <".$_POST['from'].">\r\n"; |
$headers .= "X-Priority: 1\r\n"; | $headers .= "X-Priority: 1\r\n"; | ||
$headers .= "X-MSMail-Priority: High\r\n"; | $headers .= "X-MSMail-Priority: High\r\n"; | ||
$headers .= "X-Mailer: A Server"; | $headers .= "X-Mailer: A Server"; | ||
− | mail($ | + | mail($_POST['to'], $_POST['subject'], $_POST['body'], $headers); echo |
− | "Mail sent to ".$ | + | "Mail sent to ".$_POST['to'].". |
\n"; | \n"; | ||
} | } | ||
− | ?></ | + | ?></syntaxhighlight> |
Latest revision as of 19:22, 1 April 2015
Contents
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"; } ?>