Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
azbne
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Andrew
azbne
Commits
d453e35b
Commit
d453e35b
authored
Sep 20, 2017
by
Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first
parents
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
0 deletions
+85
-0
index.php
index.php
+10
-0
dsp.php
pages/dsp.php
+44
-0
go.php
pages/go.php
+15
-0
nurl.php
pages/nurl.php
+16
-0
b1.png
static/b1.png
+0
-0
No files found.
index.php
0 → 100644
View file @
d453e35b
<?
define
(
'INDEX'
,
'index'
);
if
(
$_SERVER
[
'REQUEST_URI'
]
==
'/dsp'
)
require
(
"pages/dsp.php"
);
else
if
(
preg_match
(
"/^\/go\?/"
,
$_SERVER
[
'REQUEST_URI'
]))
require
(
"pages/go.php"
);
else
if
(
preg_match
(
"/^\/nurl\?/"
,
$_SERVER
[
'REQUEST_URI'
]))
require
(
"pages/nurl.php"
);
else
die
(
"OK"
);
\ No newline at end of file
pages/dsp.php
0 → 100644
View file @
d453e35b
<?
if
(
!
defined
(
'INDEX'
))
die
;
$json
=
file_get_contents
(
"php://input"
);
$data
=
json_decode
(
$json
,
true
);
if
(
!
$data
){
header
(
"HTTP/1.0 204 No Content"
);
die
;
}
$bid
=
array
();
$bidid
=
1
;
if
(
!
isset
(
$data
[
'imp'
])){
header
(
"HTTP/1.0 204 No Content"
);
die
;
}
foreach
(
$data
[
'imp'
]
as
$imp
)
{
$rnd
=
md5
(
rand
()
.
microtime
());
$bid
[]
=
array
(
'id'
=>
strval
(
$bidid
++
),
'impid'
=>
$imp
[
'id'
],
'price'
=>
0.18
,
'nurl'
=>
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/nurl?i='
.
$rnd
.
'&z=${AUCTION_IMP_ID}&price=${AUCTION_PRICE}&b=1'
,
'adm'
=>
'<a target="_blank" href="https://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/go?i='
.
$rnd
.
'&z=${AUCTION_IMP_ID}&b=1"><img src="https://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/static/b1.png" width="300px" height="600px" border="none"></a>'
,
'adid'
=>
'1'
,
);
}
$resp
=
array
(
'id'
=>
$data
[
'id'
],
'seatbid'
=>
array
(
array
(
'bid'
=>
$bid
),
),
'cur'
=>
'USD'
,
'nbr'
=>
0
,
);
header
(
"Content-type: application/json"
);
echo
json_encode
(
$resp
);
\ No newline at end of file
pages/go.php
0 → 100644
View file @
d453e35b
<?
if
(
!
defined
(
'INDEX'
))
die
;
$q
=
parse_url
(
$_SERVER
[
'REQUEST_URI'
])[
"query"
];
parse_str
(
$q
,
$_GET
);
$imp
=
$_GET
[
'i'
];
$z
=
intval
(
$_GET
[
'z'
]);
$b
=
intval
(
$_GET
[
'b'
]);
if
(
!
$z
||
!
$b
||
!
preg_match
(
"/^([0-9a-f]
{
32
}
)$/"
,
$imp
))
die
;
error_log
(
"imp=
$imp
||z=
$z
||b=
$b
\n
"
,
3
,
"go.log"
);
header
(
"location: http://gillette.themag.com.ua/gl/?utm_source=
$z
&utm_campaign=
$b
"
);
die
;
pages/nurl.php
0 → 100644
View file @
d453e35b
<?
if
(
!
defined
(
'INDEX'
))
die
;
$q
=
parse_url
(
$_SERVER
[
'REQUEST_URI'
])[
"query"
];
parse_str
(
$q
,
$_GET
);
$imp
=
$_GET
[
'i'
];
$z
=
intval
(
$_GET
[
'z'
]);
$b
=
intval
(
$_GET
[
'b'
]);
$price
=
floatval
(
$_GET
[
'price'
]);
if
(
!
$z
||
!
$b
||
!
$price
||
!
preg_match
(
"/^([0-9a-f]
{
32
}
)$/"
,
$imp
))
die
;
error_log
(
"imp=
$imp
||z=
$z
||b=
$b
||price=
$price
\n
"
,
3
,
"nurl.log"
);
header
(
"HTTP/1.0 204 No Response"
);
die
;
static/b1.png
0 → 100644
View file @
d453e35b
42.5 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment