Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Help!


graphicore

Recommended Posts

I modified/created a new popup_audio.php file to open MIDI files intead of images since in the database there is only one field for the image of the product.

 

The original code found in popup_image.php says this:

 

$products_query = tep_db_query("select pd.products_name,

which:

I replace it to:

$products_query = tep_db_query("select pd.products_id,

 

But I need to pull products_model and the code gives me an error if I chage it to it... I guess it needs to be declared somewhere else in the code.

 

I need to pull the product model instead of the ID (Which I am using here), but I do not know PHP enough to pull the data from the database.

 

Can anyone help me here to modify this script????? Thanks in advance.

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();

 $products_query = tep_db_query("select pd.products_id, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
 if (navigator.appName == 'Netscape') i=10;
 if (document.images[0]) window.resizeTo(document.images[0].width +10, document.images[0].height+60-i);
 self.focus();
}
//--></script>
</head>
<body onload="resize();">

<embed src="samples/midi/<?php echo $products['products_id']; ?>.mid" autostart=true loop=false>
<p class="smallText" align="right"><?php echo '<a href="java script:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>

<?php // echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

Link to comment
Share on other sites

<?php

/*

$Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

$navigation->remove_current_page();

 

$products_query = tep_db_query("select p.products_model, pd.products_id, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");

$products = tep_db_fetch_array($products_query);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo $products['products_name']; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<script language="javascript"><!--

var i=0;

function resize() {

if (navigator.appName == 'Netscape') i=10;

if (document.images[0]) window.resizeTo(document.images[0].width +10, document.images[0].height+60-i);

self.focus();

}

//--></script>

</head>

<body onload="resize();">

 

<embed src="samples/midi/<?php echo $products['products_model']; ?>.mid" autostart=true loop=false>

<p class="smallText" align="right"><?php echo '<a href="java script:window.close()">' . TEXT_CLOSE_WINDOW . '</a>'; ?></p>

 

<?php // echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>

</body>

</html>

<?php require('includes/application_bottom.php'); ?>

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Thanks Monika...

 

Gee... I wonder what I did before that gave me an 'product_model' not defined error before...... hmmm...

 

OHHH... I see now... You added p.products_model and left pd.products_id, which I replaced with pd.products_model. (tht was the error :P)... Lack of PHP knowledge...

Thanks a lot!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...