Em Andamento

Rewrite php function in ASP Vbscript

Hello,

We require a php function to be rewritten in ASP VBScript.

aspJson serialiser is to be used to create the JSON data [url removed, login to view]

the following function can be used to create the iso 8601 date

Function iso8601Date(dt)

s = datepart("yyyy",dt)

s = s & RIGHT("0" & datepart("m",dt),2)

s = s & RIGHT("0" & datepart("d",dt),2)

s = s & "T"

s = s & RIGHT("0" & datepart("h",dt),2)

s = s & RIGHT("0" & datepart("n",dt),2)

s = s & RIGHT("0" & datepart("s",dt),2)

iso8601Date = s

End Function

Data is to be posted using the [url removed, login to view] object

The php Function is below;

<?php

const IDS_LOG_PORT = 60100;

function IdsLogAccess($reportingtoken, $username, $success, $website, $ip=false)

{

if($ip===false)

{

$IP = $_SERVER['REMOTE_ADDR'];

}

else

{

$IP = $ip;

}

$IPLong = ip2long($IP);

if(($IPLong === -1 || $IPLong === false) || ($success != true && $success != false) || $username === null || $website === null)

{

return;

}

$Time = strftime("%Y-%m-%d %H:%M:%S");

$UserName = $username.'';

$Success = $success;

$Website = $website;

$ReportingToken = $reportingtoken.'';

$arr = array('IP' => $IP, 'Success' => $Success, 'UserName' => $UserName, 'UTCTimestamp' => $Time, 'ReportingToken' => $ReportingToken, 'Website' => $Website);

$JSONObject = json_encode($arr);

$options = array(

'http' => array(

'method' => 'POST',

'content' => $JSONObject,

'header'=> "Content-Type: application/json\r\n" .

"Accept: application/json\r\n"

)

);

$context = stream_context_create( $options );

$url = "http://localhost:".IDS_LOG_PORT."/report";

if( ini_get('allow_url_fopen') )

{

$result = file_get_contents( $url, false, $context );

}

else if(function_exists('curl_init'))

{

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

curl_setopt($ch, CURLOPT_POSTFIELDS, $JSONObject);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(

'Content-Type: application/json',

'Content-Length: ' . strlen($JSONObject))

);

$result = curl_exec($ch);

}

}

?>

Habilidades: ASP, PHP

Ver mais: php code to create report, h&m, h & m, website url rewrite, vbscript, php function , google ch, vbscript php, vbscript post, php post array, php curl_exec json, remote_addr, rewrite function php, create vbscript, php vbscript, vbscript http post php, http post vbscript, ip2long, php https post, json php array, report rewrite, asp serverxmlhttp, curl_setopt, function asp, using php create iso

Acerca do Empregador:
( 20 comentários ) Lismore, Australia

ID do Projeto: #7109758

Premiar a:

rkmomin

Dear Hiring Manager, The QUALITY of our work speaks for itself, and the fact that our company has grown exponentially since it's formation in November 2013 is a testimony to our work ethic. Here are links of our Mais

$30 USD em 1 dia
(52 Avaliações)
5.7

5 freelancers estão ofertando em média $44 para este trabalho

ITservice

Hi, I have 5+ years of experience. Developed various projects in ASP with MsSql database. Infact, 90% of the projects done so far are in classic ASP, which includes simple dynamic page to complex ecommerce related w Mais

$55 USD em 1 dia
(135 Comentários)
7.4
leomedina01

Hi sir, My name is Leonardo Medina, and I'm from Brazil. I have lots of experience in Classic ASP & VB. I'm an experienced Web Developer working since 1996 in this field, with: * 7+ years experience in PHP, AS Mais

$55 USD in 2 dias
(127 Comentários)
6.6
fwuse

Hello, I have 12+ years of experience with both PHP and ASP. I can definitely help you out with this project. Please let me know if I can be of assistance.

$54 USD em 1 dia
(12 Comentários)
4.2
smrutiran

A proposal has not yet been provided

$24 USD em 1 dia
(5 Comentários)
3.4
insidesoft2

Dear Client, Greeting of the day ahead !!! Thanks for providing us opportunity to place bid over the project and communicate with you. I am a serious bidder here and i have already worked on a similar project befor Mais

$25 USD em 1 dia
(0 Comentários)
0.0