Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
include 'config.inc.php';
include 'opendb.php';
if(isset($_POST['btnSign']))
{
// get the input from $_POST variable
// trim all input to remove extra spaces
$name = trim($_POST['txtName']);
$email = trim($_POST['txtEmail']);
$url = trim($_POST['txtUrl']);
$message = trim($_POST['mtxMessage']);
if(!get_magic_quotes_gpc())
{
$name = addslashes($name);
$message = addslashes($message);
}
if ($url == 'http://')
{
$url = '';
}
//Badwords
$badwords = array('sex', 'porno', 'nutten');
$evil = false;
foreach ($badwords as $badword)
{
if (strstr($_POST["message"], $badword))
{
$evil = true;
}
}
if ($evil == false)
{
//gb eintrag
$zeit = time();
$query = "INSERT INTO $gb (name, email, url, message, entry_date) " .
"VALUES ('$name', '$email', '$url', '$message', '$zeit')";
mysql_query($query);
}
else
{
echo "keinen boesen Woerter bitte!!";
}
//shoutbox
$short_entry = substr($message, 0, strpos($message," ",50)).'<a href="index.php?kat=gbook"><br>[mehr im gb]</a>';
mysql_query("INSERT INTO $shoutbox (time, nick, txt) VALUES('".time()."', '$name', '$short_entry')");
mysql_query($query) or die('Error, query failed. ' . mysql_error());
header('Location: ' . $_SERVER['REQUEST_URI']);
}
<?php
include 'config.inc.php';
include 'opendb.php';
if(isset($_POST['btnSign'])){
// get the input from $_POST variable
// trim all input to remove extra spaces
$name= trim($_POST['txtName']);
$email = trim($_POST['txtEmail']);
$url = trim($_POST['txtUrl']);
$message = trim($_POST['mtxMessage']);
$zeit = time();
if(!get_magic_quotes_gpc()){
$name= addslashes($name);
$message = addslashes($message);
}
if ($url == 'http://'){
$url = '';
}
//Badwords
$badwords = array('sex', 'porno', 'nutten');
$evil = false;
foreach ($badwords as $badword){
if (strstr($_POST["message"], $badword)){
$evil = true;
}
}
if ($evil == false){
//gb eintrag
$sql = "INSERT INTO $gb (name, email, url, message, entry_date) VALUES ('$name', '$email', '$url', '$message', '$zeit')";
$query = mysql_query($sql);
//shoutbox
$short_entry = substr($message, 0, strpos($message," ",50)).'<a href="index.php?kat=gbook"><br>[mehr im gb]</a>';
$sql = "INSERT INTO $shoutbox (time, nick, txt) VALUES('".time()."', '$name', '$short_entry')";
$query = mysql_query($sql) or die('Error, query failed. ' . mysql_error());
header('Location: ' . $_SERVER['REQUEST_URI']);
} else {
echo "keinen boesen Woerter bitte!!";
}
}
?>
include 'config.inc.php';
include 'opendb.php';
if(isset($_POST['btnSign']))
{
$name = trim($_POST['txtName']);
$email = trim($_POST['txtEmail']);
$url = trim($_POST['txtUrl']);
$message = trim($_POST['mtxMessage']);
$zeit = time();
if(!get_magic_quotes_gpc())
{
$name = addslashes($name);
$message = addslashes($message);
}
if ($url == 'http://')
{
$url = '';
}
//Badwords
$badwords = array('sex', 'porno', 'nutten');
$evil = false;
foreach ($badwords as $badword)
{
if (strstr($_POST["message"], $badword))
{
$evil = true;
}
}
if ($evil == false)
{
//gb eintrag
$sql = "INSERT INTO $gb (name, email, url, message, entry_date) " .
"VALUES ('$name', '$email', '$url', '$message', '$zeit')";
$query = mysql_query($sql);
//shoutbox
$short_entry = substr($message, 0, strpos($message," ",50)).'<a href="index.php?kat=gbook"><br>[mehr im gb]</a>';
$sql = "INSERT INTO $shoutbox (time, nick, txt) VALUES('".time()."', '$name', '$short_entry')";
$query = mysql_query($sql) or die('Error, query failed. ' . mysql_error());
header('Location: ' . $_SERVER['REQUEST_URI']);
}
else
{
echo "keinen boesen Woerter bitte!!";
}
}
<?php
include 'config.inc.php';
include 'opendb.php';
function transform_gpc_variables( &$var )
{
if( is_array($var) ) {
foreach( $var as $key => $value ) {
$var[$key] = transform_gpc_variables($var);
}
}
if( is_string($var) ) {
$var = stripslashes($var);
}
return $var;
}
if( (bool) ini_get('magic_quotes_gpc') === true ) {
array_walk($_GET, 'transform_gpc_variables');
array_walk($_POST, 'transform_gpc_variables');
array_walk($_COOKIE, 'transform_gpc_variables');
}
if( isset($_POST['btnSign']) ) {
$_POST['txtName'] = trim($_POST['txtName']);
$_POST['txtEmail'] = trim($_POST['txtEmail']);
$_POST['mtxMessage'] = trim($_POST['mtxMessage']);
if( $_POST['txtUrl'] = trim($_POST['url']) && $_POST['txtUrl'] == 'http://' ) {
$_POST['txtUrl'] = '';
}
// Badwords
$badwords = array('sex', 'porno', 'nutten');
$evil = (bool) preg_match('/\b(?:' . implode('|', $badwords) .')\b/s', $_POST['message']);
if( $evil == false ) {
// Eintragen
$query = '
INSERT INTO
`'.$gb.'`
SET
`name` = "'.mysql_real_escape_string($_POST['txtName']).'",
`email` = "'.mysql_real_escape_string($_POST['txtEmail']).'",
`url` = "'.mysql_real_escape_string($_POST['txtUrl']).'",
`message` = "'.mysql_real_escape_string($_POST['mtxMessage']).'",
`entry_date` = '.time().'
';
$result = mysql_query($query);
// shoutbox
$short_entry = substr($_POST['mtxMessage'], 0, strpos($_POST['mtxMessage'], ' ', 50)).'<a href="index.php?kat=gbook"><br>[mehr im gb]</a>';
$query = '
INSERT INTO `'.$shoutbox.'` (`time`, `nick`, `txt`) VALUES ('.time().', "'.mysql_real_escape_string($_POST['name']).'", "'.mysql_real_escape_string($short_entry).'")';
$result = mysql_query($query)
or die('Error, query failed. ' . mysql_error());
header('Location: ' . $_SERVER['REQUEST_URI']);
} else {
echo 'Keinen bösen Wörter bitte!';
}
}
?>
loki2002 hat gesagt.:PHP:$datum = time()-60; $result = mysql_query("SELECT dataid FROM ohdata WHERE ddate>=$datum AND downer='$user'"); if(mysql_num_rows($result) == 1) { echo "Der Eintrag wurde bereits gespeichert"; }
so sollte es klappen.
<?
include("config.inc.php");
function format_message($post) {
global $smilies_ubb_array, $smilies_ort;
$post= addslashes($post);
$post= stripslashes($post);
$post= htmlspecialchars($post);
$post= trim($post);
// URLS in HRC umwandeln:
$post=eregi_replace("([ \r\n])http://([^ ,\r\n]*)","\\1[ url]http://\\2[ /url]",$post);
$post=eregi_replace("([ \r\n])[ url]https://([ /url][^ ,\r\n]*)","\\1[ url]https://\\2 [ /url]",$post);
$post=eregi_replace("([ \r\n])[ url]ftp://([ /url][^ ,\r\n]*)","\\1[ url]ftp://\\2[ /url]",$post);
$post=eregi_replace("([ \r\n])www\\.([^ ,\r\n]*)","\\1[ url]http://www.\\2[ /url]",$post);
$post=eregi_replace("^[ url]http://([ /url][^ ,\r\n]*)","[ url]http://\\1[ /url]",$post);
$post=eregi_replace("^[ url]https://([ /url][^ ,\r\n]*)","[ url]https://\\1[ /url]",$post);
$post=eregi_replace("^[ url]ftp://([ /url][^ ,\r\n]*)","[ url]ftp://\\1[ /url]",$post);
$post=eregi_replace("^www\\.([^ ,\r\n]*)","[ url]http://www.\\1[ /url]",$post);
// ######### HRC Codes:
$post = str_replace("[hr]","<hr>",$post);
$post=preg_replace("/\[b\](.*)\[\/b\]/iUms","<b>\\1</b>",$post);
$post=preg_replace("/\[i\](.*)\[\/i\]/iUms","<i>\\1</i>",$post);
$post=preg_replace("/\[s\](.*)\[\/s\]/iUms","<strike>\\1</strike>",$post);
$post=preg_replace("/\[u\](.*)\[\/u\]/iUms","<u>\\1</u>",$post);
//email link
$post=preg_replace("/\[email\](.*)\[\/email\]/msiU", "<a href=\"mailto:\\1\">\\1</a>", $post);
$post=preg_replace("/\[url\]www.(.*)\[\/url\]/iUms","<a href=\"http://www.\\1\" target=_blank>http://www.\\1</a>",$post);
$post=preg_replace("/\[url\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>->link</a>",$post);
// [URL=
$post=preg_replace("/\[url=(.*)\](.*)\[\/url\]/iUms","<a href=\"\\1\" target=_blank>\\2</a>",$post);
//code ausrichtung
$post=preg_replace("/\[code\](.*)\[\/code\]/msiU", "<blockquote><pre><smallfont>code:<hr>\\1<hr></blockquote></pre></smallfont>", $post);
//quote ausrichtung
$post=preg_replace("/\[quote\](.*)\[\/quote\]/msiU", "<blockquote><smallfont>quote:<hr>\\1<hr></blockquote></smallfont>", $post);
//pic anzeigen
$post=preg_replace("/\[img\](.*)\[\/img\]/iUms","<center><img src=\"\\1\" alt=\"bild\"></center>",$post);
// Farbiger Text
$post=preg_replace("/\[green\](.*)\[\/green\]/iUms","<span style=\"color:green\">\\1</span>",$post);
$post=preg_replace("/\[red\](.*)\[\/red\]/iUms","<span style=\"color:red\">\\1</span>",$post);
$post=preg_replace("/\[blue\](.*)\[\/blue\]/iUms","<span style=\"color:blue\">\\1</span>",$post);
$post=preg_replace("/\[white\](.*)\[\/white\]/iUms","<span style=\"color:white\">\\1</span>",$post);
// sub, sup
$post=preg_replace("/\[sub\](.*)\[\/sub\]/iUms","<sub>\\1</sub>",$post);
$post=preg_replace("/\[sup\](.*)\[\/sup\]/iUms","<sup>\\1</sup>",$post);
// ########## Ende HRC Codes
$post= nl2br($post);
return $post;
}
function format_title($post) {
$post= addslashes($post);
$post= stripslashes($post);
$post= htmlspecialchars($post);
return $post;
function foobar( $url )
{
return '[ url]' . str_replace('http://http://', 'http://', 'http://'.$url) . '[ /url]';
}
$urlPatterns = array(
// @link <url:http://www.foad.org/~abigail/Perl/url2.html>
'http' => "(?:(?:https?://)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@&=])*))?)?)",
'ftp' => "(?:[ url]ftp://(?:(?:(?:(?:(?:[ /url][a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[?:@&=])*))*)(?:;type=[AIDaid])?)?)",
'mailto' => "(?:mailto:(?:[a-zA-Z\d$\-_.+!*'(),;/?:@&=]|(?:%[a-fA-F\d]{2}))+)"
);
$pattern = '<(' . $urlPatterns['http'] . '|' . $urlPatterns['ftp'] . '|' . $urlPatterns['mailto'] . ')>';
$string = preg_replace($pattern, 'foobar("\1")', $string);
$string = preg_replace('<\[url\](.+?)\[/url\]>iUms', '<a href="\1">\1</a>', $string);
}
$ip ="$REMOTE_ADDR";
$link = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbtable, $link);
if($txtMessage!="" && $txtNickname!=""){
$txtMessage=format_message($txtMessage);
$txtNickname=format_title($txtNickname);
if(mysql_query("INSERT INTO $shoutbox (time, nick, txt,ip) VALUES('".time()."', '$txtNickname', '$txtMessage','$ip')")){
header("Location: http://www.stokesdesign.de/");
} }
$ausgabe = mysql_query("SELECT * FROM $shoutbox ORDER BY time DESC LIMIT 6");
?>
$io == 1; // in dem anschließenden SQL-Querry wird nur wenn $io immernoch 1 ist, der Querry ausgeführt
$spamschutz = strtoupper($_POST['inhalt']); // $_POST['inhalt'] ist der Inhalt des Formularfeldes, dass ich überprüfe
$sql_spamschutz = "SELECT * FROM spamschutz ORDER BY id";
$result_spamschutz = mysql_query($sql_spamschutz);
while ($reihe = mysql_fetch_assoc($result_spamschutz)) {
if (strstr($spamschutz, $reihe['spaminhalt']) != FALSE) {
echo 'Ihre Nachricht wurde als <font color="darkred">Spam</font> klassifiziert.';
$io = 0; // die $io Variable (In Ordnung) setz ich auf null, und der eintrag wird anschließend nur gespeichert, wenn $io = 1 ist.
}
}
if ($io == 1) {
//hier der Datenbankeintrag
}