ik heb een htacces script gemaakt, er staat een .htacces bestand en een .htpasswd bestand. Maar toch gaat de server meteen over dit stukje php heen.. dit is het bestand:
PHP:
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
| <?PHP if (($user) && ($password)) { # get url $url = $DOCUMENT_ROOT . dirname($_SERVER['PHP_SELF']) . "/.htpasswd"; # make .htaccess and .htpasswd $htaccess_txt = "AuthType Basic" . "\n"; $htaccess_txt .= "AuthName \home3\phclan\public_html" . "\n"; $htaccess_txt .= "AuthUserFile $url" . "\n"; $htaccess_txt .= "require valid-user" . "\n"; $htpasswd_txt .= "$user:".crypt($passwort,CRYPT_STD_DES)."\n"; # save files $htaccess= fopen(".htaccess", "w"); $htpasswd= fopen(".htpasswd", "w"); fputs($htaccess, $htaccess_txt); fputs($htpasswd, $htpasswd_txt); fclose($htaccess); fclose($htpasswd); # output die ("OK!<HR>" . nl2br($htaccess_txt) . "<HR>" . nl2br($htpasswd_txt)); } ?> <html> <title>QUERY PHP</title> <head> <?php $db = mysql_connect("localhost",nac82512,weird); mysql_select_db("DB_nac82512",$db); ?> </head> <body bgcolor=000066 text=FF9900> <?php $var = $HTTP_POST_VARS['query']; $result = mysql_query($var,$db) or trigger_error("Could not do query", E_USER_ERROR); $article= mysql_fetch_object($result); echo "<br><br><h1><center>Your Query has been executed on the database</h1>"; echo "<hr>"; echo "This is the dump value of the result of your query:<br>"; var_dump($article); ?> </center> </body> </html> |
[ Voor 18% gewijzigd door D2k op 21-01-2003 14:10 ]