44 users online (2 members and 42 guests)  


Page 2 of 2 First 1 2
  Results 16 to 30 of 30

Related

  1. Replies: 1
  2. Replies: 4
  3. Replies: 1
  4. Form Handling Script for 'Tell A Friend' Form    Forum: Javascript Forum
    Replies: 1
  5. Replies: 3
  1. #16
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    Thx I'll give this a try tonight.

  2. #17
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    Ok....this is the situation. With the regular JavaScript Alert
    it works fine, but I get two emails...one blank and one with the info. If I try to use my chromeless JavaScript and the popup window with thankyou.html in it I get a PHP error plus 3 emails.....2 blanks and one relevant. Just wondering if you have any ideas....oh yeah how do I make it send to two people?
    **EDIT** CORRECTION: If I have the Chromeless Window JavaScript @ the top of the page instead of right above the code which is supposed to pop it up I get 2 emails one blank one with content....if I put the Chromeless Window JavaScript right above the pop up code then I get this error:
    Parse error: parse error, expecting `','' or `';'' in /.../contact.php on line 51
    And no emails......looks like when it tries to send it it hits some catch. This is how i have it with the current situation above....
    PHP Code:
    <HTML>
    <HEAD>
    <TITLE>COLOR Concepts - Your Source For Digital Artwork - [Contact]</TITLE>
    <style type="text/css">
    <!-- BODY, TABLE, DIV, P
    a { font: 10pt arial narrow ; color: #000000; text-decoration: none; font-weight: 

    bold}
    a:link { color: #0000FF; text-decoration: none;}
    a:active { color: #0000FF; text-decoration: underline; }
    a:visited { color: #0000FF; text-decoration: none }
    a:hover { color: #0000FF; text-decoration: underline; }
    BODY {scrollbar-3d-light-color:#171582; 
    scrollbar-arrow-color:#FFFFFF; 
    scrollbar-base-color:#CCCCCC; 
    scrollbar-dark-shadow-color:#000000; 
    scrollbar-face-color:#CFCFCF; 
    scrollbar-highlight-color:#FFFFFF; 
    scrollbar-shadow-color:#000000}
    -->
    </style>
    </HEAD>
    <BODY alink="#DDDDDD" vlink="#DDDDDD" link="#DDDDDD" 

    background="images/framebackground.gif" bgproperties="fixed" leftmargin="2" 

    topmargin="2">
    <center>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
            <img src="images/contactbanner.gif" width="700" height="78" 

    alt="Contact Banner">
            </td>
        </tr>
    </table>
    </center>
    <br>
    <center>
    <form method=POST action="contact.php">
    Name: <input type="text" name="name"><br>
    Subject: <input type="text" name="subject"><br>
    E-mail: <input type="text" name="email"><br>
    <textarea name="message" cols=45></textarea><br>
    <input type="Submit" value="Submit" name="submit">
    </form>
    <?php
    strip_tags
    ($name);
    strip_tags($subject);
    strip_tags($email);
    strip_tags($message);
    mail("dave@colorconceptsdesign.com""$subject""
    Name: 
    $name\n
    Message: 
    $message\n""From: Color Concepts Contact Form\nReply-to: $email\n");

    if (
    $submit) {
    echo 
    "
    <script language="
    javascript" type="text/javascript" src="chromeless.js"></script>
    <script language="
    javascript">
    function openIT(u,W,H,X,Y,n) {
    var cD ='images/close.gif'
    var cU ='images/close.gif'
    var cO ='images/close.gif'
    var cL
    var tH ='<font face=arial size=1><b>.::COLORCONCEPTS::.</b></font>'
    var tW ='COLOR Concepts'
    var wB ='#000000'
    var wBs ='#000000'
    var wBG ='#FFFFFF'
    var wBGs='#FFFFFF'
    var wNS 

    ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'
    var fSO ='scrolling=no noresize'
    chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO)
    }
    </script>
    <body onload=java script:OpenIT('thankyou.html',200,200,null,null,'thankyou')>
    "
    ;
    }
    ?>
    </center>
    </BODY>
    </HTML>
    Last edited by Mr. Blue; 04-19-2002 at 07:52 PM.

  3. #18
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    one thing I see wrong is the double quotes... I changed them to single for a reason man.

    like <script language="javascript"> should be <script language='javascript'> (inside the echo " " tag). You can't have double quotes inside of double quotes.

    try changing that and tell me what happens.

  4. #19
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148

    PHP Code:
    <HTML>
    <HEAD>
    <TITLE>COLOR Concepts - Your Source For Digital Artwork - [Contact]</TITLE>
    <style type="text/css">
    <!-- BODY, TABLE, DIV, P
    a { font: 10pt arial narrow ; color: #000000; text-decoration: none; font-weight: 

    bold}
    a:link { color: #0000FF; text-decoration: none;}
    a:active { color: #0000FF; text-decoration: underline; }
    a:visited { color: #0000FF; text-decoration: none }
    a:hover { color: #0000FF; text-decoration: underline; }
    BODY {scrollbar-3d-light-color:#171582; 
    scrollbar-arrow-color:#FFFFFF; 
    scrollbar-base-color:#CCCCCC; 
    scrollbar-dark-shadow-color:#000000; 
    scrollbar-face-color:#CFCFCF; 
    scrollbar-highlight-color:#FFFFFF; 
    scrollbar-shadow-color:#000000}
    -->
    </style>
    </HEAD>
    <BODY alink="#DDDDDD" vlink="#DDDDDD" link="#DDDDDD" 

    background="images/framebackground.gif" bgproperties="fixed" leftmargin="2" 

    topmargin="2">
    <center>
    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
            <img src="images/contactbanner.gif" width="700" height="78" 

    alt="Contact Banner">
            </td>
        </tr>
    </table>
    </center>
    <br>
    <center>
    <form method=POST action="contact.php">
    Name: <input type="text" name="name"><br>
    Subject: <input type="text" name="subject"><br>
    E-mail: <input type="text" name="email"><br>
    <textarea name="message" cols=45></textarea><br>
    <input type="Submit" value="Submit" name="submit">
    </form>
    <?php
    strip_tags
    ($name);
    strip_tags($subject);
    strip_tags($email);
    strip_tags($message);
    mail("dave@colorconceptsdesign.com""$subject""
    Name: 
    $name\n
    Message: 
    $message\n""From: Color Concepts Contact Form\nReply-to: $email\n");

    if (
    $submit) {
    echo 
    "
    <script language='javascript' type='text/javascript' src='chromeless.js'></script>
    <script language='javascript'>
    function openIT(u,W,H,X,Y,n) {
    var cD ='images/close.gif'
    var cU ='images/close.gif'
    var cO ='images/close.gif'
    var cL
    var tH ='<font face=arial size=1><b>.::COLORCONCEPTS::.</b></font>'
    var tW ='COLOR Concepts'
    var wB ='#000000'
    var wBs ='#000000'
    var wBG ='#FFFFFF'
    var wBGs='#FFFFFF'
    var wNS    ='toolbar=0,location=0,directories=0,status=0,menu
    bar=0,scrollbars=0,resizable=0'
    var fSO ='scrolling=no noresize'
       chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wB
    G,wBGs,wNS,fSO)
    }
    </script>
    <body onload=java script:OpenIT('thankyou.html',200,200,null,null,'thankyou')>
    "
    ;
    }
    ?>
    </center>
    </BODY>
    </HTML>
    This doesn't work....it still submits twice and the popup doesn't work....

  5. #20
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    <HTML>
    <HEAD>
    <TITLE>COLOR Concepts - Your Source For Digital Artwork - [Contact]</TITLE>
    <style type="text/css">
    <!-- BODY, TABLE, DIV, P
    a { font: 10pt arial narrow ; color: #000000; text-decoration: none; font-weight:

    bold}
    a:link { color: #0000FF; text-decoration: none;}
    a:active { color: #0000FF; text-decoration: underline; }
    a:visited { color: #0000FF; text-decoration: none }
    a:hover { color: #0000FF; text-decoration: underline; }
    BODY {scrollbar-3d-light-color:#171582;
    scrollbar-arrow-color:#FFFFFF;
    scrollbar-base-color:#CCCCCC;
    scrollbar-dark-shadow-color:#000000;
    scrollbar-face-color:#CFCFCF;
    scrollbar-highlight-color:#FFFFFF;
    scrollbar-shadow-color:#000000}
    -->
    </style>
    </HEAD>
    <BODY alink="#DDDDDD" vlink="#DDDDDD" link="#DDDDDD"

    background="images/framebackground.gif" bgproperties="fixed" leftmargin="2"

    topmargin="2">
    <center>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <img src="images/contactbanner.gif" width="700" height="78"

    alt="Contact Banner">
    </td>
    </tr>
    </table>
    </center>
    <br>
    <center>
    <form method=POST action="contact.php">
    Name: <input type="text" name="name"><br>
    Subject: <input type="text" name="subject"><br>
    E-mail: <input type="text" name="email"><br>
    <textarea name="message" cols=45></textarea><br>
    <input type="Submit" value="Submit" name="submit">
    </form>
    <?php
    if ($submit==1) {
    echo "
    <script language='javascript' type='text/javascript' src='chromeless.js'></script>
    <script language='javascript'>
    function openIT(u,W,H,X,Y,n) {
    var cD ='images/close.gif'
    var cU ='images/close.gif'
    var cO ='images/close.gif'
    var cL
    var tH ='<font face=arial size=1><b>.::COLORCONCEPTS::.</b></font>'
    var tW ='COLOR Concepts'
    var wB ='#000000'
    var wBs ='#000000'
    var wBG ='#FFFFFF'
    var wBGs='#FFFFFF'
    var wNS ='toolbar=0,location=0,directories=0,status=0,menu
    bar=0,scrollbars=0,resizable=0'
    var fSO ='scrolling=no noresize'
    chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wB
    G,wBGs,wNS,fSO)
    }
    </script>
    <body onload=java script:OpenIT('thankyou.html',200,200,null,null,'thankyou')>
    ";
    }
    strip_tags($name);
    strip_tags($subject);
    strip_tags($email);
    strip_tags($message);
    mail("dave@colorconceptsdesign.com", "$subject", "
    Name: $name\n
    Message: $message\n", "From: Color Concepts Contact Form\nReply-to: $email\n");
    ?>
    </center>
    </BODY>
    </HTML>

    Try this, does it change anything?

    and another questoin, instead of defining all those aspects of the new popup on this page why don't you just make a popup page and define it on that page instead of this one? It would probably be easier to make it work with the PHP that way.

    EDIT: It may be the '{,}' in the javascript code that might be messing it up to, I don't know, so if you define them in another page if that was the problem it would remedy that too.
    Last edited by Derek; 04-20-2002 at 12:26 AM.

  6. #21
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    It's still not working...is the if($submit supposed to have two "=" after it or one....that just looked strange to me. Right now I don't care about the pop up anymore....all I'd like is for the form not to send two emails for each submission...that is the part that is really bugging me more than the rest.

  7. #22
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    it was supposed to have two... I can see no reason it should send the other e-mails but it is so just add this... I don't think minglin PHP and JavaScript is that great anyways

    <?php
    strip_tags($name);
    strip_tags($subject);
    strip_tags($email);
    strip_tags($message);
    mail("dave@colorconceptsdesign.com", "$subject", "
    Name: $name\n
    Message: $message\n", "From: Color Concepts Contact Form\nReply-to: $email\n");

    echo "
    Name: $name
    <br>
    Email: $email
    <br>
    Message: $message
    <br>
    <br>
    Thank you for e-mailing me, I will reply as soon as possible.";
    ?>

  8. #23
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    Ok I'm still getting the two emails per submission. This is my code........
    PHP Code:
    <HTML> 
    <HEAD> 
    <TITLE>COLOR Concepts - Your Source For Digital Artwork - [Contact]</TITLE> 
    <style type="text/css"> 
    <!-- BODY, TABLE, DIV, P 
    a { font: 10pt arial narrow ; color: #000000; text-decoration: none; font-weight: bold} 
    a:link { color: #0000FF; text-decoration: none;} 
    a:active { color: #0000FF; text-decoration: underline; } 
    a:visited { color: #0000FF; text-decoration: none } 
    a:hover { color: #0000FF; text-decoration: underline; } 
    BODY {scrollbar-3d-light-color:#171582; 
    scrollbar-arrow-color:#FFFFFF; 
    scrollbar-base-color:#CCCCCC; 
    scrollbar-dark-shadow-color:#000000; 
    scrollbar-face-color:#CFCFCF; 
    scrollbar-highlight-color:#FFFFFF; 
    scrollbar-shadow-color:#000000} 
    --> 
    </style> 
    </HEAD> 
    <BODY alink="#DDDDDD" vlink="#DDDDDD" link="#DDDDDD" background="images/framebackground.gif" bgproperties="fixed" 

    leftmargin="2" topmargin="2"> 
    <center> 
    <table border="0" cellpadding="0" cellspacing="0"> 
    <tr> 
    <td> 
    <img src="images/contactbanner.gif" width="700" height="78" alt="Contact Banner"> 
    </td> 
    </tr> 
    </table> 
    </center> 
    <br> 
    <center> 
    <form method=POST action="contact.php"> 
    Name: <input type="text" name="name"><br> 
    Subject: <input type="text" name="subject"><br> 
    E-mail: <input type="text" name="email"><br> 
    <textarea name="message" cols=45></textarea><br> 
    <input type="Submit" value="Submit" name="submit"> 
    </form> 
    <?php 
    strip_tags
    ($name); 
    strip_tags($subject); 
    strip_tags($email); 
    strip_tags($message); 
    mail("dave@colorconceptsdesign.com""$subject"
    Name: 
    $name\n 
    Message: 
    $message\n""From: Color Concepts Contact Form\nReply-to: $email\n"); 

    if (
    $submit) {
    echo 
    "
    Thank You For Your Submission, You May Now Return To Viewing The Rest Of Our Site.<br> -Dave & Steve-"
    ;
    }
    ?> 
    </center> 
    </BODY> 
    </HTML>
    I know how frustrating this must be for you Derek....but thanks for hanging in there.

  9. #24
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    To me, it looks like the blank email is being sent when the page loads. Then, when the form is submitted, the page loads again, this time with the form information in it, and you get the proper email.

    Might be worth putting the mail() function within the if ($submit)
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  10. #25
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    I'm still a n00b @ PHP so how would I go about that Dean? But your explanation sounds right, even though I don't know much about PHP yet.

  11. #26
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    We will just be moving some code about -

    cut this:
    PHP Code:
    strip_tags($name); 
    strip_tags($subject); 
    strip_tags($email); 
    strip_tags($message); 
    mail("dave@colorconceptsdesign.com""$subject"
    Name: 
    $name\n 
    Message: 
    $message\n""From: Color Concepts Contact Form\nReply-to: $email\n"); 
    and paste it here, to make this:
    PHP Code:
    if ($submit) {

    strip_tags($name); 
    strip_tags($subject); 
    strip_tags($email); 
    strip_tags($message); 
    mail("dave@colorconceptsdesign.com""$subject"
    Name: 
    $name\n 
    Message: 
    $message\n""From: Color Concepts Contact Form\nReply-to: $email\n"); 



    echo 
    "
    Thank You For Your Submission, You May Now Return To Viewing The Rest Of Our Site.<br> -Dave & Steve-"
    ;

    Try that.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  12. #27
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    ya, what he said

    shoulda seen that earlier... 4 eyes are better than 2

  13. #28
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    /me gets out of his chair and runs around his house screaming at the top of his lungs! It works!!!! ONLY ONE EMAIL PER SUBMIT!!!!!!!!!! YEAH!
    **EDIT** If only my domain service wasn't so [please no profanity]....I would be able to access it at a normal speed. **
    Last edited by HTML; 04-21-2002 at 08:59 PM.

  14. #29
    blacksabbath's Avatar
    Disabled

    Status
    Offline
    Join Date
    Feb 2004
    Posts
    4

    hey

    Hey,
    i need some help on my website i created. its pretty basic in all, but i can't seem to figure out how to make a sumbit form. to sumbit tablature for guitars.
    url removed
    thats my website above. i have only taken 1 years class of webmastering at highschool so i don't kno scripting languages and all. please help me!
    Last edited by HTML; 02-11-2004 at 06:48 PM. Reason: url removed

  15. #30
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi,

    Please start a new thread. You can link back to this one if needed.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Page 2 of 2 First 1 2

Tags for this Thread