File: odbc-t1.php3

package info (click to toggle)
php3 3%3A3.0.18-0potato1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,736 kB
  • ctags: 11,198
  • sloc: ansic: 108,120; sh: 2,512; php: 2,024; yacc: 1,887; makefile: 1,038; perl: 537; pascal: 238; awk: 90; cpp: 28; sql: 11
file content (41 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (4)
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
<HTML>
<HEAD>
<TITLE>Quick &amp; dirty ODBC test</TITLE>
</HEAD>
<BODY>
<H1>ODBC Test 1 - Connection</H1>
<?
if(isset($dbuser)){
?>
Connecting to <? echo $dsn; ?> as <? echo $dbuser; ?>
<P>
<?
    $conn = odbc_connect($dsn,$dbuser,$dbpwd);
    if (!$conn){
?>
<H2>Error connecting to database! Check DSN, username and password</H2>
<?
    }else{
?>
<H2>Connection successful</H2>
<A HREF="odbc-t2.php3<? echo "?dbuser=",$dbuser,"&dsn=",$dsn,"&dbpwd=",$dbpwd; ?>">Proceed to next test</A>
| <A HREF="<? echo $PHP_SELF; ?>">Change login information</A>
<?
    }
} else {
?>
<EM>You will need permisson to create tables for the following tests!</EM>
<form action=odbc-t1.php3 method=post>
<table border=0>
<tr><td>Database (DSN): </td><td><input type=text name=dsn></td></tr>
<tr><td>User: </td><td><input type=text name=dbuser></td></tr>
<tr><td>Password: </td><td><input type=password name=dbpwd></td></tr>
</table>
<br>
<input type=submit value=connect>

</form>
<? 
} ?>
</BODY>
</HTML>