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
4ba1e375
Commit
4ba1e375
authored
Aug 14, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cambio de selector
parent
917b96dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
encuesta.php
encuesta.php
+1
-1
insertar.php
insertar.php
+7
-3
No files found.
encuesta.php
View file @
4ba1e375
...
...
@@ -77,7 +77,7 @@ session_start();
<div
class=
"input-group-append"
>
<span
class=
"input-group-text"
><i
class=
"fas fa-sort-numeric-up"
></i></span>
</div>
<input
type=
"number"
pattern=
"\d*|^[0-9]*$"
min=
"1"
max=
"99"
name=
"edad"
class=
"form-control input_user"
value=
""
placeholder=
"
<?php
<input
type=
"number"
min=
"1"
max=
"99"
name=
"edad"
class=
"form-control input_user"
value=
""
placeholder=
"
<?php
if
(
$_POST
[
'idioma'
]
==
'Maya'
)
{
echo
"Ja'ab"
;
...
...
insertar.php
View file @
4ba1e375
...
...
@@ -14,9 +14,13 @@ 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`, `fecha`, `REMOTE_ADDR`, `HTTP_USER_AGENT`, `latitude`, `longitude`) VALUES (null ,'"
.
$_SESSION
[
'clave_escuela'
]
.
"','"
.
$_POST
[
'idioma'
]
.
"','"
.
$nombre
.
"',"
.
abs
(
$_POST
[
'edad'
])
.
",'"
.
$comentario
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
$edad
=
$_POST
[
'edad'
];
$garbagearray
=
array
(
'@'
,
'#'
,
'$'
,
'%'
,
'^'
,
'&'
,
'*'
,
'('
,
')'
,
'+'
,
'-'
,
'['
,
']'
);
$garbagecount
=
count
(
$garbagearray
);
for
(
$i
=
0
;
$i
<
$garbagecount
;
$i
++
)
{
$edad
=
str_replace
(
$garbagearray
[
$i
],
''
,
$edad
);
}
$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
.
"',"
.
$edad
.
",'"
.
$comentario
.
"', CURRENT_TIMESTAMP,'"
.
$_SERVER
[
'REMOTE_ADDR'
]
.
"','"
.
$_SERVER
[
'HTTP_USER_AGENT'
]
.
"','"
.
$_SESSION
[
"latitude"
]
.
"','"
.
$_SESSION
[
"longitude"
]
.
"')"
;
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
echo
"New record created successfully"
;
...
...
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