PDA

View Full Version : Integrading comments with forum posts


Exoskeletor
10-28-2007, 03:31 PM
guys i have use the script of this site (dreamweaverclub) to make a contact form. now i have change my mind. i ant whenever someone sending a comment to be send directly to my forum.
Is this possible? this is my site www.gogua.gr (http://www.gogua.gr)

davidj
10-28-2007, 03:55 PM
post your code

Exoskeletor
10-28-2007, 04:14 PM
well my code in the contact page is nothing more that this tutorial has http://www.dreamweaverclub.com/dreamweaver-php-form.php
and the forum is phpbb2

davidj
10-28-2007, 04:20 PM
please dont provide a link when i ask for the code

By posting the code i can see If you have anything which i think could be done better. Also its easier to debug if you have any issues with it.

By visually checking your code on the page i can respond quicker with the answer you want rather than wasting time doing leg work

Exoskeletor
10-28-2007, 07:16 PM
the link has the code. here is it:

<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Results from Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'mail@rdsnetworks.net';

// Where to redirect after form is processed.
$url = 'http://www.rdsnetworks.net/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

this code send some text to an e-mail. i want to make it to send it to a forum

davidj
10-28-2007, 08:57 PM
do you want it to post to a forum or just redirect to a forum

Exoskeletor
10-29-2007, 08:00 AM
i want to post it like a reply in a thread

davidj
10-29-2007, 08:05 AM
is the forum your forum and you have admin access to it
do you have to login to the forum before you can post normally
how would the user know which forum he is going to post to

Exoskeletor
10-29-2007, 08:04 PM
yes it is and i am the admin
i can change it so anyone can post without register first
he doesnt have to know