TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,022
  • Total Topics: 21,332
  • Online today: 473
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 140
  • Total: 140

Guest messaging

Started by nokonium, October 17, 2005, 09:52:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

I'm trying find a way round a problem I have with one of my websites. Publicly displayed e-mail addresses and spam.

The SGR test site will ultimately be a website plus forum. The general idea is to attract interest and membership in the actual group and not just sign up forum members.ÂÃ,  Most of the content will be accessable to members and guests alike, but members have the advantage of PM and guests do not. I am wondering if it is possible to set up, either as an action, SSI, in a php article or within a dedicated block, a way for guests to PM selected admins. I want it to be a private system because guests enquiring about membership will need to leave contact information, which I do not want on public display. I've Googled around SMF but I can't see anything remotely like what I'd like to achieve. Any ideas?ÂÃ,  ÂÃ, Ta in advance.

bloc

You could use a html/javascript-block with a form for sending off email at least..using just the mail-server on your site. But its unsafe if allowed for guests..spam could easily be sent through it.. :P

As for sending off PM, it can be done using a custom function..the PM would need a special "member-id" though, maybe a member you create, that is used just for this. Then when you get PM from this member, you know its a PM from a guest really...

Nokonium

Hi Bloc
Your head recovered from the weekend?  :buck2:  ;)

I've had a look around and I have found these:
PHP121: PHP Instant Messenger
IBDhost Contact Form (Contact Us) With A Free PHP Email Script
Making a PHP Email Contact Form - Tutorial with code from stargeek.com

But I haven't tried them yet.

Nokonium

I'm looking at the IBDhost Contact form but I'm not getting very far as I cannot work out what to put where in TP. It is just 2 files

contact.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>

<form method="post" action="sendeail.php">

<!-- 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 ?>" />


Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
Copy Sender ? No<input name="ccopy" type="radio" value="ccno" />   Yes<input checked="checked" name="ccopy" type="radio" value="ccyes" /> <br />

<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Membership Enquiries ">Membership Enquiries </option>
<option value=" Walk Information ">Walk Information </option>
<option value=" Group Information ">Group Information </option>
<option value=" Website feedback ">Website feedback </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a>
</form>

</body>
</html>


I would guess that I put everything inside the body tags in a php article or in a php block, however I get the following error:
QuoteParse error: parse error, unexpected '<' in /[#####]/htdocs/sgr/Sources/Load.php(1600) : eval()'d code(77) : eval()'d code on line 1

sendeail.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<!-- Required: YOUR email ($myemail). Optional: Enter CC email address ($ccx)
Required: Add the link for the 'next page' (at the bottom) -->

<?php


$myemail 
= "information@south-gwent-ramblers.co.uk";
$ccx = "";
if(!
$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo 
"<p class="largetext">Use Back - Enter valid e-mail</largetext>\n";
$badinput = "<largetext>Feedback was NOT submitted</p>\n";
}
if(empty(
$visitor) || empty($visitormail) || empty($notes )) {
echo 
"<p class="largetext">Use Back - fill in all fields</p>\n";
}
echo 
$badinput;

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn . "(" . $ccopy . ")" ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: 
$attn \n
Message: 
$notes \n
From: 
$visitor ($visitormail)\n
Additional Info : IP = 
$ip \n
Browser Info: 
$httpagent \n
Referral : 
$httpref \n
"
;

$from = "From: $visitormail\r\n";

if ((
$ccopy == "ccyes") && ($visitormail != ""))
mail($visitormail, $subject, $message, $from);

if (
$myemail != "information@south-gwent-ramblers.co.uk")
mail($myemail, $subject, $message, $from);

if (
$ccx != "")
mail($ccx, $subject, $message, $from);

?>


<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />

Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo 
$notesout; ?>

<br />
<?php echo $ip ?>

<br /><br />
<a href="http://nokonium.co.uk/sgr/index.php"> Home </a>

</p>

</body>
</html>


Neither file give any error when checked individually.

Nokonium

Quote from: nokonium on October 18, 2005, 08:09:20 PM
I'm looking at the IBDhost Contact form but I'm not getting very far as I cannot work out what to put where in TP. It is just 2 files



IchBin

Sorry Nokonium, this seems to be beyond me too. :o

Nokonium

Some of it is working, I've received 54 e-mails from me to me, whilst fiddling, only I can't find out how to put something in them  :(

Nokonium

I've got it working, but outside of TP and SMF

bloc

Problem with it is that it assumes a second file will take care of the sending..so you need to make a single file out of the latter text, and just a block of the first. Perhaps also put a "go back" link on the second, since that is outside of TP/SMF.

But i really can see a good use for this routine/feature in TP too..just a "send email form" type of block, where the output can be adjusted/sent through TP itself. More safe too, since the actual sending will be controlled by the forum - not a standalone page which can be abused.

Nokonium

Quote from: Bloc on October 21, 2005, 10:16:47 AM
But i really can see a good use for this routine/feature in TP too..just a "send email form" type of block, where the output can be adjusted/sent through TP itself. More safe too, since the actual sending will be controlled by the forum - not a standalone page which can be abused.

I was hoping that you'd say that.  ;D

Thanks

This website is proudly hosted on Crocweb Cloud Website Hosting.