Am o pagina de exemplu adaugamp3.php si acolo vreau sa pun restrictie la unele cuvinte sa nu se poata pune la titlu.
Mai exact cand adaug o melodie si pun in titlu cuvantul "muzica" sa nu se poata adauga ...
Am incercat sa pun asa
Cod: Selectaţi tot
if($_POST['mamapegheata'] !== $cenzura($_POST['mamapegheata'])){
$cenzura=array("meta", "script", "iframe" );
$inlocuire_cu="***";
for ($i=0; $i< count($cenzura); $i++) {
$text=str_replace($cenzura[$i], $inlocuire_cu, $text);
}
return $text;
}
Cod orginal din pagina:
Cod: Selectaţi tot
<?php
error_reporting(0);
include('functions.php');
include('config.php');
include('../include/session.php');
if($session->isAdmin()){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Adauga fisiere</title>
</head>
<table width="565" cellpadding="1" cellspacing="1" style="margin-left:10px">
<tr>
<td align="center">
<?php
include('config.php');
$con=mysql_pconnect($server,$user,$pass);
if (!con)
{
die('Cannot connect to mysql ' . mysql_error());
}
mysql_select_db($db);
if(isset($_POST['submit']))
{
$categorie=$_POST['categorie'];
$title=$_POST['mamapegheata'];
$link=$_POST['link'];
$link2=$_POST['link2'];
$link3=$_POST['link3'];
$linkpoza=$_POST['linkpoza'];
$linkplayer=$_POST['linkplayer'];
$descriere=$_POST['descriere'];
$tags=$_POST['bunicatag'];
$uploader=$session->username;
$ip=$_SERVER['REMOTE_ADDR'];
echo $_POST['bunicatag'];
$q="INSERT INTO melodie (titlu, categorie, data_ad, link, link2, link3, linkpoza, linkplayer, descriere, tags, uploader)
VALUES ('$title','$categorie',NOW(),'$link','$link2','$link3','$linkpoza','$linkplayer','$descriere','$tags','$uploader')";
mysql_query($q) or die (mysql_error());
echo "<font color='green'><center>Fisier adaugat cu succes !!</center></font><br />
<meta http-equiv='refresh' content='2' URL='http://www.lamuzica.net/admin/addmuzica.php'></a><br>";
} else {
?>
<form action="adaugamuzica.php" method="post">
<tr>
<td width="120"><font size='2'>Nume:</td>
<td><input type="text" name="mamapegheata" id="mamapegheata" size="65"></textarea></td>
<tr>
<td><font size='2'>Categorie:</td>
<td><select name="categorie">
<option value="romaneasca">Romaneasca</option>
<option value="straina">Straina</option>
<option value="manele">Manele</option>
<option value="house">House</option>
<option value="videoclipuri">Videoclipuri</option>
<option value="albume">Albume</option>
<option value="colinde">Colinde</option>
<option value="programe">Programe</option>
<option value="filme">Filme</option>
</select></td>
</tr>
<tr>
<td><font size='2'>Download Link 1:</td>
<td><input type="text" name="link" size="65" /></td>
</tr>
<tr>
<td><font size='2'>Download Link 2:</td>
<td><input type="text" name="link2" size="65" /></td>
</tr>
<tr>
<td><font size='2'>Download Link 3:</td>
<td><input type="text" name="link3" size="65" /></td>
</tr>
<tr>
<td><font size='1' color="#FF0000"><b>Link ZippyShare, Player:</b></font></td>
<td><input type="text" name="linkplayer" size="65" /></td>
</tr>
<tr>
<td><font size='2'>Link Poza Album:</td>
<td><input type="text" name="linkpoza" size="65" /></td>
</tr>
<tr>
<td><font size='2'>Descriere Album:</td>
<td>
<textarea name="descriere" rows="10" cols="48" size="65" /></textarea></td>
</tr>
<tr>
<td><font size='2'>Tags:</td>
<td><input type="text" name="bunicatag" size="65" /></td>
</tr>
<tr>
<td><font size='2'></td>
<td><input type="submit" name="submit" value="Publica Fisierul" /> <input type="reset" value="Reseteaza Campurile!"></td>
</tr>
</tr>
</form>
</td>
</tr>
<?php
}
mysql_close();
}?>
</table>