Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorjustjack
    • CommentTimeOct 12th 2006
     permalink
    Can anyone recommend as good place to start for someone like myself with NO experience building forms to submit to a database on GoDaddy? I need basic information at this point. Name, email address, comments section. At the very least, can someone tell me what components go into this? I was planning on using php unless someone has other suggestions. I know html and built my site using CSS only. Other than that, not sure what's next.
    Jack
    • CommentAuthorchillout
    • CommentTimeOct 12th 2006
     permalink
    you can you cgi as well...but i think it would be easier for you to use php. go and google some free php form scripts. i really never spent to much time with that since i have a guy who does it for me.
    • CommentAuthorMatt
    • CommentTimeOct 12th 2006
     permalink
    • CommentAuthorPettyRider
    • CommentTimeOct 12th 2006
     permalink
    Books. Lots and lots of books. Get a book on just programming first. No languages, just the concepts. Then grab a PHP & MySQL book (even the "for dummies" one is decent) and spend a few nights playing with it.
    • CommentAuthorjustjack
    • CommentTimeOct 13th 2006
     permalink
    I will get a book when I leave work. Can someone give me one piece of information. I have created my form, but don't know where I put "MY" address for the delivery once it is submitted and HOW to write it.

    Thanks guys
  1.  permalink
    Jack

    If I understand your position correctly, GoDaddy hosts your site? They have the server-side scripts already for you, all you need to do is to link your form to one of their pre-defined scripts, either php or api if memory serves me correctly. I believe the file name is something similar to gdform.php.

    If you log into the 'account manager' section of the godaddy site and navigate to the control panel for your domain you will see a section called something like 'form mailer' Put your email address in there and they do the rest for you. If this isn't clear enough, put form mailer into their support search, they have some pretty clear instructions for you to follow. Failing that, call their support line, they are all super helpful and pretty knowledgeable.
  2.  permalink
    Sorry, I mean't asp not api?!?
    • CommentAuthorjustjack
    • CommentTimeOct 13th 2006
     permalink
    They suck. iam currently on the phone with them and thought I could get an answer from you guys faster. I am now at 1 hour and 43 min! They can not figure why is not working and they are giving me the run around. I have my OWN form that i want to use.I want to skip them. do it use this <input type="hidden" value="mymail@myemail.com" name="recipient">. If so, I just need to know where to place it in my page. THAT'S it.
    • CommentAuthordhayes
    • CommentTimeOct 13th 2006 edited
     permalink
    Hi,
    don't put your email in the source.. it's a little counteractive to the purpose (ie: harvesters will obtain your email)..it also makes it so that a potential "abuser" can analyze loopholes in your mail server (by sending mail to himself or, potentially, his "list") and exploit them, typically, as a relay for spam...also the possibility of sending x number (thousands) of emails an hour to as many addresses as one pleased. just to note: the below example wouldn't prevent the potential for abuse, but it'll limit the recipient to 1 :) .. it's not always as trivial as it's made out to be.. that's why we get paid the big bucks! hahaha! *counts change for morning coffee*

    here's a very general example:

    contact_form.php:

    <div id="contact-form-container">
    <form action="contact_post.php" method="post"><input type="hidden" name="phpMyAdmin" value="4594f30712f4fabaff6997416810f3f2" />
    <p><label for="urname">Your name:</label><input type="text" name="user_name" id="urname" /></p>
    <p><label for="uremail">Your email:</label><input type="text" name="user_email" id="uremail" /></p>
    <p><label for="urmessage">Your message:</label><br /><textarea name="user_message" rows="5" cols="40" id="urmessage"></textarea></p>
    <p><label for="submit" style="display:none;">Submit form</label><input type="submit" value="Send your message" id="submit" /></p>
    </form>
    </div>


    contact_post.php:

    <?php
    $myemail = 'johndoe@mydomain.net';
    $subject = 'Contact via form on mydomain.net';
    $message = 'Here\'s a message sent to you from '.$_REQUEST['user_email']."\n\n";
    $message .= $_REQUEST['user_message'];
    $headers = 'From: '.$_REQUEST['user_email']."\r\n"
    .'Reply-to: '.$_REQUEST['user_email']."\r\n";

    $sent = mail($myemail,$subject,$message,$headers);
    if($sent){
    echo 'Your message was sent!';
    } else {
    echo 'An error occurred. Unable to send mail';
    }
    exit;
    ?>


    .. if you do a search you might find some validation snippets as well.

    enjoy,
    devin
  3.  permalink

    Jack


    I understand that you have your OWN form, but I do not understand when you say you want to skip them? They host your service, and therefore need to process the information that people completing your form want to send. The file gdform.asp is simply a script that you call from your form, it does the work of translating the information to their servers, which in turn send you the information to an email address you specify in your control panel for the hosting account.


    If you put...


    <form action="gdform.asp" method="post" id="Form1"><input type="hidden" name="phpMyAdmin" value="4594f30712f4fabaff6997416810f3f2" />

    assuming your form is called Form1, and the gdform.asp file is in the same directory as the html page that you have your form on


    Then the godaddy servers will send the info out to you with a maximum of a five minute delay from form submission.


    You do not need to publish your email address and therefore avoid the problems that Devin was illustrating to you.


    I am sorry that you didn't get the level of service you expected, but, the scripts they provide work, I know, I have sites hosted with them that I have form submissions on.


    I hope you get it going!

    • CommentAuthorjustjack
    • CommentTimeOct 14th 2006
     permalink
    I'm traveling and haven't had a chance to try all of the recomendations, but I will as soon as I return. Adam...I was told it was five minutes and that is for asp and im using php. Which is a minumum of an hour. Since I had already made the form before anyone at godaddy pointed out that they OFFERED one, I going to use my own, I'm hosting with them, yes, but I don't need it to go to them for processing. I have been really dissatisfied with them over this. They are normally on top of their game.

    Thanks everyone.
    • CommentAuthoreasement
    • CommentTimeOct 16th 2006
     permalink
    While we are on the topic of email forms and not putting e-mail directly in the code, I would like to bring up the important fact of e-mail header injection attacks. I got burned so I am giving you a heads up.

    Here's a huge page describing the attacks:
    http://www.securephpwiki.com/index.php/Email_Injection

    The solution is that you should check the fields the users are allowed to fill in before you send the email. The fix they list [you would put this before the mail() function call ]is:

    <?php
    $from = $_POST["sender"];
    $from = urldecode($from);
    if (eregi("\r",$from) || eregi("\n",$from)){
    die("Why ?? :(");
    }
    ?>
    • CommentAuthorjustjack
    • CommentTimeOct 19th 2006
     permalink
    if ($redirect) {
    header("Location: $redirect");
    exit;


    This is the code where do i put my "www.mycompany.com/thankyou.html" to redirect? What do I leave/take out?

    Thanks. Other than that I have it figured out.
    • CommentAuthoreasement
    • CommentTimeOct 19th 2006
     permalink
    I presume this for after the form has been mailed out and you want to redirect them. I am not where your $redirect is set. Is this user set or do you set it? I am guessing you set it manually.

    From php.net
    HTTP/1.1 requires an absolute URI as argument to Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself:

    <?php
    /* Redirect to a different page in the current directory that was requested */
    $host = $_SERVER['HTTP_HOST'];
    $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'thankyou.html';
    header("Location: http://$host$uri/$extra");
    exit;
    ?>

    So, put the above code somewhere below you mail() function. Note, you could simplify and hardcode $host / $uri, but this makes it easier if you move hosts.
    • CommentAuthorjustjack
    • CommentTimeOct 19th 2006
     permalink
    if ($redirect) {
    header("Location: $redirect");
    exit;

    Can we dumb this down. That was way over my head. Given the script above, how do i redirect them. I just need to direct them to a thank you page after they submit their information.I have the script above that I did not write. However, i get errors when I put www.mycompany.com/thankyou.html

    I thought it was just to look like this

    if ($redirect) {
    header("Location: http://www.mycompany.com/thankyou.html");
    exit;
    • CommentAuthoreasement
    • CommentTimeOct 19th 2006
     permalink
    What errors do you get?

    the header("Location: xxx"); does the redirecting. The exit stops the code listed below the header() call from executing.


    Your code will work and adheres to the HTTP/1.1 spec.
    You code will execute as long as you have set $redirect to true at some point.

    <?php

    if ($redirect) {
    header("Location: http://www.mycompany.com/thankyou.html");
    exit;

    ?>
    • CommentAuthorjustjack
    • CommentTimeOct 20th 2006 edited
     permalink
    GOT IT
Add your comments
    Username Password
  • Format comments as (Help)