Jump to content
Larry Ullman's Book Forums

Recommended Posts

In the following code I am validating a url in a practice page I am using from the stuff I learned in the book­. When I enter an invalid url in my form, I get an $url undefined error when running the code below. I am guessing the error is pretty easy to spot, but I am new at this. 


if (filter_var($scrubbed['url'], FILTER_VALIDATE_URL)){

$url = mysqli_real_escape_string($dbc, $scrubbed['url']);

} else {

echo '<p class="error">Please enter a valid url</p>';


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...