php-setup-creator

Gesponsorde koppelingen

PHP script bestanden

  1. php-setup-creator

« Lees de omschrijving en reacties

Maak eerst de map: files aan met CHMOD 777.
Alle process bestanden zijn aangegeven met: p_

//////////////////
///index.php///
/////////////////

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$ip
=$_SERVER['REMOTE_ADDR'];

?>

<div align=center>
Welcome to the Setup Creator!
This generator will help you creating a stand-alone setup of all your php files!
But first you must click this button to create a session!
<form action="p_index.php" type="application/x-www-form-urlencoded">
Give up a session name!<INPUT type="hidden" name="sess" value="<?php echo $ip ?>"><br>
<INPUT type="submit" value="Create Session">
</form>
</div>


////////////////////
///p_index.php//
///////////////////
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<?php

include('functions.php');
$sess=$_GET['sess'];
if (file_exists('files/'.$sess.'/sess.lock'))
{

   alert('Session already exists\nWait 30 minutes or choose another name!');
   back();
}

Else
{
   mkdir ("files/".$sess."", 0755);
   create("files/".$sess."/sess.lock", "");
   create("files/".$sess."/setup.php", "<?php\n\n//Start Config Part");
   create("files/".$sess."/uninstall.php", "<?php\n\n//Start Config Part");
}


redirect('config.php?sess='.$sess);

?>



///////////////////
////config.php///
///////////////////

<?php

$sess
=$_GET['sess'];

?>

<div align=center>
Fill in these forms!
<form action="p_config.php" type="application/x-www-form-urlencoded">
<INPUT type="hidden" name="sess" value="<?php echo $sess ?>">
Enter the name of the program:<br>
<INPUT type="text" name="n"><br>
Enter the image host of the program:<br><INPUT type="text" name="i" value="http://renrik.freehostia.com/setup/img/"><br>The host: http://renrik.freehostia.com/setup/img/ is recommened!<br>
Enter the file to be opened after the install:<br><INPUT type="text" name="d"><br>
<INPUT type="submit" value="Submit">
</form>
</div>


///////////////////
//p_config.php//
//////////////////

<?php

$sess
=$_GET['sess'];

include('functions.php');
$n=$_GET['n'];
$i=$_GET['i'];
$d=$_GET['d'];
$nw='$name';
$iw='$img_host';
$dw='$done';

add("files/".$sess."/setup.php", "\n".$nw."='".$n."';\n".$iw."='".$i."';\n".$dw."='".$d."';\n//End Config Part\n\n");
add("files/".$sess."/uninstall.php", "\n".$nw."='".$n."';\n".$iw."='".$i."';\n//End Config Part\n\n");
$inpat1 = implode ('', file ('inpat1.php'));
add("files/".$sess."/setup.php", $inpat1);
$unpat1 = implode ('', file ('unpat1.php'));
add("files/".$sess."/uninstall.php", $unpat1);

redirect('files.php?sess='.$sess.'');

?>



//////////////////
////files.php////
/////////////////

<?php

$sess
=$_GET['sess'];

?>

<div align=center>
<form action="p_files.php" type="application/x-www-form-urlencoded">
<INPUT type="hidden" name="sess" value="<?php echo $sess ?>">
Enter the filename here:<br><INPUT type="text" name="filename"><br>
Enter the script here:<br><textarea name="filedata" rows="30" cols="120"></textarea><br>
<INPUT type="submit" value="Submit!">
</form>
</div>


///////////////////
///p_files.php///
///////////////////

<?php

$sess
=$_GET['sess'];
$mode=$_GET['mode'];
$filn=$_GET['filename'];
$fild=$_GET['filedata'];
include('functions.php');

$fila=urlencode($fild);

If ( $mode == '' )
{

   add("files/".$sess."/setup.php", "   create('".$filn."', '".$fila."');\n");
   add("files/".$sess."/uninstall.php", "   unlink('".$filn."');\n");
   redirect('p_files.php?sess='.$sess.'&mode=form');
}

