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";
}
?>
Interpret Order
Hello all,I'm wondering if I have this:Code: $switch = array( 'one' => $this->RenderOne() ,'two' => $this->RenderTwo());Would php call the function
PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the password, Any help would be great.. Heres the code, It's suppose to log the username and the password,
Forms Authentication and Refresh at Login page
Hello,
help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when the user goes to Secret-Codes.php they get a menu and when they pick the phone they want to view it
Help with looping
I have a comma separated list of colors taken from a database ($ICo) and a directory of images named "color". The images are named the "color.jpg"I am attempting to loop through
for loop without same $i digits?
Hi, Can some guru please advise how can I accomplish this with a simple for loop ? I want to use for loop to echo all number from 000 to 999Quotefor($i=0;$i<1000;$i++){echo "$i";}My
Generate multilayered array from string.
ok so i have a string that looks like this:Code: [Select]blog:edit_all,delete_all|users:edit_all,delete_all|settingsand i want to make a code that can take that string and put it in a multi-layered
Displaying data from MySql a different way
Hi all,I'm pretty new to php and MySql and have hit a problem.I am able to display data in a table using the following code:<?php $database="MYDATABASE"; mysql_connect
Help with simple query
Hi, I'm trying to do a Query with a Union where I want to print the number of rows $tc contains. Can anyone see what's wrong with this:Code: $tc = @mysql_num_rows(mysql_query("(SELECT * FROM
Email Form Syntax Issue
I need the TO: in email to display To: CEO instead of To: abc@mail.comHow to alter the script below?Code: <?PHP$to = "abc@mail.com";$subject = "subject"; $headers =