Okay, I know this probably going to be flat out the dumbest question anyone has seen on here, and I apologize for this.
I am using a sendmail.php script and it works just fine but for some reason I cannot figure out how to color the inputs from the form in red.. or any color for that matter. I assume this is easily done, I was just trying to use <font color=********>$q1 </font>
here is my script I am trying to get all the form responses in red. - <?
-
$q1 = $_REQUEST['q1'] ;
-
$q2 = $_REQUEST{'q2'} ;
-
$q3 = $_REQUEST{'q3'} ;
-
$q4 = $_REQUEST['q4'] ;
-
$q5 = $_REQUEST['q5'] ;
-
$q6 = $_REQUEST['q6'] ;
-
$q7 = $_REQUEST['q7'] ;
-
$q8 = $_REQUEST['q8'] ;
-
$q9 = $_REQUEST['q9'] ;
-
$q10 = $_REQUEST['q10'] ;
-
$comments = $_REQUEST['comments'] ;
-
-
if (!isset($_REQUEST['q1'])) {
-
header( "Location: http://itsurvey.tblrock.com" );
-
}
-
elseif (empty($q1) || empty($q2) || empty($q3) || empty($q4) || empty($q5) || empty($q6) || empty($q7) || empty($q8) || empty($q9) || empty($q10)) {
-
?>
-
-
<html>
-
<head><title>Error</title></head>
-
<body>
-
<h1>Error</h1>
-
<p>
-
All of the questions must be answered before submitting your survey. Please press your browsers back button and make sure all of them are filled in.
-
</p>
-
</body>
-
</html>
-
-
<?php
-
}
-
else {
-
-
-
mail( "feedback@email.com", "Survey Response",
-
"The overall quality of phone support: \n$q1\n\nThe overall quality of Email support: \n$q2\n\nThe overall quality of on-site support: \n$q3\n\nThe IT department responds in a timely manner: \n$q4\n\nI feel the IT Department is knowledgeable and professional: \n$q5\n\nI feel the IT Department cares about my issues: \n$q6\n\nThe IT staff understands my needs: \n$q7\n\nThe IT staff has been courteous and helpful: \n$q8\n\nThe IT staff provides complete, accurate information to me: \n$q9\n\nOverall my experiences with the IT department have been positive: \n$q10\n\nComments: \n$comments",
-
"From: feedback@email.com" );
-
header( "Location: thankyou.html" );
-
}
-
?>
-
Thank you for any responses!
27 5158
Okay, I know this probably going to be flat out the dumbest question anyone has seen on here, and I apologize for this.
I am using a sendmail.php script and it works just fine but for some reason I cannot figure out how to color the inputs from the form in red.. or any color for that matter. I assume this is easily done, I was just trying to use <font color=********>$q1 </font>
here is my script I am trying to get all the form responses in red. - <?
-
$q1 = $_REQUEST['q1'] ;
-
$q2 = $_REQUEST{'q2'} ;
-
$q3 = $_REQUEST{'q3'} ;
-
$q4 = $_REQUEST['q4'] ;
-
$q5 = $_REQUEST['q5'] ;
-
$q6 = $_REQUEST['q6'] ;
-
$q7 = $_REQUEST['q7'] ;
-
$q8 = $_REQUEST['q8'] ;
-
$q9 = $_REQUEST['q9'] ;
-
$q10 = $_REQUEST['q10'] ;
-
$comments = $_REQUEST['comments'] ;
-
-
if (!isset($_REQUEST['q1'])) {
-
header( "Location: http://itsurvey.tblrock.com" );
-
}
-
elseif (empty($q1) || empty($q2) || empty($q3) || empty($q4) || empty($q5) || empty($q6) || empty($q7) || empty($q8) || empty($q9) || empty($q10)) {
-
?>
-
-
<html>
-
<head><title>Error</title></head>
-
<body>
-
<h1>Error</h1>
-
<p>
-
All of the questions must be answered before submitting your survey. Please press your browsers back button and make sure all of them are filled in.
-
</p>
-
</body>
-
</html>
-
-
<?php
-
}
-
else {
-
-
-
mail( "feedback@email.com", "Survey Response",
-
"The overall quality of phone support: \n$q1\n\nThe overall quality of Email support: \n$q2\n\nThe overall quality of on-site support: \n$q3\n\nThe IT department responds in a timely manner: \n$q4\n\nI feel the IT Department is knowledgeable and professional: \n$q5\n\nI feel the IT Department cares about my issues: \n$q6\n\nThe IT staff understands my needs: \n$q7\n\nThe IT staff has been courteous and helpful: \n$q8\n\nThe IT staff provides complete, accurate information to me: \n$q9\n\nOverall my experiences with the IT department have been positive: \n$q10\n\nComments: \n$comments",
-
"From: feedback@email.com" );
-
header( "Location: thankyou.html" );
-
}
-
?>
-
Thank you for any responses!
This is what I do for my message parameter when using the mail function. Then you can use the HTML tags to do anything with the way it is displayed in the email.
[PHP]$message ="<table><tr><td><b>Heading</b></td></tr>";
$message .="<tr><td><b>Name:</b> " . $_POST['name'] . "</td></tr> ";
$message .="<tr><td><b>Phone:</b> " . $_POST['phone'] . "</td></tr> ";
$message .="<table>";[/PHP]
another benefit is then my call to the mail function is nice and clean.
[PHP]$mail = mail($to, $subject, $message, $headers);[/PHP]
Give that a try and let me know if you have any questions.
This is what I do for my message parameter when using the mail function. Then you can use the HTML tags to do anything with the way it is displayed in the email.
[PHP]$message ="<table><tr><td><b>Heading</b></td></tr>";
$message .="<tr><td><b>Name:</b> " . $_POST['name'] . "</td></tr> ";
$message .="<tr><td><b>Phone:</b> " . $_POST['phone'] . "</td></tr> ";
$message .="<table>";[/PHP]
another benefit is then my call to the mail function is nice and clean.
[PHP]$mail = mail($to, $subject, $message, $headers);[/PHP]
Give that a try and let me know if you have any questions.
Hey that IS a great idea, I will be giving this a shot when I get to my work computer in the AM. Thanks a ton... will update tomorrow!
for emails to be formatted in HTML you have to send the right headers
[php]
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1";
[/php]
Something like that... i think.
for emails to be formatted in HTML you have to send the right headers
[php]
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1";
[/php]
Something like that... i think.
Markusn00b, thanks for adding that, you are right! You don't have to have the first line, but definitely the second. This is how I have my headers setup.
[PHP]$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";[/PHP]
for emails to be formatted in HTML you have to send the right headers
[php]
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1";
[/php]
Something like that... i think.
Okay I am trying this out now, and when I try the first idea. I get
Parse error: syntax error, unexpected T_STRING in H:\share\IT\Websites\IT_Survey\counter\sendmail.ph p on line 2
I am trying to read up on the header business right now. any help is more than welcome!
thank you guys!
Okay I am trying this out now, and when I try the first idea. I get
Parse error: syntax error, unexpected T_STRING in H:\share\IT\Websites\IT_Survey\counter\sendmail.ph p on line 2
I am trying to read up on the header business right now. any help is more than welcome!
thank you guys!
That usually means you are missing a " ; " or something along those lines. And it might be line 1 that is actually causing the error.
Markusn00b, thanks for adding that, you are right! You don't have to have the first line, but definitely the second. This is how I have my headers setup.
[PHP]$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";[/PHP]
So I have to say I am such a novice with PHP it is hardly funny. I tried reading up on the headers that you guys wrote about so I didnt seem like TOO much of a jerk, but I got to say I cant find squat that doesnt confuse me. I think its just a simple problem and I am reading far too complex of forums, etc.
Here is my code and what is my attempt at putting the headers .= "content....
as you can see the only thing that has a font tag on it is q1 at the very top. Once I figure just one out Ill be good.
If someone could help me out I would be forever in their debt!
Thank you! - <?
-
$q1 = <font color="red">$_REQUEST['q1']</font> ;
-
$q2 = $_REQUEST{'q2'} ;
-
$q3 = $_REQUEST{'q3'} ;
-
$q4 = $_REQUEST['q4'] ;
-
$q5 = $_REQUEST['q5'] ;
-
$q6 = $_REQUEST['q6'] ;
-
$q7 = $_REQUEST['q7'] ;
-
$q8 = $_REQUEST['q8'] ;
-
$q9 = $_REQUEST['q9'] ;
-
$q10 = $_REQUEST['q10'] ;
-
$comments = $_REQUEST['comments'] ;
-
$Formid = $_REQUEST['Formid'] ;
-
$headers .= "Content-type: text/html\r\n";
-
-
if (!isset($_REQUEST['q1'])) {
-
header( "Location: http://website.com" );
-
}
-
elseif (empty($q1) || empty($q2) || empty($q3) || empty($q4) || empty($q5) || empty($q6) || empty($q7) || empty($q8) || empty($q9) || empty($q10)) {
-
?>
-
-
<html>
-
<head><title>Error</title></head>
-
<body>
-
<h1>Error</h1>
-
<p>
-
All of the questions must be answered before submitting your survey. Please press your browsers back button and make sure all of them are filled in.
-
</p>
-
</body>
-
</html>
-
-
<?
-
}
-
else {
-
-
-
mail( "feedback@tblrock.com", "IT Department Survey Response",
-
"$Formid\n\nThe overall quality of phone support: \n$q1\n\nThe overall quality of Email support: \n$q2\n\nThe overall quality of on-site support: \n$q3\n\nThe IT department responds in a timely manner: \n$q4\n\nI feel the IT Department is knowledgeable and professional: \n$q5\n\nI feel the IT Department cares about my issues: \n$q6\n\nThe IT staff understands my needs: \n$q7\n\nThe IT staff has been courteous and helpful: \n$q8\n\nThe IT staff provides complete, accurate information to me: \n$q9\n\nOverall my experiences with the IT department have been positive: \n$q10\n\nComments: \n$comments",
-
"From: feedback@website.com");
-
header( "Location: thankyou.html" );
-
-
}
-
?>
-
mbatestblrock, Take a look at this stripped down example
[PHP]<?php
$to = $_POST["toEmail"];
$from = $our_email;
$subject = $_POST["subject"];
$message ="<table><tr><td><b>Website Design Inquiry</b></td></tr>";
$message .="<tr><td><b>Name: </b> " . $_POST['name'] . "</td></tr> ";
$message .="<tr><td><b>Phone:</b> " . $_POST['phone'] . "</td></tr> ";
$message .="<tr><td><b>Email:</b> " . $_POST['email'] . "</td></tr> ";
$message .="<tr><td><b>Message:</b> <br>" . $_POST['message'] . "</td></tr></table>";
// Additional headers
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$mail = mail($to, $subject, $message, $headers);
if($mail)
{
// Message sent sucessfully, do some code
}
else
{
//Message errored, do some code
}
?>[/PHP]
Now say I wanted the "Name" Field label to show up in red, I would do the following on that line.
[PHP]$message .="<tr><td><b><p style='color:#FF0000'>Name: </b></p> " . $_POST['name'] . "</td></tr> ";[/PHP]
Hopefully seeing a full example will help you out. Let me know if you have any other questions. Also, I noticed that around your q2 and q3 fields you have curly brackets"{ }" instead of "[ ]", don't forget to correct those too! :-)
mbatestblrock, Take a look at this stripped down example
[PHP]<?php
$to = $_POST["toEmail"];
$from = $our_email;
$subject = $_POST["subject"];
$message ="<table><tr><td><b>Website Design Inquiry</b></td></tr>";
$message .="<tr><td><b>Name: </b> " . $_POST['name'] . "</td></tr> ";
$message .="<tr><td><b>Phone:</b> " . $_POST['phone'] . "</td></tr> ";
$message .="<tr><td><b>Email:</b> " . $_POST['email'] . "</td></tr> ";
$message .="<tr><td><b>Message:</b> <br>" . $_POST['message'] . "</td></tr></table>";
// Additional headers
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$mail = mail($to, $subject, $message, $headers);
if($mail)
{
// Message sent sucessfully, do some code
}
else
{
//Message errored, do some code
}
?>[/PHP]
Now say I wanted the "Name" Field label to show up in red, I would do the following on that line.
[PHP]$message .="<tr><td><b><p style='color:#FF0000'>Name: </b></p> " . $_POST['name'] . "</td></tr> ";[/PHP]
Hopefully seeing a full example will help you out. Let me know if you have any other questions. Also, I noticed that around your q2 and q3 fields you have curly brackets"{ }" instead of "[ ]", don't forget to correct those too! :-)
haha thanks for the curly notice! So what if you wanted the Name variable to be red instead of the label? I assume its the same process then?
haha thanks for the curly notice! So what if you wanted the Name variable to be red instead of the label? I assume its the same process then?
Yep!
Just wrap the
[php]
".$_POST['name']."
[/php]
With
:)
haha thanks for the curly notice! So what if you wanted the Name variable to be red instead of the label? I assume its the same process then?
No problem! I know how much time can be wasted on little typos like that and how annoying it can be.
Yep, if I wanted the variable itself to be red then I would just put the "P" tag around the variable instead of the label like this:
[PHP]$message .="<tr><td><b>Name: </b><p style='color:#FF0000'> " . $_POST['name'] . "</p></td></tr> ";[/PHP]
No problem! I know how much time can be wasted on little typos like that and how annoying it can be.
Yep, if I wanted the variable itself to be red then I would just put the "P" tag around the variable instead of the label like this:
[PHP]$message .="<tr><td><b>Name: </b><p style='color:#FF0000'> " . $_POST['name'] . "</p></td></tr> ";[/PHP]
Sorry for stealing your thunder
:(
I get bored around here, so feel the need to but in on others...
I'm a terrible person, i know.
Sorry for stealing your thunder
:(
I get bored around here, so feel the need to but in on others...
I'm a terrible person, i know.
:-) No problem Markusn00b! I'm all for someone getting answers to their questions as quickly as possible no matter where the answer comes from! Besides, it looks like we were posting at the exact same time, I happen to be having a pretty slow day as well.
Haha! Bang on the same time!
What are the chances?
If only there were more not-so php inclined people around, i wouldn't be so bored and i also wouldn't have to watch seasons 1-6 of scrubs :(
Haha! Bang on the same time!
What are the chances?
If only there were more not-so php inclined people around, i wouldn't be so bored and i also wouldn't have to watch seasons 1-6 of scrubs :(
I値l admit that I知 just a tad bit envious that you are getting to watch scrubs right now. :-)
Many thanks! This is definitely the cure for boredom...besides message boards of course! :-)
Message boards come second.. don't tell anyone i said that though
=X
Message boards come second.. don't tell anyone i said that though
=X
Our little secret...wait....
Meanwhile whenever mbatestblrock comes back they'll be wondering what happened with this thread! :-)
Our little secret...wait....
Meanwhile whenever mbatestblrock comes back they'll be wondering what happened with this thread! :-)
We're just getting our post counts up, so we can get higher on that board over there 8]
Alas, the meaningless banter must (?s:c)eist to exist!
I have hair to make pretty and eyes to rest.
Goodnight friend. :)
I have hair to make pretty and eyes to rest.
That almost sounded like a bad line that someone might use to turn down a date! Goodnight! ;-)
Well I have to say thanks to everyone I finally got the thing going! I really need to dive deep into PHP sometime but time is seriously not on my time! I do check out the w3schools and lynda.com if you guys have anything you think might be a good tool for me throw it out!
thank so much!
That almost sounded like a bad line that someone might use to turn down a date! Goodnight! ;-)
Johnny! Get the ale; we have been discovered!
Well I have to say thanks to everyone I finally got the thing going! I really need to dive deep into PHP sometime but time is seriously not on my time! I do check out the w3schools and lynda.com if you guys have anything you think might be a good tool for me throw it out!
thank so much!
Glad you got it working! PHP.net is another good resource. Other than that I find I can't find something on here, I then go to google and search. Between those you should be able to get an answer.
Well I have to say thanks to everyone I finally got the thing going! I really need to dive deep into PHP sometime but time is seriously not on my time! I do check out the w3schools and lynda.com if you guys have anything you think might be a good tool for me throw it out!
thank so much!
tizag is a nice little place.
I often find it's the smaller, blog focused websites (like pbmods site) that are the best learning grounds.
Johnny! Get the ale; we have been discovered!
ha! I thought you were going to bed? :-)
ha! I thought you were going to bed? :-)
It seems i can't drag myself away from this place; it seems i have an inane desire to help people with their PHP dilemmas!
Not an ego issue, i hope.
:S
Note: we need smileys!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John |
last post by:
Below is my code. It seems that no matter what I do, I cannot get the
following list of places to start at the top of the cell. It is always
centered in the middle of the cell. Is vAlign the...
|
by: Martin Ernst |
last post by:
Hello!
I wonder which font is normally used in IE (6) for windows if i use
"sans-serif" as font-family.
Does anybody know it? Thanks
Martin
|
by: Philipp Lenssen |
last post by:
Why is there no standardized and well-working way for a web-page to
offer the font for download/embed it, in order to be displayed on the
page?
No matter what you think of the preferred font of a...
|
by: Peter Foti |
last post by:
Simple question... which is better to use for defining font sizes and why?
px and em seem to be the leading candidates. I know what the general answer
is going to be, but I'm hoping to ultimately...
|
by: Dr John Stockton |
last post by:
Assuming default set-ups and considering all reasonable browsers,
whatever that may mean, what should an author expect that his readers in
general will see (with visual browsers) for a page with...
|
by: Adam |
last post by:
Can someone please help!!
I am trying to figure out what a font is?
Assume I am working with a fixed font say Courier 10 point font
Question 1: What does this mean 10 point font
Question 2:...
|
by: duncan352 |
last post by:
I'm new to PHP and still pretty inexperienced when it comes to everything else in web development. I'm just now learning the art of style sheets, and that's where my problem is. When I apply the...
|
by: Keith |
last post by:
Hello all,
I have a C# Windows Forms app. It is in namespace App.GUI. It builds to Nav.exe. I have entered an application level setting using the designer. Its type is string, name is "FOO"...
|
by: Michael |
last post by:
Hi,
I'm trying to use a table and format it with CSS, but I cant get it to
render with a border. I know this is really easy, but I can't see what I
have wrong and when I search for tables and...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project用lanning, coding, testing,...
| |