Skip to content

Commit

Permalink
int: initial commit from local-machine
Browse files Browse the repository at this point in the history
  • Loading branch information
birajrai committed Jan 31, 2023
0 parents commit bc2a8da
Show file tree
Hide file tree
Showing 22 changed files with 2,292 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
options -multiviews
options -indexes

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^includes/.+\.(json|php)$ 404
RewriteRule ^generate/([a-z0-9\-]{1,100})$ generate.php?slug=$1&%{QUERY_STRING}
RewriteRule ^generate/([a-z0-9\-]{1,100})/ajax$ ajax.php?slug=$1&%{QUERY_STRING}
</IfModule>
10 changes: 10 additions & 0 deletions ajax.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
// require the website config file.
require_once('includes/config.php');

// if the passed parameters are valid return a response.
if ( isset($_GET['slug']) && isset($website['sets'][$_GET['slug']]) && isset($_POST['text']) && $_POST['text'] !== '' ) {
header('content-type: text/plain; charset=utf-8');
echo text_generator::generate($_POST['text'], $website['sets'][$_GET['slug']]['characters'], true);
}
?>
Loading

0 comments on commit bc2a8da

Please sign in to comment.