Jump to content

*RESOLVED* Unknown modifier for function.preg-match?


JJohnsenDK

Recommended Posts

Hey

I'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 29

Warning: 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.

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.