Jeffro Posted June 22, 2011 Share Posted June 22, 2011 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... Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/ Share on other sites More sharing options...
requinix Posted June 22, 2011 Share Posted June 22, 2011 I don't get the problem. Can't you simply not show the email? Where is it appearing? Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233536 Share on other sites More sharing options...
Jeffro Posted June 22, 2011 Author Share Posted June 22, 2011 I don't get the problem. Can't you simply not show the email? Where is it appearing? Maybe I can? I don't do much php.. asking how one would go about it.. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233539 Share on other sites More sharing options...
requinix Posted June 22, 2011 Share Posted June 22, 2011 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)? Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233567 Share on other sites More sharing options...
Jeffro Posted June 23, 2011 Author Share Posted June 23, 2011 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)? Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233628 Share on other sites More sharing options...
gizmola Posted June 23, 2011 Share Posted June 23, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233629 Share on other sites More sharing options...
Jeffro Posted June 23, 2011 Author Share Posted June 23, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233633 Share on other sites More sharing options...
gizmola Posted June 23, 2011 Share Posted June 23, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233638 Share on other sites More sharing options...
Jeffro Posted June 23, 2011 Author Share Posted June 23, 2011 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! Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233666 Share on other sites More sharing options...
fugix Posted June 23, 2011 Share Posted June 23, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233670 Share on other sites More sharing options...
Jeffro Posted June 23, 2011 Author Share Posted June 23, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/240151-how-to-email-username-with-anonymous-form/#findComment-1233675 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.