Site will not work in Internet Explorer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Site will not work in Internet Explorer

Post 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
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

Code: Select all

value="';
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.
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Post 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>
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post by guitarlvr »

Who needs to be able to view it in IE anyway :lol: 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
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Post 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 ;).
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post 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
Last edited by guitarlvr on Wed Apr 25, 2007 8:07 pm, edited 2 times in total.
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Post 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.
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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'].
User avatar
guitarlvr
Forum Contributor
Posts: 245
Joined: Wed Mar 21, 2007 10:35 pm

Post 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
royrogersrevenge
Forum Newbie
Posts: 14
Joined: Fri Apr 06, 2007 9:57 pm

Post by royrogersrevenge »

Hmm...so how can I get around this?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
:?:
Post Reply