Avatar billede eds Nybegynder
21. oktober 2003 - 16:23 Der er 13 kommentarer og
1 løsning

Jeg vil gerne have ændret denne form

Hej, jeg vil gerne have ændret denne form sådan så man ikke behøver udfylde nogle af felterne, og så skal der heller ikke sendes nogen e-mail til den person der har brugt formen her er den:

<?
//=====================================================================||
//              NOP Design JavaScript Shopping Cart                  ||
//                  PHP SCRIPT Checkout Module                        ||
//                                                                    ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com              ||
//                                                                    ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design.  You must keep this comment unchanged in  ||
// your code.  For more information contact FreeCart@NopDesign.com.    ||
//                                                                    ||
// JavaScript Shop Module, V.4.4.0                                    ||
//=====================================================================||
//                                                                    ||
//  Function: Writes available form elements from the NOP              ||
//            Free Cart (http://www.nopdesign.com/freecart)            ||
//            and other form elements to an email file, and            ||
//            send user confirmation                                  ||
//                                                                    ||
//=====================================================================||


//######################################################################
//                                                                    #
// User defined variables:                                            #
//    $header        - string value containing the complete          #
//                      path of the HTML page header                  #
//    $footer        - string value containing the complete          #
//                      path of the HTML page footer                  #
//    $youremail    - string value containing the email address to  #
//                      send catalog orders in EMAIL or BOTH modes    #
//    $returnpage    - URL to send user when checkout is complete    #
//    $csvfilename  - string value containing the complete          #
//                      path of the user database.                    #
//    $csvquote      - string value containing what to use for quotes #
//                      in the csv file (typically "" or \")          #
//    $mode          - string value containing 'EMAIL', 'FILE' or    #
//                      'BOTH' to determine if the script should send  #
//                      an email to you with the new order, write the  #
//                      order to a CSV file, or do both.              #
//######################################################################
$header        = "header.html";
$footer        = "footer.html";
$returnpage    = "/";
$youremail    = "e-mail@e-mail";
$csvfilename  = "orders.csv";
$csvquote      = "\"\"";
$mode          = "BOTH";


//##############################################################
//#FUNCTION:  doFormError                                    #
//#RETURNS:                                                    #
//#PARAMETERS: A error message string.                        #
//#PURPOSE:    Generates an HTML page indicating a form        #
//#            submission error occurred.                      #
//##############################################################
function doFormError($errString) {

    include($header);

    echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
    echo "$errString<BR><BR>\n";
    echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE='  Return to the checkout page '><HR>";

    include($footer);

    exit;
}

//##############################################################
//#FUNCTION:  doError                                        #
//#RETURNS:                                                    #
//#PARAMETERS: A error message string.                        #
//#PURPOSE:    Generates an HTML page indicating an error      #
//#            occurred.                                      #
//##############################################################
function doError($errString) {

    include($header);

    echo "$errString<BR><BR>\n";

    include($footer);

    exit;
}



//##############################################################
//##############################################################
//###  MAIN                                                  ###
//##############################################################
//##############################################################

if (($b_first == "") || ($b_last == "") || ($b_addr == "") || ($b_city == "") || ($b_state == "") || ($b_zip == "") || ($b_phone == "") || ($b_email == "")) {
  doFormError("I'm sorry, but it appears that you forgot to fill in a required field.  Please go <A HREF='java script:history.go(-1);'>back</A> and correct the error.");
  exit;
}

//# checks for valid email address
if( !(ereg("^(.+)@(.+)\\.(.+)$",$b_email)) ) {
    doFormError("You submitted an invalid email address.  Please go <A HREF='java script:history.go(-1);'>back</A> and correct the error.");
    exit;
}

$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "A new order has been received.  A summary of this order appears below.\n";
$strMessageBody .= "\n";
$strMessageBody .= "Order Date: $today \n";
$strMessageBody .= " \n";
$strMessageBody .= "Bill To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= "  $b_first $b_last \n";
$strMessageBody .= "  $b_addr \n";
$strMessageBody .= "  $b_addr2 \n";
$strMessageBody .= "  $b_city, $b_state  $b_zip \n";
$strMessageBody .= "  $b_phone \n";
$strMessageBody .= "  $b_fax \n";
$strMessageBody .= "  $b_email \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Ship To: \n";
$strMessageBody .= "-------- \n";
$strMessageBody .= "  $s_first $s_last \n";
$strMessageBody .= "  $s_addr \n";
$strMessageBody .= "  $s_addr2 \n";
$strMessageBody .= "  $s_city, $s_state  $s_zip \n";
$strMessageBody .= "  $s_phone \n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Qty  Price(\$)  Product ID  - Product Name\n";
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "$QUANTITY_1    \$$PRICE_1    $ID_1 - $NAME_1  $ADDTLINFO_1  \n";
if( $NAME_2 ) {$strMessageBody .= "$QUANTITY_2    \$$PRICE_2    $ID_2 - $NAME_2  $ADDTLINFO_2  \n";}
if( $NAME_3 ) {$strMessageBody .= "$QUANTITY_3    \$$PRICE_3    $ID_3 - $NAME_3  $ADDTLINFO_3  \n";}
if( $NAME_4 ) {$strMessageBody .= "$QUANTITY_4    \$$PRICE_4    $ID_4 - $NAME_4  $ADDTLINFO_4  \n";}
if( $NAME_5 ) {$strMessageBody .= "$QUANTITY_5    \$$PRICE_5    $ID_5 - $NAME_5  $ADDTLINFO_5  \n";}
if( $NAME_6 ) {$strMessageBody .= "$QUANTITY_6    \$$PRICE_6    $ID_6 - $NAME_6  $ADDTLINFO_6  \n";}
if( $NAME_7 ) {$strMessageBody .= "$QUANTITY_7    \$$PRICE_7    $ID_7 - $NAME_7  $ADDTLINFO_7  \n";}
if( $NAME_8 ) {$strMessageBody .= "$QUANTITY_8    \$$PRICE_8    $ID_8 - $NAME_8  $ADDTLINFO_8  \n";}
if( $NAME_9 ) {$strMessageBody .= "$QUANTITY_9    \$$PRICE_9    $ID_9 - $NAME_9  $ADDTLINFO_9  \n";}
if( $NAME_10 ){$strMessageBody .= "$QUANTITY_10    \$$PRICE_10    $ID_10 - $NAME_10  $ADDTLINFO_10 \n";}
if( $NAME_11 ){$strMessageBody .= "$QUANTITY_11    \$$PRICE_11    $ID_11 - $NAME_11  $ADDTLINFO_11 \n";}
if( $NAME_12 ){$strMessageBody .= "$QUANTITY_12    \$$PRICE_12    $ID_12 - $NAME_12  $ADDTLINFO_12 \n";}
if( $NAME_13 ){$strMessageBody .= "$QUANTITY_13    \$$PRICE_13    $ID_13 - $NAME_13  $ADDTLINFO_13 \n";}
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n";
$strMessageBody .= "FREIGHT: $SHIPPING \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Comments: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";


if( $mode == "BOTH" || $mode == "EMAIL") {
  //# Send email order to you...
  $mailheaders = "From: $b_email\r\n";
  $mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
  $subject = "New Online Order";
  mail($youremail, $subject, $strMessageBody, $mailheaders);
}

//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);

include($header);

echo "<h2>Thank you</h2>";
echo "Thank you for your order from our online store.  You will receive a confirmation email of your order ";
echo "momentarily.  Please contact us at $youremail if you have any questions or concerns.";
echo "<P>";
echo "<A HREF=\"$returnpage\" target=_top>Return Home</A>";
echo "<P>";

include($footer);

?>
Avatar billede eds Nybegynder
21. oktober 2003 - 16:25 #1
Hvis i vil have den html-fil jeg bruger til at sende oplyninger til formen med så er den her:

<HTML>
<HEAD>
  <TITLE>
    CHECKOUT -- The Ultimate Delicacy: Your Source for Gourmet Foods
  </TITLE>
  <STYLE>
  .greetext  { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;color: #006600;}
  .blacktext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;color: #000000;}   
  .checkout {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;}
  .checkoutinput {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;} 
  .nopcart {background: #464444;border: 1px;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #ffffff;}
  .nopheader {background: #464444;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF;}
  .nopentry {background: #FFFFFF;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;}
  .noptotal {background: #FFFFFF;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;}
  .nopbutton {background: #FFFFFF;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;}
  </STYLE>
<SCRIPT SRC="language-en.js"></SCRIPT>
<SCRIPT SRC="nopcart.js">
  //=====================================================================||
  //              NOP Design JavaScript Shopping Cart                  ||
  //                                                                    ||
  // For more information on SmartSystems, or how NOPDesign can help you ||
  // Please visit us on the WWW at http://www.nopdesign.com              ||
  //                                                                    ||
  // JavaScript Shop Module, V.4.4.0                                    ||
  //=====================================================================||
</SCRIPT>
<SCRIPT>
function CheckForm( theform )
{
    var bMissingFields = false;
    var strFields = "";
   
    if( theform.b_first.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: First Name\n";
    }
    if( theform.b_last.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: Last Name\n";
    }
    if( theform.b_addr.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: Address\n";
    }
    if( theform.b_city.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: City\n";
    }
    if( theform.b_state.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: State\n";
    }
    if( theform.b_zip.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: Zipcode\n";
    }
    if( theform.b_phone.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: Phone\n";
    }
    if( theform.b_email.value == '' ){
        bMissingFields = true;
        strFields += "    Billing: Email\n";
    }
       
    if( bMissingFields ) {
        alert( "I'm sorry, but you must provide the following field(s) before continuing:\n" + strFields );
        return false;
    }
   
    return true;
}
</SCRIPT>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
</head>
<BODY BGCOLOR="White" TEXT="Black">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
  <TD VALIGN=TOP BGCOLOR=#663333>
  <IMG SRC="./images/one.gif" WIDTH=2 HEIGHT=20 ALT="">
 
  </TD>
  </TR>
</TABLE>

<blockquote>

<NOSCRIPT>
Whoops, we detected that your browser does not have JavaScript, or it is disabled.  Our product catalog requires that you
have JavaScript enabled to order products.  <a href="http://www.netscape.com">Netscape</a> and <a href="http://www.microsoft.com/ie">Microsoft</a>
offer free browsers which support JavaScript.  If you are using a JavaScript compliant browser and still have problems, make sure you
have JavaScript enabled in your browser's preferences.
</NOSCRIPT>

<FONT CLASS="checkout"><!-- If you wish to use the PHP checkout instead of perl, just replace the /cgi-bin/checkout.pl below with checkout.php -->
    </font><form action="form.php" method="POST" onSubmit="return CheckForm(this)">
    <FONT CLASS="checkout"><NOBR>
    <SCRIPT>
        CheckoutCart();
    </SCRIPT>
    </NOBR>
<br>
        </font><P>

<FONT CLASS="checkout"><font class="blacktext"><b>Please fill out the following information below to complete your order.</b>


        </font></font><p>
<FONT CLASS="checkout"><b><font class="greetext">Billing Information:</font></font></b><P>

<TABLE class="blacktext">
<TR><TD>Name:    </TD><TD><input type="text" size="18" name="b_first"> <input type="text" size="15" name="b_last"></TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="b_addr"> </TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="b_addr2"></TD></TR>
<TR><TD>City:    </TD><TD><input type="text" size="21" name="b_city"> </TD></TR>
<TR><TD>State:  </TD><TD><input type="text" size="1"  name="b_state"> </TD></TR>
<TR><TD>Zip:    </TD><TD><input type="text" size="5"  name="b_zip"></TD></TR>
<TR><TD>Phone:  </TD><TD><input type="text" size="37" name="b_phone"></TD></TR>
<TR><TD>Fax:    </TD><TD><input type="text" size="37" name="b_fax"></TD></TR>
<TR><TD>Email:  </TD><TD><input type="text" size="37" name="b_email"> </TD></TR>
</TABLE>
<p>
<FONT CLASS="checkout"><b><font class="greetext">Shipping Information (if different than billing):</font></font></b><P>
<TABLE class="blacktext">
<TR><TD>Name:    </TD><TD><input type="text" size="18" name="s_first"> <input type="text" size="15" name="s_last"></TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="s_addr"> </TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="s_addr2"></TD></TR>
<TR><TD>City:    </TD><TD><input type="text" size="21" name="s_city"> </TD></TR>
<TR><TD>State:  </TD><TD><input type="text" size="1"  name="s_state"> </TD></TR>
<TR><TD>Zip:    </TD><TD><input type="text" size="5"  name="s_zip"></TD></TR>
<TR><TD>Phone:  </TD><TD><input type="text" size="37" name="s_phone"></TD></TR>
<TR><TD>Fax:    </TD><TD><input type="text" size="37" name="s_fax"></TD></TR>
<TR><TD>Email:  </TD><TD><input type="text" size="37" name="s_email"> </TD></TR>
</TABLE>
<p>

<FONT CLASS="checkout"><FONT class="blacktext"><b><font class="greetext">Comments/Special Instructions:</font></font></b></font><P>
<FONT CLASS="checkout"><font class="blacktext"><TEXTAREA NAME="comment" ROWS=6 COLS=40>
</TEXTAREA>

        </font></font><p>
<FONT CLASS="checkout"><b><font color="#660000">This is a DEMO SITE!  No real orders will be taken, and no products
will be shipped.  Please use a real email address to view the checkout confirmation.  Your email
address will NOT be stored on the server, or used for ANYTHING, EVER!</font></font></b><P>
<FONT CLASS="checkout"><input type=submit Value="Submit Order"> <INPUT type=RESET value="  Clear Form  ">
    </font></p>
    </FORM>   
</blockquote>
    </center>   
</body>
</html>
Avatar billede eds Nybegynder
21. oktober 2003 - 17:18 #2
Kom nu er der slet ikke nogle der kan svare.
Avatar billede thesurfer Nybegynder
23. oktober 2003 - 22:36 #3
disse ligner sender en mail til brugeren der har udfyldt formen:

//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);

de skal så enten slettes eller kommenteres.

---

"jeg vil gerne have ændret denne form sådan så man ikke behøver udfylde nogle af felterne"
vil det sige at den skal sende mailen til dig selvom der ikke er skrevet nget? så du modtager en tom mail fra brugeren..? eller hvad?
Avatar billede eds Nybegynder
04. november 2003 - 13:17 #4
Ja fordi fordi det er et shopping system og den skal kun sende oplysningerne til mig og det skal kun være de oplysninger man får fra shopping cardet...
Avatar billede thesurfer Nybegynder
05. november 2003 - 00:50 #5
har du prøvet at slette eller kommenteret det jeg skrev foroven?
Avatar billede eds Nybegynder
08. november 2003 - 22:30 #6
Har fundet ud af det her:

<?
//=====================================================================||
//              NOP Design JavaScript Shopping Cart                  ||
//                  PHP SCRIPT Checkout Module                        ||
//                                                                    ||
// For more information on SmartSystems, or how NOPDesign can help you ||
// Please visit us on the WWW at http://www.nopdesign.com              ||
//                                                                    ||
// Javascript portions of this shopping cart software are available as ||
// freeware from NOP Design.  You must keep this comment unchanged in  ||
// your code.  For more information contact FreeCart@NopDesign.com.    ||
//                                                                    ||
// JavaScript Shop Module, V.4.4.0                                    ||
//=====================================================================||
//                                                                    ||
//  Function: Writes available form elements from the NOP              ||
//            Free Cart (http://www.nopdesign.com/freecart)            ||
//            and other form elements to an email file, and            ||
//            send user confirmation                                  ||
//                                                                    ||
//=====================================================================||


//######################################################################
//                                                                    #
// User defined variables:                                            #
//    $header        - string value containing the complete          #
//                      path of the HTML page header                  #
//    $footer        - string value containing the complete          #
//                      path of the HTML page footer                  #
//    $youremail    - string value containing the email address to  #
//                      send catalog orders in EMAIL or BOTH modes    #
//    $returnpage    - URL to send user when checkout is complete    #
//    $csvfilename  - string value containing the complete          #
//                      path of the user database.                    #
//    $csvquote      - string value containing what to use for quotes #
//                      in the csv file (typically "" or \")          #
//    $mode          - string value containing 'EMAIL', 'FILE' or    #
//                      'BOTH' to determine if the script should send  #
//                      an email to you with the new order, write the  #
//                      order to a CSV file, or do both.              #
//######################################################################
$header        = "header.html";
$footer        = "footer.html";
$returnpage    = "/";
$youremail    = "eirik@stofanet.dk";
$csvquote      = "\"\"";
$mode          = "BOTH";


//##############################################################
//#FUNCTION:  doFormError                                    #
//#RETURNS:                                                    #
//#PARAMETERS: A error message string.                        #
//#PURPOSE:    Generates an HTML page indicating a form        #
//#            submission error occurred.                      #
//##############################################################
function doFormError($errString) {

    include($header);

    echo "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
    echo "$errString<BR><BR>\n";
    echo "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE='  Return to the checkout page '><HR>";

    include($footer);

    exit;
}

//##############################################################
//#FUNCTION:  doError                                        #
//#RETURNS:                                                    #
//#PARAMETERS: A error message string.                        #
//#PURPOSE:    Generates an HTML page indicating an error      #
//#            occurred.                                      #
//##############################################################
function doError($errString) {

    include($header);

    echo "$errString<BR><BR>\n";

    include($footer);

    exit;
}



//##############################################################
//##############################################################
//###  MAIN                                                  ###
//##############################################################
//##############################################################


$today = date ("l, F jS Y");
$strMessageBody = "";
$strMessageBody .= "Kopi af oplysninger:\n";
$strMessageBody .= "\n";
$strMessageBody .= "\n";
$strMessageBody .= " \n";
$strMessageBody .= "Bruger = eds: \n";
$strMessageBody .= "--------\n";
$strMessageBody .= " \n";
$strMessageBody .= " \n";
$strMessageBody .= "Pris i(\kr.)  Varenummer  - Varenavn\n";
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "$QUANTITY_1    \$$PRICE_1    $ID_1 - $NAME_1  $ADDTLINFO_1  \n";
if( $NAME_2 ) {$strMessageBody .= "$QUANTITY_2    \$$PRICE_2    $ID_2 - $NAME_2  $ADDTLINFO_2  \n";}
if( $NAME_3 ) {$strMessageBody .= "$QUANTITY_3    \$$PRICE_3    $ID_3 - $NAME_3  $ADDTLINFO_3  \n";}
if( $NAME_4 ) {$strMessageBody .= "$QUANTITY_4    \$$PRICE_4    $ID_4 - $NAME_4  $ADDTLINFO_4  \n";}
if( $NAME_5 ) {$strMessageBody .= "$QUANTITY_5    \$$PRICE_5    $ID_5 - $NAME_5  $ADDTLINFO_5  \n";}
if( $NAME_6 ) {$strMessageBody .= "$QUANTITY_6    \$$PRICE_6    $ID_6 - $NAME_6  $ADDTLINFO_6  \n";}
if( $NAME_7 ) {$strMessageBody .= "$QUANTITY_7    \$$PRICE_7    $ID_7 - $NAME_7  $ADDTLINFO_7  \n";}
if( $NAME_8 ) {$strMessageBody .= "$QUANTITY_8    \$$PRICE_8    $ID_8 - $NAME_8  $ADDTLINFO_8  \n";}
if( $NAME_9 ) {$strMessageBody .= "$QUANTITY_9    \$$PRICE_9    $ID_9 - $NAME_9  $ADDTLINFO_9  \n";}
if( $NAME_10 ){$strMessageBody .= "$QUANTITY_10    \$$PRICE_10    $ID_10 - $NAME_10  $ADDTLINFO_10 \n";}
if( $NAME_11 ){$strMessageBody .= "$QUANTITY_11    \$$PRICE_11    $ID_11 - $NAME_11  $ADDTLINFO_11 \n";}
if( $NAME_12 ){$strMessageBody .= "$QUANTITY_12    \$$PRICE_12    $ID_12 - $NAME_12  $ADDTLINFO_12 \n";}
if( $NAME_13 ){$strMessageBody .= "$QUANTITY_13    \$$PRICE_13    $ID_13 - $NAME_13  $ADDTLINFO_13 \n";}
$strMessageBody .= "===================================================================== \n";
$strMessageBody .= "SUBTOTAL: $SUBTOTAL \n";
$strMessageBody .= "TOTAL: $TOTAL \n";
$strMessageBody .= "\n";
$strMessageBody .= "FRAGT: $SHIPPING \n";
$strMessageBody .= "\n\n";
$strMessageBody .= "Kommentarer: \n";
$strMessageBody .= "--------- \n";
$strMessageBody .= "$comment \n";
$strMessageBody .= " \n";

if( $mode == "BOTH" || $mode == "EMAIL") {
  //# Send email order to you...
  $mailheaders = "From: $b_email\r\n";
  $mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
  $subject = "Oplysninger fra Shisha";
  mail($youremail, $subject, $strMessageBody, $mailheaders);
}

//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Oplysninger fra Shisha";
mail($b_email, $subject, $strMessageBody, $mailheaders);

include($header);

echo "<h2>Du har nu bestilt.</h2>";
echo "Du vil modtage en e-mail med en kopi af de oplysninger du har indtastet her, samt en ordrebekræftelse (ordrebekræftelsen vil du dog ikke modtage med det samme.";
echo "<P>";
echo "<P>";
echo "<A HREF=\"test.html\" target=index>Tilbage til startsiden.</A>";
echo "<P>";

include($footer);
?>
Avatar billede eds Nybegynder
08. november 2003 - 22:30 #7
Men du får points illigevel hvis du lige gider at lægge et svar.
Avatar billede thesurfer Nybegynder
09. november 2003 - 12:57 #8
Hvis jeg ikke taget meget fejl, så sender den stadig en mail til brugeren..?

Kodeblok:
//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);


Forklaring..

Disse linier sætter headeren på en mail:
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";

Denne linie sætter subject/emnet på en mail:
$subject = "Order Confirmation";

Denne linie sender en mail til den email adr der står i $b_email:
mail($b_email, $subject, $strMessageBody, $mailheaders);

Brugerens email, dvs den han/hun har indtastet som email, står i $b_email.

Med andre ord: brugeren modtager en mail.

Hvis brugeren ikke skal have en mail, skal kodeblokken IKKE udføres.. det undgår man ved at kommentere eller slette kodeblokken.


- Kan du ikke lige skrive tilbage, om det er i orden, som det er nu?
Avatar billede eds Nybegynder
09. november 2003 - 15:01 #9
jeg kan se hvad du mener, men jeg har fjernet en linje sådan så man ikke skal indtaste e-mail, og hvis der ikke er indtastet en e-mail, sender den jo heler ikke noget til brugeren.
Avatar billede thesurfer Nybegynder
11. november 2003 - 17:46 #10
hmm.. vil da prøve på at sende mailen alligevel.. men da der ikke er nogen modtager, vil den fejle..

send mail funktionen bliver udført lige meget hvad..
Avatar billede eds Nybegynder
12. november 2003 - 14:46 #11
Ok, men skal jeg så ikke bare slette dette stykke kode:

//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);
Avatar billede thesurfer Nybegynder
17. november 2003 - 23:12 #12
Jow, og det var også det jeg skrev i mit indlæg 23/10-2003 22:36:32:

<Citat>
disse ligner sender en mail til brugeren der har udfyldt formen:

//# Send email conformation to the customer.....
$mailheaders = "From: $youremail\r\n";
$mailheaders .="X-Mailer: PHP Mail generated by:NOP Design Shopping Cart\r\n";
$subject = "Order Confirmation";
mail($b_email, $subject, $strMessageBody, $mailheaders);

de skal så enten slettes eller kommenteres.
</Citat>
Avatar billede eds Nybegynder
19. november 2003 - 21:13 #13
ok. tak for hjælpen her er dine points.
Avatar billede thesurfer Nybegynder
19. november 2003 - 23:37 #14
Glad for at kunne hjælpe.
Takker for points.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester