Page 1 of 1
Site will not work in Internet Explorer
Posted: Wed Apr 25, 2007 4:56 pm
by royrogersrevenge
Hey again everyone, I have yet another problem that I need help with. On my page as it is now, everything works just as it should and without error. Until, that is, I try to load it in internet explorer and I get this error on one of my pages:
Notice: Undefined index: picvalue in /xxx/xxx/xxx/click.php on line 10
line ten of click.php is:
Code: Select all
$position = $_REQUEST['picvalue'];
It seems to be a problem with the script from a previous page passing it the proper value. The relevent parts of the page that passes the script along (and does so successfully in firefox and safari, at least) are :
Code: Select all
echo '<form action="click.php"><table border="0">';
...
echo '<td><input type="image" src="card-back2.gif" value="';
echo $buttonvalue;
echo '" name="picvalue" height="150" width="200"></td>';
...
echo '</table></form>';
Anyone have any idea why this wouldn't function properly on IE, but be fine on other browsers or how to fix this problem?
Thanks,
Roy
Posted: Wed Apr 25, 2007 5:35 pm
by Mightywayne
Aye... it looks like you have an img with a value tag. Never seen that before, and maybe IE hasn't seen it either.

However, even if it has seen it, you've got a syntax error there anyway.
Posted: Wed Apr 25, 2007 6:59 pm
by royrogersrevenge
I'm a bit confused, what should it be instead? The html it currently creates:
<input type="image" src ="card-back2.gif" value="(whatever the value happens to be of $buttonvalue at the time)" name="picvalue" height="150" width="200"></td>
Posted: Wed Apr 25, 2007 7:32 pm
by guitarlvr
Who needs to be able to view it in IE anyway

I think it should look something like this:
Code: Select all
echo '<form action="click.php"><table border="0">';
...
echo '<td><input type="image" src="card-back2.gif" value="' . $buttonvalue . '"';
echo ' name="picvalue" height="150" width="200"></td>';
...
echo '</table></form>';
Wayne
Posted: Wed Apr 25, 2007 7:42 pm
by royrogersrevenge
Well that helps in that it let me change what was several lines of code into one, but i still get the same error when trying it in IE. And I agree with your opinion of not caring whether it works on IE, but I doubt my professor would

.
Posted: Wed Apr 25, 2007 7:50 pm
by guitarlvr
haha yeah I hear ya. I see what your asking and am attempting to work up a solution. Does it need to be a form?
EDIT:
for example, would this do what your looking for?
Code: Select all
<?php
echo '<a href="http://www.domain.com/click.php?picvalue=' . $buttonvalue . '"><img src="card-back2.gif" /></a>';
?>
Then you have to change $_REQUEST to $_GET (i think)
Wayne
Posted: Wed Apr 25, 2007 7:56 pm
by royrogersrevenge
It doesn't need to be, i suppose, it's just the way i have it set up to do it though. I do need to have this set up so that the pictures return values, and forms seemed to be the best way to do it, atleast with my limited knowledge.
Posted: Wed Apr 25, 2007 8:05 pm
by guitarlvr
well there is definitely other people on this board that are a lot more knowledgeable at PHP than I but I dont think forms work very well with images like that. I could be wrong and there might be a way to do it with forms. but echoing the <a href= and <img> tags work for sure in IE.
Wayne
Posted: Wed Apr 25, 2007 8:37 pm
by volka
While mozilla sends the contents of the value property of the input/image control the ie does not.
take a look at
http://msdn2.microsoft.com/en-us/library/ms535836.aspx
INPUT type=image Element | input type=image Object
[...]
Remarks
The x-coordinate is submitted under the name of the control with .x appended, and the y-coordinate is submitted under the name of the control with .y appended. Any value property is ignored.
Therefore
<input type="image" src ="card-back2.gif" value="(whatever the value happens to be of $buttonvalue at the time)" name="picvalue" height="150" width="200"></td>
will result in $_REQUEST['picvalue.x'] and $_REQUEST['picvalue.y'].
Posted: Wed Apr 25, 2007 8:58 pm
by guitarlvr
the x and y values end up being the dimensions of the image then $buttonvalue is put at the end of the url as picvalue=$button.
Wayne
Posted: Wed Apr 25, 2007 9:07 pm
by royrogersrevenge
Hmm...so how can I get around this?
Posted: Wed Apr 25, 2007 10:27 pm
by volka
guitarlvr wrote:the x and y values end up being the dimensions of the image then $buttonvalue is put at the end of the url as picvalue=$button.
Wayne
