note 42585 added to function.ereg

From: Date: Sat, 22 May 2004 06:39:56 +0000
Subject: note 42585 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-69936@lists.php.net to get a copy of this message
mabe somebody can help me with this pattern... <? function check_host($host) { if (ereg("^http://([a-z0-9]{2,}\.[_a-z0-9-])+", $host)) { return true; } else { return false; } } if (isset($_POST['host'])) { if (check_host($_POST['host'])) { echo "Valid URL..."; } else { echo "Invalid URL..."; } } echo '<form name="FormPost" action="'.$_SERVER[PHP_SELF].'" method="post">'; echo '<input type="text" name="host" size="40" maxlength="256">'; echo '<input type="submit" value="Go!">'; echo '</form>'; ?> ---- Manual Page -- http://www.php.net/manual/en/function.ereg.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42585 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42585&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42585&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69936) next »