Click here to Skip to main content
15,887,683 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Return list of object from a Class Pin
awedaonline6-Dec-11 1:01
awedaonline6-Dec-11 1:01 
QuestionInstalling GD2 with PHP on linux Pin
jiksaw2135-Dec-11 14:41
jiksaw2135-Dec-11 14:41 
QuestionMulti lingual Wordpress site Pin
CodingLover1-Dec-11 1:07
CodingLover1-Dec-11 1:07 
AnswerRe: Multi lingual Wordpress site Pin
Mohibur Rashid1-Dec-11 19:09
professionalMohibur Rashid1-Dec-11 19:09 
GeneralRe: Multi lingual Wordpress site Pin
CodingLover5-Dec-11 19:26
CodingLover5-Dec-11 19:26 
GeneralRe: Multi lingual Wordpress site Pin
Peter_in_27805-Dec-11 19:58
professionalPeter_in_27805-Dec-11 19:58 
GeneralRe: Multi lingual Wordpress site Pin
Mohibur Rashid5-Dec-11 20:20
professionalMohibur Rashid5-Dec-11 20:20 
QuestionPHP Form is not working. Pin
mkukulka30-Nov-11 21:23
mkukulka30-Nov-11 21:23 
Hi everyone,

I have problem with form at my site. When you fill the text boxes it works fine but when you click SEND, the site is refreshing, form is clear and no message has been sent. My knowledge about PHP is very low. I found the tutorial which shows how to make that kind of form.

form is on this site --> www.hogar-biokominki.pl/jak_kupic.html

I have 3 files which operate the form.

first file: formularz.php
PHP
<div class="form" >
	  <form action="jak_kupic.php" method="post" id="form1">
      <input type="hidden" name="sender" value="true">
            
              Formularz kontaktowy
              
              <label for="imieinazwisko">Imię i Nazwisko:</label>
              <input name="imieinazwisko" type="text" id="imieinazwisko" tabindex="1" maxlength="30">
              Pole wymaganeZa mało znaków
              
              <label for="adresemail2">Adres e-mail:</label>
              <input type="text" name="adresemail" id="adresemail2" tabindex="2">
              Błędny adres emailBłędny adres e-mail
              
                <label for="walidacjaemail">Podaj ponownie e-mail:</label>
                <input type="text" name="walidacjaemail" id="walidacjaemail" tabindex="3">
                Pole wymaganeAdres się nie zgadza
              
              
              <label for="numertelefonu">Telefon:</label>
              <input type="text" name="numertelefonu" id="numertelefonu" tabindex="4">
              Niewłaściwy numerNiewłaściwy numerZa mało cyfr
              
                <label for="miasto">Miasto:</label>
                <input name="miasto" type="text" id="miasto" tabindex="5" maxlength="15">
              
              
              
              <label for="wiadomosc2">Wiadomość:</label>
              <textarea name="wiadomosc" id="wiadomosc2" cols="45" rows="5" tabindex="6"></textarea>
              Pole wymaganeZa mało znaków
             

              
              <input type="submit" name="wyslij" id="wyslij" value="Wyślij" tabindex="6">
            
	  </form>>



second file: jak_kupic.html (I paste only form's DIV)
HTML
<div class="form">
	  <form action="" method="post" name="form1" id="form1">
            <fieldset>
              <legend>Formularz kontaktowy</legend>
              <li><span id="sprytextfield1">
              <label for="imieinazwisko">Imię i Nazwisko:</label>
              <input name="imieinazwisko" type="text" id="imieinazwisko" tabindex="1" maxlength="30">
              <span class="textfieldRequiredMsg">Pole wymagane</span><span class="textfieldMinCharsMsg">Za mało znaków</span></span></li>
              <li><span id="sprytextfield2">
              <label for="adresemail2">Adres e-mail:</label>
              <input type="text" name="adresemail" id="adresemail2" tabindex="2">
              <span class="textfieldRequiredMsg">Błędny adres email</span><span class="textfieldInvalidFormatMsg">Błędny adres e-mail</span></span></li>
              <li><span id="spryconfirm1">
                <label for="walidacjaemail">Podaj ponownie e-mail:</label>
                <input type="text" name="walidacjaemail" id="walidacjaemail" tabindex="3">
                <span class="confirmRequiredMsg">Pole wymagane</span><span class="confirmInvalidMsg">Adres się nie zgadza</span></span>
              </li>
              <li><span id="sprytextfield3">
              <label for="numertelefonu">Telefon:</label>
              <input type="text" name="numertelefonu" id="numertelefonu" tabindex="4">
              <span class="textfieldInvalidFormatMsg">Niewłaściwy numer</span><span class="textfieldMinCharsMsg">Niewłaściwy numer</span><span class="textfieldMinValueMsg">Za mało cyfr</span></span></li>
              <li>
                <label for="miasto">Miasto:</label>
                <input name="miasto" type="text" id="miasto" tabindex="5" maxlength="15">
              </li>
              <li>
              <span id="sprytextarea1">
              <label for="wiadomosc2">Wiadomość:</label>
              <textarea name="wiadomosc" id="wiadomosc2" cols="45" rows="5" tabindex="6"></textarea>
              <span class="textareaRequiredMsg">Pole wymagane</span><span class="textareaMinCharsMsg">Za mało znaków</span></span></li>
             
<li>
              
              <input type="submit" name="wyslij" id="wyslij" value="Wyślij" tabindex="6">
            </fieldset>
	  </form>
	  </li>
  		 </ul>
</div>


third file: jak_kupic.php (pasted only form's DIV)
PHP
<div class="form_field">
 	 <img src="images/jak_zamawiac_02.jpg" width="1024" height="661" alt="formularz">
  <?
  
  if(isset($_POST["sender"]))
  {
	  
  $imie=$_POST['imieinazwisko'];
  $email=$_POST['adresemail'];
  $telefon=$_POST['telefon'];
  $miasto=$_POST['miasto'];
  $wiadomosc=$_POST['wiadomosc'];
  
  //Potwierdzenie dla użytkownika
  $reply_subject= 'Zapytanie ze strony Hogar';
  $reply_body = 'Witamy serdecznie,\nOtrzymaliśmy Państwa wiadomość. Odezwiemy się najprędzej jak to mozliwe.\n\nZ poważaniem\nBiokominki Hogar';
  $reply_email = 'biuro@hogar-biokominki.pl';
  
  //Wysyłanie do Hogar
  $to = 'biuro@hogar-biokominki.pl';
  $from = $imie . "<" . $email .">";
  $subject = 'Zapytanie ze strony Hogar';
  $body="\n\nImię i Nazwisko" . $imie . "\n\nEmail: " . $email . "\n\nTelefon" . $telefon . "\n\nMiasto" . $miasto . "\n\nWiadomość:" . $wiadomosc;
  $coding = "Content-Type: text/plain; charse=utf-8 \nContent-Transfer-Encoding: 8bit";
  
  if(mail($to, $subject, $body, "From: " . $from . "\n"  . $coding))
  {
	  if(mail($email, $reply_subject, $reply_body, "From: " . $reply_email . "\n" . $coding))
	  {
		  echo"<p class=\"dziekujemy\"> Dziekujemy za wysłanie wiadomości!</p>";
	  }
	  else
	  {
    	   echo"<p class=\"dziekujemy\">Formularz nie został wysłany. Spróbuj ponownie.</p>";
	  }
  }
  }
  require_once("formularz.php");
  ?>
  
  		
  
  </div>



Strange thing is that I can send form from /jak_kupic.php and it works. But layout sucks. But I can't send from /jak_kupic.html.

Can I connect these two files somehow?
AnswerRe: PHP Form is not working. Pin
Gerben Jongerius30-Nov-11 22:03
Gerben Jongerius30-Nov-11 22:03 
GeneralRe: PHP Form is not working. Pin
m_kukulka5-Dec-11 8:05
m_kukulka5-Dec-11 8:05 
AnswerRe: PHP Form is not working. Pin
kannan pichumani8-Dec-11 1:31
kannan pichumani8-Dec-11 1:31 
QuestionFrom name & email Pin
Jassim Rahma28-Nov-11 4:42
Jassim Rahma28-Nov-11 4:42 
AnswerRe: From name & email Pin
Graham Breach28-Nov-11 7:40
Graham Breach28-Nov-11 7:40 
QuestionPROPERTIES file in PHP Pin
Aniket S Kulkarni28-Nov-11 2:35
Aniket S Kulkarni28-Nov-11 2:35 
AnswerRe: PROPERTIES file in PHP Pin
Mohibur Rashid28-Nov-11 19:16
professionalMohibur Rashid28-Nov-11 19:16 
AnswerRe: PROPERTIES file in PHP Pin
Aniket S Kulkarni28-Nov-11 19:49
Aniket S Kulkarni28-Nov-11 19:49 
GeneralRe: PROPERTIES file in PHP Pin
Mohibur Rashid28-Nov-11 20:29
professionalMohibur Rashid28-Nov-11 20:29 
GeneralRe: PROPERTIES file in PHP Pin
Aniket S Kulkarni28-Nov-11 21:02
Aniket S Kulkarni28-Nov-11 21:02 
QuestionSMPP for PHP Pin
Jassim Rahma26-Nov-11 22:27
Jassim Rahma26-Nov-11 22:27 
AnswerRe: SMPP for PHP Pin
Satheesh154627-Nov-11 17:08
Satheesh154627-Nov-11 17:08 
AnswerRe: SMPP for PHP Pin
Mohibur Rashid29-Nov-11 20:23
professionalMohibur Rashid29-Nov-11 20:23 
QuestionCake PHP Pin
sarang_k23-Nov-11 17:20
sarang_k23-Nov-11 17:20 
AnswerRe: Cake PHP Pin
Satheesh154623-Nov-11 18:38
Satheesh154623-Nov-11 18:38 
QuestionRed Hat Enterprise install issue... Pin
Albert Holguin23-Nov-11 2:42
professionalAlbert Holguin23-Nov-11 2:42 
AnswerRe: Red Hat Enterprise install issue... Pin
Kevin Schaefer3-Jan-12 12:34
Kevin Schaefer3-Jan-12 12:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.