hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it to be posted.
this is my current php, any help would be very much appreciated! thanks.
Code:
<?php
$comment=$_POST['comment'];
$name=$_POST['name'];
$email=$_POST['email'];
$website=$_POST['website'];
$date=date("y/m/d h:i:s");
if($name && $email && $comment){
$sql="INSERT INTO `comments` (`name`, `email`, `website`, `articleid`, `comment`, `datetime`) VALUES ('$name', '$email', '$website', '$id', '$comment', '$date')";
$result=mysql_query($sql) or die(mysql_error());
if($result){
echo "Your comment was posted succesfully on the article n";
echo $rows['title'];
echo '<p><a href="view_article.php?id=';
echo $id;
echo '">Click here to go back to the article.</a></p>';
}else {
echo "Sorry, your comment could not be posted. Please make sure you fill in all the fields marked with *.n";
}
}else {
echo "Sorry, your comment could not be posted. Please make sure you fill in all the fields marked with *.n";
}
?>
php and downloading
I want to use a php script to create two files. Then I want it to redirect (or whatever) to have those files download together. Can I have it download a folder? Or maybe have it create a zip/rar file
Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order to update my site. I decided to make a form that only I should have access to that PHP can filter and
PHP Tab Control
Hi All,I would like to have PHP tab control with/without Javascript. But I want to retrieve some information from database server when clicking on a tab. Any body had used this kind of tab?Any help
Firewall / visited websites logger
Hi.
IP question
ive got 2 ip addresses both global from same user how would i detect if they are local to each other
help countdown timers
hello every one,I'd like to know how to insert many countdowns in the same page.The duration of each must be different and defined by members with a form.
tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the end i need to somehow tell it to skip the rows that have nothing on them:Code: <?php // define
matching numbers inside ( )
I know I can match numbers by just [0-9]+, so I thought matching numbers inside ( ) would be something like Code: [Select]/\([0-9]+\)/, but that doesn't work Can someone correct me please?
mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily MySQL, we used the Microsoft variety in school). I have a weird problem, I'm trying to create a
division gives infinity anser
int main(){ int z=0; int i=1/z; cout<<i;}It doesn't throw any error in Visual Studio 2008. .......What setting one has to change so that it will show runtime error in VS 2008.....