473,670 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send form to user and to mysql

7 New Member
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.
Attached Files
File Type: txt 3150950.txt (14.0 KB, 372 views)
Apr 11 '08 #1
10 1608
TheServant
1,168 Recognized Expert Top Contributor
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!
Apr 11 '08 #2
LTCreationsLLC
7 New Member
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.
Apr 11 '08 #3
LTCreationsLLC
7 New Member
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...
Apr 11 '08 #4
Markus
6,050 Recognized Expert Expert
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.
Apr 11 '08 #5
TheServant
1,168 Recognized Expert Top Contributor
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!
Apr 11 '08 #6
LTCreationsLLC
7 New Member
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:
Expand|Select|Wrap|Line Numbers
  1.  
  2. mail( $user_email,$user_name,$user_password);
  3.  
  4.  
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.
Apr 11 '08 #7
ronverdonk
4,258 Recognized Expert Specialist
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
Apr 11 '08 #8
LTCreationsLLC
7 New Member
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:

Expand|Select|Wrap|Line Numbers
  1. 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?
Attached Files
File Type: txt registernow.txt (15.8 KB, 369 views)
Apr 11 '08 #9
LTCreationsLLC
7 New Member
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.
Attached Files
File Type: txt registernow.txt (15.8 KB, 338 views)
Apr 12 '08 #10

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

Similar topics

2
1355
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 great... I now need to use the e-mail field in the form to send a mail back to the user who entered the form to let them know registration was a sucess...
6
11175
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 will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
2
2233
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 course. SQL dictates... If text box 1 isNull do nothing or do this OR if text
9
3142
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 other page, or is there something else like a stream which will be like a file. I am attempting to get a way from writing out a file and then having to give the page that I am posting to the file name. Instead I would like to just from asp.net...
4
2995
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 with data from the database, allow the user to update it, and then display the form again with POST data. I can get the data out of the database and get the user updates back into the database, but how do I get the filled-out form back to the user...
18
3800
ak1dnar
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 check box to delete it, use can select the check box and then he will press the Update Button in the Form to submit for processing. //Here I will get the Values from MySQL Table //This Area is Inside a HTML form with Update button and On...
1
4277
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 another main and sub form. The requery on the sub form and refresh comands on the main form do not work when the form is first displayed and when the selection criteria is changed. Should I be doing a refresh and then repaint of the sub form. ...
11
2992
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 username $password=""; // Mysql password $db_name=""; // Database name
0
3348
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 MySQL Insert statement. I am familiar with PHP, where you would write $_POST(), however I can not find the equivalent in PSP. I believe that this is the my missing piece. Technically, what is occurring that that when I click the 'Submit'...
0
8384
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8813
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8659
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7412
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6212
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.