TinyPortal

Development => Support => Topic started by: TolerancE on July 21, 2007, 12:43:16 AM

Title: Form Code Issue
Post by: TolerancE on July 21, 2007, 12:43:16 AM
I have modified this code to fit what info I need submitted, yet when I test it and send it does work, but the thank you page changes the actual theme. I use Mesh, and when the form info is submitted, the thank you screen changes everything to the default theme. Can anyone look at the code and tell me what I'm doing wrong?


Quoteglobal $scripturl;

$youremail = 'tolerance@theringsidevoice.com'; // Enter your email address here
$emailtitle = 'PWSmarks Contract';

  $str = getenv("QUERY_STRING");
  if ($str)
    $action = 'index.php?'.$str;
  else
    $action = 'index.php';


if (isset($_POST['submit']))
{
  $message='';
  isset($_POST['name']) ? $name = $_POST['name'] : $name = '';
  isset($_POST['height']) ? $height = $_POST['height'] : $height = '';
  isset($_POST['weight']) ? $weight = $_POST['weight'] : $weight = '';
  isset($_POST['hometown']) ? $hometown = $_POST['hometown'] : $hometown = '';
  isset($_POST['orientation']) ? $orientation = $_POST['orientation'] : $orientation = '';
  isset($_POST['finishing']) ? $finishing = $_POST['phone'] : $finishing = '';
  isset($_POST['pic']) ? $pic = $_POST['pic'] : $pic = '';
  isset($_POST['theme']) ? $theme = $_POST['theme'] : $theme = '';
  isset($_POST['email']) ? $email = $_POST['email'] : $email = '';

  $text = "Superstars Name = $name \n Height = $height \n Weight = $weight \n Hometown = $hometown \n Orientation = $orientation \n Finishing Move = $finishing \n Picture = $pic \n Theme Song = $theme \n Email = $email";
  mail( $youremail, $emailtitle, $text);
  echo 'Thank you';
}

else
{
  // You'll want to make the form prettier
  echo '<form method="post" action="' . $action . '">';
  echo '<table>';
  echo '<tr><td>Superstars Name:</td></tr><tr><td><input type="text" name="name" /></td></tr>';
  echo '<tr><td>Height:</td></tr><tr><td><input type="text" name="height" /></td></tr>';
  echo '<tr><td>Weight:</td></tr><tr><td><input type="text" name="weight" /></td></tr>';
  echo '<tr><td>Hometown:</td></tr><tr><td><input type="text" name="hometown" /></td></tr>';
  echo '<tr><td>Orientation (Heel/Face/Tweener):</td></tr><tr><td><input type="text" name="orientation" /></td></tr>';
  echo '<tr><td>Finishing Move:</td></tr><tr><td><input type="text" name="finishing" /></td></tr>';
  echo '<tr><td>Picture (Link):</td></tr><tr><td><input type="text" name="pic" /></td></tr>';
  echo '<tr><td>Theme Song:</td></tr><tr><td><input type="text" name="theme" /></td></tr>';
  echo '<tr><td>Email:</td></tr><tr><td><input type="text" name="email" /></td></tr>';
  // add whatever other fields you want for your form
  echo '<tr><td align="center"><input type="submit" name="submit" value="Send"></td></tr>';
  echo '</table>';
  echo '</form>';
}
Title: Re: Form Code Issue
Post by: IchBin on July 21, 2007, 02:20:30 AM
In your article options is it set to display a specific theme?
Title: Re: Form Code Issue
Post by: TolerancE on July 21, 2007, 02:24:03 AM
Yes it is. It is set as Mesh, but still goes over to default. But after looking closely, when I try it as a guest it is fine, but when I'm logged in it jumps to default....