I am in my 4th week of a PHP & MySQL class - no prior experience with either.
The problem I am having is relative to using an image as a form input button - I have two problems . . . Here are my lines of code:
echo '<input type="image" name=."$imgarray[2]". src="./images/'."$imgarray[2]";
echo '"value=submit"';
echo '"width="150" height="180" />';
First problem is no matter what syntax I use I get (viewing source of output page)
<input type="image" name=."$imgarray[2]". src="./images/vistainanutshell_t.jpg"value=submit""width="150" height="180" />
The code correctly inserts the name of the image at src=, but at name= it keeps giving the variable name itself rather than the required image name.
Second problem is that no value of any kind is being passed . .
Here is my form tag:
<form action="details.php" method="post" name="details">
Here is what I have at the beginning of my details.php script:
// create short variable names
$details=$_POST['details'];
$details= trim($details);
$details= trim($details);
if (!$details)
{
echo 'You have not entered search details. Please go back and try again.';
exit;
}
And, there is never $details - nada, zip - if there was something at all I could figure out what was wrong there. I have read that when using an image click coordinates are what is passed - but I'm getting nothing.
I am doing this same type of thing on the same page with radio buttons and it works great!
I'd really appreciate your help on this.