Skip to content

Commit c5b37d5

Browse files
index.html
1 parent f975c03 commit c5b37d5

1 file changed

Lines changed: 35 additions & 8 deletions

File tree

index.html

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
5-
</head>
6-
<body>
7-
<p>Hello, World!</p>
8-
</body>
9-
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>PHP Proxy Example</title>
7+
</head>
8+
<body>
9+
<h1>PHP Proxy Example</h1>
10+
11+
<?php
12+
// The URL you want to fetch content from
13+
$url = 'https://api.example.com/data';
14+
15+
// Initialize a cURL session
16+
$ch = curl_init();
17+
18+
// Set the URL
19+
curl_setopt($ch, CURLOPT_URL, $url);
20+
// Return the transfer as a string
21+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
22+
23+
// Execute the cURL session
24+
$output = curl_exec($ch);
25+
26+
// Close the cURL session
27+
curl_close($ch);
28+
29+
// Output the content
30+
if ($output === FALSE) {
31+
echo "cURL Error: " . curl_error($ch);
32+
} else {
33+
echo $output;
34+
}
35+
?>
36+
</body>
1037
</html>

0 commit comments

Comments
 (0)