Jump to content

How to email username with anonymous form?


Jeffro

Recommended Posts

I have a required membership on one of my sites.. and after a user registers, it creates a unique username in the 'user' table. 

 

I'm looking for some ideas on how users could send messages to other users via a form.. without displaying the registered users email? 

 

I don't have a problem displaying the 'current list of registered users'... just not sure where to go next.

 

Thanks for any ideas...

Link to comment
Share on other sites

Well, for starters, remove anything that shows the email address...

 

I don't know anything about your code or your system. You may not know much either, but at least you know something.

Is this code you downloaded/bought from someplace (is there any kind of support system you can tap into)? Did you get somebody else to write it for you (and where are they now)?

Link to comment
Share on other sites

Well, for starters, remove anything that shows the email address...

 

I don't know anything about your code or your system. You may not know much either, but at least you know something.

Is this code you downloaded/bought from someplace (is there any kind of support system you can tap into)? Did you get somebody else to write it for you (and where are they now)?

 

I don't have any code for anything right now.  I want to incorporate this into my current site so I'm trying to figure out how to go about it.. I'm pretty new to php but if I have an idea of how to achieve something, I can usually muddle through it and make it work.  So..  I'm just talking about concept.  Pretend I just want to create this as standalone code.  Let's say I have nothing more than a 'user' table with a list of usernames and I query my database and display the top 10 usernames on a new page.  How can I click one of those usernames and send an email to that person via a form... much the same as replying to a craigslist ad (this too will be used for classifieds)? 

Link to comment
Share on other sites

If the table has the email address in it, you let the person fill out the form, you look up the email address in the user table and you use mail to send them the email.

 

I would probably not be very happy about your system if i was a user, as it would enable any fool to spam your entire user base quite easily.  Many systems (including this forum) do enable private messaging between users, but that does not involve email, and requires that the person sending the message have established their identity by logging in. 

 

You could exert some control over this with an implementation of a solid captcha like recaptcha that would make it at least a bit harder for someone to spam your users, but I would spend some time thinking the system through, and make sure you have really thought out all the angles.

Link to comment
Share on other sites

If the table has the email address in it, you let the person fill out the form, you look up the email address in the user table and you use mail to send them the email.

 

I would probably not be very happy about your system if i was a user, as it would enable any fool to spam your entire user base quite easily.  Many systems (including this forum) do enable private messaging between users, but that does not involve email, and requires that the person sending the message have established their identity by logging in. 

 

You could exert some control over this with an implementation of a solid captcha like recaptcha that would make it at least a bit harder for someone to spam your users, but I would spend some time thinking the system through, and make sure you have really thought out all the angles.

 

Thanks, gizmola..  And yes.. every user has an associated 'email' column. 

 

...but do keep in mind that when you say you wouldn't be happy with my system...  that I don't have a system.. and again...  this is the point in asking this question.  I don't want "any fool" to be able to spam my entire user base..  so understanding the best method to achieve this is my goal here.

 

Thanks for the input. 

Link to comment
Share on other sites

So, the question is, how do you enhance your system with a login.  Make a user who wants to send a message to another user, login in order to do so.  Then spammers will not be able to message other users anonymously.

 

I don't care anything about enhancing my system with a login or understanding how to make a user login to do this.  I have a login system and know how to require a user be logged in to access any page on my site, so that's done.  All I'm after...  "okay, here's a username that created this classified ad (pulled from the user table and displayed below the ad).  I have access to this username's email in mysql but how can I create a link that says 'reply to this user'?"    ... bringing the visitor to a new page and having an email form that will send the form message off only to that user without exposing the actual email? 

 

This is why I'm just asking that you forget about my login system (I can take care of that part) and get back to the basics of...  "I display a user on a php page.  How do I send an message to that user without ever showing the email?"

 

After I understand that, I'll build the login system into it. 

 

Thanks!

Link to comment
Share on other sites

Create a link to another php page, insert the recipients user id into the querystring to allow it to be used in your form page. I would create another table designed specifically to handle user messages. The typical fields for this would be an primary key, auto-incrementing field, recipient id field, sender id field, message field. Then create a messaging form that upon submitting, will insert the necessary information into your table. Also, create a section that will display messages where the current user id equals the recipient id in your table.

Link to comment
Share on other sites

Create a link to another php page, insert the recipients user id into the querystring to allow it to be used in your form page. I would create another table designed specifically to handle user messages. The typical fields for this would be an primary key, auto-incrementing field, recipient id field, sender id field, message field. Then create a messaging form that upon submitting, will insert the necessary information into your table. Also, create a section that will display messages where the current user id equals the recipient id in your table.

 

Perfect!!!  Thanks so much!  I'm off to start on the fun.  :) 

 

Thanks to all.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.