Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Forms

  1. #1

    Default Forms

    Just before everything went offline over the weekend, i had posted asking if there was any gadget etc I could use to put a page on mt site for people to subscribe for email updates.
    The answer I got was that it had to be done by a third party so I knocked up a page myself using Open Office and tried to post it for people to assess.
    However, the post doesn't open when I click on the new post conformation in my email folders so it looks like it's been lost.

    As it stands though I have found a superb alternative.
    I did a bit of searching for a free account and found Cognito Forms.
    Fantastic. Basic with options to upgrade but I don't need anything fancy,

    Just thought I'd post so that others needing similar can find it.

  2. #2
    Join Date
    Jul 2015
    Location
    Currently New York State
    Posts
    774

    Default Re: Forms

    I use a PHP form maker tool for simple forms and host everything on my site. This way you are not relaying on a third party to host the form and send you the information. Your site has to have PHP enabled in order for it to work. Here is the website for the form maker http://www.formmail-maker.com/formmail-maker-home.php

    Ray

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,747

    Info Re: Forms

    Quote Originally Posted by Lynnzer View Post
    As it stands though I have found a superb alternative.
    I did a bit of searching for a free account and found Cognito Forms.
    Fantastic. Basic with options to upgrade but I don't need anything fancy,

    Just thought I'd post so that others needing similar can find it.
    It does look interesting but pricey if you need PayPal payments ($24/m == £££). It does appear comprehensive but I always worry about such entities hosting my data, especially as it is called Cognito. I might have been drawn were it named InCognito. I would probably go down the XT-CMS route (££) for a payment service but roll my own simpler forms in PHP and self-host (free) or even use the worthy forms provided through XaraTemplate.com (£).

    I'm currently looking at https://jqueryform.com/.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  4. #4
    Join Date
    May 2002
    Location
    Canada
    Posts
    3,338

    Default Re: Forms

    Thank you. Do you have one in action, live link? Do you get their ad with the free one?

  5. #5
    Join Date
    Apr 2020
    Location
    Tierra Verde, Florida USA
    Posts
    3

    Default Re: Forms

    I needed a contact form for several websites I had developed, and didn't want to go the third-party route. So, using the "HTML in a placeholder" feature of Web Designer I wrote some HTML code that works well, has a "Recaptcha wannabe" input field,and uses a .php file for input validation. The .php file also sends me an email with the collected contact information. If you want to see the sample code and the .php file, let me know and I will send it to you.

    You can see (and try out) the form at https://nresystems.com
    Last edited by capnjackp; 16 April 2020 at 04:54 AM. Reason: oops, forgot something!

  6. #6
    Join Date
    Feb 2014
    Location
    Toronto, Canada
    Posts
    792

    Default Re: Forms

    Quote Originally Posted by capnjackp View Post
    I needed a contact form for several websites I had developed, and didn't want to go the third-party route. So, using the "HTML in a placeholder" feature of Web Designer I wrote some HTML code that works well, has a "Recaptcha wannabe" input field,and uses a .php file for input validation. The .php file also sends me an email with the collected contact information. If you want to see the sample code and the .php file, let me know and I will send it to you.

    You can see (and try out) the form at https://nresystems.com

    Hi capnjackp and welcome to talk graphics. You being a new member I can’t send you a pm. I like your form and would like to see your sample code and the .php file. Perhaps you can put it in this thread for all to see and benefit. Thank you for your offer.

  7. #7
    Join Date
    Apr 2020
    Location
    Tierra Verde, Florida USA
    Posts
    3

    Default Re: Forms

    Roly, I feel like a penny waiting for change - never saw your post until recently, then had to figure out how to post the sample code - needless to say, I'm not adept at these forum functions! Anyway, here is the code for the HTML placeholder on a "contact" web page. I'll put the .php code in a followup post.

    Put this code in the HTML placeholder "HTML code (body)":

    <form name="htmlform62" method="post" action="html_form62_send.php" style="font-size: 18pt">
    <table width="700px" align=center font-color: black>
    <tr><td>
    <label for="first_name62">Your First Name *</label>
    </td>
    <td colspan=2>
    <label for="last_name62">Your Last Name *</label>
    </td></tr>
    <tr><td>
    <input type="text" name="first_name62" maxlength="30" size="30">
    </td>
    <td colspan=2>
    <input type="text" name="last_name62" maxlength="30" size="30">
    </td></tr>
    <tr><td><br></td></tr>
    <tr><td>
    <label for="telephone62">Your Phone (just numbers) *</label>
    </td>
    <td colspan=2>
    <label for="email62">Your Email Address *</label>
    </td></tr>
    <tr><td>
    <input type="text" name="telephone62" maxlength="15" size="15">
    </td>
    <td colspan=2>
    <input type="text" name="email62" maxlength="50" size="30">
    </td></tr>
    <tr><td><br></td></tr>
    <tr>
    <td colspan=3>
    <label for="website62">Your Current Family Website if Applicable</label>
    </td></tr>
    <tr>
    <td colspan=3>
    <input type="text" name="website62" maxlength="50" size="50">
    </td></tr>
    <tr><td><br></td></tr>
    <tr>
    <td valign="top" colspan=3>
    <label for="comments62">Additional Comments</label>
    </td></tr>
    <tr>
    <td valign="top" colspan=3>
    <textarea name="comments62" maxlength="1000" cols="50" rows="8"></textarea>
    </td></tr>
    <tr><td><br></td></tr>
    <tr>
    <td colspan=3>
    <label for="usercode62">Enter (in all caps) Security Code letters: </label>
    <br>
    <input type="hidden" id="syscode62" name="syscode62" value="">
    <script type="text/javascript">
    var syscode62 = makeid62();
    document.write(syscode62);
    document.getElementById('syscode62').value = syscode62;
    </script>
    <input type="text" name="usercode62" maxlength="4" size="5">
    </td></tr>
    <tr><td><br></td></tr>
    <tr>
    <td colspan=3 style="text-align:left">
    <input type="submit" value="Submit " style="height: 35px; width:115px; font-size: 16pt">
    </td></tr>
    </table>
    </form>

    ******************************************

    Put this code in the HTML placeholder "HTML code (head)":

    <script type="text/javascript">

    function makeid62(){
    syscode62x = "";
    var possible = "ABCDEFGHJLMNPQRSTUVWXYZ";
    for( var i=0; i < 4; i++ )
    syscode62x += possible.charAt(Math.floor(Math.random() * possible.length));
    return syscode62x;
    }

    </script>

  8. #8
    Join Date
    Apr 2020
    Location
    Tierra Verde, Florida USA
    Posts
    3

    Default Re: Forms

    This would be the code for the "html_form62_send.php" file - obviously change the "$to" code, etc., to whatever desired:

    <?php

    $to = 'jlp@nresystems.com';

    $subject = "NRES contact form submission (wide form62)";

    $first_name62 = test_input($_POST['first_name62']); // required
    $last_name62 = test_input($_POST['last_name62']); // required
    $wherefrom62 = test_input($_POST['email62']); // required
    $telephone62 = test_input($_POST['telephone62']); // not required
    $website62 = test_input($_POST['website62']); // not required
    $syscode62 = test_input($_POST['syscode62']); // fixed from makeid62 function
    $usercode62 = test_input($_POST['usercode62']); // required
    $comments62 = test_input($_POST['comments62']); // not required
    date_default_timezone_set("America/New_York");
    $nowdate62 = date("Y/m/d");
    $nowtime62 = date("h:i:sa");

    $error_message = "";

    $string_exp = "/^[A-Za-z0-9 .,'-]+$/";
    if(!preg_match($string_exp,$first_name62)) {
    $error_message .= 'A valid First Name must be entered.<br />';
    }

    if(!preg_match($string_exp,$last_name62)) {
    $error_message .= 'A valid Last Name must be entered.<br />';
    }

    if ($telephone62 >= 1001000000 && $telephone62 <= 99999999999) {
    $var = "true";
    } else {
    $error_message .='A valid Telephone number must be entered.<br />';
    }

    if (!filter_var($wherefrom62, FILTER_VALIDATE_EMAIL)) {
    $error_message .= 'A valid Email Address must be entered.<br />';
    }

    if($usercode62 == ""){
    $error_message .= 'Security Code cannot be blank.<br />';
    }

    if($syscode62 != $usercode62){
    $error_message .= 'Security Code entered must match displayed letters.<br />';
    }

    if(strlen($error_message) > 0) {
    died($error_message);
    }

    $message = "NRES Contact Information: \n\n";

    function clean_string($string) {
    $bad = array("content-type","bcc:","to:","cc:","href");
    return str_replace($bad,"",$string);
    }

    function test_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
    }

    function died($error) {
    echo '<span style="font-size:18px">There appear to be one or more input issues with the information you submitted. <br /><br />';
    echo $error.'<br />';
    echo 'Please enter valid responses to those input fields.<br /><br />';
    echo 'Click back arrow to return to input page.<br /><br /></span>';
    die();
    }


    function get_client_ip_by_getenv() {
    $ipaddress = '';
    if (getenv('HTTP_CLIENT_IP'))
    $ipaddress = getenv('HTTP_CLIENT_IP');
    else if(getenv('HTTP_X_FORWARDED_FOR'))
    $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
    else if(getenv('HTTP_X_FORWARDED'))
    $ipaddress = getenv('HTTP_X_FORWARDED');
    else if(getenv('HTTP_FORWARDED_FOR'))
    $ipaddress = getenv('HTTP_FORWARDED_FOR');
    else if(getenv('HTTP_FORWARDED'))
    $ipaddress = getenv('HTTP_FORWARDED');
    else if(getenv('REMOTE_ADDR'))
    $ipaddress = getenv('REMOTE_ADDR');
    else
    $ipaddress = 'UNKNOWN';
    return $ipaddress;
    }

    $message .= "First Name: " . clean_string($first_name62) . "\n";
    $message .= "Last Name: " . clean_string($last_name62) . "\n";
    $message .= "Telephone: " . clean_string($telephone62) . "\n";
    $message .= "Email: " . clean_string($wherefrom62) . "\n";
    $message .= "Website: " . clean_string($website62) . "\n";
    $message .= "Sys Code: " . clean_string($syscode62) . "\n";
    $message .= "User Code: " . clean_string($usercode62) . "\n";
    $message .= "Comments: " . clean_string($comments62) . "\n";
    $message .= "Visitor IP Address: " . get_client_ip_by_getenv() . "\n";
    $message .= "Date: " . clean_string($nowdate62) . "\n";
    $message .= "Time: " . clean_string($nowtime62) . "\n";

    // create email headers
    $headers = 'From: ' . $wherefrom62 . "\r\n" .
    'Reply-To: ' . $wherefrom62 . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);

    header("Location:https://nresystems.com/contact info-a.htm");

    die();
    ?>

  9. #9
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,747

    Default Re: Forms

    @captjackp, thank you for submitting your coding.
    I found the Recapcha blocks interesting.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  10. #10
    Join Date
    Jun 2012
    Location
    CZECH
    Posts
    147

    Default Re: Forms

    @captjackp - good job, thank you
    ____________________________
    __I am sorry for my bad English__

    P&G 10, 11, 15; XWD Premium 11,15; XDPX 15.1; XDPX 18.5; XDPX 19; XBuilder;

 

 

Bookmarks

Posting Permissions

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