Jump to content

query help


aseaofflames

Recommended Posts

im having problems geting my script to insert values into my database

[code]
function addtosql($date, $ip, $name, $comments) {
if($name=="") $name = "Anonymous";
include('connect.php');
$check = str_replace('[video]','',$comments);
if($check!==$comments) {
$video = explode('[video]', $comments);
$videos = explode('[/video]', $video[0]);
$videourl = $videos[0];
$url = createasx($videourl);
if(file_exists($videourl)) {
$comments = $video[0]."[video]".$url."[/video]".$videos[1];
$comments = nl2br($comments);
$sql = "INSERT INTO guestbook VALUES ('', '$date', '$ip', '$name', '$comments')";
$result = mysql_query($sql);
}
}
elseif($check==$comments) {
$comments = nl2br($comments);
$sql = "INSERT INTO guestbook VALUES ('', '$date', '$ip', '$name', '$comments')";
$result = mysql_query($sql);
    }
elseif(!file_exists($videourl)) {
echo "Video Does Not Exist";
}
}

if (isset($comment) && $comment!=="") {
$date = date("m-d-Y");
$name = $_POST['name'];
$ip = $_SERVER['REMOTE_ADDR'];
$comments = $_POST['comment'];
if(censor('$comments')=="explict") { echo "<div align='center'><font size='-1'><b>This Comment Contains Language Not Suitable For This Site!</b></font></div>"; }
else {
addtosql('$date', '$ip', '$name', '$comments');
echo "<div align='center'>Comment Added. <a href='index.php'>Click Here</a></div><br>";
}
}
[/code]
any help is greatly appricated
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.