problem with php script HELP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rosigolden
Forum Newbie
Posts: 2
Joined: Fri Feb 03, 2012 2:19 am

problem with php script HELP

Post by rosigolden »

<?php
if(isSet($_POST['submit'])) {
if(isSet($_POST['date'], $_POST['description'], $_POST['text'], $_POST['author'], $_POST['title'])) {
$date = $_POST['date'];
$description = $_POST['description'];
$text = $_POST['text'];
$author = $_POST['author'];
$cars = $_POST['title'];
} else {
$date = '';
$description = '';
$text = '';
$author = '';
$cars = '';
}
if(!$date || !$description || !$text || !$author | !$cars) {
echo 'Не сте попълнили всичко необходимо, не може да продъжите. ';
} else {
$title = $_FILES['title']['name'];
$titleTmp = $_FILES['title']['tmp_name'];
$titleSize = $_FILES['title']['size'];
$isPng = end(explode('.', $title));
copy($titleTmp, '../CARS/');
mysql_query ("INSERT INTO lessons (title,date,description,text,author) VALUES ('{$title}', '{$date}','{$description}','{$text}','{$author}')") or die(mysql_error());
echo '<p>Успешно добавено!</p>';
}
} else {
echo '
<form method=\'post\' enctype=\'multipart/form-data\' action=\'\'>
<p>
<label>ADD IMAGE<br /><input name=\'title\' type=\'file\'><br /></label>
</p>
<p>
<label>CAR BRAND<br><input name=\'date\' type=\'text\' id=\'date\' value=\'2007-01-27\'></label>
</p>
<p>
<label>DESCRIPTION OF CARS<textarea name=\'description\' id=\'description\' cols=\'40\' rows=\'5\'></textarea></label>
</p>
<p>
<label>LOW PRICE<br /><textarea name=\'text\' id=\'text\' cols=\'40\' rows=\'5\'></textarea></label>
</p>
<p>
<label>HIGH PRICE<br><input type=\'text\' name=\'author\' id=\'author\'></label>
</p>
<p>
<label><input type=\'submit\' name=\'submit\' id=\'submit\' value=\'Record in the database\'></label>
</p>
</form>'
}
?>
where is the problem /in line 67 / with red color/
User avatar
theserve
Forum Newbie
Posts: 24
Joined: Wed Jan 18, 2012 6:35 am
Location: London

Re: problem with php script HELP

Post by theserve »

you are missing a semi colon right at the end

</form>';
}
?>
rosigolden
Forum Newbie
Posts: 2
Joined: Fri Feb 03, 2012 2:19 am

Re: problem with php script HELP

Post by rosigolden »

now this is OK. but new problem
echo 'Не сте попълнили всичко необходимо, не може да продъжите. ';
this is the message, why?
Post Reply