Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
if($_POST['submit']){
$text1 = htmlspecialchars($_POST['text1']);
$text2 = htmlspecialchars($_POST['text2']);
$text3 = htmlspecialchars($_POST['text3']);
$query = mysql_query("INSERT INTO `tablica` ( `id`, `text1`, `text2`,`text3`,`image`) VALUES('','$text1','$text2','$text3','$image');
}
<form method='post' action=''>
<input type='text' name='text1'>
<input type='text' name='text2'>
<input type='text' name='text3'>
<input type="file" name='image'>
<input type='submit' name='submit' value='submit'>
</form>
if($_POST['submit']){
$text1 = htmlspecialchars($_POST['text1']);
$text2 = htmlspecialchars($_POST['text2']);
$text3 = htmlspecialchars($_POST['text3']);
$query = mysql_query("INSERT INTO `tablica` ( `id`, `text1`, `text2`,`text3`,`image`) VALUES('','$text1','$text2','$text3','$image');
}
<form method='post' action=''>
<input type='text' name='text1'>
<input type='text' name='text2'>
<input type='text' name='text3'>
<input type="file" name='image'>
</form>
if($_POST['submit']){
$text1 = htmlspecialchars($_POST['text1']);
$text2 = htmlspecialchars($_POST['text2']);
$text3 = htmlspecialchars($_POST['text3']);
$image = htmlspecialchars($_POST['image']);
$query = mysql_query("INSERT INTO `tablica` ( `id`, `text1`, `text2`,`text3`,`image`) VALUES('','$text1','$text2','$text3','$image');
}
<form method='post' action='' enctype="multipart/form-data">
<input type='text' name='text1' />
<input type='text' name='text2' />
<input type='text' name='text3' />
<input type="file" name='file' />
<input type="submit" name="submit" value="dobawi" />
</form>
<?php
if($_POST['submit']){
@move_uploaded_file($_FILES['file']["tmp_name"], "[b]image[/b]/" . $_FILES['file']['name']);
$image = $_FILES['file']['name'];
$text1 = htmlspecialchars($_POST['text1']);
$text2 = htmlspecialchars($_POST['text2']);
$text3 = htmlspecialchars($_POST['text3']);
$query = mysql_query("INSERT INTO `tablica` ( `id`, `text1`, `text2`,`text3`,`image`) VALUES('','$text1','$text2','$text3','$image');
}
?>
<form method='post' action='' enctype="multipart/form-data">
<input type='text' name='text1' />
<input type='text' name='text2' />
<input type='text' name='text3' />
<input type="file" name='file' />
<input type="submit" name="submit" value="dobawi" />
</form>
<?php
if($_POST['submit'])
{
$path = "image/"; // папка в която се качват картинките.
$file = $_FILES['file']['name'];
$type = end(explode(".",$file));
$razresheni = array("jpg","gif","png"); // разрешени формати
if (in_array($type,$razresheni))
{
@move_uploaded_file($_FILES['file']["tmp_name"], $path.$_FILES['file']['name']);
$image = $_FILES['file']['name'];
$text1 = htmlspecialchars($_POST['text1']);
$text2 = htmlspecialchars($_POST['text2']);
$text3 = htmlspecialchars($_POST['text3']);
$query = mysql_query("INSERT INTO `tablica` ( `id`, `text1`, `text2`,`text3`,`image`) VALUES('','$text1','$text2','$text3','$image');
}
else
{
echo "Изображението е непозволен формат.";
}
}
?>