cleanup, register in one file
This commit is contained in:
		
							parent
							
								
									e6b84035e1
								
							
						
					
					
						commit
						68e4b418fd
					
				
							
								
								
									
										46
									
								
								register.php
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								register.php
									
									
									
									
									
								
							@ -1,9 +1,48 @@
 | 
			
		||||
<?php
 | 
			
		||||
include 'header.php';
 | 
			
		||||
 | 
			
		||||
if($_POST['email'] && $_POST['nick'] && $_POST['how']) {
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<article>
 | 
			
		||||
Hej
 | 
			
		||||
<strong>
 | 
			
		||||
<?= htmlspecialchars($_POST['nick']); ?>
 | 
			
		||||
</strong>!
 | 
			
		||||
<br><br>
 | 
			
		||||
Otrzymaliśmy twój formularz rejestracji. Oczekuj na dalsze informacje na swojej skrzynce mailowej. :) Odpowiedź może potrwać kilka dni, w zależności od oczekującej liczby użytkowników.
 | 
			
		||||
</article>
 | 
			
		||||
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
    $nick=htmlspecialchars($_POST["nick"]);
 | 
			
		||||
    $email=htmlspecialchars($_POST["email"]);
 | 
			
		||||
    $url=htmlspecialchars($_POST["url"]);
 | 
			
		||||
    $who=htmlspecialchars($_POST["who"]);
 | 
			
		||||
    $how=htmlspecialchars($_POST["how"]);
 | 
			
		||||
    $interests=htmlspecialchars($_POST["interests"]);
 | 
			
		||||
 | 
			
		||||
    $to      = 'smoorg@tylda.org';
 | 
			
		||||
    $subject = 'Rejestracja usera' . "$nick";
 | 
			
		||||
    $message = "Nick: $nick\n" . 
 | 
			
		||||
	"Email: $email\n" .
 | 
			
		||||
	"Url: $url\n" .
 | 
			
		||||
	"Opowiedz coś na swój temat: $who\n" .
 | 
			
		||||
	"Jak do nas trafiłeś?: $how\n" .
 | 
			
		||||
	"Zainteresowania: $interests\n"
 | 
			
		||||
	;
 | 
			
		||||
    $headers = array(
 | 
			
		||||
        'From' => 'noreply@tylda.org',
 | 
			
		||||
        'Reply-To' => 'noreply@tylda.org',
 | 
			
		||||
        'X-Mailer' => 'PHP/' . phpversion()
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    mail($to, $subject, $message, $headers);
 | 
			
		||||
} else {
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
Poniższy formularz trafi do naszych administratorów, którzy go ocenią. Potraktuj go częściowo jako antyspam. Chcemy sensownych odpowiedzi na poniższe pytania. Posiadanie własnej strony też jest na duży plus.
 | 
			
		||||
<form action="register_post.php" method="POST">
 | 
			
		||||
<form action="register.php" method="POST">
 | 
			
		||||
<div class="form-row">
 | 
			
		||||
    <label>Email*</label>
 | 
			
		||||
    <input name="email" type="email" required>
 | 
			
		||||
@ -40,3 +79,8 @@ Poniższy formularz trafi do naszych administratorów, którzy go ocenią. Potra
 | 
			
		||||
<button type="submit">Submit</button>
 | 
			
		||||
</div>
 | 
			
		||||
</form>
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
@ -1,38 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
include 'header.php';
 | 
			
		||||
?>
 | 
			
		||||
 | 
			
		||||
<article>
 | 
			
		||||
Hej 
 | 
			
		||||
<strong>
 | 
			
		||||
<?= htmlspecialchars($_POST['nick']); ?>
 | 
			
		||||
</strong>!
 | 
			
		||||
<br><br>
 | 
			
		||||
Otrzymaliśmy twój formularz rejestracji. Oczekuj na dalsze informacje na swojej skrzynce mailowej. :) Odpowiedź może potrwać kilka dni, w zależności od oczekującej liczby użytkowników.
 | 
			
		||||
</article>
 | 
			
		||||
 | 
			
		||||
<?php
 | 
			
		||||
    $nick=htmlspecialchars($_POST["nick"]);
 | 
			
		||||
    $email=htmlspecialchars($_POST["email"]);
 | 
			
		||||
    $url=htmlspecialchars($_POST["url"]);
 | 
			
		||||
    $who=htmlspecialchars($_POST["who"]);
 | 
			
		||||
    $how=htmlspecialchars($_POST["how"]);
 | 
			
		||||
    $interests=htmlspecialchars($_POST["interests"]);
 | 
			
		||||
 | 
			
		||||
    $to      = 'smoorg@tylda.org';
 | 
			
		||||
    $subject = 'Rejestracja usera' . "$nick";
 | 
			
		||||
    $message = "Nick: $nick\n" . 
 | 
			
		||||
	"Email: $email\n" .
 | 
			
		||||
	"Url: $url\n" .
 | 
			
		||||
	"Opowiedz coś na swój temat: $who\n" .
 | 
			
		||||
	"Jak do nas trafiłeś?: $how\n" .
 | 
			
		||||
	"Zainteresowania: $interests\n"
 | 
			
		||||
	;
 | 
			
		||||
    $headers = array(
 | 
			
		||||
        'From' => 'noreply@tylda.org',
 | 
			
		||||
        'Reply-To' => 'noreply@tylda.org',
 | 
			
		||||
        'X-Mailer' => 'PHP/' . phpversion()
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    mail($to, $subject, $message, $headers);
 | 
			
		||||
?>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user