my code stock.com

Snippet options

Download: Download snippet as php-link-ueberpruefung.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>php Linkerkennung</title>
</head>
<body>
<?php
			if (isset($_POST['submit']))
			{
				$link = mysql_real_escape_string($_POST['url']);
				if (empty($link) or $link =="")
				{ 
					$error_msg = "Die Url ist nicht richtig (1)";
				}
				else
				
				
				{	
					if (strpos(strtolower($link), "www.google.de/user/") == true)
						{
						$link_sorte = "1"; echo"1"; exit;
						}
					if (strpos(strtolower($link), "www.youtube.com/user/") == true)
						{
						$link_sorte = "2";echo"2"; exit;
						}
					
					$error_msg = "Die Url ist nicht richtig (2)";
				}
			}
?>
 <?php if(isset($error_msg) && !empty($error_msg)) : ?><br><br>
        <div style="border:2px solid #F33;background-color: #C00; padding: 10px; ">
            <?php echo $error_msg; ?>
        </div><br><br>
        <?php endif; ?>


        <?php if(isset($success_msg) && !empty($success_msg)) : ?><br><br>
        <div style="border:2px solid #3F3;background-color: #390; padding: 10px; ">
            <?php echo $success_msg; ?>
        </div><br><br>
        <?php endif; ?>
<form  method="post">
<fieldset>
<input type="text" value="" name="url" />
<input type="submit" value="absenden" name="submit"  />
</fieldset>
</form>

</body>
</html>
<br>

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.