Exemplo n.º 1
0
}
if ($signed) {
    $result = mysql_query("SELECT email FROM signatures where email = '" . mysql_real_escape_string($email) . "'");
    if (mysql_num_rows($result) > 0) {
        $signed = 1;
    } else {
        if ($anonymous) {
            $id = "";
            $result = mysql_query("SELECT COUNT(id) FROM signatures", $con);
            if ($result) {
                $row = mysql_fetch_row($result);
                $id = $row[0] + 1;
            }
            $from = "PS3 User " . $id . " <*****@*****.**>";
        } else {
            $from = $fname . " " . $lname . " <" . $email . ">";
        }
        $bcc = "signatures@humblehomebrew.com, " . $email;
        // Fix any bare linefeeds in the message to make it RFC821 Compliant.
        $message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
        // mail requires max 70 chars per line
        $message = wordwrap($comment, 70);
        $mailed = mail($PETITION_DESTINATION, get_petition_subject(), $message, "BCC: " . $bcc . "\nFrom: " . $from);
        $values = "'" . mysql_real_escape_string($fname) . "', " . "'" . mysql_real_escape_string($lname) . "', " . "'" . mysql_real_escape_string($email) . "', " . "'" . mysql_real_escape_string($comment) . "', " . "'" . mysql_real_escape_string($paygame) . "', " . "'" . mysql_real_escape_string($payrights) . "', ";
        $values .= $anonymous ? "TRUE, " : "FALSE, ";
        $values .= $mailed ? "TRUE" : "FALSE";
        $signed = mysql_query("INSERT INTO signatures (fname, lname, email, comment, " . "game, rights, anonymous, mailed) VALUES (" . $values . ")", $con);
    }
}
mysql_close($con);
header("Location: index.php?" . "signed=" . ($signed ? "1" : "0") . "&first_name=" . urlencode($fname) . "&last_name=" . urlencode($lname) . "&email=" . urlencode($email) . "&comment=" . urlencode($comment) . "&paygame=" . urlencode($paygame) . "&payrights=" . urlencode($payrights) . "&anonymous=" . urlencode($anonymous) . "#petition");
Exemplo n.º 2
0
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td>
                            <div align="right" class="style6">
                              <span class="style6">Subject :</span>
                            </div>
                          </td>
                          <td>
                            <table>
                              <td>
                                <div align="left">
                                  <span class="style6" valign="center"> &nbsp;
                                    <input name="subject" type="text" id="subject" size="50" value="<?php 
echo htmlspecialchars(get_petition_subject());
?>
" disabled="disabled" />
                                  </span>
                                </div>
                              </td>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td>
                            <div align="right" class="style6">
                              <span class="style6">Message to Sony: </span>
                            </div>
                          </td>
                          <td>