return $url;
}
-// Send a HEAD request
+// Sends a HTTP request (GET, POST, HEAD are currently supported)
+function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = false) {
+ // Init response
+ $response = array();
+
+ // Start "detecting" the request type
+ switch ($requestType) {
+ case 'HEAD': // Send a HTTP/1.1 HEAD request
+ $response = sendHeadRequest($baseUrl, $requestData);
+ break;
+
+ case 'GET': // Send a HTTP/1.1 GET request
+ $response = sendGetRequest($baseUrl, $requestData, $removeHeader);
+ break;
+
+ case 'POST': // Send a HTTP/1.1 POST request
+ $response = sendPostRequest($baseUrl, $requestData, $removeHeader);
+ break;
+
+ default: // Unsupported HTTP request, this is really bad and needs fixing
+ debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported request detected. requestType=' . $requestType . ',baseUrl=' . $baseUrl . ',requestData()=' . count($requestData));
+ break;
+ } // END - switch
+
+ // Return response
+ return $response;
+}
+
+// Sends a HEAD request
function sendHeadRequest ($baseUrl, $requestData = array()) {
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
// Do we have http[s]:// in front of the URL?
if (isFullQualifiedUrl($getUrl)) {
- // Remove http[s]://<hostname> from url
+ // Remove http[s]://<hostname> from URL
$getUrl = removeHttpHostNameFromUrl($getUrl);
} elseif (substr($getUrl, 0, 1) != '/') {
// Prepend a slash
'ADMIN_NETWORK_TYPES_PAGEPEEL' => "Page-Peel",
'ADMIN_NETWORK_TYPES_TRAFFIC' => "Traffic", // These are visitor exchanges like ext-surfbar!
// - Sponsor networks
+ 'ADMIN_LIST_NEWORK_DATA_TITLE' => "Auflistung der Grunddaten aller Werbenetzwerke",
'ADMIN_NETWORK_NONE_SUPPORTED' => "Es sind noch keine Werbenetzwerke eingerichtet.",
'ADMIN_NETWORK_SHORT_NAME' => "Kurzname:",
'ADMIN_NETWORK_TITLE' => "Linktitel:",
<div align="center">
<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&what=list_networks&do=handle_network%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
- <tr>
- <td height="25" colspan="3" class="header_column bottom right separator"> </td>
- <td colspan="2" class="header_column bottom right" align="center">
- <strong>{--ADMIN_NETWORK_SEPARATOR--}</strong>
- </td>
- <td colspan="3" class="header_column bottom separator"> </td>
- </tr>
- <tr>
- <td align="center" class="header_column bottom right" height="25"><strong>{--ID_SELECT--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_SHORT_NAME--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REFERRAL_LINK--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_DATA_SEPARATOR2--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_ROW_SEPARATOR2--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REQUEST_TYPE--}</strong></td>
- <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_CHARSET--}</strong></td>
- <td align="center" class="header_column bottom"><strong>{--ADMIN_NETWORK_REQUIRE_ID_CARD--}</strong></td>
- </tr>
- $content
- <tr>
- <td colspan="8" class="table_footer">
- <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
- <input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
- <input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
- </td>
- </tr>
+<tr>
+ <td colspan="8" class="table_header">
+ <strong>{--ADMIN_LIST_NEWORK_DATA_TITLE--}</strong>
+ </td>
+</tr>
+<tr>
+ <td height="25" colspan="3" class="header_column bottom right separator"> </td>
+ <td colspan="2" class="header_column bottom right" align="center">
+ <strong>{--ADMIN_NETWORK_SEPARATOR--}</strong>
+ </td>
+ <td colspan="3" class="header_column bottom separator"> </td>
+</tr>
+<tr>
+ <td align="center" class="header_column bottom right" height="25"><strong>{--ID_SELECT--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_SHORT_NAME--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REFERRAL_LINK--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_DATA_SEPARATOR2--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_ROW_SEPARATOR2--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_REQUEST_TYPE--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--ADMIN_NETWORK_CHARSET--}</strong></td>
+ <td align="center" class="header_column bottom"><strong>{--ADMIN_NETWORK_REQUIRE_ID_CARD--}</strong></td>
+</tr>
+$content
+<tr>
+ <td colspan="8" class="table_footer">
+ <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
+ <input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
+ <input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
+ </td>
+</tr>
</table>
</form>