{"absolute_url": "/voyeg3r/validade-e-mail-address/", "blog_post": false, "code": "\n4-11 Validating e-mail addresses\n\n\n
\n
\n

\nBad e-mail address. Please correct \".\n \"and resubmit the form
\";\n }\n}\n?>\n
\n\n\n", "created": "2009-05-18T11:33:14", "description": null, "description_rendered": "None", "embed_url": "https://snipt.net/embed/2b749870d3f451c3d5820ad26bf82eb5/", "full_absolute_url": "/voyeg3r/validade-e-mail-address/", "id": 5781, "lexer": "php", "line_count": 28, "log_entries": [], "meta": null, "modified": "2019-06-15T17:06:43.720777", "publish_date": null, "raw_url": "/raw/2b749870d3f451c3d5820ad26bf82eb5/", "resource_uri": "/api/public/snipt/5781/", "slug": "validade-e-mail-address", "stylized": "
 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27
<html>\n<head><title>4-11 Validating e-mail addresses</title></head>\n<style>\n    .err { color : red ; font-weight : bold }\n</style>\n<body>\n<form action="recipe4-11.php" method="post">\n<input type="text" name="input" /><br/>\n<input type="submit" value="Submit Form" /><br/><br/>\n<?php\nif ( $_SERVER['REQUEST_METHOD'] == "POST" )\n{\n    $input = $_POST['input'];\n    if ( preg_match( "/^[-\\w.]+@([A-z0-9][-A-z0-9]+\\.)+[A-z]{2,4}$/", $input ) )\n    {\n        # Do some processing here - input if valid\n    }\n    else\n    {\n        print "<span class=\\"err\\">Bad e-mail address. Please correct ".\n            "and resubmit the form</span><br/>";\n    }\n}\n?>\n</form>\n</body>\n</html>\n
\n
", "tags": [{"absolute_url": "/public/tag/php/", "id": 9, "name": "php", "resource_uri": "/api/public/tag/9/", "snipts": "/api/public/snipt/?tag=9"}], "title": "validade e-mail address", "user": {"absolute_url": "/voyeg3r/", "email_md5": "a5f3d249cc5053cdc1eb4ede60fd2f45", "id": 2390, "resource_uri": "/api/public/user/2390/", "snipts": "/api/public/snipt/?user=2390", "snipts_count": 107, "username": "voyeg3r"}}