Jump to content
php.lv forumi

input parbaude


FT3

Recommended Posts

Labdien , ta tada lieta vai jus varetu pateikt kodu kurš parbauda vai ir aizpilditi title, text, autor, date lauki

 

iepriekš paldies !

 

<?php
require("connect.php");

$title = $_POST[title];
$text= $_POST[text];
$autor = $_POST[autor];
$date = $_POST[date];

mysql_query ("INSERT INTO news (title, text, autor, date) VALUES ('$title','$text','$autor','$date')") or die(mysql_error());

echo "Zina ir veiksmigi pievienota !";

?>

Link to comment
Share on other sites

<?
if(!empty($_POST['title'])){
$title = $_POST[title];
$text= $_POST[text];
$autor = $_POST[autor];
$date = $_POST[date];

mysql_query ("INSERT INTO news (title, text, autor, date) VALUES ('$title','$text','$autor','$date')") or die(mysql_error());

}else{echo"aizpildi visus laukus!";}
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...