Saturday, April 16, 2011

Simple web form not working

I have created simplest of web forms.

purpose- visitors will enter their name and email address and comment and hit send, I will receive that comment in my email inbox and visitor will see a conformation page.

result- I receive an email everytime, but it doesn't show visitor's email address, name or the comment that they enter.

I assigned a veriable for each of them and set up $msg to show all these. The mail comes from some undefined@gator1064.hostgator.com and I found an error message that says something like: "[15-Apr-2011 02:29:33] PHP Parse error: syntax error, unexpected T_ECHO in... (bla bla bla)... on line 13". Line 13 is the mail() command so the problem probably is with $msg, which is the line before.

There is no sign of any confirmation page either.

My research shows that the problem is I am missing a (") or "}" or something similar. My php is not finding it, instead seeing the end of php (?>). Triple checked but can't see anything missing.

I have added the contact.php and html form page below.

Let me know if you need more information.

Thanks for taking a look guys.


Html Form-

<form action="contact.php" method="post" id="contactform">
<ol>
<li><label for="firstname">Name</label><br/>
<input name="firstname" type="text" /></li><br/>
<li><label for="email">Email</label><br/>
<input name="email" type="text" /></li><br/>
<li><label for="comment">Comment</label><br/>
<textarea row="6" cols="50" name="comment"></textarea></li><br/>
<input value="send" type="submit" />
</ol>
</form>


PHP script-


<html>
<head>
<title>this was a try</title>
</head>
<body>

<?php
$name = $_POST['firstname'];
$email = $_POST['email'];
$comment = $_POST['comment'];


$to = 'myemail@yahoo.com';
$subject = 'test';
$msg = "$name sent you a message from $email and said $comment";


mail($to, $subject, $msg, 'From:' . $email);


echo 'Thanks for you comment.<br/>';
echo 'Your message has been sent from' . $email . '<br/>';
echo 'We will get back to you with in 48 hours or less.';
?>
</body>
</html>
***end of codes***
The only difference is that I replaced "myemail@yahoo.com" with a real email adress

Wednesday, February 23, 2011

THIS ISSUE HAS BEEN SOLVED

I am editing a template for a HTML site. The problem is with a background image. The top half of the background is an image. I am simply changing the image with a different one. It is a .jpg , 1400 x 617. I simply added the image in the images folder and replaced the image name in the style sheet. It displays perfectly in firefox and chrome but in IE it doesn't show. It is all white.

I have uploaded pictures of how it looks in Firefox and IE. In IE I want it to look the same as Firefox.

This is how it looks in Firefox -



This is how it looks in Internet Explorer -




FYI, the previous image was not white. It was blue and I am changing it to red. I created my image in Photoshop.

I tried to find possible solutions through Google and got a couple, none of them works for me. First one was image type. In my case image type was .jpg . New image is also .jpg .

Second option was this code in stylesheet- .blok_header { margin:0; padding:0; background: url(images/redback.jpg) top center repeat-x;} . The advice was to leave a space between ")" and "top center". It has been like that throughout. So nothing to change there.

Third tip I got when someone suggested that I put ("") mark around my url like this- .blok_header { margin:0; padding:0; background: url("images/redback.jpg") top center repeat-x;} . I tried that as well but no luck. Nothing changed.


I have already spent so much time on this that I am getting really frustrated now. If anyone kindly give me some pointers what can possibly be wrong, I would appreciate it a lot.

If I left out any critical information, just ask. I really need to find an answer.

Many thanks for taking a look at my post. Hope you guys can help me out with this.

Thanks

Sak

SOLVED