Código PHP:
function register($key, $value) {
$image = array();
global $image;
$image[$key] = $value;
}
function input($name, $value, $attributes = array()) {
$defaultAttributes = array(
'id' => $name,
'name' => $name
);
$finalAttributes = array_merge($defaultAttributes, $attributes);
if ($value !== null) {
$finalAttributes['value'] = $value;
}
return Tags('input', $finalAttributes, false);
}
function Tags($tag, $attributes, $content = false) {
$code = '<' . $tag;
foreach ($attributes as $attribute => $value) {
$code .= ' ' . $attribute . '="' . htmlentities(stripslashes($value), ENT_COMPAT) . '"';
}
if ($content === false || $content === null) {
$code .= ' />';
} else {
$code .= '>' . $content . '</' . $tag . '>';
}
return $code;
}
Código PHP:
$numbers = intval(isset($_POST['numbers']) ? $_POST['numbers'] : 30);
register('numbers', $numbers);
echo input('numbers', $numbers, array('type' => 'number', 'min' => 30, 'max' => 50, 'step' => 5, 'required' => 'required'));
Código:
<input name="numbers" id="numbers" value="<?php $numbers = intval(isset($_POST['numbers']) ? $_POST['numbers'] : 30); echo $numbers ?>" type="number" min="30" max="50" step="5" required>
al hacer esto directamente con el formulario me deja de funcionar el código php alguna sugerencia, se los agradecería bastante ya que dicha función es para realizar un barcode con inserción a una base de datos.
agradezco cualquier ayuda.