I have a page that is used to create a user account. The form is "supposed" to send the username and password to the user upon successful completion of the form. But, it only sends the information to the database - at least that's done well. I've included the code from the page to find out if someone can tell me where I need to add the $mailto code and exactly how. I have seen many example, but not being a php programmer with mysql, I'm not sure that cut and paste from something that "should" work will work in this instance. Please look and let me know how to get the form to E-mail the username and password to the user: 600 lines of code added as attachment
The person who wrote the page, or should I say cut and pasted from other pages, failed to complete the assignment of making the page send to the user. However, the resulting page tells the user to expect the information in their E-mail.
Help!
Thanks.
10 1595
Point 1: Use CODE tags in your post so it is easier to read.
Point 2: Use <?php not <? as this will be removed in future php versions and it is good practice as <? can be used for XML I believe.
I didn't read a lot of it closely, just skimmed because I don't have the time to sit through all that... However there is no mail() function in all that code you posted, so how do you expect it to email someone?
You need to include a line with:
[PHP]mail(to,subject,message);[/PHP]
Read more about it here.
Come back when you have tried that and use the correct CODE tags or else no one will read it!
I have a page that is used to create a user account. The form is "supposed" to send the username and password to the user upon successful completion of the form. But, it only sends the information to the database - at least that's done well. I've included the code from the page to find out if someone can tell me where I need to add the $mailto code and exactly how. I have seen many example, but not being a php programmer with mysql, I'm not sure that cut and paste from something that "should" work will work in this instance. Please look and let me know how to get the form to E-mail the username and password to the user:
The person who wrote the page, or should I say cut and pasted from other pages, failed to complete the assignment of making the page send to the user. However, the resulting page tells the user to expect the information in their E-mail.
Help!
Thanks.
I hope the corrections are as required for the forum.
Point 1: Use CODE tags in your post so it is easier to read.
Point 2: Use <?php not <? as this will be removed in future php versions and it is good practice as <? can be used for XML I believe.
I didn't read a lot of it closely, just skimmed because I don't have the time to sit through all that... However there is no mail() function in all that code you posted, so how do you expect it to email someone?
You need to include a line with:
[PHP]mail(to,subject,message);[/PHP]
Read more about it here.
Come back when you have tried that and use the correct CODE tags or else no one will read it!
Ok. I understand that I've posted incorrectly due to my newness to the forum. I also agree, as I pointed out in my post, that the $mailto is missing. My question is where would it go and what is the proper code to include?
I could delete and then repost, but I don't see anywhere I can edit the original post.
I'm going now to see if I can follow your suggested link. As I also mentioned, I'm not a php programmer. I can read and understand what's going on. But I'm not sure if I include something how it will effect the interaction with mysql.
Thanks for your help. Don't give up on me...
Ok. I understand that I've posted incorrectly due to my newness to the forum. I also agree, as I pointed out in my post, that the $mailto is missing. My question is where would it go and what is the proper code to include?
I could delete and then repost, but I don't see anywhere I can edit the original post.
I'm going now to see if I can follow your suggested link. As I also mentioned, I'm not a php programmer. I can read and understand what's going on. But I'm not sure if I include something how it will effect the interaction with mysql.
Thanks for your help. Don't give up on me...
Would you be able to go back and edit your first post so that it's actually readable?
Read the forum guidelines on how to do that.
Regards.
as I pointed out in my post, that the $mailto is missing. My question is where would it go and what is the proper code to include? ... Don't give up on me...
It doesn't matter where you include it, as long as it is in the place where the information is sent to (before or after your SQL stuff). I recommend after so that it will only send if your database update worked.
And I am not giving up on you, trust me I am still very much in the beginner category of php. Unlike you however, that is the only knowledge I have, so I am a beginner in internet coding too!
It doesn't matter where you include it, as long as it is in the place where the information is sent to (before or after your SQL stuff). I recommend after so that it will only send if your database update worked.
And I am not giving up on you, trust me I am still very much in the beginner category of php. Unlike you however, that is the only knowledge I have, so I am a beginner in internet coding too!
The original message can't be edited...or at least I have no idea how. I've opened it several time, tried to save it, and nothing changes. I can only reply to the message. Once it's saved, that's it.
But, here is what I got to work...sort of: -
-
mail( $user_email,$user_name,$user_password);
-
-
I added that just before the end of the php, just as you suggested, although I did that before I saw your suggestion.
The above works, although only the last attribute is sent via mail, and the "from" is not what I want. I'd like to assign the "from" address, but it comes from the default account of the site.
I tried a LOT of other mailto configurations and nothing worked other than the above. I tried to add things to the beginning of the script, added things from the contact page that works well, added things from the listing page (another part of the site) and nothing works in "this" page but what I have above. The trick now is to get all 3 of the things I want sent, and I want to be able to assign a "from" E-mail address.
I'm about burned out for the night on this. It's nearly 00:30 and I'm spent. If you come up with any great answers let me know.
Thanks.
Your code source if too large, so we can only read it by editing your post.
Store the code in a .txt file and add it to your post as an attachment.
another warning: Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
Attaching would be great...if I could see where to attach something in this reply window. I understand the moderator will allow attachments. I have the .txt file prepared if you would point me in the right direction. I've also made another foiled attempt to create what I want in the code.
Ok. I understand now that I can attach if I post then edit. So, here goes...
You can see on line 104 where I've been attemping to create the send. I used the mailto at the top with other clarifications, but it didn't work. Using the line 104 does work, but I obviously don't have the code correct to send everything I want. I get it to mail to the user, and the mail subject is the username and the body contains the last parameter I specifiy. This mimnal success was using the following: - mail($user_email;$user_password,$user_name);
So, how do I "correctly" write the above so that the message is sent to the user, the subject contains whatever, and the password along with user name are in the body of the message?
I've been successful in creating the code necessary to send everything "except for" the user name and password from the form that is created/completed by the user. I've exhausted every possible combination that I can find/think to try and still need help. Where/how can I pull the user name and password from the form and send that to the user via E-mail as they submit the form? I've attached the updated version of the page in order to see what I used to make it 90% operable.
Would you be able to go back and edit your first post so that it's actually readable?
Read the forum guidelines on how to do that.
Regards.
I'm still pulling out my hair on this mail issue. Is there a possibility that you can provide some insight...please? I've reposted and uploaded a txt file to show what I have for the php page. I'm 90% there, but can't figure out how to include the password and user name in the message that is sent to the user. I've been successful in sending the user message with all but the user name and password. Any thoughts? Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Domestos |
last post by:
Need some help...
I have a form and one of the fileds is a users e-mail address
I have the validity set-up and the form now works, accepts data and posts to
a mysql database - that side works...
|
by: DigitalRick |
last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my
guestbook. It had been working fine untill I upgraded to Server 2003 (I am
also running Exchange 2003) all locally. I...
|
by: misschristalee |
last post by:
I'm having a brain blockage day....
Scenario:
Search Form with 6 text boxes
Query has same six fields
Each has this IIF: IIf(IsNull(!!),"",!!)
with each dictating the correct text box of...
|
by: eswanson |
last post by:
I have a web page I need to post a file plus some other fields to it. How
can I do this from a asp.net page. I know I can send individual fields to the
other page, but how do I send a file to the...
|
by: dac |
last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
|
by: ak1dnar |
last post by:
Hi, I have created a web application that enables to Delete Items in a product table using check boxes.
I Need to Display each and every product in <TR> and with the product there is a corresponding...
|
by: tomlebold |
last post by:
Having problems displaying query results from combo boxes on a sub
form, which is on the same form that is used to select criteria.
This has always worked form me when displaying query results on...
|
by: craigtomo |
last post by:
i have changed my login .php file to the following
this file is opened directly and is not called from any other file
<?php
// dBase file
$host=""; // Host name
$username=""; // Mysql...
|
by: brianrpsgt1 |
last post by:
I am attempting to insert data from a HTML form using a .psp script.
I can not find how to link the data that is inserted into the form to
the variables in the .psp script to then insert into the...
|
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: 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
|
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: 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...
|
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: 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...
|
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...
| |