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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,989
  • Total Topics: 21,322
  • Online today: 1,078
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 535
  • Total: 535

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've just had another go with all the code between the <div> tags and I still get a parse error

Parse error: parse error, unexpected '<' in /homepages/6/d119724375/htdocs/sgr/Sources/Load.php(1600) : eval()'d code(32) : eval()'d code on line 1

The code for the contact form is

<!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>South Gwent Ramblers Contact Form</title>
<link rel="stylesheet" type="text/css" href= "http://nokonium.co.uk/sgr/Themes/South-Gwent/style.css"/>
</head>
<body class="body" align="center">
<div class="box align="center">
<table cellpadding="4" border="2" align="center"><table align="center"><tr><td class="largetext">South Gwent Ramblers Contact Form</td></tr>
<tr><td class="normaltext">Please select from the drop down list<br /> and then enter your message in the text box</td></tr></table>

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


:Please Enter Your Name: <br />
<input type="text" name="visitor" size="50" />
<br />
:And Your Email Address:<br />
<input type="text" name="visitormail" size="50" />
<br /> <br />
Do You Want A Copy? No<input name="ccopy" type="radio" value="ccno" />   Yes<input checked="checked" name="ccopy" type="radio" value="ccyes" /> <br />

<br />
:My Message Is About:<br />
<select name="attn" size="1">
<option value=" Membership Enquiries ">Membership </option>
<option value=" Walk Information ">Walk Information </option>
<option value=" Group Information ">South Gwent Ramblers </option>
<option value=" Website feedback ">Website feedback </option>
</select>
<br /><br />
:Mail Message:
<br />
<textarea name="notes" rows="8" cols="50"></textarea>
<br />
<input class="titlebg" type="submit" value="Send Mail" />

</form>

</td></tr><tr><td align="center"><br /><br /><span class="largetext">Thank you</span><br /><br /></td></tr>
<tr><td align="center"><br /><br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a></td></tr></table>
</div>
</body>
</html>


And for the mail file

<!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>
<link rel="stylesheet" type="text/css" href= "http://nokonium.co.uk/sgr/Themes/South-Gwent/style.css"/>
</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 
"################";
$ccx "";
if(!
$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo 
"<largetext>Use Back - Enter valid e-mail</largetext>\n";
$badinput "<largetext>Feedback was NOT submitted</largetext>\n";
}
if(empty(
$visitor) || empty($visitormail) || empty($notes )) {
echo 
"<largetext>Use Back - fill in all fields</largetext>\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>

bloc

Does this code for a phpblock work?

echo '
<div class="box align="center">
<table cellpadding="4" border="2" align="center"><table align="center"><tr><td class="largetext">South Gwent Ramblers Contact Form</td></tr>
<tr><td class="normaltext">Please select from the drop down list<br /> and then enter your message in the text box</td></tr></table>

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

$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");

echo '
<input type="hidden" name="ip" value="'.$ipi.'" />
<input type="hidden" name="httpref" value="'. $httprefi .'" />
<input type="hidden" name="httpagent" value="'. $httpagenti .'" />


:Please Enter Your Name: <br />
<input type="text" name="visitor" size="50" />
<br />
:And Your Email Address:<br />
<input type="text" name="visitormail" size="50" />
<br /> <br />
Do You Want A Copy? No<input name="ccopy" type="radio" value="ccno" />   Yes<input checked="checked" name="ccopy" type="radio" value="ccyes" /> <br />

<br />
:My Message Is About:<br />
<select name="attn" size="1">
<option value=" Membership Enquiries ">Membership </option>
<option value=" Walk Information ">Walk Information </option>
<option value=" Group Information ">South Gwent Ramblers </option>
<option value=" Website feedback ">Website feedback </option>
</select>
<br /><br />
:Mail Message:
<br />
<textarea name="notes" rows="8" cols="50"></textarea>
<br />
<input class="titlebg" type="submit" value="Send Mail" />

</form>

</td></tr><tr><td align="center"><br /><br /><span class="largetext">Thank you</span><br /><br /></td></tr>
<tr><td align="center"><br /><br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a></td></tr></table>
</div>';


The other code you can just put in a file..and of course setting the right path in the above code.

Nokonium

Thanks Bloc, I'll try it when I can get into my own domains. I have a connection problem at the moment.


Nokonium

#13
Just got around to trying it. That does display, but there is a bigger problem, one that I seem to get with the basic contact code. The best way I can descibe it is that it leaks into the TPAdmin panel. I can send when I first paste it in, but then if I call it back up to edit it I get a "Send Mail" tab and "Free code at" under the block input box, I then cannot send the block edit, the "Send" is inactive but the "Send Mail" tab is active.

Likewise with a php article.

bloc

Was the "<form method="post" action="sendeail.php">';" correct? You need a full path to get out of SMF there..only "sendmail.php" will in fact parse it through the SMF instead.

Create a file on your server called "sendmail.php" and put in the path to that in your code above.

Nokonium

The send I was refering to was the TPadmin 'Send', not the e-mail one. The problem was seen editing the article. I didn't make that very clear.

bloc

Try to add a id/name to this element:
<input class="titlebg" type="submit" value="Send Mail" />

..like:
<input id="mailsend" name="mailsend" class="titlebg" type="submit" value="Send Mail" />

I think the submit button in your script may be interfering with TPadmin saving routine.

Nokonium

Thanks Bloc, I'll give it a try.

This website is proudly hosted on Crocweb Cloud Website Hosting.