Form Problem

Joined: 11/28/2008

This form (see here - http://www.christiangamers.net/forum/template.php?page=36) is suppose to submit (via email). It seems to process fine, but no email. Do you see anything wrong?

CODE
<form method="POST" action="http://christiangamers.net/linksubmit.php" name="f1">
  <div align="center">
<p class="gensmall">Submit a link:</p>
<table width="500" border="0">
<tr>
        <td width="217">
<div align="right" class="gensmall">Site Name</div>
</td>
        <td width="273">
<input type="text" name="sitename">
</td>
      </tr>
      <tr>
        <td width="217">
<div align="right" class="gensmall">Site URL</div>
</td>
        <td width="273">
<input type="text" name="siteurl">
</td>
      </tr>
      
      <tr>
        
        
      </tr>
      <tr>
              
      </tr>
      <tr>
        <td width="217">
<div align="right">
<input type="reset" name="Reset" value="Reset">
</div>
</td>
        <td width="273">
<input type="submit" name="Submit" value="Submit" onClick="MM_validateForm('Site Name','','R','Site URL','','R','','','Select one','','','Select one','','','Select one','','','','');return document.MM_returnValue">
</td>
      </tr>
</table>
  </div>
</form>

action code

CODE
<?php
# ----------------------------------------------------
# -----
# ----- This script was generated by PHP-Form Wizard 1.1 on 2/9/2008 at 10:28:04 PM
# -----
# ----- http://www.tools4php.com
# -----
# ----------------------------------------------------

// Receiving variables
@$sitename = addslashes($_GET['sitename']);
@$siteurl = addslashes($_GET['siteurl']);

// Validation
//Sending Email to form owner
$pfw_header = "From: $sitename\n"
  . "Reply-To: $sitename\n";
$pfw_subject = "Link submit.";
$pfw_email_to = "ked(at)kenerly.com";
$pfw_message = "sitename: $sitename\n"
. "siteurl: $siteurl\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header );

echo("<p align='center'><font face='Arial' size='2' color='#000000'>Thanks for the link...</font></p>");
?>

http://christiangamers.net
One Love, One God, One Way
"Allow me to live today, To give you the praise"

Joined: 11/28/2008
HiI just wonder if

Hi

I just wonder if putting

CODE
<?php
if(!empty($_POST)) extract($_POST);
if(!empty($_GET)) extract($_GET);
?>

at the extreme top of linksubmit.php
makes any difference?

Blessings

Tony

Online outreach:
Internet Evangelism Day
Helping church websites:
Church Websites

Joined: 11/28/2008
Using that code soon, I then

Using that code soon, I then get

Parse error: syntax error, unexpected '@' in /home/chrisnet/public_html/linksubmit.php on line 13

Line 13 is
@$sitename = addslashes($_GET['sitename']);

http://christiangamers.net
One Love, One God, One Way
"Allow me to live today, To give you the praise"

Joined: 11/28/2008
@ in PHP suppresses errors

@ in PHP suppresses errors from appearing when using PHP functions; it has no place before a variable. Try removing that from your variables and see what happens.

Who can bring a charge to God's elect? It is God who justifies!

Joined: 11/28/2008
Removed @ and now I getParse

Removed @ and now I get

Parse error: syntax error, unexpected T_VARIABLE in /home/chrisnet/public_html/linksubmit.php on line 13

http://christiangamers.net
One Love, One God, One Way
"Allow me to live today, To give you the praise"

Joined: 11/28/2008
I'm assuming line 13 is

I'm assuming line 13 is $sitename = addslashes($_GET['sitename']); ?

Who can bring a charge to God's elect? It is God who justifies!

Joined: 11/28/2008
You are POSTing those

You are POSTing those variables to the server, so they won't appear in $_GET, they appear in $_POST or $_REQUEST.

Try changing to

CODE
$sitename = addslashes($_POST['sitename']);
$siteurl = addslashes($_POST['siteurl']);

Also remove the @ in front of the mail function in case that brings up errors too.

~Andrew~

Joined: 11/28/2008
addslashes is not what you

addslashes is not what you should be doing with POST variables to be used in an email. I would have a read through these threads:

http://www.christian-web-masters.com/forum...?showtopic=8259
http://www.christian-web-masters.com/forum...?showtopic=9290

Paul Davey
Whitford Church
"Everyone who calls on the name of the Lord will be saved." Romans 10:13
"For all have sinned and fall short of the glory of God, and are justified

Joined: 11/28/2008
Current linksubmit.php no

Current linksubmit.php no errors, but I'm still not getting a email with the submitted data.

CODE
<?php
# ----------------------------------------------------
# -----
# ----- This script was generated by PHP-Form Wizard 1.1 on 2/9/2008 at 10:28:04 PM
# -----
# ----- http://www.tools4php.com
# -----
# ----------------------------------------------------
if(!empty($_POST)) extract($_POST);
if(!empty($_GET)) extract($_GET);

// Receiving variables
$sitename = addslashes($_POST['sitename']);
$siteurl = addslashes($_POST['siteurl']);

// Validation
//Sending Email to form owner
$pfw_header = "From: $sitename\n"
  . "Reply-To: $sitename\n";
$pfw_subject = "Link submit.";
$pfw_email_to = "news@christiangamers.net";
$pfw_message = "sitename: $sitename\n"
. "siteurl: $siteurl\n";
mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header );

echo("<p align='center'><font face='Arial' size='2' color='#000000'>Thanks for the link...</font></p>");
?>

http://christiangamers.net
One Love, One God, One Way
"Allow me to live today, To give you the praise"

Joined: 11/28/2008
Fixed it. My server would not

Fixed it. My server would not process the form with out a from (email address). New code, working.

CODE
<?php
# ----------------------------------------------------
# -----
# ----- This script was generated by PHP-Form Wizard 1.1 on 2/17/2008 at 8:32:51 AM
# -----
# ----- http://www.tools4php.com
# -----
# ----------------------------------------------------

// Receiving variables
$sitename = addslashes($_POST['sitename']);
$siteurl = addslashes($_POST['siteurl']);

// Validation
if (strlen($sitename) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid sitename</font></p>");
}

if (strlen($siteurl) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid siteurl</font></p>");
}

//Sending Email to form owner
$pfw_header = "From: news@christiangamers.net\n"
  . "Reply-To: news@christiangamers.net\n";
$pfw_subject = "URL Submit";
$pfw_email_to = "news@christiangamers.net";
$pfw_message = "sitename: $sitename\n"
. "siteurl: $siteurl\n";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header );

echo("<p align='center'><font face='Arial' size='2' color='#000000'>Thank You...</font></p>");
?>

http://christiangamers.net
One Love, One God, One Way
"Allow me to live today, To give you the praise"