JJohnsenDK Posted November 17, 2006 Share Posted November 17, 2006 HeyI'm duing a registration script where the users should be able to register thier website adresse. Im trying to get the code to sort out some stuff for eksempel blank fields. But this error appears when i run the script:[quote]Warning: preg_match() [function.preg-match]: Unknown modifier '/' in C:\Programmer\xampp\htdocs\blog\register.php on line 29Warning: Cannot modify header information - headers already sent by (output started at C:\Programmer\xampp\htdocs\blog\register.php:29) in C:\Programmer\xampp\htdocs\blog\register.php on line 64[/quote]Now the scripts actually does what it is supose to, it adds all info in MySql database. But why this error the browser comes up with ??? Here is the code:[code]if ($_POST['website'] != '' & !preg_match("/^(http|ftp):///", $_POST['website'])) { $_POST['website'] = 'http://'.$_POST['website'];}[/code]Line 29 is the first line in the code. Hope someone can help. Link to comment https://forums.phpfreaks.com/topic/27631-resolved-unknown-modifier-for-functionpreg-match/ Share on other sites More sharing options...
printf Posted November 17, 2006 Share Posted November 17, 2006 use backslashes on '/' or change your enclosing brackets![code]if ($_POST['website'] != '' & !preg_match("/^(http|ftp)\:\/\//", $_POST['website'])) { $_POST['website'] = 'http://'.$_POST['website'];}[/code] Link to comment https://forums.phpfreaks.com/topic/27631-resolved-unknown-modifier-for-functionpreg-match/#findComment-126364 Share on other sites More sharing options...
JJohnsenDK Posted November 17, 2006 Author Share Posted November 17, 2006 Danm i love this forum. Unbelieveable fast replys and they actually helps ;DThanks alot mate! Link to comment https://forums.phpfreaks.com/topic/27631-resolved-unknown-modifier-for-functionpreg-match/#findComment-126368 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.