I’m using the code from this PHP contact form and it works well, but I would like to add a “Pre-filled” prefix in the subject line, something like this:
mydomain.com: (followed by the sender’s actual subject line here)
Here’s an example:
mydomain.com: Question about password
How would I do that?
I wouldnt do it pre-filled, because a user could remove your header. I’d add the prefix after submission, so you know it will be there when it arrives in your mailbox.
After checking the validity of the email in the PHP code, before you
mail it, change the value of $email_title to include your prefix.
That makes sense, but I’m not sure how to implement it. Can you give me an example?
I’m not going to write your code for you, especially if you’re telling me you cant even do the most basic of things like string concatenation.
Assign to the variable $email_title, your prefix string, concatenated with the current value of $email_title.
Why the attitude?
We all have to start somewhere when learning something. I only posted here after extensive searches turned up nothing.
For a beginner, extracting info from a reference like PHP.net is like trying to decipher Phoenician. That’s why I asked for an example.
Had you condescended to that, I would have learned something about code and you, perhaps a bit of civility.
The reason I took ‘the attitude’ is because too often “the beginner” goes to a website, finds a piece of code that almost does what they want, then begs someone to do the work for them under the guise of “I dont understand, show me?”, so the “learning something about code” is zero. They bounce away and dont bother to actually learn anything, and instead have what they need. Until they break it, or they need it to do something slightly different, and there isnt another example to steal.
Sticking two strings together is not some deep language construct that requires intense study, “deciphering” of references, or such. A google of something basic like… “php add to string” would rather quickly turn up several such instructive pages…
Look at it from my perspective. We’re here helping people all the time, spotting errors and instructing people. And then you show up, throw up a link to another person’s work and say “How do I do this one thing?”, which gets answered, and then followed up by “I dont know how to do it, can you do it for me?”
Havent said “I’m a beginner and dont know what its doing”, haven’t asked a generalized question about the subject, you’ve asked for a specific example of how to do a one-line thing. When given a page that shows exactly what you asked for, an example of the one line thing, you say its in greek, and that you’ve done extensive searching on the matter when the above links are all in the top 7 results of the search that i did in 10 seconds. So how extensive does it look to me? How can I see any effort that’s been put forward to try and solve the problem? We will gladly help someone get to the answer. We won’t do it for them. Means seeing effort from both parties.
That’s why you got the answer you got.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.