Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
email script not working
Old 11-04-2006, 05:44 AM email script not working
Novice Talker

Posts: 10
Trades: 0
Hi,

I recently had someone do me a simple email script for my new website's splash page.

For some reason I don't seem to be receiving the emails from users.

Could somewone please take a look at it and let me know what the problem is as I have no idea about PHP coding.

Any help will be greatly appreciated.

Thanks.


Here is the index code:


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Breakout Music Network - Coming Soon!</title>
<META HTTP-EQUIV=Refresh CONTENT="4; URL=index.php">
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
<div id="wrapper">
<div id="top"></div>
<div id="thankyou-text"></div>
</div>
<?php 
 
$email = htmlentities ($_POST['email']); 
 
?>
<?php
 
 
mail("info@breakoutmusic.net", "Breakout Music Website Request", "Someone has submitted their email to request further information :\n
-----------------------------------------
 
Email: $email
______________________________________________________________
Breakout Music
www.breakoutmusic.net", "From: Breakout <info@breakoutmusic.net>");
 
?>
 
</body>
</html>


Here is the thankyou page code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Break Out Music Network - Coming Soon!</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
<div id="wrapper">
<div id="top"></div>
<div id="text"></div>
<div id="container">
<div id="email">
<form name="breakout" method="post" action="thankyou.php">
<input class="box" type="text" name="email" />
<input name="submit" type="image" class="button" id="submit" src="images/submit-button.jpg" alt="Subscribe" />
</form>
</div>
</div>
</div>
 
</body>
</html>

Last edited by djexelta; 11-04-2006 at 06:21 AM..
djexelta is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-04-2006, 06:12 AM Re: email script not working
Junior Talker

Posts: 1
Trades: 0
[spoiler=Hidden Text]Blah blah blah[/spoiler]
Matthew C is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 06:16 AM Re: email script not working
Novice Talker

Posts: 10
Trades: 0
Sorry, like I said I'm new to .php

Where should the line "[spoiler=Hidden Text]Blah blah blah[/spoiler]" go in the script?

thanks
djexelta is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 08:17 AM Re: email script not working
Novice Talker

Posts: 6
Trades: 0
There are programmers who can help you do this
visit here and just post it up and wait for a reply.
http://www.your-bids.com/Freelancer/index.php
coldgansta is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 10:59 AM Re: email script not working
Novice Talker

Posts: 10
Trades: 0
I'm sure I could get a little advice without paying for it.
djexelta is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 11:57 AM Re: email script not working
Extreme Talker

Posts: 246
Trades: 3
If that index code is the page that PHP executes everytime a visitor visits your page, then you should be getting an email every time there is a visit. If that is the case, and your email address in the mail() function is correct, then you probably want to check your junk mail.

It would make more sense to only run the mail() function is a user has submitted the form.

Something like:
PHP Code:
if (isset($_POST["submit"]) and isset($_POST["submit"])) {
   
mail(
   
//address, subject, body, headers
   
)

__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 12:05 PM Re: email script not working
Extreme Talker

Posts: 246
Trades: 3
Also, I notice that the email form is on the thankyou page, and that submitting the form will take the user back to the thankyou page, which does not have the mail() function on it. So, starting with the basics... you want to have the form on some page (probably not the thankyou page). And if you're going to send the user to a thankyou page after they submit the form (with their message), then you should put the mail() function on the thankyou page, which will email the message to you, then display a message of thanks.

Hopefully that will help in your overall understanding.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 11-04-2006, 12:13 PM Re: email script not working
Novice Talker

Posts: 10
Trades: 0
problem solved, thanks to everyone for their advice.
djexelta is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to email script not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27753 seconds with 12 queries