473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Email not being Sent

155 100+
I'm using the User Registration from the book by Larry Ullman "PHP and MYSQL for dynamc websites - second edition, and it is suppose to send an email to the person who just registered so thay can activate their account or registration. But no email is being sent out. Could something be missing from this?

I have the appropriate information (www and From: email) set in my actual script.

[PHP]// Send the email.
$body = "Thank you for registering at the User Registration site. To activate your account, please click on this link:\n\n";
$body .= "http://www.whateveraddressyouwanthere.com/activate.php?x=" . mysql_insert_id() . "&y=$a";
mail($_POST['email'], 'Registration Confirmation', $body, 'From: admin@sitename.com');[/PHP]
Is this all that's needed to send an email from this script?
Jun 20 '07 #1
1 1265
DavidPr
155 100+
It's sending an email now, but I can't get the login page to redirect me to another page upon a successful login.

[PHP]// Register the values & redirect.
$row = mysql_fetch_array ($result, MYSQL_NUM);
mysql_free_result($result);
mysql_close(); // Close the database connection.
$_SESSION['first_name'] = $row[1];
$_SESSION['user_id'] = $row[0];


// Start defining the URL.
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
// Check for a trailing slash.
if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
$url = substr ($url, 0, -1); // Chop off the slash.
}
// Add the page.
$url .= '../image_load.php';[/PHP]

the image_upload.php is in directory - gallery. The login script is in the directory - registration, which is a sub-directory of gallery.

Edited**

I decided to just do this:
[PHP]// Start defining the URL.
$url = 'http://www.website.com/gallery/image_upload.php';

ob_end_clean(); // Delete the buffer.
header("Location: $url");
exit(); // Quit the script.[/PHP]

I didn't understand what that code meant, only that it wasn't redirecting my page. It is now.
Jun 20 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: JayB | last post by:
We sent out an email today to a list of subscribers from our database using ASP and CDO. For some reason, many people received it twice, including myself. I checked the database and there were do...
1
by: WillWeGetOurFreedomBack | last post by:
Here is the text of an email I recently received from a user of our Access 2K application. This is totally baffling to me. "WXYZ" = the name of our program for the purpose of this message. ...
1
by: bidllc | last post by:
I'm working on a minor bug from an open source bug tracking system (bugtracket.net). It's a great app, but I don't want to bother the creator any more than I have to, so I thought I'd pose the...
3
by: Nicola | last post by:
When using the NewMail.Body object, ! and spaces are being added into the email after the email has been sent. Has anyone else had this problem or even better a solution??
0
by: Mike | last post by:
Hi, This question how to check that email was sent correctly. At VB6 when I used EMail Controls for sending email I could check the result of sent email - checking the Sent Items folder at my...
4
by: elampirai | last post by:
Hi, I did a feedback form in PHP. When i click the submit button, the form is submitted and the mail has been sent successfully and all the fields had been clear. But then if i click the...
4
by: lucavilla | last post by:
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in...
2
by: Smithers | last post by:
I have a service that will periodically send email messages to system adminstrators. I would like for this service to send a email notification whenever the service is started and when it is...
2
by: Comcast | last post by:
I am using a form that uses PHP to create an e-mail and send it off. When the script runs, I get an error page, although the e-mail is sent off. The error I am getting is: Warning:...
2
by: ssmeshack | last post by:
Hai there, I have doing php code for form data to be send to email. But it is showing... Here is my code for html form... <body>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.