[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/extras/pr21_to_pr22/ -> address_book.php (source)

   1  <?php
   2  /*
   3    $Id: address_book.php,v 1.1 2003/05/19 21:58:46 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    if (!$HTTP_POST_VARS['DB_SERVER']) {
  14  ?>
  15  <html>
  16  <head>
  17  <title>osCommerce Preview Release 2.2 Database Update Script</title>
  18  <style type=text/css><!--
  19    TD, P, BODY {
  20      font-family: Verdana, Arial, sans-serif;
  21      font-size: 14px;
  22      color: #000000;
  23    }
  24  //--></style>
  25  </head>
  26  <body>
  27  <p>
  28  <b>osCommerce Preview Release 2.2 Database Update Script</b>
  29  <p>This script updates the address book table so that the address_book_id field becomes auto_increment again.
  30  <form name="database" action="<?php echo basename($PHP_SELF); ?>" method="post">
  31  <table border="0" cellspacing="2" cellpadding="2">
  32    <tr>
  33      <td colspan="2"><b>Database Server Information</b></td>
  34    </tr>
  35    <tr>
  36      <td>Server:</td>
  37      <td><input type="text" name="DB_SERVER"> <small>(eg, 192.168.0.1)</small></td>
  38    </tr>
  39    <tr>
  40      <td>Username:</td>
  41      <td><input type="text" name="DB_SERVER_USERNAME"> <small>(eg, root)</small></td>
  42    </tr>
  43    <tr>
  44      <td>Password:</td>
  45      <td><input type="text" name="DB_SERVER_PASSWORD"> <small>(eg, bee)</small></td>
  46    </tr>
  47    <tr>
  48      <td>Database:</td>
  49      <td><input type="text" name="DB_DATABASE"> <small>(eg, catalog)</small></td>
  50    </tr>
  51    <tr>
  52      <td>&nbsp;</td>
  53      <td><input type="submit" value="Submit"></td>
  54    </tr>
  55  </table>
  56  </form>
  57  </body>
  58  </html>
  59  <?php
  60      exit;
  61    }
  62  
  63    function tep_db_connect() {
  64      global $db_link, $HTTP_POST_VARS;
  65  
  66      $db_link = mysql_connect($HTTP_POST_VARS['DB_SERVER'], $HTTP_POST_VARS['DB_SERVER_USERNAME'], $HTTP_POST_VARS['DB_SERVER_PASSWORD']);
  67  
  68      if ($db_link) mysql_select_db($HTTP_POST_VARS['DB_DATABASE']);
  69  
  70      return $db_link;
  71    }
  72  
  73    function tep_db_error ($query, $errno, $error) {
  74      die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
  75    }
  76  
  77    function tep_db_query($db_query) {
  78      global $db_link;
  79  
  80      $result = mysql_query($db_query, $db_link) or tep_db_error($db_query, mysql_errno(), mysql_error());
  81  
  82      return $result;
  83    }
  84  
  85    function tep_db_fetch_array($db_query) {
  86      $result = mysql_fetch_array($db_query);
  87  
  88      return $result;
  89    }
  90  
  91    tep_db_connect() or die('Unable to connect to database server!');
  92  
  93    tep_db_query("alter table address_book change address_book_id address_book_id int not null auto_increment");
  94  ?>
  95  
  96  Done!


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics