Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi all,

 

I have a site where people can sign up for a service.

 

I want to be able to create a form that registers a user in my database (so they can log in, pay a bill and then log out). In the form I want to be able to send myself a form saying that I have a new order with the relevent information.

 

So to be clear,

 

Part 1 of the form would be a user signing up (the details like email and password would be used to access their account)

 

Part 2 would be information sent over to me via email

 

Please someone help me!

 

Thanks,

 

Ben.

Link to post
Share on other sites

This is code snippet of what I use:

if ( (isset($_POST['email'])) && (!empty($_POST['email'])) )
    $e = $_POST['email'];
mail(CT, MY_SUB, $body, "From:" . $e);

You might also check that email is valid.

CT is my email address.

MY_SUB is the email subject line that I give it.

$body is the information the user has input. You'll have to grab that from your form, similar to the way I do email address.

 

I think you also have to have mail enabled on your server.

 

I hope this is the information you are looking for.

 

I don't use this particular book, so if this book doesn't have example of forms, then some of Larry's other books do.

  • Upvote 1
Link to post
Share on other sites

One thing to keep in mind is that information sent over email is harder to protect. It's easy to use SSL for Web activity, but to secure an email, the sender needs to use SSL, you need to use SSL to get the email, and the email really ought to be encrypted because it'll go through computers in between. That's assuming there's something sensitive in the email.

 

As for two actions on one form, if I understand your question, you can't do that using HTML. You can use JavaScript to fake it, but it'd be better to create two different forms with two different actions.

Link to post
Share on other sites
  • 2 weeks later...

One thing to keep in mind is that information sent over email is harder to protect. It's easy to use SSL for Web activity, but to secure an email, the sender needs to use SSL, you need to use SSL to get the email, and the email really ought to be encrypted because it'll go through computers in between. That's assuming there's something sensitive in the email.

 

As for two actions on one form, if I understand your question, you can't do that using HTML. You can use JavaScript to fake it, but it'd be better to create two different forms with two different actions.

 

 

Hi Larry,

 

Once again thank you for replying to me.

 

Thank you for the advice regarding e-mail. The site will have SSL and will look into encrypting form to e-mail. I have redesigned the form and no longer need it to have two form actions as I just have one form.

 

I love learning php very much and learn something new each day. Keeps me busy!

 

Thanks again,

 

Ben.

 

P.S. You can close this thread if you want to?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...