Премини към съдържанието
Форумът в приложение

По-лесно сърфиране. Научи повече.

Kaldata.com - Форуми

Приложение на форума на цял екран с push известия, значки и други.

За да инсталирате това приложение на iOS и iPadOS
  1. Докоснете Иконата за споделяне в Safari
  2. Превъртете менюто и докоснете Добавяне към началния екран.
  3. Докоснете Добавяне в горния десен ъгъл.
За да инсталирате това приложение на Android
  1. Докоснете менюто с 3 точки (⋮) в горния десен ъгъл на браузъра.
  2. Докоснете Добавяне към началния екран или Инсталиране на приложение.
  3. Потвърдете, като докоснете Инсталиране.

Добре дошли!

Добре дошли в нашите форуми, пълни с полезна информация. Имате проблем с компютъра или телефона си? Публикувайте нова тема и ще намерите решение на всичките си проблеми. Общувайте свободно и открийте безброй нови приятели.

Моля, регистрирайте се за да публикувате тема и да получите пълен достъп до всички функции.

 

Моля за готова контакт форма, която да представлява

Featured Replies

едно поленце за въвеждане на потребителски e-mail, едно за съдържание на запитването и едно бутонче изпрати :tease:

Заповядай, мисля ще това искаш...

<?php

if($_POST['send']){


	$name = $_POST['name'];

	$email_na = "[email protected]"; // Email на получателя

	$email = $_POST['email'];

	$message = $_POST['message'];

	$subject = "Ново съобщение от $name";

	$send = mail($email_na, $subject, $message, "From: $email");


		if($send == TRUE){

			echo "Благодаря, Вашето съобщение е изпратено успешно!";

		}


}

?>


<form action="" method="post">

Вашият Email:

<br />

<input name="email" type="text" />

<br />

Съобещение:

<br />

<textarea name="message" cols="30" rows="5"></textarea>

<br />

<input name="send" type="submit" value="изпрати" />

</form>

  • Автор

всичко хубаво, но ми дава грешка на реда:

