Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a page to do a couple of things

    HI guys, I'm quite a novice when it comes to this but was wondering how do I create a simple page to :

    Enter a filename
    Enter an email address

    Submit

    When submit is pressed, I have a program to convert the file and then send it to the email entered.

    I've got the html designed but I'm not sure how to get the submit part started

  • #2
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    You need a form and a server side scripting language to pass the information. I prefer PHP. Here are a few links that will help you get started:

    http://email.about.com/od/emailprogr...PHP_Script.htm

    http://www.ibdhost.com/contact/
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #3
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks!

    I think I got the email part right

    Now,

    How do I take the filename that is entered (assuming its on c:\<filename>) and run my program that converts it and then send it to the email address entered?

  • #4
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    This is a server-side script. You cannot test it locally. You have to:

    1 - set the proper link to the php script in your form
    <form method="post" action="filename.php">

    2 - upload the php script to your server in the right directory (as specified in the link above)

    3 - test the script out to make sure it works.

    You should check with your service provider to make sure they support PHP. Most do nowadays, but not all.
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #5
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I uploaded the script to the server and I don't think it works...
    it just gives me a blank page after I enter the details

  • #6
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    post your html form code and php code so we can troubleshoot.
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #7
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <html>

    <head>

    <title> CSV to XML Conversion </title>
    <link rel="stylesheet" href="/ssi/subs.css" type="text/css" />
    </head>

    <body>

    <a name="top"></a>
    <!-- start top nav -->
    <div id="nav">
    </div>

    <div id="main">

    <div class="subsbox">
    <form action="csv_to_xml.php" method="get" name="input">
    <!-- DO NOT change ANY of the php sections -->
    <?php
    $ipi = getenv("REMOTE_ADDR");
    $httprefi = getenv ("HTTP_REFERER");
    $httpagenti = getenv ("HTTP_USER_AGENT");
    ?>
    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />

    <table border="0">
    <tr>
    <td class="sm"><label class="subs_label" for="csvfileName">FILENAME(no extension):</label></td>
    <td class="sm"><input class="nice" type="text" name="csvfilename" id="filename"></td>
    </tr>
    <tr>
    <td class="sm"><label class="subs_label" for="email">EMAIL:</label></td>
    <td class="sm"><input class="nice" type="text" name="email" id="your@email.com"></td>
    </tr>
    <tr>
    <td class="sm" colspan="2" align="right"><input type="Submit" src="C:\Documents and Settings\Mak\My Documents\My Pictures/goimage.jpg" value="Convert">

    </td>
    </tr>
    </table>
    </form>
    </div>


    </body>
    </html>

  • #8
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php
    $email = "recipient@example.com";
    $subject = "$csvfilename";

    if (mail($email, $subject,)) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }

    <?

  • #9
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    Don't know if this was a typo, but the <? part at end should be reversed:

    <?php
    $email = "recipient@example.com";
    $subject = "$csvfilename";

    if (mail($email, $subject,)) {
    echo("<p>Message successfully sent!</p>");
    } else {
    echo("<p>Message delivery failed...</p>");
    }

    ?>
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #10
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok I fixed that but it still gives me a blank page

  • #11
    Regular Coder optimus203's Avatar
    Join Date
    Sep 2008
    Location
    CT
    Posts
    317
    Thanks
    22
    Thanked 16 Times in 15 Posts
    Hmnn. PHP is not my area of expertise. Try posting in the PHP forum on this site. I'm sure someone will be able to help you there. Sorry and good luck.
    Always thank those CF Users who help you solve issues...
    Connecticut Web Design

  • #12
    New Coder
    Join Date
    Apr 2010
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cheers anyway

    much appreciated


  •  

    Posting Permissions

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