RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Web Design] Mailing Lists

0 Members and 1 Guest are viewing this topic.

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
So I want a "contact" page on my site, where people can put send me their emails, and/or send me a message ... WITHOUT having to open their email clients.

I don't want to physically put my email on my site, because then spambots will get it.
I have it on there as a png image, so bots can't grab it, but you can still see it. But actual people can't CLICK it to send me an email, so that might dismay some people, and I certainly don't want to do that.

So, uh, how do I even go about doing this? Do I have to download and install something on my webspace? Or can I do this just with html?

Help. :(

:tinysmile::tinysmile:

*
( ´ิ(ꈊ) ´ิ) ((≡^⚲͜^≡)) (ી(΄◞ิ౪◟ิ‵)ʃ)
Rep:
Level 102
(っ˘ڡ˘ς) ʕ•̼͛͡•ʕ-̺͛͡•ʔ•̮͛͡•ʔ (*ꆤ.̫ꆤ*)
2014 Avast Ye Merry Pirate!2013 Avast Ye Merry Pirate Award2012 Avast Ye Merry Pirate AwardFor frequently finding and reporting spam and spam bots2011 Most Unsung Member2011 Avast Ye Merry Pirate2010 Avast Ye Merry Pirate Award
It depends on your hosting setup (if you're still on lunarpages they might restrict such things to fight spam, though at the same time block alot of legitimate use), but it's simple with php's mail() function.



<?php
$myemail 
= &#39;adonis@ryanleber.com&#39;;
$subject = &#39;You\&#39;re the man bro!&#39;;

$op $_POST[op];

if(
$op == &#39;contact&#39;)
{
    
$name stripslashes($_POST[name]);
    
$email stripslashes($_POST[email]);
    
$text stripslashes($_POST[text]);
    
$referer $_POST[referer];
    
$remote_host $_SERVER[REMOTE_ADDR];
    
$server $_SERVER[SERVER_NAME];
    
$browser $_SERVER[HTTP_USER_AGENT];

    if(!
eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$",$email)) 
    { 
        
$status "Sorry, but you&#39;ve entered an e-mail address that cannot exist (invalid characters). Are you sure you typed it correctly? Please try again.<br />";
    }
    if(!
$name)
    {
        
$status .= "Please enter your name.<br />";
    }
    if(!
$text)
    {
        
$status .= "Please enter a message.<br />";
    }

    if(!
$status)
    {
        
$header "From: $emailrnReply-To: $emailrn";

        
$message "
            Name: 
$name
            Referer: 
$referer
            Site: 
$server
            Remote Host: 
$remote_host
            Remote Browser: 
$browser

            
$text
        "
;

        if(
mail($myemail$subject$message$header))
        {
            
$status "Thank you for contacting us! We&#39;ll be sure to reply as soon as we can.<br /><br />";
        }
        else
        {
            
$status "Unfortunately, there was a problem sending your message. Please try again later.<br /><br />";
        }

    }
    else
    {
        
$status .= "<br />Please press <u>back</u> on your browser to resubmit.<br /><br />";
    }
}    

// Now check the referer page and ensure it&#39;s a proper URL

$referer $_SERVER[HTTP_REFERER];

if(!
preg_match(&#39;#^http\:\/\/[a-z0-9-]+.([a-z0-9-]+.)?[a-z]+#i&#39;, $referer))
{
    unset(
$referer);
}

echo 
$status

?>

<form method="post" action="<?php print $_SELF?>">
	
<input type="hidden" name="op" value="contact">
	
<input type="hidden" name="referer" value="<?php print $referer?>">
	
Name<br />
	
<input name="name" size="35" value=""><br />
	
Your Email address (so we can get back to you)<br />
	
<input name="email" size="35" value=""><br /><br />
	
Message<br />
	
<textarea name="text" cols="45" rows="10"></textarea><br /><br />
	
<input type="submit" value="Send message">
</form>




[edit] fixed regex for email addy
« Last Edit: November 17, 2009, 06:10:19 AM by Roph »
bringing sexy back

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
I don't use lunarpages, I use StartLogic. Do you know where I can find out whether or not my hosting will have problems with this?

But either way, thanks a ton man, that's awesome.

:tinysmile::tinysmile:

*
A Random Custom Title
Rep:
Level 96
wah
Just test it? ;8 You can make an exact replica of your website page thing and then test it out?

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
Hey, so I gave this a try, and it didn't work.

I got the email at the address I put in, it gave me the name and the message, but NOT the email.
It says the email was sent from an "Unknown Sender," and, uh, that kind of makes this pointless.

I don't know php, what's missing from the code?





edit: Nevermind, I see what's missing.
Thanks, Roph. :3
« Last Edit: November 24, 2009, 03:12:21 AM by arlen »

:tinysmile::tinysmile:

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
:3

Time for me to check it out.

Oh :( nothing yet.

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
No, I'm having trouble launching php from within html. I mean, sure, I can link out to a php file as a last resort, but I don't really want to.

I can't find the file to edit on my webspace (probably hidden), and another site said to put
Code: [Select]
<Files emailtest.html> AddType application/x-httpd-php .html </Files>
in my file, obviously altering the name of the .html file, but he didn't say WHERE to put that code in. I tried various places, it doesn't work, the html just ends up displaying half the php (because it sees a <br /> and it breaks the <?php because it's reading html, not php, meaning the above code didn't even go through...)

Eh.

:tinysmile::tinysmile:

*
( ´ิ(ꈊ) ´ิ) ((≡^⚲͜^≡)) (ી(΄◞ิ౪◟ิ‵)ʃ)
Rep:
Level 102
(っ˘ڡ˘ς) ʕ•̼͛͡•ʕ-̺͛͡•ʔ•̮͛͡•ʔ (*ꆤ.̫ꆤ*)
2014 Avast Ye Merry Pirate!2013 Avast Ye Merry Pirate Award2012 Avast Ye Merry Pirate AwardFor frequently finding and reporting spam and spam bots2011 Most Unsung Member2011 Avast Ye Merry Pirate2010 Avast Ye Merry Pirate Award
Crap, lost this topic, sorry =o

Save the file with the .php extentsion. Most servers won't bother parsing a file for php code if it has the .html file extension, it will just assume it's a static file and serve it right to the browser.

You can output HTML from a php script.

Anything that isn't in <?php (opening) and ?> (closing) tags won't get parsed by php and will be sent right to the browser as HTML. Alternatively while "inside" php, you can output with print or echo.

<?php
echo &#39;<b>yummy yummy html here, but notice you have to escape apostrophes with a backslash so you don\&#39;t fuck up your php syntax&#39;;
?>
bringing sexy back

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
I guess that's easy enough. The page that I'm putting this on has a lot of other stuff on it, but as long as there's no code issues it'll still work, right? You can still put tables in php files, and link to css styles and such, right? It'll just look a little weird being contact.php instead of .html, but nobody really cares about that I guess.


edit: Oh, shit, uh, I changed the file to a .php, and then just kind of threw in the code you gave me right in the middle where I wanted it, and it totally worked and displayed right. I didn't even have to do anything extra...
« Last Edit: November 24, 2009, 05:26:17 PM by arlen »

:tinysmile::tinysmile:

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
MY GOD

I think I have it working!

http://ryanleber.com/contact.php

:D

(You'll also notice that I chopped up the background, so it loads in parts now, instead of waiting through 5 seconds of silence and wondering "hey, is this it?")


LET ME KNOW IF MY WEBSITE WORKS IN IE. I'm on a Mac. I have Opera, Firefox, and Safari, and they all check out, but I have no means to check IE right now...

:tinysmile::tinysmile:

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
well, it works on safari like you said. I might suggest to remove your contact info on your homepage since you now have a contact page.

*
( ´ิ(ꈊ) ´ิ) ((≡^⚲͜^≡)) (ી(΄◞ิ౪◟ิ‵)ʃ)
Rep:
Level 102
(っ˘ڡ˘ς) ʕ•̼͛͡•ʕ-̺͛͡•ʔ•̮͛͡•ʔ (*ꆤ.̫ꆤ*)
2014 Avast Ye Merry Pirate!2013 Avast Ye Merry Pirate Award2012 Avast Ye Merry Pirate AwardFor frequently finding and reporting spam and spam bots2011 Most Unsung Member2011 Avast Ye Merry Pirate2010 Avast Ye Merry Pirate Award
MY GOD

I think I have it working!

http://ryanleber.com/contact.php

:D

(You'll also notice that I chopped up the background, so it loads in parts now, instead of waiting through 5 seconds of silence and wondering "hey, is this it?")


LET ME KNOW IF MY WEBSITE WORKS IN IE. I'm on a Mac. I have Opera, Firefox, and Safari, and they all check out, but I have no means to check IE right now...

This site will be very useful to you as you develop designs =)

I already started a request for your contact page:

IE6:


IE7:


IE8: (lol)


s'all good :)
« Last Edit: December 06, 2009, 12:09:28 PM by Roph »
bringing sexy back

********
Rep:
Level 96
2010 Most Attractive Male Member2010 Best Musician
<3

Yeah, I actually checked it a week ago on my dad's laptop in IE new.whatever, and the text was unusually large and it threw off the tables. I tried adjusting it within the browser, but IE is the definition of the words clunky and oversized, so I ended up taking the text css down a pt.

And, yeah, apparently it looks fine now. Thanks, Roph. :)

:tinysmile::tinysmile: