Jump to content


Photo

Form help


  • Please log in to reply
29 replies to this topic

#1 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 02:28 PM

im trying to make a survey that emails you the results, i have some of it working. when u fill out the form and hit submit the email gets sent and i only get the email and the message (the botton half ) not the survey questions. any help will be appreciated!


[!--sizeo:4--][span style=\"font-size:14pt;line-height:100%\"][!--/sizeo--]PHP page [!--sizec--][/span][!--/sizec--]


[!--coloro:#330099--][span style=\"color:#330099\"][!--/coloro--]<form method="post" action="sendeail.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<table width="500">
<tr>
<td width="319"><label><span class="style1">How often do you visit MOSI?</span></label></td>
</tr>
<tr>
<td><span class="style5">
<input type="radio" name="Q1" value="radio">
First visit</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="radio">
Less than once a year</label>
</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="radio">
About once a year</label>
</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="radio">
More than once a year</label>
</span></td>
</tr>
</table>
<br>
<p align="left" class="style1">
<label></label>
</p>
<table width="500">
<tr>
<td><label><span class="style1">How often do you visit museums in general?</span></label></td>
</tr>
<tr>
<td><input type="radio" name="Q2" value="radio">
Less than once a year</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="radio">
About once a year</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="radio">
A few times a year</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="radio">
Once a month or more</label></td>
</tr>
</table>
<br>
<table width="500">
<tr>
<td><label>What is your gender? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q3" value="radio">
Male</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q3" value="radio">
Female</label></td>
</tr>
</table>
<br>
<table width="500">
<tr>
<td><label>What is your age group? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q4" value="radio">
15-24</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="radio">
25-34</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="radio">
35-54</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="radio">
55-64</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="radio">
65 and over</label></td>
</tr>
</table>
<p align="left" class="style1">&nbsp; </p>
<table width="500">
<tr>
<td><label>Do you currently live in Tampa? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q5" value="radio">
Yes</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q5" value="radio">
No</label></td>
</tr>
</table>
<p align="left" class="style1">Including yourself, how many persons are there in your group or family visiting the museum with you today?<br>
<label>
<select name="Q6" size="1">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6 or more</option>
</select>
</label>
</p>
<p align="left" class="style1">How many of those are aged 12 or older, again, including yourself?<br>
<label>
<select name="Q7">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6 or more</option>
</select>
</label>
</p>

Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br />
<br />
<br />
Mail Message: <br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
</form>[!--colorc--][/span][!--/colorc--]
[!--sizeo:4--][span style=\"font-size:14pt;line-height:100%\"][!--/sizeo--]
redirected page[!--sizec--][/span][!--/sizec--]


[!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$Q1= $_POST['$Q1'];
$Q2= $_POST['$Q2'];
$Q3= $_POST['$Q3'];
$Q4= $_POST['$Q4'];
$Q5= $_POST['$Q5'];
$Q6= $_POST['$Q6'];
$Q7= $_POST['$Q7'];

$attn = $_POST['attn'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR...ml4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>..::..RateMyBoyfriend..::..</title>
<style type="text/css">
<!--
body {
background-color: #424242;
background-image: url();
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style></head>

<body>
<table width="200" border="0" align="center">
<tr>
<td width="490" colspan="4"><p>&nbsp;</p>
<p>&nbsp;</p>
<table width="433" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="433">

<?php

$myemail = "erinkuzma@yahoo.com";


if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n

";
$Q1="How often do you visit MOSI? $Q1\r\n";
$Q2="How often do you visit museums in general? $Q2 \r\n";
$Q3="What is your gender? $Q3 \r\n";
$Q4="What is your age group? $Q4 \r\n";
$Q5="Do you currently live in Tampa? $Q5 \r\n";
$Q6="Including yourself, how many persons are there in your group or family visiting the museum with you today? $Q6 \r\n";
$Q7="How many of those are aged 12 or over, again, including yourself? $Q7 \r\n";

$from = "From: $visitormail\r\n";


if ($myemail != "")
mail($myemail, $attn, $subject, $message, $Q1, $Q2, $Q3, $Q4, $Q5, $Q6, $Q7, $from);

?>
<p align="left" class="style1">
<strong>Date:</strong> <?php echo $todayis ?>
<br />
<strong>Thank You :</strong> ( <?php echo $visitormail ?> )
<br />

<br />
<strong>Message:</strong><br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
How often do you visit MOSI?<?php echo $Q1 ?> <br>
How often do you visit museums in general? <?php echo $Q2 ?><br>
What is your gender? <?php echo $Q3 ?><br>
What is your age group? <?php echo $Q4 ?><br>
Do you currently live in Tampa? <?php echo $Q5 ?><br>
Including yourself, how many persons are there in your group or family visiting the museum with you today?<?php echo $Q6 ?><br>
How many of those are aged 12 or over, again, including yourself? <?php echo $Q7 ?><br>



<?php echo $ip ?>

<br /><br />
<a href="WhatDoYouThink.php"> Send another message.. </a></p> </td>
</tr>
</table> <p>&nbsp;</p></td>
</tr>
</table>[!--colorc--][/span][!--/colorc--]

Thats what im getting in the email, i need that plus the result of the question



Tuesday, May 30, 2006, 10:11 am [EST]

Attention:

Message: AH!!!!!!!!!!!!!!!!

From: (erinkuzma@yahoo.com)


Browser Info:

Referral :


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 03:13 PM

Change that part of code to this:

for ($i=1; $i<8; $i++) {
   $message .= ${'Q' . $i};;
}

mail($myemail, $subject, $message, $from);

~ D Kuang

#3 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:22 PM

change what part?


#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 03:25 PM

Erm... My bad.

mail($myemail, $attn, $subject, $message, $Q1, $Q2, $Q3, $Q4, $Q5, $Q6, $Q7, $from);

To what I posted above.
~ D Kuang

#5 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:28 PM

-sad face- didnt work, i didnt even get the email this time


#6 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 30 May 2006 - 03:28 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
mail($myemail, $attn, $subject, $message, $Q1, $Q2, $Q3, $Q4, $Q5, $Q6, $Q7, $from);
[/quote]
This is incorrect. The mail() function can have at most 5 parameters.

Ken

#7 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:31 PM

well what are my options then?

ok i got the email but nothing changed

#8 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 03:32 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]This is incorrect. The mail() function can have at most 5 parameters.

Ken[/quote]
Yeah, I was just pointing where she should edit it.

Concatenate the variables into $message and send the email.
Try my code.

Whoa sorry, there was a small mistake with it. $attn shouldn't be an argument.
I removed $attn, but I don't know where it should be.

Anyways the mail function is:

bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )

Which means you mustn't use more than 5 arguments, and at least 3 arguments. And also they must respect that order.
~ D Kuang

#9 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:45 PM

ok now your talking over my head..

what do i need to do?

#10 ludwigvb

ludwigvb
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 May 2006 - 03:45 PM

Try changinf this code:

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n

";
$Q1="How often do you visit MOSI? $Q1\r\n";
$Q2="How often do you visit museums in general? $Q2 \r\n";
$Q3="What is your gender? $Q3 \r\n";
$Q4="What is your age group? $Q4 \r\n";
$Q5="Do you currently live in Tampa? $Q5 \r\n";
$Q6="Including yourself, how many persons are there in your group or family visiting the museum with you today? $Q6 \r\n";
$Q7="How many of those are aged 12 or over, again, including yourself? $Q7 \r\n";

to:

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n

";
$Q1="How often do you visit MOSI? $Q1\r\n";
$Q2="How often do you visit museums in general? $Q2 \r\n";
$Q3="What is your gender? $Q3 \r\n";
$Q4="What is your age group? $Q4 \r\n";
$Q5="Do you currently live in Tampa? $Q5 \r\n";
$Q6="Including yourself, how many persons are there in your group or family visiting the museum with you today? $Q6 \r\n";
$Q7="How many of those are aged 12 or over, again, including yourself? $Q7 \r\n"; 

$message .= $Q1
$message .= $Q2
$message .= $Q3
$message .= $Q4
$message .= $Q5
$message .= $Q6
$message .= $Q7


and:

mail($myemail, $attn, $subject, $message, $Q1, $Q2, $Q3, $Q4, $Q5, $Q6, $Q7, $from);

to:
mail($myemail, $attn, $subject, $message, $from);

or:

mail($myemail, $subject, $message, $from);


#11 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 03:50 PM

[!--quoteo(post=378404:date=May 30 2006, 08:31 AM:name=phpPrincess)--][div class=\'quotetop\']QUOTE(phpPrincess @ May 30 2006, 08:31 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]ok now your talking over my head..[/quote]
lol sorry [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]

Just try to replace your code with what I posted. Check again because I edited my post.

If that doesn't work, try to add :
echo $message;
right below the mail($myemail, $subject...) line.

It will output the message and you should see what was sent to your email.

LudwigVB,
mail($myemail, $attn, $subject, $message, $from);
Won't work as expected because the arguments are messed up.
And:
$message .= $Q1
$message .= $Q2
$message .= $Q3
$message .= $Q4
$message .= $Q5
$message .= $Q6
$message .= $Q7

Can be replaced with:
for ($i=1; $i<8; $i++) {
   $message .= ${'Q' . $i};;
}
It makes the code shorter [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]
~ D Kuang

#12 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:52 PM

am i keeping this


for ($i=1; $i<8; $i++) {
$message .= ${'Q' . $i};;
}

#13 ludwigvb

ludwigvb
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 May 2006 - 03:55 PM

poirot you are right, but this should make more sense to phpPrincess

YOUR code is shorter and that means that is more correct.

[!--quoteo(post=378414:date=May 30 2006, 06:52 PM:name=phpPrincess)--][div class=\'quotetop\']QUOTE(phpPrincess @ May 30 2006, 06:52 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
am i keeping this
for ($i=1; $i<8; $i++) {
$message .= ${'Q' . $i};;
}
[/quote]


Yes keep this.
It has the same results that my code has and it makes your file smaller!

#14 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 03:59 PM

still no go.lemme repost my code to make sure im pasting in the right stuff...


[!--coloro:#993399--][span style=\"color:#993399\"][!--/coloro--]<?php

$myemail = "erinkuzma@yahoo.com";


if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n

";
$Q1="How often do you visit MOSI? $Q1\r\n";
$Q2="How often do you visit museums in general? $Q2 \r\n";
$Q3="What is your gender? $Q3 \r\n";
$Q4="What is your age group? $Q4 \r\n";
$Q5="Do you currently live in Tampa? $Q5 \r\n";
$Q6="Including yourself, how many persons are there in your group or family visiting the museum with you today? $Q6 \r\n";
$Q7="How many of those are aged 12 or over, again, including yourself? $Q7 \r\n";

$from = "From: $visitormail\r\n";


if ($myemail != "")
for ($i=1; $i<8; $i++) {
$message .= ${'Q' . $i};;
}

mail($myemail, $attn, $subject, $message, $from);

?>
<p align="left" class="style1">
<strong>Date:</strong> <?php echo $todayis ?>
<br />
<strong>Thank You :</strong> ( <?php echo $visitormail ?> )
<br />

<br />
<strong>Message:</strong><br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
How often do you visit MOSI?<?php echo $Q1 ?> <br>
How often do you visit museums in general? <?php echo $Q2 ?><br>
What is your gender? <?php echo $Q3 ?><br>
What is your age group? <?php echo $Q4 ?><br>
Do you currently live in Tampa? <?php echo $Q5 ?><br>
Including yourself, how many persons are there in your group or family visiting the museum with you today?<?php echo $Q6 ?><br>
How many of those are aged 12 or over, again, including yourself? <?php echo $Q7 ?><br>



<?php echo $ip ?> [!--colorc--][/span][!--/colorc--]

#15 ludwigvb

ludwigvb
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 May 2006 - 04:07 PM

Try:
mail($myemail, $subject, $message, $from);

Instead of:
mail($myemail, $attn, $subject, $message, $from);


#16 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 04:09 PM

Change this:

mail($myemail, $attn, $subject, $message, $from);

to

mail($myemail, $subject, $message, $from);

~ D Kuang

#17 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 04:28 PM

WHAT AM I DOING WRONG!!! ITS NOT WORKING!!!

YOU GUYS WANT THE WHOLE CODE AGAIN


#18 ludwigvb

ludwigvb
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 May 2006 - 04:42 PM

[!--quoteo(post=378421:date=May 30 2006, 07:28 PM:name=phpPrincess)--][div class=\'quotetop\']QUOTE(phpPrincess @ May 30 2006, 07:28 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
WHAT AM I DOING WRONG!!! ITS NOT WORKING!!!

YOU GUYS WANT THE WHOLE CODE AGAIN
[/quote]

HERE IS THE RIGHT CODE:

FILE:
WhatDoYouThink.php

<form method="post" action="sendeail.php">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<table width="500">
<tr>
<td width="319"><label><span class="style1">How often do you visit MOSI?</span></label></td>
</tr>
<tr>
<td><span class="style5">
<input type="radio" name="Q1" value="First visit">
First visit</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="Less than once a year">
Less than once a year</label>
</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="About once a year">
About once a year</label>
</span></td>
</tr>
<tr>
<td><span class="style5">
<label>
<input type="radio" name="Q1" value="More than once a year">
More than once a year</label>
</span></td>
</tr>
</table>
<br>
<p align="left" class="style1">
<label></label>
</p>
<table width="500">
<tr>
<td><label><span class="style1">How often do you visit museums in general?</span></label></td>
</tr>
<tr>
<td><input type="radio" name="Q2" value="Less than once a year">
Less than once a year</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="About once a year">
About once a year</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="A few times a year">
A few times a year</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q2" value="Once a month or more">
Once a month or more</label></td>
</tr>
</table>
<br>
<table width="500">
<tr>
<td><label>What is your gender? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q3" value="Male">
Male</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q3" value="Female">
Female</label></td>
</tr>
</table>
<br>
<table width="500">
<tr>
<td><label>What is your age group? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q4" value="15-24">
15-24</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="25-34">
25-34</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="35-54">
35-54</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="55-64">
55-64</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q4" value="65 and over">
65 and over</label></td>
</tr>
</table>
<p align="left" class="style1">&nbsp; </p>
<table width="500">
<tr>
<td><label>Do you currently live in Tampa? </label></td>
</tr>
<tr>
<td><input type="radio" name="Q5" value="Yes">
Yes</td>
</tr>
<tr>
<td><label>
<input type="radio" name="Q5" value="No">
No</label></td>
</tr>
</table>
<p align="left" class="style1">Including yourself, how many persons are there in your group or family visiting the museum with you today?<br>
<label>
<select name="Q6" size="1">
<option selected>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6 or more</option>
</select>
</label>
</p>
<p align="left" class="style1">How many of those are aged 12 or older, again, including yourself?<br>
<label>
<select name="Q7">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6 or more</option>
</select>
</label>
</p>

Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br />
<br />
<br />
Mail Message: <br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
</form>

File: sendeail.php


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>..::..RateMyBoyfriend..::..</title>
<style type="text/css">
<!--
body {
background-color: #424242;
background-image: url();
}
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style></head>

<body>
<table width="200" border="0" align="center">
<tr>
<td width="490" colspan="4"><p>&nbsp;</p>
<p>&nbsp;</p>
<table width="433" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="433">

<?php

$myemail = "erinkuzma@yahoo.com";


if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a");

$attn = $attn;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n

";
$A1="How often do you visit MOSI?". $Q1 ."\r\n";
$A2="How often do you visit museums in general?". $Q2 ."\r\n";
$A3="What is your gender?". $Q3 ."\r\n";
$A4="What is your age group?". $Q4 ."\r\n";
$A5="Do you currently live in Tampa?". $Q5 ."\r\n";
$A6="Including yourself, how many persons are there in your group or family visiting the museum with you today?". $Q6 ."\r\n";
$A7="How many of those are aged 12 or over, again, including yourself?". $Q7 ."\r\n";

$from = "From: $visitormail\r\n";

if ($myemail != "")
for ($i=1; $i<8; $i++) {
$message .= ${'A' . $i};;
}

if ($myemail != "")
mail($myemail, $subject, $message, $from);

?>
<p align="left" class="style1">
<strong>Date:</strong> <?php echo $todayis ?>
<br />
<strong>Thank You :</strong> ( <?php echo $visitormail ?> )
<br />

<br />
<strong>Message:</strong><br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $A1 ?> <br>
<?php echo $A2 ?><br>
<?php echo $A3 ?><br>
<?php echo $A4 ?><br>
<?php echo $A5 ?><br>
<?php echo $A7 ?><br><br>
<?php echo $A7 ?><br>



<?php echo $ip ?>

<br /><br />
<a href="WhatDoYouThink.php"> Send another message.. </a></p> </td>
</tr>
</table> <p>&nbsp;</p></td>
</tr>
</table>

At least it's working for me!!!

#19 phpPrincess

phpPrincess
  • Members
  • PipPip
  • Member
  • 29 posts

Posted 30 May 2006 - 05:48 PM

ok its working but the results arent displaying next to the question!!1 banging head on desk- im so over this

#20 ludwigvb

ludwigvb
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 May 2006 - 06:01 PM

[!--quoteo(post=378451:date=May 30 2006, 08:48 PM:name=phpPrincess)--][div class=\'quotetop\']QUOTE(phpPrincess @ May 30 2006, 08:48 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
ok its working but the results arent displaying next to the question!!1 banging head on desk- im so over this
[/quote]


That's is a matter of HTML.
Try making tables to include text and variables.
Since everything is going to be sent as an e-mail too, don't forget to change the header information of the e-mail to html




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users