ben3001 Posted November 15, 2006 Share Posted November 15, 2006 Hi guys, wow havent posted since september its been so long lol....The problem i have is that i have an image, which once clicked hopefully inputs the persons email address into the form. For example there are 5 pictues of the person you want to contact, you click there face and it is entered into a seperate php file called contact.php.How would i go about this?cheers peopleBen Link to comment Share on other sites More sharing options...
reportingsjr Posted November 15, 2006 Share Posted November 15, 2006 Simply make the get like this: ?contact=person. Then on the form make this:<input readonly="readonly" type="text" value="<?php echo $_GET['contact']; ?>" name="contact" />that makes it so when the person clicks the picture it will have the contactee in the field but it cant be edited.. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 15, 2006 Share Posted November 15, 2006 Instead of readonly, I believe the attribute is disabled. I might be wrong though. Link to comment Share on other sites More sharing options...
ben3001 Posted November 16, 2006 Author Share Posted November 16, 2006 this thing is i have a page calledcontact.htmlHere are all the images.contact.php, i have the form on this page.is it possible for me to have a hyperlink on the image that will input the relevant email address.e.g The user clicks on persons one image, who's email is personone@thedomain.com. This then gets inputted onto contact.php in the field called 'email.i though something like contact.php?contact=personone@thedomain.com but that didnt Link to comment Share on other sites More sharing options...
justsomeguy Posted November 16, 2006 Share Posted November 16, 2006 That will work, you just have to look for it. But that will also expose email addresses to spambots. You can either have everyone stored in a database, and just pass the database ID and look it up again when the form gets submitted, or split the address up like this:contact.php?u=personone&d=thedomain.comAnd then rebuild it when the form gets submitted. <?php$user = $_GET['u'];$doman = $_GET['d'];?>...<input type="hidden" name="u" value="<?php echo $user; ?>"><input type="hidden" name="d" value="<?php echo $domain; ?>">...<?php$to = $_POST['u'] . "@" . $_POST['d'];?> Link to comment Share on other sites More sharing options...
ben3001 Posted November 17, 2006 Author Share Posted November 17, 2006 i didnt really think of spam bots etc, im probably gonna scrap the idea.instead when the user clicks the image it puts the persons name in the field. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now