You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
968 B

  1. <HTML>
  2. <HEAD>
  3. <TITLE>Quick &amp; dirty ODBC test</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <H1>ODBC Test 1 - Connection</H1>
  7. <?php
  8. if(isset($dbuser)){
  9. echo "Connecting to $dsn as $dbuser\n<P>";
  10. $conn = odbc_connect($dsn,$dbuser,$dbpwd);
  11. if(!$conn){
  12. ?>
  13. <H2>Error connecting to database! Check DSN, username and password</H2>
  14. <?php
  15. }else{
  16. ?>
  17. <H2>Connection successful</H2>
  18. <A HREF="odbc-t2.php<?php echo "?dbuser=$dbuser&dsn=$dsn&dbpwd=$dbpwd" ?>">Proceed to next test</A>
  19. | <A HREF="<?php echo $PHP_SELF ?>">Change login information</A>
  20. <?php
  21. }
  22. } else {
  23. ?>
  24. <EM>You will need permisson to create tables for the following tests!</EM>
  25. <form action=odbc-t1.php method=post>
  26. <table border=0>
  27. <tr><td>Database (DSN): </td><td><input type=text name=dsn></td></tr>
  28. <tr><td>User: </td><td><input type=text name=dbuser></td></tr>
  29. <tr><td>Password: </td><td><input type=password name=dbpwd></td></tr>
  30. </table>
  31. <br>
  32. <input type=submit value=connect>
  33. </form>
  34. <?php
  35. } ?>
  36. </BODY>
  37. </HTML>