Product Pop-up.
Moderator: General Moderators
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
Product Pop-up.
I've got a PHP-only shopping cart system, and am trying to integrate a function where the user clicks on a product image and a window pops with back/next links and a slideshow above. Currently the URLs of the images are stored in a MySQL database column and can be accessed with $row["itemPic"].
I am very un-savvy in regards to JScript. How could I implement this functionality?
I am very un-savvy in regards to JScript. How could I implement this functionality?
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
Right, so I've got a JScript built with all the functionality I want. It pulls the URLs from an array called 'Picture'. How do I populate the array with $row["itemPic"] values from PHP? If the function is called from the middle of the PHP page where this is already defined from the MySQL query, can I just do a FOREACH loop or something?
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
I'm now echoing the Javascript through PHP.
Would this work? If there are multiple URL values in the "itemPic" column in the MySQL database, is Count() going to lump them together as one value, or as many?
Would this work? If there are multiple URL values in the "itemPic" column in the MySQL database, is Count() going to lump them together as one value, or as many?
Code: Select all
$pics = $rowї"itemPic"];
$num = count($pics);
for($i = 0; $i < $num; $i++) {
foreach ($pics as $pic) {
echo "Pictureї" . $i . "] = '" . $pic . "';"; }
}- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
the $_GET variables are set when you go to a url like this: http://imadork.com/page.php?something=nothing
where $_GET['something'] is set to 'nothing'
where $_GET['something'] is set to 'nothing'
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm
-
conscience
- Forum Commoner
- Posts: 33
- Joined: Mon Dec 27, 2004 12:34 pm