Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <body>
- <br />
- <?php
- if(!$_POST)
- {
- ?>
- <div class="col-md-4">
- <div class="input-group">
- <form action="" method="POST">
- <label for="ID">IDs:</label>
- <textarea class="form-control" id="ids" name="ids" rows="10" cols="30" autofocus></textarea>
- <br />
- <label for="tab">Tab:</label><br>
- <input type="text" id="tab" name="tab"><br>
- </div>
- <br />
- <input class="btn btn-success btn-lg" type="submit" value="Create Links"></input>
- </form>
- </div>
- <?php
- }
- ?>
- </body>
- </html>
- <?php
- class Config
- {
- public $url = "https://changethislink.com";
- function url()
- {
- return $this->url;
- }
- }
- $config = new Config;
- if(!empty($_POST['ids']))
- {
- $ids = trim($_POST['ids']);
- $ids = explode("\n", $ids);
- echo '<style>.alert { width:20%; } </style>';
- echo '<div class="col-md-10">';
- foreach ($ids AS $id)
- {
- $oid = (int) $id;
- if(!is_int($oid) OR $oid == 0)
- {
- echo '<div class="alert alert-danger" role="alert"><strong>ERROR: Invalid Offer ID Provided</strong></div>';
- exit();
- }
- }
- echo '<div class="alert alert-success" role="alert"><strong>Congrats! The links are below.</strong></div>';
- foreach ($ids AS $id)
- {
- $oid = (int) $id;
- if(!(empty($_POST['tab'])))
- {
- $addtab = (string) htmlspecialchars($_POST['tab']);
- $firstCharacter = substr($addtab, 0, 1);
- // Edit Tabs
- $edittab = substr($addtab, 0, 4);
- if($edittab == "edit")
- {
- echo "$config->url/$oid/$addtab";
- }
- elseif($firstCharacter == "?")
- {
- echo "$config->url/$oid$addtab";
- }
- else
- {
- echo "$config->url/$oid?$addtab";
- }
- }
- else
- {
- echo "$config->url/$oid";
- }
- echo "<br />";
- }
- }
- elseif($_POST && empty($_POST['ids']))
- {
- echo '<style>.alert { width:25%; } </style>';
- echo '<div class="col-md-10">';
- echo '<div class="alert alert-danger" role="alert"><strong>ERROR: You must provide atleast one ID.</strong></div>';
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement