Jump to content

PrPrO

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

PrPrO's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you only have to read the last code If you want to help EDIT: @BagoZonde, what do you mean there is no $email variable? It is red from the form. And about print_r, I tried and tried before to print it but without success, can you please copy the code I have to insert? Thank you
  2. Hello, so this post is two flies in one go First I will start with the form. I have another form which is not in table and it works fine, it reads all the values and send the email normally. Here is the code: <form id="Contact Form" name="Contact Form" method="post" action="index.php?option=com_content&view=featured&Itemid=534'"> <p><br /> Odaberite proizvod:<br /> <select name="select" id="select"> <option value="Molimo odaberite" selected="selected">Molimo odaberite</option> <option value="Karbonske cijevi">Karbonske cijevi </option> <option value="Karbonski kepovi">Karbonski kepovi</option> <option value="Kabine">Kabine</option> <option value="Karbonski nosači za komande">Karbonski nosači za komande</option> <option value="Karbonski D-Box">Karbonski D-Box</option> <option value="Karbonske ploče raznih dimenzija">Karbonske ploče raznih dimenzija</option> </select> </p> <p>Vaše ime: <label> <br /> <input type="text" name="ime" id="ime" /> </label> </p> <p> <label>E-mail adresa: </label> <label><br /> </label> <label> <input type="text" name="email" id="email" /> </label> </p> <p>Naslov: <label> <br /> <input type="text" name="naslov" id="naslov" /> </label> </p> <p>Unesite svoju poruku:<br /> <label> <textarea name="poruka" id="poruka" cols="45" rows="5"></textarea> </label> </p> <p> <input name="newsletter" type="checkbox" id="newsletter" value="Želim primati newsletter" onclick="changeCheckboxText( function changeCheckboxText(checkbox) { if (checkbox.checked) checkbox.nextSibling.innerHTML = 'Želim primati newsletter'; else checkbox.nextSibling.innerHTML = 'Ne želim primati newsletter; } ;"/> Označite ovaj kvadratić ako želite primati newsletter</p> <p> </p> <p> <input type="submit" value="Pošalji Upit" /> <br /> </p> </form> And the .php <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavamo se, prilikom slanja Vašeg upita pronašli smo pogrešku/e. "; echo "Pogreška/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Molimo, vratite se na prijašnju stranicu i promjenite upit.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['naslov']) || !isset($_POST['select']) || !isset($_POST['poruka'])) { died('Ispričavamo se, pronašli smo pogrešku prilikom slanja vašeg upita.'); } $ime = $_POST['ime']; // required $email = $_POST['email']; // required $naslov = $_POST['naslov']; // required $poruka = $_POST['poruka']; // required $select = $_POST['select'] ; // required $newsletter = $_POST['newsletter']; // not required if($select == 'Molimo odaberite'){ died('Molimo Vas, odaberite proizvod.'); } } $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'Vaš E-mail nije valjan.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$ime)) { $error_message .= 'Vaše se ime sastoji od nepodržavanih znakova.<br />'; } if(strlen($naslov) < 2) { $error_message .= 'Vaš naslov nije valjan.<br />'; } if(strlen($poruka) < 2) { $error_message .= 'Vaša poruka je prekratka.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Detalji upita.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Ime: ".clean_string($ime)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Naslov: ".clean_string($naslov)."\n"; $email_message .= "Poruka: ".clean_string($poruka)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $naslov, $poruka, "From:" . $email . "\r\n" . $newsletter . "\r\n" . $select . "\r\n" . $ime); //AUTO RESPONCE MESSAGE //Create main headers $pporuka = ""; $pporuka .= "Poštovani "; $pporuka .= $ime; $pporuka .= ", hvala na Vašem upitu u vezi proizvoda "; $pporuka .= $select; $pporuka .= ", javit ćemo Vam se u što kraćem roku. "; $pporuka .= " Upitali ste nas slijedece: "; $pporuka .= $poruka; //E-mails subject //Send the email mail($email, $naslov, $pporuka, "From:" . "info@clm-pro.tk"); ?> Primili smo Vaš upit. Kontaktirat ćemo Vas u što kraćem roku And this form is working great. And now the one that isn't working... Here is the link to that form: http://www.clm-pro.t.../usluge-rezanja Onpage code: <p>(Forma će biti dovršena kroz par dana. Zahvaljujemo na strpljenju.)</p> <form id="Contact Form" name="Contact Form" method="post" action="index.php?option=com_content&view=featured&Itemid=527"> <p> <table> <tbody> <tr> <td> Sekcija 1 </td> <td> </td> <td> Sekcija 2 </td> <td> </td> </tr> <tr> <td>Profil u korijenu:</td> <td><input name="puk1" id="puk1" size="6" maxlength="5" type="text" /></td> <td> Profil u korijenu:</td> <td><input name="puk2" id="puk2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td>Dimenzija u korijenu:</td> <td><input name="duk1" id="duk1" size="6" maxlength="5" type="text" /></td> <td> Dimenzija u korijenu:</td> <td><input name="duk2" id="duk2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Profil na vrhu:</td> <td><input name="pnv1" id="pnv1" size="6" maxlength="5" type="text" /></td> <td> Profil na vrhu:</td> <td><input name="pnv2" id="pnv2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Dimenzija na vrhu:</td> <td><input name="dnv1" id="dnv1" size="6" maxlength="5" type="text" /></td> <td> Dimenzija na vrhu:</td> <td><input name="dnv2" id="dnv2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Dužina panela:</td> <td><input name="dp1" id="dp1" size="6" maxlength="5" type="text" /></td> <td> Dužina panela:</td> <td><input name="dp2" id="dp2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Sweep:</td> <td><input name="sw1" id="sw1" size="6" maxlength="5" type="text" /></td> <td> Sweep:</td> <td><input name="sw2" id="sw2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Zakrivljenost:</td> <td><input name="zak1" id="zak1" size="6" maxlength="5" type="text" /></td> <td> Zakrivljenost:</td> <td><input name="zak2" id="zak2" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> Sekcija 3</td> <td></td> <td> Sekcija 4</td> <td></td> </tr> <tr> <td> Profil u korijenu:</td> <td><input name="puk3" id="puk3" size="6" maxlength="5" type="text" /></td> <td> Profil u korijenu:</td> <td><input name="puk4" id="puk4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Dimenzija u korijenu:</td> <td><input name="duk3" id="duk3" size="6" maxlength="5" type="text" /></td> <td> Dimenzija u korijenu:</td> <td><input name="duk4" id="duk4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Profil na vrhu:</td> <td><input name="pnv3" id="pnv3" size="6" maxlength="5" type="text" /></td> <td> Profil na vrhu:</td> <td><input name="pnv4" id="pnv4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Dimenzija na vrhu:</td> <td><input name="dnv3" id="dnv3" size="6" maxlength="5" type="text" /></td> <td> Dimenzija na vrhu:</td> <td><input name="dnv4" id="dnv4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Dužina panela:</td> <td><input name="dp3" id="dp3" size="6" maxlength="5" type="text" /></td> <td> Dužina panela:</td> <td><input name="dp4" id="dp4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td> Sweep:</td> <td><input name="sw3" id="sw3" size="6" maxlength="5" type="text" /></td> <td> Sweep:</td> <td><input name="sw4" id="sw4" size="6" maxlength="5" type="text" /></td> </tr> <tr> <td>Zakrivljenost:</td> <td><input name="zak3" id="zak3" size="6" maxlength="5" type="text" /></td> <td> Zakrivljenost:</td> <td><input name="zak4" id="zak4" size="6" maxlength="5" type="text" /></td> </tr> </tbody> </table> </p> <p> </p> <p> </p> <p> <table> <tbody> <tr> <td>Ime:</td> <td><input name="ime" id="ime" size="15" maxlength="25" type="text" /></td> </tr> <tr> <td>E-Mail:</td> <td><input name="email" id="email" size="15" maxlength="25" type="text" /></td> </tr> <tr> <td>Adresa:</td> <td><input name="adresa" id="adresa" size="15" maxlength="40" type="text" /></td> </tr> <tr> <td>Država:</td> <td><input name="drzava" id="drzava" size="15" maxlength="25" type="text" /></td> </tr> <tr> <td>Poštanski broj:</td> <td><input name="zip" id="zip" size="15" maxlength="25" type="text" /></td> </tr> <tr> <td>Telefon:</td> <td><input name="tel" id="tel" size="15" maxlength="25" type="text" /></td> </tr> <tr> <td>Napomena:</td> <td><textarea name="poruka" id="poruka" cols="45" rows="5"></textarea></td> </tr> </tbody> </table> </p> <p><input value="Pošalji Upit" type="submit" /></p> </form> And the .php for that form: <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavamo se, prilikom slanja Vašeg upita pronašli smo pogrešku/e. "; echo "Pogreška/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Molimo, vratite se na prijašnju stranicu i promjenite upit.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['adresa']) || !isset($_POST['drzava']) || !isset($_POST['zip']) || !isset($_POST['tel']) || !isset($_POST['poruka']) || !isset($_POST['puk1']) || !isset($_POST['puk2']) || !isset($_POST['puk3']) || !isset($_POST['puk4']) || !isset($_POST['duk1']) || !isset($_POST['duk2']) || !isset($_POST['duk3']) || !isset($_POST['duk4']) || !isset($_POST['pnv1']) || !isset($_POST['pnv2']) || !isset($_POST['pnv3']) || !isset($_POST['pnv4']) || !isset($_POST['dnv1']) || !isset($_POST['dnv2']) || !isset($_POST['dnv3']) || !isset($_POST['dnv4']) || !isset($_POST['dp1']) || !isset($_POST['dp2']) || !isset($_POST['dp3']) || !isset($_POST['dp4']) || !isset($_POST['sw1']) || !isset($_POST['sw2']) || !isset($_POST['sw3']) || !isset($_POST['sw4']) || !isset($_POST['zak1']) || !isset($_POST['zak2']) || !isset($_POST['zak3']) || !isset($_POST['zak4'])) { died('Ispričavamo se, pronašli smo pogrešku prilikom slanja vašeg upita.'); } } $email_message .= "Ime: " . $_POST['ime'] . "\n"; $email_message .= "E-Mail: " . $_POST['email'] . "\n"; $email_message .= "Adresa: " . $_POST['adresa'] . "\n"; $email_message .= "Država: " . $_POST['drzava'] . "\n"; $email_message .= "Poštanski broj: " . $_POST['zip'] . "\n"; $email_message .= "Telefon: " . $_POST['tel'] . "\n"; $email_message .= "Poruka: " . $_POST['poruka'] . "\n"; $email_message .= "Profil u korijenu(1): " . $_POST['puk1'] . "\n"; $email_message .= "Profil u korijenu(2): " . $_POST['puk2'] . "\n"; $email_message .= "Profil u korijenu(3): " . $_POST['puk3'] . "\n"; $email_message .= "Profil u korijenu(4): " . $_POST['puk4'] . "\n"; $email_message .= "Dimenzija u korijenu(1): " . $_POST['duk1'] . "\n"; $email_message .= "Dimenzija u korijenu(2): " . $_POST['duk2'] . "\n"; $email_message .= "Dimenzija u korijenu(3): " . $_POST['duk3'] . "\n"; $email_message .= "Dimenzija u korijenu(4): " . $_POST['duk4'] . "\n"; $email_message .= "Profil na vrhu(1): " . $_POST['pnv1'] . "\n"; $email_message .= "Profil na vrhu(2): " . $_POST['pnv2'] . "\n"; $email_message .= "Profil na vrhu(3): " . $_POST['pnv3'] . "\n"; $email_message .= "Profil na vrhu(4): " . $_POST['pnv4'] . "\n"; $email_message .= "Dimenzija na vrhu(1): " . $_POST['dnv1'] . "\n"; $email_message .= "Dimenzija na vrhu(2): " . $_POST['dnv2'] . "\n"; $email_message .= "Dimenzija na vrhu(3): " . $_POST['dnv3'] . "\n"; $email_message .= "Dimenzija na vrhu(4): " . $_POST['dnv4'] . "\n"; $email_message .= "Dužina panela (1): " . $_POST['dp1'] . "\n"; $email_message .= "Dužina panela (2): " . $_POST['dp2'] . "\n"; $email_message .= "Dužina panela (3): " . $_POST['dp3'] . "\n"; $email_message .= "Dužina panela (4): " . $_POST['dp4'] . "\n"; $email_message .= "Sweep(1): " . $_POST['sw1'] . "\n"; $email_message .= "Sweep(2): " . $_POST['sw2'] . "\n"; $email_message .= "Sweep(3): " . $_POST['sw3'] . "\n"; $email_message .= "Sweep(4): " . $_POST['sw4'] . "\n"; $email_message .= "Zakrivljenost(1): " . $_POST['zak1'] . "\n"; $email_message .= "Zakrivljenost(2): " . $_POST['zak2'] . "\n"; $email_message .= "Zakrivljenost(3): " . $_POST['zak3'] . "\n"; $email_message .= "Zakrivljenost(4): " . $_POST['zak4'] . "\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $poruka, "From:" . $email . "\r\n" . $adresa . "\r\n" . $drzava . "\r\n" . $ime . "\r\n" . $zip . "\r\n" . $tel . "\r\n" . $puk1 . "\r\n" . $puk2 . "\r\n" . $puk3 . "\r\n" . $puk4 . "\r\n" . $duk1 . "\r\n" . $duk2 . "\r\n" . $duk3 . "\r\n" . $duk4 . "\r\n" . $pnv1 . "\r\n" . $pnv2 . "\r\n" . $pnv3 . "\r\n" . $pnv4 . "\r\n" . $dnv1 . "\r\n" . $dnv2 . "\r\n" . $dnv3 . "\r\n" . $dnv4 . "\r\n" . $dp1 . "\r\n" . $dp2 . "\r\n" . $dp3 . "\r\n" . $dp4 . "\r\n" . $sw1 . "\r\n" . $sw2 . "\r\n" . $sw3 . "\r\n" . $sw4 . "\r\n" . $zak1 . "\r\n" . $zak2 . "\r\n" . $zak3 . "\r\n" . $zak4); //AUTO RESPONCE MESSAGE //Create main headers $pporuka = ""; $pporuka .= "Poštovani "; $pporuka .= $ime; $pporuka .= ", dimenzije koje ste nam poslali su slijedeće: "; $pporuka .= ", Profil u korijenu(1): "; $pporuka .= $puk1; $pporuka .= ", Profil u korijenu(2): "; $pporuka .= $puk2; $pporuka .= ", Profil u korijenu(3): "; $pporuka .= $puk3; $pporuka .= ", Profil u korijenu(4): "; $pporuka .= $puk4; $pporuka .= ", Dimenzija u korijenu(1): "; $pporuka .= $duk1; $pporuka .= ", Dimenzija u korijenu(2): "; $pporuka .= $duk2; $pporuka .= ", Dimenzija u korijenu(3): "; $pporuka .= $duk3; $pporuka .= ", Dimenzija u korijenu(4): "; $pporuka .= $duk4; $pporuka .= " Upitali ste nas slijedece: "; $pporuka .= $poruka; //E-mails subject //Send the email mail($email, $pporuka, "From:" . "info@clm-pro.tk"); ?> I don't know what to do anymore... I tried replacing the $_POST with $_GET in $email_message and inserting the clean.string but then i got error that i have to define it but I did Can you please help me somehow? And the other "problem"... when I set text style which is in table to heading 1, it increases the table height which wouldn't be big dea when there wouldn't be background for that table So, what I wan't to do is set normal height for the table. Here is the link(don't look at the images, it's just for test, webpage is curently under construction): http://www.clm-pro.t...i?view=featured The problematic text is: "Karbonske cijevi" Thank you in advance! Matija
  3. Yes, but I have to define it somehow. And this is the main file, that ones has to get values and send them...
  4. Thank you very much for your reply, I replaced the code to what you said and I got the following error: Fatal error: Call to undefined function clean_string() in /home/a7264383/public_html/tmp/htmliJLCfz on line 59 line 59 is $email_message .= "Ime: " . clean_string($_POST['ime']) . "\n"; The clean_string has to be defined EDIT: I've tried to define the clean_string but I dont get anything in mail subject or body and the email it was sent from
  5. It isn't about Joomla, it's about formtoemail.php not reading values from the tables
  6. Thank you very much for your fast reply, I looked many times a couldnt find it I fixed this a some other minor problems but, here is the other one.. The forms you can see are in tables built in Joomla and it seems that the formtoemail.php doesn't read them, because i get error that my message is to short, or I get error on line 59 which is: $email_message .= "Ime: ".clean_string($ime)."\n"; meaning that it is missing this information, meaning, it doesn't read the forms in tables?
  7. Hello, I have created a little bigger form to be sent to email after submiting but after I click submit(Pošalji) buton, i get the error: Parse error: syntax error, unexpected $end in /home/a7264383/public_html/tmp/htmlAvDbUi on line 129. This error appears when i submit on this form: <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavamo se, prilikom slanja Vašeg upita pronašli smo pogrešku/e. "; echo "Pogreška/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Molimo, vratite se na prijašnju stranicu i promjenite upit.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['puk1']) || !isset($_POST['puk2']) || !isset($_POST['puk3']) || !isset($_POST['puk4']) || !isset($_POST['duk1']) || !isset($_POST['duk2']) || !isset($_POST['duk3']) || !isset($_POST['duk4']) || !isset($_POST['pnv1']) || !isset($_POST['pnv2']) || !isset($_POST['pnv3']) || !isset($_POST['pnv4']) || !isset($_POST['dnv1']) || !isset($_POST['dnv2']) || !isset($_POST['dnv3']) || !isset($_POST['dnv4']) || !isset($_POST['dp1']) || !isset($_POST['dp2']) || !isset($_POST['dp3']) || !isset($_POST['dp4']) || !isset($_POST['sw1']) || !isset($_POST['sw2']) || !isset($_POST['sw3']) || !isset($_POST['sw4']) || !isset($_POST['zak1']) || !isset($_POST['zak2']) || !isset($_POST['zak3']) || !isset($_POST['zak4']) || !isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['adresa']) || !isset($_POST['drzava']) || !isset($_POST['zip']) || !isset($_POST['tel']) || !isset($_POST['poruka'])) { died('Ispričavamo se, pronašli smo pogrešku prilikom slanja vašeg upita.'); $email_message .= "Ime: ".clean_string($ime)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Adresa: ".clean_string($adresa)."\n"; $email_message .= "Drzava: ".clean_string($drzava)."\n"; $email_message .= "Poštanski broj: ".clean_string($zip)."\n"; $email_message .= "Telefon: ".clean_string($tel)."\n"; $email_message .= "Napomena: ".clean_string($poruka)."\n"; $email_message .= "Profil u korijenu(1): ".clean_string($puk1)."\n"; $email_message .= "Profil u korijenu(2): ".clean_string($puk2)."\n"; $email_message .= "Profil u korijenu(3): ".clean_string($puk3)."\n"; $email_message .= "Profil u korijenu(4): ".clean_string($puk4)."\n"; $email_message .= "Dimenzija u korijenu(1): ".clean_string($duk1)."\n"; $email_message .= "Dimenzija u korijenu(2): ".clean_string($duk2)."\n"; $email_message .= "Dimenzija u korijenu(3): ".clean_string($duk3)."\n"; $email_message .= "Dimenzija u korijenu(4): ".clean_string($duk4)."\n"; $email_message .= "Profil na vrhu(1): ".clean_string($pnv1)."\n"; $email_message .= "Profil na vrhu(2): ".clean_string($pnv2)."\n"; $email_message .= "Profil na vrhu(3): ".clean_string($pnv3)."\n"; $email_message .= "Profil na vrhu(4): ".clean_string($pnv4)."\n"; $email_message .= "Dimenzija na vrhu(1): ".clean_string($dnv1)."\n"; $email_message .= "Dimenzija na vrhu(2): ".clean_string($dnv2)."\n"; $email_message .= "Dimenzija na vrhu(3): ".clean_string($dnv3)."\n"; $email_message .= "Dimenzija na vrhu(4): ".clean_string($dnv4)."\n"; $email_message .= "Dužina panela (1): ".clean_string($dp1)."\n"; $email_message .= "Dužina panela (2): ".clean_string($dp2)."\n"; $email_message .= "Dužina panela (3): ".clean_string($dp3)."\n"; $email_message .= "Dužina panela (4): ".clean_string($dp4)."\n"; $email_message .= "Sweep(1): ".clean_string($sw1)."\n"; $email_message .= "Sweep(2): ".clean_string($sw2)."\n"; $email_message .= "Sweep(3): ".clean_string($sw3)."\n"; $email_message .= "Sweep(4): ".clean_string($sw4)."\n"; $email_message .= "Zakrivljenost(1): ".clean_string($zak1)."\n"; $email_message .= "Zakrivljenost(2): ".clean_string($zak2)."\n"; $email_message .= "Zakrivljenost(3): ".clean_string($zak3)."\n"; $email_message .= "Zakrivljenost(4): ".clean_string($zak4)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $naslov, $poruka, "From:" . $email . "\r\n" . $adresa . "\r\n" . $drzava . "\r\n" . $ime . "\r\n" . $zip . "\r\n" . $tel . "\r\n" . $puk1 . "\r\n" . $puk2 . "\r\n" . $puk3 . "\r\n" . $puk4 . "\r\n" . $duk1 . "\r\n" . $duk2 . "\r\n" . $duk3 . "\r\n" . $duk4 . "\r\n" . $pnv1 . "\r\n" . $pnv2 . "\r\n" . $pnv3 . "\r\n" . $pnv4 . "\r\n" . $dnv1 . "\r\n" . $dnv2 . "\r\n" . $dnv3 . "\r\n" . $dnv4 . "\r\n" . $dp . "\r\n" . $dp2 . "\r\n" . $dp3 . "\r\n" . $dp4 . "\r\n" . $sw1 . "\r\n" . $sw2 . "\r\n" . $sw3 . "\r\n" . $sw4 . "\r\n" . $zak1 . "\r\n" . $zak . "\r\n" . $zak3 . "\r\n" . $zak4); //AUTO RESPONCE MESSAGE //Create main headers $pporuka = ""; $pporuka .= "Poštovani "; $pporuka .= $ime; $pporuka .= ", dimenzije koje ste nam poslali su slijedeće: "; $pporuka .= ", Profil u korijenu(1): "; $pporuka .= $puk1; $pporuka .= ", Profil u korijenu(2): "; $pporuka .= $puk2; $pporuka .= ", Profil u korijenu(3): "; $pporuka .= $puk3; $pporuka .= ", Profil u korijenu(4): "; $pporuka .= $puk4; $pporuka .= ", Dimenzija u korijenu(1): "; $pporuka .= $duk1; $pporuka .= ", Dimenzija u korijenu(2): "; $pporuka .= $duk2; $pporuka .= ", Dimenzija u korijenu(3): "; $pporuka .= $duk3; $pporuka .= ", Dimenzija u korijenu(4): "; $pporuka .= $duk4; $pporuka .= " Upitali ste nas slijedece: "; $pporuka .= $poruka; //E-mails subject //Send the email mail($email, $pporuka, "From:" . "info@clm-pro.tk"); ?> line 127 is mail($email, $pporuka, "From:" . "info@clm-pro.tk"); and when I delete the Auto-respose part, I get another error: Parse error: syntax error, unexpected $end in /home/a7264383/public_html/tmp/htmlaJcgAB on line 100. on following code: <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavamo se, prilikom slanja Vašeg upita pronašli smo pogrešku/e. "; echo "Pogreška/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Molimo, vratite se na prijašnju stranicu i promjenite upit.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['puk1']) || !isset($_POST['puk2']) || !isset($_POST['puk3']) || !isset($_POST['puk4']) || !isset($_POST['duk1']) || !isset($_POST['duk2']) || !isset($_POST['duk3']) || !isset($_POST['duk4']) || !isset($_POST['pnv1']) || !isset($_POST['pnv2']) || !isset($_POST['pnv3']) || !isset($_POST['pnv4']) || !isset($_POST['dnv1']) || !isset($_POST['dnv2']) || !isset($_POST['dnv3']) || !isset($_POST['dnv4']) || !isset($_POST['dp1']) || !isset($_POST['dp2']) || !isset($_POST['dp3']) || !isset($_POST['dp4']) || !isset($_POST['sw1']) || !isset($_POST['sw2']) || !isset($_POST['sw3']) || !isset($_POST['sw4']) || !isset($_POST['zak1']) || !isset($_POST['zak2']) || !isset($_POST['zak3']) || !isset($_POST['zak4']) || !isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['adresa']) || !isset($_POST['drzava']) || !isset($_POST['zip']) || !isset($_POST['tel']) || !isset($_POST['poruka'])) { died('Ispričavamo se, pronašli smo pogrešku prilikom slanja vašeg upita.'); $email_message .= "Ime: ".clean_string($ime)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Adresa: ".clean_string($adresa)."\n"; $email_message .= "Drzava: ".clean_string($drzava)."\n"; $email_message .= "Poštanski broj: ".clean_string($zip)."\n"; $email_message .= "Telefon: ".clean_string($tel)."\n"; $email_message .= "Napomena: ".clean_string($poruka)."\n"; $email_message .= "Profil u korijenu(1): ".clean_string($puk1)."\n"; $email_message .= "Profil u korijenu(2): ".clean_string($puk2)."\n"; $email_message .= "Profil u korijenu(3): ".clean_string($puk3)."\n"; $email_message .= "Profil u korijenu(4): ".clean_string($puk4)."\n"; $email_message .= "Dimenzija u korijenu(1): ".clean_string($duk1)."\n"; $email_message .= "Dimenzija u korijenu(2): ".clean_string($duk2)."\n"; $email_message .= "Dimenzija u korijenu(3): ".clean_string($duk3)."\n"; $email_message .= "Dimenzija u korijenu(4): ".clean_string($duk4)."\n"; $email_message .= "Profil na vrhu(1): ".clean_string($pnv1)."\n"; $email_message .= "Profil na vrhu(2): ".clean_string($pnv2)."\n"; $email_message .= "Profil na vrhu(3): ".clean_string($pnv3)."\n"; $email_message .= "Profil na vrhu(4): ".clean_string($pnv4)."\n"; $email_message .= "Dimenzija na vrhu(1): ".clean_string($dnv1)."\n"; $email_message .= "Dimenzija na vrhu(2): ".clean_string($dnv2)."\n"; $email_message .= "Dimenzija na vrhu(3): ".clean_string($dnv3)."\n"; $email_message .= "Dimenzija na vrhu(4): ".clean_string($dnv4)."\n"; $email_message .= "Dužina panela (1): ".clean_string($dp1)."\n"; $email_message .= "Dužina panela (2): ".clean_string($dp2)."\n"; $email_message .= "Dužina panela (3): ".clean_string($dp3)."\n"; $email_message .= "Dužina panela (4): ".clean_string($dp4)."\n"; $email_message .= "Sweep(1): ".clean_string($sw1)."\n"; $email_message .= "Sweep(2): ".clean_string($sw2)."\n"; $email_message .= "Sweep(3): ".clean_string($sw3)."\n"; $email_message .= "Sweep(4): ".clean_string($sw4)."\n"; $email_message .= "Zakrivljenost(1): ".clean_string($zak1)."\n"; $email_message .= "Zakrivljenost(2): ".clean_string($zak2)."\n"; $email_message .= "Zakrivljenost(3): ".clean_string($zak3)."\n"; $email_message .= "Zakrivljenost(4): ".clean_string($zak4)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $naslov, $poruka, "From:" . $email . "\r\n" . $adresa . "\r\n" . $drzava . "\r\n" . $ime . "\r\n" . $zip . "\r\n" . $tel . "\r\n" . $puk1 . "\r\n" . $puk2 . "\r\n" . $puk3 . "\r\n" . $puk4 . "\r\n" . $duk1 . "\r\n" . $duk2 . "\r\n" . $duk3 . "\r\n" . $duk4 . "\r\n" . $pnv1 . "\r\n" . $pnv2 . "\r\n" . $pnv3 . "\r\n" . $pnv4 . "\r\n" . $dnv1 . "\r\n" . $dnv2 . "\r\n" . $dnv3 . "\r\n" . $dnv4 . "\r\n" . $dp . "\r\n" . $dp2 . "\r\n" . $dp3 . "\r\n" . $dp4 . "\r\n" . $sw1 . "\r\n" . $sw2 . "\r\n" . $sw3 . "\r\n" . $sw4 . "\r\n" . $zak1 . "\r\n" . $zak . "\r\n" . $zak3 . "\r\n" . $zak4); ?> line 100 is $poruka, "From:" . $email . "\r\n" . $adresa . "\r\n" . $drzava . "\r\n" . $ime . "\r\n" . $zip . "\r\n" . $tel . "\r\n" . $puk1 . "\r\n" . $puk2 . "\r\n" . $puk3 . "\r\n" . $puk4 . "\r\n" . $duk1 . "\r\n" . $duk2 . "\r\n" . $duk3 . "\r\n" . $duk4 . "\r\n" . $pnv1 . "\r\n" . $pnv2 . "\r\n" . $pnv3 . "\r\n" . $pnv4 . "\r\n" . $dnv1 . "\r\n" . $dnv2 . "\r\n" . $dnv3 . "\r\n" . $dnv4 . "\r\n" . $dp . "\r\n" . $dp2 . "\r\n" . $dp3 . "\r\n" . $dp4 . "\r\n" . $sw1 . "\r\n" . $sw2 . "\r\n" . $sw3 . "\r\n" . $sw4 . "\r\n" . $zak1 . "\r\n" . $zak . "\r\n" . $zak3 . "\r\n" . $zak4); It doesn't mather if I change all that code to with(I still get the same error) @mail($email_to, $email_subject, $email_message, $headers); And I have very similar form to this one: <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavamo se, prilikom slanja Vašeg upita pronašli smo pogrešku/e. "; echo "Pogreška/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Molimo, vratite se na prijašnju stranicu i promjenite upit.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['naslov']) || !isset($_POST['select']) || !isset($_POST['poruka'])) { died('Ispričavamo se, pronašli smo pogrešku prilikom slanja vašeg upita.'); } $ime = $_POST['ime']; // required $email = $_POST['email']; // required $naslov = $_POST['naslov']; // required $poruka = $_POST['poruka']; // required $select = $_POST['select'] ; // required $newsletter = $_POST['newsletter']; // not required if($select == 'Molimo odaberite'){ died('Molimo Vas, odaberite proizvod.'); } } $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'Vaš E-mail nije valjan.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$ime)) { $error_message .= 'Vaše se ime sastoji od nepodržavanih znakova.<br />'; } if(strlen($naslov) < 2) { $error_message .= 'Vaš naslov nije valjan.<br />'; } if(strlen($poruka) < 2) { $error_message .= 'Vaša poruka je prekratka.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Detalji upita.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Ime: ".clean_string($ime)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Naslov: ".clean_string($naslov)."\n"; $email_message .= "Poruka: ".clean_string($poruka)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $naslov, $poruka, "From:" . $email . "\r\n" . $newsletter . "\r\n" . $trup . "\r\n" . $ime); //AUTO RESPONCE MESSAGE //Create main headers $pporuka = ""; $pporuka .= "Poštovani "; $pporuka .= $ime; $pporuka .= ", hvala na Vašem upitu u vezi proizvoda "; $pporuka .= $select; $pporuka .= ", javit ćemo Vam se u što kraćem roku. "; $pporuka .= " Upitali ste nas slijedece: "; $pporuka .= $poruka; //E-mails subject //Send the email mail($email, $naslov, $pporuka, "From:" . "info@clm-pro.tk"); ?> Primili smo Vaš upit. Kontaktirat ćemo Vas u što kraćem roku. Are those error indicators and what is required and what si not neccesary? Can you help me anyhow please? Thank you in advance! EDIT: Here is the link to the problematic form: http://www.clm-pro.tk/index.php/galerija it still isn't done... And the link to working form: http://www.clm-pro.tk/index.php/index.php?option=com_content&view=featured&Itemid=526
  8. I fixed my problem by adding the if($select == 'Molimo odaberite'){ died('Ispričavamo se, prona?li smo pogre?ku prilikom slanja va?eg upita.'); } Because I just want to send an error if "Molimo odaberite" is chosen, otherwise to send the porduct name in the email form Thank you fro you help!
  9. Hello.. My problem is that I have created the form and formtoemail.php and everything works fine and now I created a list to choose the product... Here is the list: <select name="select" id="select"> <option value="Molimo odaberite" selected="selected">Molimo odaberite</option> <option value="Trup #T100">Trup #T100</option> <option value="Trup #T101">Trup #T101</option> <option value="Trup #T102">Trup #T102</option> <option value="Trup #T103">Trup #T103</option> <option value="Trup #T104">Trup #T104</option> <option value="Trup #T105">Trup #T105</option> <option value="Trup #T106">Trup #T106</option> <option value="Trup #T107">Trup #T107</option> <option value="Trup #T108">Trup #T108</option> <option value="Trup #T109">Trup #T109</option> <option value="Trup #T110">Trup #T110</option> <option value="Trup #T111">Trup #T111</option> <option value="Trup #T112">Trup #T112</option> <option value="Trup #T113">Trup #T113</option> <option value="Trup #T114">Trup #T114</option> </select> And the current FormToEmail.php code <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "info@clm-pro-tk"; $email_subject = "Your email subject line"; function died($error) { // your error code can go here echo "Ispričavano se, prilikom po?iljanja va?eg upita smo prona?li pogre?ku/e. "; echo "Pogre?ka/e će biti prikazane ispod.<br /><br />"; echo $error."<br /><br />"; echo "Vrni se i popravi.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['ime']) || !isset($_POST['email']) || !isset($_POST['naslov']) || !isset($_POST['poruka'])) { died('Ispričavamo se, prona?li smo npogre?ku prilikom slanja va?eg upita.'); } $ime = $_POST['ime']; // required $email = $_POST['email']; // required $naslov = $_POST['naslov']; // required $poruka = $_POST['poruka']; // required $trup = $_POST['select'] ; // not required $newsletter = $_POST['newsletter']; // not required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email)) { $error_message .= 'E-mail ne valja.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$ime)) { $error_message .= 'Ime ne valja.<br />'; } if(strlen($naslov) < 2) { $error_message .= 'Naslov ne valja.<br />'; } if(strlen($poruka) < 2) { $error_message .= 'Poruka ne valja.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Ime: ".clean_string($ime)."\n"; $email_message .= "Email: ".clean_string($email)."\n"; $email_message .= "Naslov: ".clean_string($naslov)."\n"; $email_message .= "Poruka: ".clean_string($poruka)."\n"; // create email headers $headers = 'From: '.$email."\r\n". 'Reply-To: '.$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @ mail("info@clm-pro.tk", $naslov, $poruka, "From:" . $email . "\r\n" . $newsletter . "\r\n" . $trup . "\r\n" . $ime); //AUTO RESPONCE MESSAGE //Create main headers $pporuka = ""; $pporuka .= "Po?tovani "; $pporuka .= $ime; $pporuka .= ", hvala na vasem upitu u vezi proizvoda: "; $pporuka .= $trup; $pporuka .= ", javit cemo vas se u ?to kracem roku. "; $pporuka .= " Upitali ste nas slijedece: "; $pporuka .= $poruka; //E-mails subject //Send the email mail($email, $naslov, $pporuka, "From:" . "info@clm-pro.tk"); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> The error messages are on Croatian but you don't have to bother with that.. The problem is that the default selected item is Please choose(translated to english) and I need in the formtoemail to say if the select(that list) is "Molim odaberite" --> please choose then send an error message like for other parameters.. and if it is Trup #100 - Trup #114 then do nothing and submit form I think there is a simple msolution but I can't remember any -.- Thank you in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.