if($_POST['send']){

<!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>

<title>Josh's Nearly Perfect Form Example</title>

<style>

body{

	background: #fff;

	font-size:16px;

}

a{

  text-decoration:none;

}


.container{

	width:950px;

	margin-left:auto;

	margin-right:auto;

}

.enter{

	position:relative;

	top:120px;

	height:250px;

	width:400px;

	margin-left:auto;

	margin-right:auto;

	padding:24px;

}


.footer{

	border-top:1px #ccc;

	width: 960px;

	position:absolute;

	bottom:0;

}

.head{

	font-size:22px;

	font-family:Verdana, Rockwell, Arial, Helvetica, sans-serif;

	font-weight:bold;

	padding-top:8px;

}

</style>


<body onload="document.form.name.focus()">


<div class="container">

<div>


<?php

// This will only process the form if the form has been posted to it.

if($_SERVER['REQUEST_METHOD']=='POST') {



	if($_POST['email']){

				/* there was something entered, but was it an email? */

		$email = $_POST['email'];

		/* $e = email pattern */

				$e = "/^[-+\\.0-9=a-z_]+@([-0-9a-z]+\\.)+([0-9a-z]){2,4}$/i";

		//

		if(!preg_match($e, $email)){

		/* then the email doesn't match the pattern */

				$error[] = "Your email address isn't valid";

		}else{

				$_SESSION['email'] = $email;

			}

	}else{

		$error[] = "You need to enter your email address.";

	}

	if($_POST['message']){

		/* We've got something, so let's check for spammers */

				if(substr_count($_POST['message'],'<') > 1 || substr_count($_POST['message'],'>') > 1){

			$error[] = "You bad, bad spammer, you. Stop submitting links or I'll hunt you down.";

		}else{

			$message = $_POST['message'];

			$_SESSION['message'] = $message;

		}

	}else{

		$error[] = "You need to enter a message.";

	}

	/* ok, if we have an error, then we need to show them to the user, but also keep the valid data in the form and just delete the data that didn't pass validation */

		if($error){

		foreach($error as $e){

			echo "<b>" . $e . "</b><br>";

		}

	}else{

		/* We passed validation so kill the session (you may not want to do this if you're using sessions on your site. You can just unset the session variables we set above. */

				$_SESSION = array();

				/* wrap the message every 70 characters for readability */

		$message = wordwrap($message, 70);

		/* This is a little silly, but you never know about spammers, so let's remove the gt & lt signs from the message just in case */

				$message = str_replace("<","",$message);

		$message = str_replace(">","",$message);

		/* and while we're at it, let's remove their URL openings too */

				$message = str_replace("http://","",$message);

		$message = str_replace("www.","",$message);

		/* Now that the message is scrubbed, add the IP address to the end of it so that we can block anyone that overmails us */

				$message = $message . "\n" . $_SERVER['REMOTE_ADDR'];

				/* Pretty standard stuff from here on out */

		$headers  = 'MIME-Version: 1.0' . "\r\n";

		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


		/* Additional headers, change out the two [email protected] references for your email! */

		$headers .= "To: Joshua <[email protected]>" . "\r\n";

		$headers .= "From: $email" . "\r\n" . "Reply-To: $email" . "\r\n";


		mail("[email protected]","Message from the Nearly Perfect Form",$message,$headers);

		echo "Thanks for the message!";

	}

}

?></div>

<div class="enter" align="center">

<form name="form" method="post" action="contact.php">

<div align="center" class="head">Contact Us</div>

<br />

<table>

<tr><td><div align="right">Your Email</div></td><td><div align="left">

  <input name="email" size="30" maxlength="70" value="<?=$_SESSION['email'];?>" />

  *</div></td></tr>

<tr><td valign="top"><div align="right">Message</div></td><td><div align="left">

  <text area name="message" cols="26" rows="4"><?=$_SESSION['message'];?></text area>

  *</div></td></tr>

<tr><td> </td><td><div align="left">

  <input type="submit" value="Send Message" />

</div></td></tr></table>

</form>

</div>

<div class="footer" align="center">

		<div class="clear"> </div>

</div>

</div>

</body>

</html>

<!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>

<title>Josh's Nearly Perfect Form Example</title>

<style>

body{

	background: #fff;

	font-size:16px;

}

a{

  text-decoration:none;

}


.container{

	width:950px;

	margin-left:auto;

	margin-right:auto;

}

.enter{

	position:relative;

	top:120px;

	height:250px;

	width:400px;

	margin-left:auto;

	margin-right:auto;

	padding:24px;

}


.footer{

	border-top:1px #ccc;

	width: 960px;

	position:absolute;

	bottom:0;

}

.head{

	font-size:22px;

	font-family:Verdana, Rockwell, Arial, Helvetica, sans-serif;

	font-weight:bold;

	padding-top:8px;

}

</style>


<body onload="document.form.name.focus()">


<div class="container">

<div>


<?php

// This will only process the form if the form has been posted to it.

if($_SERVER['REQUEST_METHOD']=='POST') {



	if($_POST['email']){

				/* there was something entered, but was it an email? */

		$email = $_POST['email'];

		/* $e = email pattern */

				$e = "/^[-+\\.0-9=a-z_]+@([-0-9a-z]+\\.)+([0-9a-z]){2,4}$/i";

		//

		if(!preg_match($e, $email)){

		/* then the email doesn't match the pattern */

				$error[] = "Your email address isn't valid";

		}else{

				$_SESSION['email'] = $email;

			}

	}else{

		$error[] = "You need to enter your email address.";

	}

	if($_POST['message']){

		/* We've got something, so let's check for spammers */

				if(substr_count($_POST['message'],'<') > 1 || substr_count($_POST['message'],'>') > 1){

			$error[] = "You bad, bad spammer, you. Stop submitting links or I'll hunt you down.";

		}else{

			$message = $_POST['message'];

			$_SESSION['message'] = $message;

		}

	}else{

		$error[] = "You need to enter a message.";

	}

	/* ok, if we have an error, then we need to show them to the user, but also keep the valid data in the form and just delete the data that didn't pass validation */

		if($error){

		foreach($error as $e){

			echo "<b>" . $e . "</b><br>";

		}

	}else{

		/* We passed validation so kill the session (you may not want to do this if you're using sessions on your site. You can just unset the session variables we set above. */

				$_SESSION = array();

				/* wrap the message every 70 characters for readability */

		$message = wordwrap($message, 70);

		/* This is a little silly, but you never know about spammers, so let's remove the gt & lt signs from the message just in case */

				$message = str_replace("<","",$message);

		$message = str_replace(">","",$message);

		/* and while we're at it, let's remove their URL openings too */

				$message = str_replace("http://","",$message);

		$message = str_replace("www.","",$message);

		/* Now that the message is scrubbed, add the IP address to the end of it so that we can block anyone that overmails us */

				$message = $message . "\n" . $_SERVER['REMOTE_ADDR'];

				/* Pretty standard stuff from here on out */

		$headers  = 'MIME-Version: 1.0' . "\r\n";

		$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


		/* Additional headers, change out the two [email protected] references for your email! */

		$headers .= "To: Joshua <[email protected]>" . "\r\n";

		$headers .= "From: $email" . "\r\n" . "Reply-To: $email" . "\r\n";


		mail("[email protected]","Message from the Nearly Perfect Form",$message,$headers);

		echo "Thanks for the message!";

	}

}

?></div>

<div class="enter" align="center">

<form name="form" method="post" action="contact.php">

<div align="center" class="head">Contact Us</div>

<br />

<table>

<tr><td><div align="right">Your Email</div></td><td><div align="left">

  <input name="email" size="30" maxlength="70" value="<?=$_SESSION['email'];?>" />

  *</div></td></tr>

<tr><td valign="top"><div align="right">Message</div></td><td><div align="left">

  <textarea name="message" cols="26" rows="4"><?=$_SESSION['message'];?></textarea>

  *</div></td></tr>

<tr><td> </td><td><div align="left">

  <input type="submit" value="Send Message" />

</div></td></tr></table>

</form>

</div>

<div class="footer" align="center">

		<div class="clear"> </div>

</div>

</div>

</body>

</html>

Имало е по един излишен интервал в textarea

Редактирано от Ken (преглед на промените)

Регистрирайте се или влезете в профила си за да коментирате

Разглеждащи това в момента 0

  • Няма регистрирани потребители разглеждащи тази страница.

Дарение

  • Подкрепи съществуването на форума - направи дарение
    32%
    Дарени 315 € от нужните 1 000 €

Бюлетин

Получавайте известие, когато има важна промяна или новина свързана с форума.

Профил

Навигация

Търсене

Търсене

Конфигуриране на push известия в браузъра

Chrome (Android)
  1. Докоснете иконата на катинар до адресната лента.
  2. Докоснете Разрешения → Известия.
  3. Променете предпочитанията си.
Chrome (Desktop)
  1. Кликнете върху иконата на катинар в адресната лента.
  2. Изберете Настройки на сайта.
  3. Намерете Известия и коригирайте предпочитанията си.