auriaks
11-05-2009, 08:24 PM
Hi, i have include.php
<?php
$culture = "Good luck searching! And thanks for coming.";
?>
where i write masseges and they appear i my webpage.
But, faced problem when i want to write someting in " " or ' '. It splits my variable. How i can write don't or "music" without any problems?
I will be thenkfull if someone could tell me how to fix the same problem in my mysql inserting php script:
<?php
//connect to the database
$connect = mysql_connect("","","") or die("Error connecting to db");
//select table
mysql_select_db("") or die("Error selecting db");
$date = date("Y-m-d");
$time = date("H:i:s");
$type = $_POST['type'];
if($_POST['product'] == '') {
$error .= "<li>None or same product</li>";
}
if($_POST['about'] == '') {
$error .= "<li>Insert your description</li>";
}
if($_POST['url'] == '') {
$error .= "<li>Insert link</li>";
}
if(isset($_POST['submit'])) {
if(isset($error)) {
echo '<font color="#ff0000">Cant insert. Mistakes:';
echo '<ol>'.$error.'</ol></font>';
} else {
echo '<font color="Green">Inserted!</font>';
mysql_query("INSERT INTO this (product, about, date, time, url)
VALUES('$_POST[product]', '$_POST[about]', '$date', '$time', '$_POST[url]')") or die(mysql_error());
}
}
?>
Thanks a LOT :)
<?php
$culture = "Good luck searching! And thanks for coming.";
?>
where i write masseges and they appear i my webpage.
But, faced problem when i want to write someting in " " or ' '. It splits my variable. How i can write don't or "music" without any problems?
I will be thenkfull if someone could tell me how to fix the same problem in my mysql inserting php script:
<?php
//connect to the database
$connect = mysql_connect("","","") or die("Error connecting to db");
//select table
mysql_select_db("") or die("Error selecting db");
$date = date("Y-m-d");
$time = date("H:i:s");
$type = $_POST['type'];
if($_POST['product'] == '') {
$error .= "<li>None or same product</li>";
}
if($_POST['about'] == '') {
$error .= "<li>Insert your description</li>";
}
if($_POST['url'] == '') {
$error .= "<li>Insert link</li>";
}
if(isset($_POST['submit'])) {
if(isset($error)) {
echo '<font color="#ff0000">Cant insert. Mistakes:';
echo '<ol>'.$error.'</ol></font>';
} else {
echo '<font color="Green">Inserted!</font>';
mysql_query("INSERT INTO this (product, about, date, time, url)
VALUES('$_POST[product]', '$_POST[about]', '$date', '$time', '$_POST[url]')") or die(mysql_error());
}
}
?>
Thanks a LOT :)