Else If ( $mode == 'form' )
{

   ?>
<form action="p_files.php" type="application/x-www-form-urlencoded">
   <INPUT type="hidden" name="sess" value="<?php echo $sess ?>">
   Do you want to add another file?<br>
   <INPUT type="submit" name="mode" value="Yes">
   <INPUT type="submit" name="mode" value="No"></form><?php
}
Else If ( $mode == 'Yes' )
{

   redirect('files.php?sess='.$sess);
}

Else If ( $mode == 'No' )
{

   $inpat2 = implode ('', file ('inpat2.php'));
   $unpat2 = implode ('', file ('unpat2.php'));
   add("files/".$sess."/uninstall.php", $unpat2);
   $unins = implode ('', file ('files/'.$sess.'/uninstall.php'));
   $unpadder = urlencode($unins);
   add("files/".$sess."/setup.php", "   create('uninstall.php', '".$unpadder."');\n");
   add("files/".$sess."/setup.php", $inpat2);
   redirect('download.php?sess='.$sess);
}


?>



///////////////////
//functions.php//
///////////////////

<?php

function alert($alert)
{

   print('<script language=javascript> alert("'.$alert.'"); </script>');
}

function
back()
{

   print('<script language=javascript> history.go(-1); </script>');
}

function
create($filename, $filedata)
{

   $fh = fopen($filename, 'w') or die("can't open file");
   fwrite($fh, $filedata);
   fclose($fh);
}

function
add($filename, $filedata)
{

   $fh = fopen($filename, 'a') or die("can't open file");
   fwrite($fh, $filedata);
   fclose($fh);
}

function
redirect($url)
{

   print('<script language=javascript> window.location.reload("'.$url.'"); </script>');
}


?>



Hier zijn de klaargezette scripts:
/////////////////
///inpat1.php//
/////////////////

function create($filename, $filedata)
{
   $filedat1 = urldecode($filedata);
   $filedat2 = stripslashes($filedat1);
   $fh = fopen($filename, 'w') or die("can't open file");
   fwrite($fh, $filedat2);
   fclose($fh);
}

$step=$_GET['step'];
If ( $step == '' )
{
   $step=1;
}
echo '<HTML><HEAD><meta http-equiv="imagetoolbar" content="no"><title>'.$name.' setup :: Step: '.$step.'</title>';

If ( $step == '1' )
{
   $text='Welcome to the setup of '.$name.'. We are happy you decided to use our software on your webserver. This setup will create the neccesary files on your server.<br><br><br><br>Press the Next button!';
}
Else If ( $step == '2' )
{



//////////////////
///inpat2.php///
/////////////////

   $text='The files have been uninstalled succesfully!';
}
Else If ( $step == '3' )
{
   $text='Press the finish button to completely delete this file (uninstaller) too!';
}
Else
{
   ?> <script language=javascript>
   alert("You left the knows steps, please try again!");
   history.go(-1);
   </script><?php
}

$next=$step + 1;
$prev=$step - 1;
If ( $prev == '0' )
{

   $prev='1';
}


?>

<!-- Start Design Part --!>
<IMG src="<?php echo $img_host ?>back.jpg" alt="" align="top" border="0" width="574" height="439" style="position:absolute;left:188px;top:40px;width:574px;height:439px;z-index:0">
<A href="javascript:window.close();"><IMG src="<?php echo $img_host ?>close.jpg" alt="Close the setup of <?php echo $name ?>" align="top" border="0" width="34" height="40" style="position:absolute;left:713px;top:43px;width:34px;height:40px;z-index:1"></A>
<DIV style="position:absolute;left:231px;top:55px;width:481px;height:16px;z-index:2" align="left">
<FONT style="font-size:13px" color="#FFFFFF" face="Arial"><?php echo $name ?> setup :: Step: <?php echo $step ?></FONT>
</DIV>
<DIV style="position:absolute;left:373px;top:96px;width:353px;height:16px;z-index:3" align="left">
<FONT style="font-size:13px" color="#000000" face="Arial"><?php echo $text ?></FONT>
</DIV>
<button onclick="javascript:window.close();" style="position:absolute;left:650px;top:423px;width:75px;height:24px;z-index:4">Exit</button>
<?php
If ( $step == '3' )
{

   ?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
   <INPUT type="submit" name="" value="Finish" style="position:absolute;left:563px;top:423px;width:75px;height:24px;z-index:5">
   <INPUT type="hidden" name="deletethis" value="1">
   </form><?php
}
Else
{
   ?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
   <INPUT type="hidden" name="step" value="<?php echo $next ?>">
   <INPUT type="submit" name="" value="Next" style="position:absolute;left:563px;top:423px;width:75px;height:24px;z-index:5">
   </form><?php
}
?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
<INPUT type="hidden" name="step" value="<?php echo $prev ?>">
<INPUT type="submit" name="" value="Previous" style="position:absolute;left:476px;top:423px;width:75px;height:24px;z-index:6">
</form>
<!-- End Design Part --!>


