- This topic is empty.
September 27, 2009 at 1:56 pm #26266cc99Member
I am a newbie web designer so please excuse me if this is a silly question.
I am working on a site which has a standard css style sheet as well as another one for IE. The IE comes into play through a conditional statement in the header of each page:
<link href="styles/xyz.css" rel="stylesheet" type="text/css" />
<!–[if IE 7]>
<link href="styles/ie7_xyz.css" rel="stylesheet" type="text/css" />
However, my Contact Us page contains an email form which interacts with a PHP document to send the email and show a ‘Thank for your message’ page. However, the PHP document only seems to recognise the standard stylesheet and ignores the <!–[if…..]> comments, so when viewed in IE the page is all over the place.
As I don’t know anything about PHP (I got the code for the email form and response file from my tutor but the course is finished now so I can’t ask), I don’t know what I need to do to get the condisional comment recognised.
All help is hugely appreciated!September 28, 2009 at 1:16 pm #64786BaylorRaeMember
You shouldn’t use PHP to add the links to your style sheets. Your <head> should just have this.Code:
Perhaps I don’t fully understand your question, but this isn’t a problem with PHP.September 28, 2009 at 2:48 pm #64789cc99Member
Thanks for your reply :) I actually have it just like you suggest in my html pages. However, when a user clicks on the ‘Send’ button on the email form within the Contact Us page, it activates a PHP page that will generate the email with all the responses from the form and sends it to me and then displays a page to the user telling them the message was sent successfully. In the html pages, my conditional comment work perfectly and adds in the IE style sheet where required. However, the same does not work in the php file, so the page that is returned when successful is all over the place if viewed in an IE browser. So my question is how do I achieve the same thing here, i.e. ensure that a user with an IE browser will also get the right styles applied in the $theResults = <<<EOD part of the php file?
Code in contact.htmlCode:
If you have any questions, contact XYZ by completing the form below.
Code in contactformprocess.phpCode:
Phone Number: $phoneField
$headers = “From: $emailrn”;
$headers .= “Content-type: text/htmlrn”;
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<
?>October 6, 2009 at 8:56 pm #65120BaylorRaeMember
You don’t need to put your response in a variable. Use an if to make sure the email sent correctly and save a true or false in a variable. So later in your page you can use php to find out if the email sent and give a message to the user.Code:
Page title here
Your email has been sent!
There was an error sending the email :(
- The forum ‘Back End’ is closed to new topics and replies.