Skip to content

Commit dce549e

Browse files
committed
first commit
0 parents  commit dce549e

File tree

754 files changed

+65160
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

754 files changed

+65160
-0
lines changed

.htaccess

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
RewriteEngine On
2+
RewriteRule ^([a-zA-Z0-9]{6})$ redirect.php?id=$1 [L]

BD HEAR/bd.sql

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
-- phpMyAdmin SQL Dump
2+
-- version 5.2.1
3+
-- https://www.phpmyadmin.net/
4+
--
5+
-- Servidor: 127.0.0.1
6+
-- Tiempo de generación: 26-01-2025 a las 03:50:32
7+
-- Versión del servidor: 10.4.32-MariaDB
8+
-- Versión de PHP: 8.0.30
9+
10+
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11+
START TRANSACTION;
12+
SET time_zone = "+00:00";
13+
14+
15+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
16+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
17+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
18+
/*!40101 SET NAMES utf8mb4 */;
19+
20+
--
21+
-- Database: `url_shortener`
22+
--
23+
24+
-- --------------------------------------------------------
25+
26+
--
27+
-- Table structure for the `transactions` table
28+
--
29+
30+
CREATE TABLE `transactions` (
31+
`id` int(11) NOT NULL,
32+
`order_id` varchar(255) NOT NULL,
33+
`email` varchar(255) NOT NULL,
34+
`status` varchar(50) NOT NULL,
35+
`fecha` timestamp NOT NULL DEFAULT current_timestamp()
36+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
37+
38+
-- --------------------------------------------------------
39+
40+
--
41+
-- Estructura de tabla para la tabla `urls`
42+
--
43+
44+
CREATE TABLE `urls` (
45+
`id` int(11) NOT NULL,
46+
`short_id` varchar(6) NOT NULL,
47+
`original_url` text NOT NULL,
48+
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
49+
`user_ip` varchar(45) NOT NULL,
50+
`user_email` varchar(200) DEFAULT NULL
51+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
52+
53+
-- --------------------------------------------------------
54+
55+
--
56+
-- Estructura de tabla para la tabla `users`
57+
--
58+
59+
CREATE TABLE `users` (
60+
`id` int(11) NOT NULL,
61+
`username` varchar(50) NOT NULL,
62+
`email` varchar(100) NOT NULL,
63+
`contrasena_hash` varchar(255) NOT NULL,
64+
`registration_date` datetime NOT NULL,
65+
`payment_date` datetime DEFAULT NULL,
66+
`expiration_date` datetime DEFAULT NULL,
67+
`remaining_links` int(11) DEFAULT 0,
68+
`plan` varchar(300) NOT NULL
69+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
70+
71+
-- --------------------------------------------------------
72+
73+
--
74+
-- Estructura de tabla para la tabla `visits`
75+
--
76+
77+
CREATE TABLE `visits` (
78+
`id` int(11) NOT NULL,
79+
`short_id` varchar(255) NOT NULL,
80+
`visit_time` datetime NOT NULL,
81+
`ip_address` varchar(45) NOT NULL,
82+
`country` varchar(100) DEFAULT NULL,
83+
`referrer` varchar(255) DEFAULT NULL,
84+
`user_agent` text DEFAULT NULL
85+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
86+
87+
--
88+
-- Índices para tablas volcadas
89+
--
90+
91+
--
92+
-- Indices de la tabla `transactions`
93+
--
94+
ALTER TABLE `transactions`
95+
ADD PRIMARY KEY (`id`),
96+
ADD UNIQUE KEY `order_id` (`order_id`);
97+
98+
--
99+
-- Indices de la tabla `urls`
100+
--
101+
ALTER TABLE `urls`
102+
ADD PRIMARY KEY (`id`);
103+
104+
--
105+
-- Indices de la tabla `users`
106+
--
107+
ALTER TABLE `users`
108+
ADD PRIMARY KEY (`id`),
109+
ADD UNIQUE KEY `email` (`email`);
110+
111+
--
112+
-- Indices de la tabla `visits`
113+
--
114+
ALTER TABLE `visits`
115+
ADD PRIMARY KEY (`id`);
116+
117+
--
118+
-- AUTO_INCREMENT de las tablas volcadas
119+
--
120+
121+
--
122+
-- AUTO_INCREMENT de la tabla `transactions`
123+
--
124+
ALTER TABLE `transactions`
125+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
126+
127+
--
128+
-- AUTO_INCREMENT de la tabla `urls`
129+
--
130+
ALTER TABLE `urls`
131+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
132+
133+
--
134+
-- AUTO_INCREMENT de la tabla `users`
135+
--
136+
ALTER TABLE `users`
137+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
138+
139+
--
140+
-- AUTO_INCREMENT de la tabla `visits`
141+
--
142+
ALTER TABLE `visits`
143+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
144+
COMMIT;
145+
146+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
147+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
148+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

connection/connection.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
// Configuring the database connection
3+
$servername = "localhost";
4+
$username = "root";
5+
$password = "";
6+
$dbname = "url_shortener";
7+
8+
// Create connection
9+
$conn = new mysqli($servername, $username, $password, $dbname);
10+
11+
// Check connection
12+
if ($conn->connect_error) {
13+
die("Conexión fallida: " . $conn->connect_error);
14+
}
15+
session_start();
16+
17+
// Validate the transaction with PayPal
18+
$clientID = "you api key"; // Replace with your PayPal Client ID
19+
$secret = "you secret key"; // Replace with your PayPal Secret
20+
?>

0 commit comments

Comments
 (0)