IE not working right with PHP/html

When I run this code, it works fine in Chrome and FF, however, with IE it does not.

[php]<?php
include(‘connection.php’);
$query=“SELECT * FROM veh ORDER BY year DESC”;
$resource=mysql_query($query);

?>












<?php while($result=mysql_fetch_array($resource)) { echo ""; } ?>
Year Make Model Style Mileage Color Retail Price Image Details
".$result['year']." ".$result['make']." ".$result['model']." ".$result['style']." ".$result['mileage']." ".$result['color']." ".$result['rprice']." <input type=\"button\" name = \"details\" value = \"Details\" /
[/php]

I get that the
[php]<input type=“button” name = “details” value = “Details” /[/php]

should be submit instead of button for IE, but when I change it to submit, it will not run the php in any of the browsers, instead when clicking the details button it just jumps the page back to teh top.

Any advice?

Why do you have a link around the button ?

[php]<a href=‘modify2.php?id=’.$result[0]."">
<input type=“button” name = “details” value = “Details” />
[/php]

[php] [/php]

If I put the modify2.php in the form action field, it will work,but it does not pull the record, it just goes to the details page but without the details.

Have you tried putting the full form in the loop and not half of it ?

Even though the details page works fine when the html was codded the other way in chrome and IE? im sorry to cause such a problem, im just really new at this and honestly it’s really confusing.

It’s like, it runs the modify2.php page, but it doesnt run the part after it when I have it not in a link down by the button. the ?id=’.$result[0]. part doesnt work in:

In your code > is mssing off the end of the code maybe this might be to do with it ?

[php]<input type=“button” name = “details” value = “Details” /[/php]

just to make it right
[php]<input type=“button” name = “details” value = “Details” />[/php]

Thank you for catching that error, I have corrected it, but still did not fix the other issue, unfortunately.

Looking at your form what are you trying to do ?
Make option drop down menus ?
because nothing makes sence to me, what you are doing which is why its hard to tell you what to do next to fix your problem.

Gotcha, again im sorry im new at this so im sure theres better ways of writing that same code.

This code:
[php]<?php
include(‘connection.php’);
$query=“SELECT * FROM veh ORDER BY year DESC”;
$resource=mysql_query($query);

?>












<?php while($result=mysql_fetch_array($resource)) { echo ""; } ?>
Year Make Model Style Mileage Color Retail Price Image Details
".$result['year']." ".$result['make']." ".$result['model']." ".$result['style']." ".$result['mileage']." ".$result['color']." ".$result['rprice']."
[/php]

Is a learning project I gave myself, its an online used car dealership. This code above is a “View All” page for inventory. It just lists all the inventory in the database and puts a “Details” button beside it. When you click the Details button next to the car your interested in it runs that Modify2.php script I wrote and takes you to that modify2.php page where it shows that particular cars details and pictures.

Is that making any sense?

ok so it is not a form that is what was confusing me.

you want a button though to take you to the details page

Try this then you could make a image for the link to make it look like a button or use css to make a button

[php]

<?php include('connection.php'); $query="SELECT * FROM `veh` ORDER BY `year` DESC"; $resource=mysql_query($query); ?> <?php while($result=mysql_fetch_array($resource)){ echo " "; } ?>
Year Make Model Style Mileage Color Retail Price Image Details
".$result['year']." ".$result['make']." ".$result['model']." ".$result['style']." ".$result['mileage']." ".$result['color']." ".$result['rprice']." link
[/php]

add and image instead of a link
[php]<a href=‘modify2.php?id=’".$result[0]."’>[/php]

:slight_smile: You guys are great. working like a charm now. thank you very much.

Sponsor our Newsletter | Privacy Policy | Terms of Service