Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Formulario de paz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ulises Morales Ramírez
Formulario de paz
Commits
ad35244e
Commit
ad35244e
authored
Aug 11, 2019
by
Ulises
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arreglado insertar maya
parent
2cc34534
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
22 deletions
+9
-22
conexion.php
conexion.php
+3
-3
conexion2.php
conexion2.php
+0
-14
insertar.php
insertar.php
+6
-5
No files found.
conexion.php
View file @
ad35244e
<?php
<?php
$servername
=
"localhost"
;
$servername
=
"localhost"
;
$username
=
"
root
"
;
$username
=
"
sec_user
"
;
$password
=
"
PkJXPQFykKLmS3cWhqmZKNYE
"
;
$password
=
"
5Qn6g2je6WkF7FX6CcBhAzUf
"
;
$dbname
=
"Escuelas"
;
$dbname
=
"Escuelas"
;
// Create connection
// Create connection
...
@@ -11,4 +11,4 @@ if ($conn->connect_error) {
...
@@ -11,4 +11,4 @@ if ($conn->connect_error) {
die
(
"Connection failed: "
.
$conn
->
connect_error
);
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
}
?>
?>
\ No newline at end of file
conexion2.php
deleted
100644 → 0
View file @
2cc34534
<?php
$servername
=
"localhost"
;
$username
=
"sec_user"
;
$password
=
"5Qn6g2je6WkF7FX6CcBhAzUf"
;
$dbname
=
"Escuelas"
;
// Create connection
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
// Check connection
if
(
$conn
->
connect_error
)
{
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
?>
insertar.php
View file @
ad35244e
...
@@ -5,15 +5,18 @@
...
@@ -5,15 +5,18 @@
<?php
<?php
session_start
();
session_start
();
include
'conexion.php'
;
include
'conexion.php'
;
/*
echo $_SESSION['clave_escuela'];
echo $_SESSION['clave_escuela'];
echo $_POST['idioma'];
echo $_POST['idioma'];
echo $_POST['nombre'];
echo $_POST['nombre'];
echo $_POST['edad'];
echo $_POST['edad'];
echo $_POST['comentario'];
echo $_POST['comentario'];
*/
$nombre
=
str_replace
(
"'"
,
"''"
,
$_POST
[
'nombre'
]);
$comentario
=
str_replace
(
"'"
,
"''"
,
$_POST
[
'comentario'
]);
//$sql = "INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`) VALUES (null ,".$_SESSION['clave_escuela'].",,,,)";
$sql
=
"INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'"
.
$_SESSION
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$nombre
.
"',"
.
$_POST
[
'edad'
]
.
",'"
.
$comentario
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
$sql
=
"INSERT INTO `respuesta`(`id_respuesta`, `clave_escuela`, `idioma`, `nombre`, `edad`, `comentario`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'"
.
$_SESSION
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$_POST
[
'nombre'
]
.
"',"
.
$_POST
[
'edad'
]
.
",'"
.
$_POST
[
'comentario'
]
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
echo
"New record created successfully"
;
echo
"New record created successfully"
;
...
@@ -25,8 +28,6 @@ $conn->close();
...
@@ -25,8 +28,6 @@ $conn->close();
/* Esto producirá un error. Fíjese en el html
* que se muestra antes que la llamada a header() */
header
(
'Location: salida.php?idioma='
.
$_POST
[
'idioma'
]);
header
(
'Location: salida.php?idioma='
.
$_POST
[
'idioma'
]);
exit
;
exit
;
?>
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment