Page 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

  1. #1
    jjjacas is offline x10Hosting Member
    Join Date
    Mar 2008
    Location
    South Florida.
    Posts
    18

    Unhappy Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Hi everyone I am a new girl here, i recently bought a pretty and fantastic template to showcae my Paintings and Art and to promote my Frame Shop. The Site is a Dynamic Flash Photo Gallery done almost entirely in Flash. I am able to customize it through a .htm file by editing preset text and replacing preset images with my own. It also contains an admin panel for uploading images to my gallery which is VERY nifty.

    But BEFORE i do any more of that.
    I need help getting a Contact Form to work correctly and to send to an email address. Please...

    The Contact Form is made up of TWO files(which are made to specifically work and fit in my Template, so i guess i cant exchange the code with new code,i must edit what is already there to make it work):
    contact.asp
    contact.php


    The thing is,I CANT just find a Contact/Email Tutorial and copy it because the Contact/Email Form is already preset into my Template. I guess i must change some code in the two files that make it WORK.

    But i do not know how to go from there.... I know absolutely nothing about HTML or PHP or SMTP or anything to get a Form to send emails. Please help me....

    Here is my site:
    http://jamneajacas.x10hosting.com
    I have not modified anything in my X10 hosting, i have ADD-FREE. And ONLY Upgraded PHP to Intermediate (to fix WYSIWYG fatal errors).

    Here is the code that is inside each of the files:

    CONTACT.ASP=
    Code:
    <%
        for i=1 to 7
             message=Request("message")
        next
             message=message + Request("message")    
            smtpServer = "enter your SMTP SERVER HERE"
            smtpPort = 25
            
    
            name = Request("Your_Name:")
            Set myMail = CreateObject("CDO.Message") 
            myMail.Subject = "from " & name
            myMail.From = Request("Your_Email:")
            myMail.To = Request("recipient")
            myMail.HTMLBody = "<html><head><title>Contact letter</title></head><body><br>" & message & "</body></html>"
            myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
            myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = smtpServer
            myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = smtpPort
            myMail.Configuration.Fields.Update 
            myMail.Send
        
    %>
    CONTACT.PHP=
    Code:
    <?
    Error_Reporting(E_ALL & ~E_NOTICE);
    
     while ($request = current($_REQUEST)) {
         if (key($_REQUEST)!='recipient') {
            $pre_array=split ("&777&",  $request);
            $post_vars[key($_REQUEST)][0]=$pre_array[0];
            $post_vars[key($_REQUEST)][1]=$pre_array[1];
        }
        next($_REQUEST);
    }
    
    
    
    reset($post_vars);
    
    
    $subject="From ".$post_vars['your_name'][0] ;
    $headers= "From: ".$post_vars['your_email'][0] ."\n";
     $headers.='Content-type: text/html; charset=iso-8859-1';
     $message='';
      while ($mess = current($post_vars)) {
          if ((key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {
    
             $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
        }
        next($post_vars);
     }
    
    mail($_REQUEST['recipient'], $subject,  "
    <html>
    <head>
     <title>Contact letter</title>
    </head>
    <body>
    <br>
      ".$message."
    </body>
    </html>" , $headers);
    echo ("Your message was successfully sent!");
    
    ?>
    <script>
        resizeTo(300, 300);
    </script>
    I already tried entering my email into the "your email here" and "your_email" sections with no success... I apologize i am a complete newbie when it comes to Web Site Code.

    What Server/Hosting side Optoins and .php and .asp code do I have to change to get this form to work? Can a girl get some help Please?
    Last edited by jjjacas; 03-13-2008 at 07:49 PM.

  2. #2
    Sohail's Avatar
    Sohail is offline x10 Spammer
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    3,052

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    I don't think ASP works with Flash, but i do know the PHP does. So that's why you need to convert the documnet right?
    Last edited by Sohail; 03-13-2008 at 10:04 PM.

  3. #3
    sunils's Avatar
    sunils is offline x10 Spammer
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,266

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Sorry i cant get your problem. Put your email address in the place specified in the template and test the site. Post the error that you are getting. More over your site was not scrollable for me to see the submit button. Most bottom part of the site cannot be seen in my system.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  4. #4
    easykey is offline x10Hosting Member
    Join Date
    Feb 2008
    Posts
    45

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Do you mean you are not getting any mail? There does not seem to be any errors reported when using the form.

    Know nothing about asp but in your php form the mail() function sends the mail to $_REQUEST['recipient']. You can add echo $_REQUEST['recipient']; as the first line in contact.php to see where mail() is wanting to send the message. Perhaps this is something preset in the flash template that you need to edit.

  5. #5
    jjjacas is offline x10Hosting Member
    Join Date
    Mar 2008
    Location
    South Florida.
    Posts
    18

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    @ sunils

    Ah i see... how do i make my site scrollable? The template came that way, to see the bottom, i have to go to 1280x1024 Resolution.

    And i did already put my email into the place specified, I mentioned it at the bottom of my post. But i did not receive any email from it.

    @ easykey

    Correct, i am not receiving any mail, I'm not sure why when i put my email in the required spots i still did not receive anything. But it still says that "You're message was sent!" when i hit "submit" to try and send something to my mail...

    Preset in the flash template, i don't think so. The main.fla and .swf in the site i don't have to edit. I can edit all content through a xxxxx_main.html. And that file says nothing about email.

    The only two files that say anything about mail are the contact.asp and contact.php, so if theres any code i must change its in those two files. Things is i already tried putting my email in the "your email here" and "your_email" spots, but nothing works.

    I will attempt to add the line you mentioned

    echo $_REQUEST['recipient'];

    to the top of contact.php and see if that helps. Anyone else know how to get this forum working?

  6. #6
    easykey is offline x10Hosting Member
    Join Date
    Feb 2008
    Posts
    45

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    The 'your_email' and 'your_name' fields will tell you where the email is from - you are interested in the field that tells the server where the email is going to. This is the first part of the mail() function in the contact.php page.

    If there is nothing (or something wrong) in $_REQUEST['recipient'] then you can always change it in contact.php to your email address enclosed in "" i.e.
    PHP Code:
    mail("info@somewhere.com"$subject etc.... 
    If $_REQUEST['recipient'] is OK then there must be a problem on the x10hosting mail server. It's important to know what is in that field...

  7. #7
    jjjacas is offline x10Hosting Member
    Join Date
    Mar 2008
    Location
    South Florida.
    Posts
    18

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Quote Originally Posted by easykey View Post
    Do you mean you are not getting any mail? There does not seem to be any errors reported when using the form.

    Know nothing about asp but in your php form the mail() function sends the mail to $_REQUEST['recipient']. You can add echo $_REQUEST['recipient']; as the first line in contact.php to see where mail() is wanting to send the message. Perhaps this is something preset in the flash template that you need to edit.
    Ok i tried adding that line like you said and this is what i got... it shows the email its sending to , right??



    But that email is not in the contact.php or contact.asp? I'm guessing if i find th code where that email is located , i can change it to my email, will that work?

    Can anyone help me find where that code is located?

    Here is an image of the public_html directory in my hosting:

    Maybe the code for that email is located in a file besides contact.php and contact.asp, since as you can see, that email is not in the code for those two files.
    Last edited by jjjacas; 03-14-2008 at 08:30 AM.

  8. #8
    sunils's Avatar
    sunils is offline x10 Spammer
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,266

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    I have made a small adjustment in the coding

    This was your coding
    PHP Code:
    <?
    Error_Reporting
    (E_ALL & ~E_NOTICE);

     while (
    $request current($_REQUEST)) {
         if (
    key($_REQUEST)!='recipient') {
            
    $pre_array=split ("&777&",  $request);
            
    $post_vars[key($_REQUEST)][0]=$pre_array[0];
            
    $post_vars[key($_REQUEST)][1]=$pre_array[1];
        }
        
    next($_REQUEST);
    }



    reset($post_vars);
    /**************************************************/

    $subject="From ".$post_vars['your_name'][0] ;
    $headers"From: ".$post_vars['your_email'][0] ."\n";
     
    $headers.='Content-type: text/html; charset=iso-8859-1';
     
    $message='';
      while (
    $mess current($post_vars)) {
          if ((
    key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) {

             
    $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
        }
        
    next($post_vars);
     }

    mail($_REQUEST['recipient'], $subject,  "
    <html>
    <head>
     <title>Contact letter</title>
    </head>
    <body>
    <br>
      "
    .$message."
    </body>
    </html>" 
    $headers);
    echo (
    "Your message was successfully sent!");
    /******************************************/
    ?>
    <script>
        resizeTo(300, 300);
    </script>
    I have marked some coding within the /***********/. Replace that coding by the coding which i have given below.

    PHP Code:
    $subject="From ".$post_vars['your_name'][0] ;
    $headers "MIME-Version: 1.0\r\n";
    $headers.= "Content-Type: text/html;";
    $headers.= "Charset=iso-8859-1\r\n";
    $headers.= "From: ".$post_vars['your_email'][0];
    $message='';
    while (
    $mess current($post_vars)) 
    {
        if ((
    key($post_vars)!="i") && (key($post_vars)!="your email here") && (key($post_vars)!="your name here")) 
        {
             
    $message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
        }
            
    next($post_vars);
    }
    $message "<html><head> <title>Contact letter</title></head><body><br>".$message."</body></html>";

    mail("put your email address here double quotes is needed"$subject$message$headers);
    echo (
    "Your message was successfully sent!"); 

    Replace the text in mail() function it with your email address in which you want to receive the mails. (within double quotes.)

    I think this will do the job.
    Last edited by sunils; 03-14-2008 at 08:52 AM.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  9. #9
    easykey is offline x10Hosting Member
    Join Date
    Feb 2008
    Posts
    45

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Thats right Sunil - as I said in my post a bit further up!!

  10. #10
    jjjacas is offline x10Hosting Member
    Join Date
    Mar 2008
    Location
    South Florida.
    Posts
    18

    Re: Flash Site "contact.php"&"contact.asp",to send Email. Code Gurus, I Need Help!

    Quote Originally Posted by easykey View Post
    The 'your_email' and 'your_name' fields will tell you where the email is from - you are interested in the field that tells the server where the email is going to. This is the first part of the mail() function in the contact.php page.

    If there is nothing (or something wrong) in $_REQUEST['recipient'] then you can always change it in contact.php to your email address enclosed in "" i.e.
    PHP Code:
    mail("info@somewhere.com"$subject etc.... 
    If $_REQUEST['recipient'] is OK then there must be a problem on the x10hosting mail server. It's important to know what is in that field...
    Thanks, i did not knwo those feild were for the person SENDING the email. Thanks for letting me know.

    I didnt have a
    PHP Code:
    mail("info@somewhere.com"$subject etc.... 
    part in my code. But sunil helped me out and now the email works! :D

    My only concern is that i left the
    PHP Code:
    $_REQUEST['recipient'
    code in there to see where it sent to, and i still shows up as...


    but it DID send to my mail. Here is a picture.


    @ Sunil, Thank you very much for helping me fix it, how did you kow?

    By the way I have 3 more questions they are easy ones. ;)

    1. How can i repay you guys for helping me?
    2. What is that extra text and numbers in teh emial that was sent? What does it mean, any way to get rid of it?
    3. My site doesn't have a scroolbar, how can i add one?

    Thank you oh-so very much for what you
    ve done so far fellas!! :bowdown:

Page 1 of 4 123 ... LastLast

Similar Threads

  1. Link Exchange
    By Conor in forum Scripts, 3rd Party Apps, and Programming
    Replies: 117
    Last Post: 12-09-2007, 12:20 PM
  2. Banner Ads On Full Flash Site?
    By NK57thug in forum Free Hosting
    Replies: 2
    Last Post: 06-17-2005, 01:47 AM
  3. Ad Code and Site Music
    By GMS in forum Free Hosting
    Replies: 6
    Last Post: 03-06-2005, 12:30 AM
  4. Ad Code Support (Flash)
    By Kalim3ru in forum Free Hosting
    Replies: 2
    Last Post: 03-02-2005, 08:37 AM
  5. Flash design site up
    By KbFr08 in forum Graphics & Webdesign
    Replies: 14
    Last Post: 02-21-2005, 04:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
dedicated servers