Last change
on this file since 333 was
326,
checked in by andersk, 18 years ago
|
urlencode some stuff.
|
-
Property svn:executable set to
*
|
File size:
457 bytes
|
Rev | Line | |
---|
[131] | 1 | #!/usr/bin/php |
---|
| 2 | <?php |
---|
| 3 | |
---|
| 4 | list($h,$u,$p) = explode("\t",`/mit/scripts/sql/bin/get-password`); |
---|
| 5 | $newdb = str_replace($u.'+','',$argv[1]); |
---|
| 6 | $testdb = str_replace('.','',$u).'+'.$newdb; |
---|
[326] | 7 | $dbs = explode("\n",file_get_contents('http://sql.mit.edu/~sql/tools/list_dbs.php?h=' . urlencode($h) . '&u=' . urlencode($u) . '&p=' . urlencode($p))); |
---|
[131] | 8 | if (in_array($testdb,$dbs)) { |
---|
| 9 | $i = 1; |
---|
| 10 | while(in_array($testdb.$i,$dbs)) { |
---|
| 11 | $i++; |
---|
| 12 | } |
---|
| 13 | echo $newdb.$i; |
---|
| 14 | } else echo $newdb; |
---|
| 15 | |
---|
| 16 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.