Jump to content
php.lv forumi

nevaru iebraukt kas pa problēmu!


ziedinjsh

Recommended Posts

informācijas ievadīšanas kods

$uid = mysql_real_escape_string($_POST['uid']);
$author = mysql_real_escape_string($_POST['author']);
$title = mysql_real_escape_string($_POST['title']);
$link = mysql_real_escape_string($POST['link']);
$date = date("Y:h:i y.m.d");

$statuss = "ok";

if(empty($author) || empty($title) || empty($link)){
$error = "<div class='i-error'>Kads no lauciņiem ir palicis tukš!</div>";
	$statuss = "error";
}
if($statuss<>"ok"){
echo $error;
}else{

mysql_query("INSERT INTO songs (uid, author, title, link, date) VALUES ('$uid', '$author', '$title', '$link', '$date')") or die(musql_error());
echo "<div class='i-ok'>Dziesma pievienota!</div>";

}

 

kad atstāj kādu lauciņu tukšu viņš rād erroru ka kāds lauciņš ir tukš.. tā ir jābūt, bet to pašu viņš rāda arī tad kad visi lauciņi ir aizpildīti!! kapēc tā!?

Link to comment
Share on other sites

 

array

'author' => string 'D7' (length=2)

'title' => string 'Human Source' (length=12)

'link' => string '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param>'>http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/gatisziedins/d7-human-source">D7 -'... (length=594)

'uid' => string '1' (length=1)

'addmusic' => string 'Pievienot dziesmu' (length=17)

Link to comment
Share on other sites

Mikijs bik izgāzās :D

 

ziedinjsh, acīmredzot neieslēdzi gan to kļūdu parādīšanos, tāpēc, ka ja būtu, tad uzreiz izlektu Notice ar kļūdaino vietu.

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
include("../misc/dbase.php");


$uid = mysql_real_escape_string($_POST['uid']);
$author = mysql_real_escape_string($_POST['author']);
$title = mysql_real_escape_string($_POST['title']);
$link = mysql_real_escape_string($POST['link']);
$date = date("d.m.y");

$statuss = "ok";

var_dump($_POST);

if(empty($author) || empty($title) || empty($link)){
$error = "<div class='i-error'>Kads no lauciņiem ir palicis tukš!</div>";
	$statuss = "error";
}
if($statuss<>"ok"){
echo $error;
}else{

mysql_query("INSERT INTO songs (uid, author, title, link, date) VALUES ('$uid', '$author', '$title', '$link', '$date')") or die(musql_error());
echo "<div class='i-ok'>Dziesma pievienota!</div>";

}
?>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...