Jump to content

Please Help Me With This Coding......


arunpatal

Recommended Posts

Hi, Please some help with this one...... :confused:

 

I have a small image and when i click on link full view it opens in full screen , i want to show this image in a specific place when i click on it or full view link...

 

For me it would be fine if its works with java or css also........ but i need it to be like this...

 

 

 

<?php
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
<?php
// Check to see the URL variable is set and that it exists in the database
if (isset($_GET['id'])) {
// Connect to the MySQL database
include "storescripts/connect_to_mysql.php";
$id = preg_replace('#[^0-9]#i', '', $_GET['id']);
// Use this var to check to see if this ID exists, if yes then get the product
// details, if no then exit this script and give message why
$sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
 // get all the product details
 while($row = mysql_fetch_array($sql)){
		 $product_name = $row["product_name"];
		 $price = $row["price"];
		 $img1 = $row["img1"];
		 $details = $row["details"];
		 $category = $row["category"];
		 $subcategory = $row["subcategory"];
		 $date_added = strftime("%b %d, %Y", strtotime($row["date_added"]));
	 }

} else {
 echo "That item does not exist.";
 exit();
}

} else {
echo "Data to render this page is missing.";
exit();
}
mysql_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $product_name; ?></title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once("template_header.php");?>
<div id="pageContent">
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr>


This line shows Image

<td width="19%" valign="top"><img src="inventory_images/<?php echo $img1; ?>.jpg" width="142" height="188" alt="<?php echo $product_name; ?>" /><br />
 <a href="inventory_images/<?php echo $img1; ?>.jpg">View Full Size Image</a></td>



<td width="81%" valign="top"><h3><?php echo $product_name; ?></h3>
 <p><?php echo "$".$price; ?><br />
 <br />
 <?php echo "$subcategory $category"; ?> <br />
<br />
 <?php echo $details; ?>
<br />
 </p>
 <form id="form1" name="form1" method="post" action="cart.php">
 <input type="hidden" name="pid" id="pid" value="<?php echo $id; ?>" />
 <input type="submit" name="button" id="button" value="Add to Shopping Cart" />
 </form>
 </td>
</tr>
</table>
</div>
<?php include_once("template_footer.php");?>
</div>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/270442-please-help-me-with-this-coding/
Share on other sites

Hi, i am trying it like this way........... but its not working....

what i am missing???

 

<a href="#" onclick="document.getElementById('imgRange').src="inventory_images/<?php echo $img1; ?>.jpg">View Large</a>

<div id="img1">

<img id="imgRange" src="imgLocation.png" alt="imgLocation" name="imgLocation" width="504" height="360" id="imgLocation" />
</div>

Hi, i am trying it like this way........... but its not working....

what i am missing???

 

<a href="#" onclick="document.getElementById('imgRange').src="inventory_images/<?php echo $img1; ?>.jpg">View Large</a>

<div id="img1">

<img id="imgRange" src="imgLocation.png" alt="imgLocation" name="imgLocation" width="504" height="360" id="imgLocation" />
</div>

 

 

Forgot to say its a javascript....

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.