|
Posted by Stefan Rybacki on 01/10/06 15:51
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Danny wrote:
> Thanks, but i still have problems,
>
> When i escape the htm file, i cant update it into the database: Without the
> preg_replace i get it into the database. Am i doing somthing wrong=
>
> Danny
>
> $par = mysql_real_escape_string(file_get_contents($p1));
> $rep = preg_replace("/<title>[^<]*</title>/","",$par);
Try it the other way around. First the replacement then the escaping. You should
escape your string just before you do the query. (I also just saw that the
regexp was wrong, there was a backslash missing before the slash in </title>.
$rep=file_get_contents($p1);
$rep = preg_replace("/<title>[^<]*<\/title>/","",$rep);
$rep = mysql_real_escape_string($rep);
$query = "UPDATE prog set datum='$datum',titel='$titel',p1='$rep' " ;
Regards
Stefan
>...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1rc2 (MingW32)
iD8DBQFDw7vKyeCLzp/JKjARAo4oAJ9Gj16O7pj3Qewx1RLmzly28i68ygCePpDa
p/0q4qb3mx6wvOfBirX4iH4=
=+Rs9
-----END PGP SIGNATURE-----
[Back to original message]
|