More String Stuff

Example: file_get_contents()


Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/salzburs/public_html/citw185/week6/moreStringStuff.php on line 18

Warning: file_get_contents(https://salzburg.com): Failed to open stream: no suitable wrapper could be found in /home/salzburs/public_html/citw185/week6/moreStringStuff.php on line 18

fopen is not allowed on this host.

<?php
include ('../header/assignmentHeader.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>More String Stuff</title>
    <link rel="stylesheet" href="../css/assignmentHeaderStyles.css" />
</head>
<body>
<h1>Example: file_get_contents()</h1>

<?php
ini_set
('display_errors', 1); //Sets the value of a configuration option
$url = "https://salzburg.com";
$a = file_get_contents($url);
$a = strip_tags($a);
echo(
$a);

// Output information about allow_url_fopen:
if (ini_get('allow_url_fopen') == 1) {
    echo 
'<p style="color: #0A0;">fopen is allowed on this host.</p>';
} else {
    echo 
'<p style="color: #A00;">fopen is not allowed on this host.</p>';
}
?>

</body>
</html>
<?php
show_source
(__FILE__);
include(
'../footer/footer.php');
?>