function __construct() { require_once "../coreapp/conection.php"; $conection = new Conection(); $this->con = $conection->Conexion(); }
<input type="text" name="carpeta" class="form-control" id="inputText" placeholder="Carpeta"> </div> </div> <div class="form-group"> <div class="col-lg-10 col-lg-offset-2"> <button type="reset" class="btn btn-default">Cancel</button> <button type="submit" name="btnGuardar" class="btn btn-primary">Submit</button> </div> </div> </fieldset> </form> </div> </div> </div> </body> </html> <?php require "../coreapp/conection.php"; $conection = new Conection(); $mysqli = $conection->Conexion(); if (isset($_POST['btnGuardar'])) { $archivo = $_FILES['archivo']['tmp_name']; $destino = $_SERVER['DOCUMENT_ROOT'] . "/digiarch/img/" . $_FILES['archivo']['name']; move_uploaded_file($archivo, $destino); //echo $mysqli->host_info. " aqui en addtruta"; $sql = "INSERT INTO imagenes (idimagen,ruta,directorio,idproy) VALUES (null,'{$destino}','carpeta',19)"; $mysqli->query($sql); //Insertar en base de datos }