Jump to content

GET Variable


ben3001

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...