Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
mail forma i verzije php-a

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
r3dsc0rpi0n



Joined: 20 Apr 2005
Posts: 354
Location: Zagreb

PostPosted: 18.01.2006 20:34    Post subject: mail forma i verzije php-a Add user to your forum ignore list Reply with quote

Doma imam 5.05 a na serveru 4.3.11.
I naravno doma radi mail forma a na serveru ne...

Kod je od nel`chee tu negdje sa mi3ja Very Happy

Sta da promijenim da radi i na 4.3.11?

Code:
<?php
function showcontactform($name="", $email="", $website="", $subject="", $message="") {
   if(!$_SERVER['REMOTE_HOST']) {
      $host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
   } else {
      $host = $_SERVER['REMOTE_HOST'];
   }
   echo '
   
   <form action="' . $PHP_SELF . '" method="post" enctype="multipart/form-data">
Name:<br />           
<input name="name" class="box" type="text" value="' . $name . '" size="50" maxlength="50" />
E-mail:<br />
<input name="email" class="box" type="text" value="' . $email . '" size="50" maxlength="50" />
Homepage:<br />
<input name="website" class="box" type="text" value="' . $website . '" size="50" maxlength="50" />
Subject:<br />
<input name="subject" class="box" type="text" value="' . $subject . '" size="50" maxlength="50" />
Message:<br />
<textarea name="message" cols="50" rows="5" id="message" class="boxbig">' . $message . '</textarea>
<input type="hidden" name="ip" value="' . $_SERVER['REMOTE_ADDR'] . '" />
<input type="hidden" name="isp" value="' . $host . '" />
<input type="hidden" name="browser" value="' . $_SERVER['HTTP_USER_AGENT'] . '" />
<br /><br />
<input type="submit" name="send" value="Send it" class="gumb"/>
           
   </form>';
}


if ($send) {
   $to = 'r3dsc0rpi0n@elevenfeelings.com';
   $name = stripslashes($_POST['name']);
   $message = stripslashes($_POST['message']);
   $subject = stripslashes($_POST['subject']);
   $email = $_POST['email'];
   $website = $_POST['website'];
   if (!(($name) && ($message) && ($email))) {
      echo '<p>Are you sure you want to contact me?</p>';
      showcontactform($name, $email, $website, $subject, $message);
   } elseif (!eregi('^([._a-z0-9-]+[._a-z0-9-]*)@(([a-z0-9-]+\.)*([a-z0-9-]+)(\.[a-z]{2,3})?)$', $email)) {
      echo '<p>Nice e-mail address :p</p>';
      showcontactform($name, $email, $website, $subject, $message);
   } else {
      $message .= "\n\n***********************************************************\n\nFrom: "
         . $name . "\nwww: " . $website . "\n\nIP: "
         . $_POST['ip'] . "\nISP: " . $_POST['isp'] . "\nbrowser: " . $_POST['browser'];
      $subject = "<!--Contact from elevenfeelings.-->" . $subject;
     
      if (mail($to,$subject,$message, "From: " . $name . "<" . $_POST['email'] . "> \r\n"
      . "Reply-To:" . $_POST['email'] . "\r\n"
      ."Content-Type: text/plain; charset=UTF-8\r\n"
      ."X-Mailer: PHP/" . phpversion() )) {
         echo '
               <p>Your message has been sent...</p>
               ';
      } else {
         echo '
               <p>The message could not be sent. Please try again later.</p>';
      }
   }
} else {
   ?>
 
   <?
   showcontactform();
}
?>


hvala

edit:
forma se pokaze ali klikom na gumb samo se reloada ista stvar

_________________
::: Fortis est, qui se vincit ! ::::
Back to top
View user's profile Send private message Send e-mail Visit poster's website Twitter profile
Tedius



Joined: 22 Dec 2003
Posts: 149
Location: Zagreb

PostPosted: 18.01.2006 20:52    Post subject: Add user to your forum ignore list Reply with quote

Ovako na prvi pogled mi se cini da umjesto
Code:
if ($send) {
treba staviti
Code:
if (isset($_POST['send'])) {
U tom slucaju ne radi se o verzijama php-a vec o postavkama servera, na jednom imas ukljucen REGISTER_GLOBALS, a na drugom ne.
Back to top
View user's profile Send private message Visit poster's website
r3dsc0rpi0n



Joined: 20 Apr 2005
Posts: 354
Location: Zagreb

PostPosted: 18.01.2006 21:32    Post subject: Add user to your forum ignore list Reply with quote

Da u pravu si!
Radi sad.
Hvala Very Happy

_________________
::: Fortis est, qui se vincit ! ::::
Back to top
View user's profile Send private message Send e-mail Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group