Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Joe Robinson
blapaste
Commits
b20a972d
Commit
b20a972d
authored
12 years ago
by
Luke Bratch
Browse files
Options
Download
Patches
Plain Diff
Make redirect work with any hostname or path
parent
e84100d6
master
test
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
submit.php
+10
-2
submit.php
with
10 additions
and
2 deletions
+10
-2
submit.php
+
10
−
2
View file @
b20a972d
<?php
$path
=
str_replace
(
basename
(
$_SERVER
[
'SCRIPT_NAME'
]
),
""
,
$_SERVER
[
'SCRIPT_NAME'
]
);
if
(
isset
(
$_SERVER
[
'HTTP_HOST'
]
)
)
{
$hostname
=
$_SERVER
[
'HTTP_HOST'
];
}
else
{
$hostname
=
$_SERVER
[
'SERVER_NAME'
];
}
if
(
isset
(
$_POST
[
"paste"
])
&&
$_POST
[
"paste"
]
!=
""
)
{
$paste
=
$_POST
[
"paste"
];
$id
=
dechex
(
crc32
(
$paste
)
);
$fh
=
fopen
(
$id
,
"w"
);
fwrite
(
$fh
,
$paste
);
fclose
(
$fh
);
header
(
"Location: http://
p.of.je/
$id
"
);
header
(
"Location: http://
"
.
$hostname
.
$path
.
$id
);
}
else
{
header
(
"Location: http://
p.of.je"
);
header
(
"Location: http://
"
.
$hostname
.
$path
);
}
?>
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets