Jump to content

simple problems


Porkie

Recommended Posts

Hey

 

for some reason this doesnt seem to submit when i try to submit using my form before.iam pritty sure that the contact form is ok which means the error must lie in here somewhere. can someone please help me out ?

 

and also i want to make this text white. how could i do it?

echo nl2br("<h2>Your Data has been submitted to our Support Team</h2>") ;

 

cheers in advance :D

 

 

<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
-->
</style><title>Getrecognized.co.uk - Thank You</title>
<div align="center"><img src="images/gr-edit.png" width="604" height="100"></div>
<?php

if(isset($_POST['submit'])) {


$to = "[email protected]";

$namefield = $_POST['nbox'];
$emailfield = $_POST['ebox'];
$messagefield = $_POST['mbox'];
$sub = $_POST['sbox'];

$subject = "Get Recognized (Name: $namefield) (Email: $emailfield) (Subject: $sub)";

$body = "\n From: $namefield\n E-Mail: $emailfield\n \n Subject: $sub\n Message: $messagefield\n";

echo nl2br("<h2>Your Data has been submitted to our Support Team</h2>") ;


  
mail($to, $subject, $body);
}

?>

Link to comment
https://forums.phpfreaks.com/topic/155900-simple-problems/
Share on other sites

To fix the white issue:

 

<style type="text/css">
<!--
body,td,th {
   color: #FFFFFF;
}
body {
   background-color: #000000;
}
h2 { 
   color #ffffff;
}
-->
</style>

 

As far as the form not submitting. It would be helpful to post the actual form code. And as far as "not submitting" does it not enter into the IF or do you not get an email? As they are two separate issues.

Link to comment
https://forums.phpfreaks.com/topic/155900-simple-problems/#findComment-820632
Share on other sites

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Getrecognized.co.uk - Contact Us</title>
<style type="text/css">
<!--
.style1 {font-family: Arial, Helvetica, sans-serif}
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
-->
</style>
</head>

<body>
<p align="center"><img src="images/gr-edit.png" width="604" height="100" /></p>
<form id="form1" name="form1" method="post" action="send_contact.php">
  <table width="458" height="274" border="0" align="center">
    <tr>
      <td colspan="8"><div align="center" class="style1">Contact Form </div></td>
    </tr>
    <tr>
      <td colspan="3"><span class="style1">Name : </span></td>
      <td colspan="4"><span class="style1">
        <label>
          <input name="nbox" type="text" id="nbox" size="30" maxlength="30" />
        </label>
      </span></td>
      <td width="46"><span class="style1"></span></td>
    </tr>
    <tr>
      <td colspan="3"><span class="style1">Email : </span></td>
      <td colspan="4"><span class="style1">
        <label>
          <input name="ebox" type="text" id="ebox" size="30" maxlength="30" />
        </label>
      </span></td>
      <td><span class="style1"></span></td>
    </tr>
    <tr>
      <td width="20"> </td>
      <td width="20"> </td>
      <td width="43"> </td>
      <td width="90"> </td>
      <td width="72"> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td colspan="3"><span class="style1"></span><span class="style1"></span><span class="style1">Subject : </span></td>
      <td colspan="2"><span class="style1"></span><span class="style1">
        <label>
          <input name="sbox" type="text" id="sbox" size="30" maxlength="30" />
        </label>
      </span></td>
      <td width="69"><span class="style1"></span></td>
      <td width="64"><span class="style1"></span></td>
      <td><span class="style1"></span></td>
    </tr>
    <tr>
      <td colspan="3"><span class="style1">Message : </span></td>
      <td colspan="4" rowspan="3"><span class="style1">
        <label>
          <textarea name="mbox" cols="50" rows="7" id="mbox"></textarea>
        </label>
      </span></td>
      <td><span class="style1"></span></td>
    </tr>
    <tr>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
    </tr>
    <tr>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
      <td><span class="style1"></span></td>
    </tr>
    <tr>
      <td colspan="4"><label>
        <input type="submit" name="Submit" value="Submit" />
        <input type="reset" name="Submit2" value="Reset" />
      </label></td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
  </table>
  <p> </p>
</form>
<p> </p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/155900-simple-problems/#findComment-820635
Share on other sites

        <input type="submit" name="Submit" value="Submit" />

 

PHP is CaSe SenSiTiVe on variable names and array indexes. Change the name in the input above to be all lowercase submit and the form should submit.

 

        <input type="submit" name="submit" value="Submit" />

Link to comment
https://forums.phpfreaks.com/topic/155900-simple-problems/#findComment-820638
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.