Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

adding information to form entries

  • 30-08-2005 04:21PM
    #1
    Closed Accounts Posts: 223 ✭✭


    I'm using the basic preinstalled formmail cgi that comes with my hosting to email user entered information in a number of form fields, one of these being the "recipient" value to decide where the email goes. I have the cgi script configured to only send to email addresses within my own domain to avoid spammer hijacking but was wondering if there's anyway to automaticly add the "@domain.com" onto the user enetered information as this will be identical in every case, resulting in the user simply entering "bob" into the recipient field as opposed to "bob@domain.com".

    I've had a look at using a php mail form and while i've about cobbled together one that does pretty much the same thing as the cgi version I have i'm still not sure how to amend information onto submitted fields, is this at all possible without the use of some sort of databse backend?


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    I don't know anything about cgi but once you've taken the value of the user you can use the cgi to create a new variable with value of user+"domain.com";

    with php you could use

    $user = $_REQUEST;
    $email = $user."@domain.com";

    and then in the mail() function or whatever you use use the email value. not that complicated.


  • Registered Users, Registered Users 2 Posts: 32,132 ✭✭✭✭is_that_so


    Just append the domain.

    in PHP/PERL
    $domain='@domain.com';
    $mail=$username.$domain;


  • Closed Accounts Posts: 223 ✭✭telemachus


    Cheers for that, thankfully nice and simple :D , up until recently i'd been content to bury my head in the basics of nice safe static html or css if I was feeling unusually experimental, suddenly i've found myself dazzled and overwhelmed by the various interactive javascripts/php routes.


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Webmonkey wrote:

    $user = $_REQUEST;
    $email = $user."@domain.com";

    is_that_so wrote:
    $domain='@domain.com';
    $mail=$username.$domain;


    Warning, warning; injection danger! (Possibly; especially if command-line invoking Sendmail). Some form of escaping may be indicated.


Advertisement