Jump to content

Preg_match issue


hotaru

Recommended Posts

[a href=\"http://localhost/test.php?p=icons\" target=\"_blank\"]http://localhost/test.php?p=icons[/a]

works for me.

test.php:
[code]
<?php
$pattern = '/^[a-z0-9]*$/i';
if (!preg_match($pattern, trim($_GET["p"])) || strlen(trim($_GET["p"]) == 0))
{
echo "<html><body>fails</body></html>";
exit;
}
echo "<html><body>success</body></html>";
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/6782-preg_match-issue/#findComment-24868
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.