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
formmail php problem

 
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
štrumfhoza



Joined: 24 Feb 2005
Posts: 89

PostPosted: 14.10.2005 14:01    Post subject: formmail php problem Add user to your forum ignore list Reply with quote

molim pomoć'''' prvi put ovo radim i niš mi nije jasno.
htjela bi na sajt postavit formular za kontakt. sve je oke, poruka se upiše i pošalje ali mi se onda učita neka stranica 404 koja kaže da ne nalazi traženo - u adresi piše da je http://...../form2mail.php a ja bi da mi se refresha postojeća s fomularom.
evo kak izgledaju vitalni dijelovi:
html
Code:
<form action="/form2mail.php" method="POST">

php:
Code:
<?php

$MailToAddress = "trilobit@inet.hr"; // your email address
$redirectURL = "http://ADRESA STRANICE NA KOJOJ JE FORMULAR"; // the URL of the thank you page.

# optional settings
$MailSubject = "PORUKA"; // the subject of the email
$MailToCC = ""; // CC (carbon copy) also sen......


mislim da je tu negdje caka ali motam se s tim cijelo prijepodne pa bi bila zahvalna ako bi tko pomogo. tenks
Back to top
View user's profile Send private message
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 14.10.2005 14:11    Post subject: Add user to your forum ignore list Reply with quote

Code:
<form action="PRAVI_PATH_DO_form2mail.php" method="POST">

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
štrumfhoza



Joined: 24 Feb 2005
Posts: 89

PostPosted: 14.10.2005 14:35    Post subject: Add user to your forum ignore list Reply with quote

ne ide. stavila sam za pravi path sve: ftp adresu iz adres trake, ftp iz properties, www,... ne znam šta da mu radim..
Back to top
View user's profile Send private message
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 14.10.2005 18:33    Post subject: Add user to your forum ignore list Reply with quote

@maratz: nije pravi path, ako je form2mail stvarno u document root-u onda je form action dobro napisan

ovo što si poslala nije dovoljno, hoćemo vidjeti dio gdje PHP šalje redirect headere
Back to top
View user's profile Send private message Send e-mail Visit poster's website
štrumfhoza



Joined: 24 Feb 2005
Posts: 89

PostPosted: 17.10.2005 10:57    Post subject: Add user to your forum ignore list Reply with quote

oke. tenks.

Code:
<HTML>
<HEAD>
<TITLE>E-Mail Form</TITLE>
</HEAD>
<BODY>
<form action="ftp://...koja adresa..?./form2mail.php" method="POST">
                                            <table width="500" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#CCCCCC">
                                                <tr>
                                                    <td>
                                                        <table width="600" border="0" cellspacing="1" cellpadding="3" align="center">
                                                            <tr bgcolor="#FFFFFF">
                                                                <td colspan="2"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Kontakt </b></font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td align="right" width="220"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">ime: </font></td>
                                                                <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><input id="name" type="text" name="name"> </font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td align="right" width="220"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">e-mail: </font></td>
                                                                <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><input id="email" type="text" name="email"> </font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td align="right" width="220"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">pitanje :</font></td>
                                                                <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><select id="subject" name="subject">
                                                                            <option>prvo</option>
                                                                            <option>drugo</option>
                                                                            <option>nešto</option>
                                                                        </select> </font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td align="right" width="220"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">kontaktiraj me..</font></td>
                                                                <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><label><input type="radio" name="contact_preference" value="email"> E-mail</label><br>
                                                                        <label><input type="radio" name="contact_preference" value="phone"> Telefon</label> </font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td align="right" width="220"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">poruka</font></td>
                                                                <td align="left"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><textarea id="message" name="message" rows="6" cols="40"></textarea> </font></td>
                                                            </tr>
                                                            <tr bgcolor="#FFFFFF">
                                                                <td colspan="2" align="center"><input type="submit" name="Submit" value="posalji"></td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>


</BODY>
</HTML>


---------------------------------------------------

<?php

$MailToAddress = "trilobit@net.hr"; // your email address
$redirectURL = "http://..koja adresa..."; // the URL of the thank you page.

# optional settings
$MailSubject = "PORUKA"; // the subject of the email
$MailToCC = ""; // CC (carbon copy) also send the email to this address (leave empty if you don't use it)
# in the $MailToCC field you can have more then one e-mail address like "a@yoursite.com, b@yoursite.com, c@yoursite.com"

# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
# You can use this scirpt to submit your forms or to receive orders by email.

# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes

# This script was written by George A. & Calin S. from Web4Future.com
# There are no copyrights in the sent emails.

# SPAMASSASSIN RATING: 0.4

# DO NOT EDIT BELOW THIS LINE ==================================================================
# ver. 1.5
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>$MailSubject</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body>";
if (count($_GET) >0) {
    reset($_GET);
    while(list($key, $val) = each($_GET)) {
        $GLOBALS[$key] = $val;
        if (is_array($val)) {
            $w4fMessage .= "<b>$key:</b> ";
            foreach ($val as $vala) {
                $vala =stripslashes($vala);
                $w4fMessage .= "$vala, ";
            }
            $w4fMessage .= "<br>";
        }     
        else {
            $val = stripslashes($val);
            if (($key == "Submit") || ($key == "submit")) { }     
            else {     if ($val == "") { $w4fMessage .= "$key: - <br>"; }
                    else { $w4fMessage .= "<b>$key:</b> $val<br>"; }
            }
        }
    } // end while
}//end if
else {
    reset($_POST);
    while(list($key, $val) = each($_POST)) {
        $GLOBALS[$key] = $val;
        if (is_array($val)) {
            $w4fMessage .= "<b>$key:</b> ";
            foreach ($val as $vala) {
                $vala =stripslashes($vala);
                $w4fMessage .= "$vala, ";
            }
            $w4fMessage .= "<br>";
        }     
        else {
            $val = stripslashes($val);
            if (($key == "Submit") || ($key == "submit")) { }     
            else {     if ($val == "") { $w4fMessage .= "$key: - <br>"; }
                    else { $w4fMessage .= "<b>$key:</b> $val<br>"; }
            }
        }
    } // end while
    }//end else
$w4fMessage = "<font face=verdana size=2>".$w4fMessage."</font></body></html>";
if (!mail($MailToAddress, $MailSubject, $w4fMessage, "From: $name <$email>\r\nReply-To: $name <$email>\r\nMessage-ID: <". md5(rand()."".time()) ."@". ereg_replace("[url=http://www.]www.[/url]","",$_SERVER["SERVER_NAME"]) .">\r\nMIME-Version: 1.0\r\nX-Priority: 3\r\nX-Mailer: PHP/" . phpversion()."\r\nX-MimeOLE: Produced By Web4Future Easiest Form2Mail v1.5\r\nBCc: $MailToCC\r\nContent-Type: text/html; charset=ISO-8859-1\r\nContent-Transfer-Encoding: 8bit\r\n")) { echo "Error sending e-mail!";}
else { header("Location: ".$redirectURL); }
?>
Back to top
View user's profile Send private message
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 17.10.2005 16:59    Post subject: Add user to your forum ignore list Reply with quote

zašto je form action preko FTP protokola, makni to... stavi samo ime php datoteke na koju podaci idu

Rekla si da te ne redirecta na dobru stranicu nakon što uspješno pošalje mail? Iz PHP-a kojeg si poslala jasno vidim da će te u svakom slučaju redirectat na $redirectURL. Dakle provjeri sadržaj te varijable - neka bude apsolutna URL adresa
Back to top
View user's profile Send private message Send e-mail Visit poster's website
štrumfhoza



Joined: 24 Feb 2005
Posts: 89

PostPosted: 17.10.2005 17:54    Post subject: Add user to your forum ignore list Reply with quote

velki tenks ju!
Back to top
View user's profile Send private message
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