/////////////////
//unpat1.php//
/////////////////

function create($filename, $filedata)
{
   $fh = fopen($filename, 'w') or die("can't open file");
   fwrite($fh, $filedata);
   fclose($fh);
}

$step=$_GET['step'];
$deti=$_GET['deletethis'];
If ( $deti == '1' )
{
   unlink('uninstall.php');
}
If ( $step == '' )
{
   $step=1;
}
echo '<HTML><HEAD><meta http-equiv="imagetoolbar" content="no"><title>'.$name.' uninstall :: Step: '.$step.'</title>';

If ( $step == '1' )
{
   $text='Welcome to the uninstaller of '.$name.'! This file lets you uninstall all the files that are installed with the setup!<br><br>Please set this directory to CHMOD 777.<br><br>Press the Next button!';
}
Else If ( $step == '2' )
{



/////////////////
//unpat2.php//
////////////////

   $text='The files have been uninstalled succesfully!';
}
Else If ( $step == '3' )
{
   $text='Press the finish button to completely delete this file (uninstaller) too!';
}
Else
{
   ?> <script language=javascript>
   alert("You left the knows steps, please try again!");
   history.go(-1);
   </script><?php
}

$next=$step + 1;
$prev=$step - 1;
If ( $prev == '0' )
{

   $prev='1';
}


?>

<!-- Start Design Part --!>
<IMG src="<?php echo $img_host ?>back.jpg" alt="" align="top" border="0" width="574" height="439" style="position:absolute;left:188px;top:40px;width:574px;height:439px;z-index:0">
<A href="javascript:window.close();"><IMG src="<?php echo $img_host ?>close.jpg" alt="Close the setup of <?php echo $name ?>" align="top" border="0" width="34" height="40" style="position:absolute;left:713px;top:43px;width:34px;height:40px;z-index:1"></A>
<DIV style="position:absolute;left:231px;top:55px;width:481px;height:16px;z-index:2" align="left">
<FONT style="font-size:13px" color="#FFFFFF" face="Arial"><?php echo $name ?> setup :: Step: <?php echo $step ?></FONT>
</DIV>
<DIV style="position:absolute;left:373px;top:96px;width:353px;height:16px;z-index:3" align="left">
<FONT style="font-size:13px" color="#000000" face="Arial"><?php echo $text ?></FONT>
</DIV>
<button onclick="javascript:window.close();" style="position:absolute;left:650px;top:423px;width:75px;height:24px;z-index:4">Exit</button>
<?php
If ( $step == '3' )
{

   ?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
   <INPUT type="submit" name="" value="Finish" style="position:absolute;left:563px;top:423px;width:75px;height:24px;z-index:5">
   <INPUT type="hidden" name="deletethis" value="1">
   </form><?php
}
Else
{
   ?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
   <INPUT type="hidden" name="step" value="<?php echo $next ?>">
   <INPUT type="submit" name="" value="Next" style="position:absolute;left:563px;top:423px;width:75px;height:24px;z-index:5">
   </form><?php
}
?>
<form action="uninstall.php" type="application/x-www-form-urlencoded">
<INPUT type="hidden" name="step" value="<?php echo $prev ?>">
<INPUT type="submit" name="" value="Previous" style="position:absolute;left:476px;top:423px;width:75px;height:24px;z-index:6">
</form>
<!-- End Design Part --!>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.