1 |
<? |
2 |
/* |
3 |
* Phormation |
4 |
* - A library of PHP code to make development of database-driven |
5 |
* html forms easy and quick |
6 |
* |
7 |
* Copyright (C) 2000 Jason D. Hildebrand |
8 |
* PeaceWorks Computer Consulting |
9 |
* |
10 |
* jason@peaceworks.ca |
11 |
* |
12 |
* This program is free software; you can redistribute it and/or modify |
13 |
* it under the terms of the GNU General Public License as published by |
14 |
* the Free Software Foundation; either version 2 of the License, or |
15 |
* (at your option) any later version. |
16 |
* |
17 |
* This program is distributed in the hope that it will be useful, |
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 |
* GNU General Public License for more details. |
21 |
* |
22 |
* You should have received a copy of the GNU General Public License |
23 |
* along with this program; if not, write to the Free Software |
24 |
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. |
25 |
*/ |
26 |
|
27 |
|
28 |
function add_var_to_url( $url, $keyvalue ) |
29 |
{ |
30 |
// add a key-value pair (such as "content=main" to a url) |
31 |
if( ! strpos( $url, "?" ) ) { |
32 |
$url .= "?" . $keyvalue; |
33 |
} else { |
34 |
$url .= "&" . $keyvalue; |
35 |
} |
36 |
return $url; |
37 |
} |
38 |
|
39 |
|
40 |
function lpad( $str, $length, $padchar ) |
41 |
{ |
42 |
$output = ""; |
43 |
$actuallen = strlen( $str ); |
44 |
for( $i = 0; $i < $length - $actuallen; $i++ ) { |
45 |
$output .= $padchar; |
46 |
} |
47 |
$output .= $str; |
48 |
return( $output ); |
49 |
} |
50 |
|
51 |
|
52 |
function make_error( $str ) |
53 |
{ |
54 |
exit( "ERROR : $str<BR>" ); |
55 |
} |
56 |
?> |