Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
add php scripts to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed May 9, 2011
1 parent 83ea3fe commit 501b309
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
15 changes: 15 additions & 0 deletions generatePassword.php
@@ -0,0 +1,15 @@
<?php
$callback = $_GET['callback'];
$password = '';
for($counter = rand(3,10); $counter > 0; $counter --) {
$password = $password . chr(rand(33, 126));
}
$data = array(
"password" => $password );
$json = json_encode($data);
header("Content-type: text/javascript");
if ($callback)
echo $callback .' (' . $json . ');';
else
echo $json;
?>
56 changes: 56 additions & 0 deletions greet.php
@@ -0,0 +1,56 @@
<?php
$name = $_GET['name'];
$callback = $_GET['callback'];
$salutations = array(
"Adab",
"Ahoj",
"An-nyeong-ha-se-yo",
"Apa khabar",
"Barev Dzez",
"Buenos días",
"Bula Vinaka",
"Chào",
"Ciao",
"Dia Duit",
"Hallo",
"Hallå",
"Halló",
"Halo",
"Haye",
"Hei",
"Hej",
"Hello",
"Helo",
"Hola",
"Kamusta",
"Konnichiwa",
"Merhaba",
"Mingalarba",
"Namaskar",
"Namaste",
"Olá",
"Pryvit",
"Pryvitannie",
"Përshëndetje",
"Salam",
"Salut",
"Sat Sri Akal",
"Sholem aleikhem",
"Sveiki",
"Szia",
"Tere",
"Zdraveĭte",
"Zdravo" );
$salutation = $salutations[rand(0, count($salutations) - 1)];
$greeting = $salutation . ' ' . $name . '!';
$data = array(
"name" => $name,
"salutation" => $salutation,
"greeting" => $greeting );
$json = json_encode($data);
header("Content-type: text/javascript");
if ($callback)
echo $callback .' (' . $json . ');';
else
echo $json;
?>

0 comments on commit 501b309

Please sign in to comment.