Well, I've run into a bit of a problem... I'm putting together my first PHP/MySQL combo page. I've got a form to input URLs, which in turn, are inserted into a database, and displayed on my page. I'm trying to check the input from the form to make sure "http://" was typed, and some other stuff. Here's where the bug seems to be hiding:
if (ereg(".", $url_new) == 1 && ereg(".", $url_description_new) == 1) {
// Check url_new for the "http://" part.
if (ereg("\http://", $url_new) == 1 && ereg("\http://", $url_new) == 0) {
header ("Location: list_edit.php?do=add&bad=no_http");
}
}
This should be checking if something is in both $url_new and $url_description_new, then checking for http://. If http:// isn't there, it should redirect to an error message on the form. Unfortunately, even if there is no http:// in the address, it is still put into the database.. Any ideas?