Jump to content

Using php in a Javascript code block


luminary4Him

Recommended Posts

Here is my question...

I am very new to PHP but have begun implementing it into my webpage to simplify adding / updating content. (it's been great!!)

the page is [url=http://www.boxerbonanza.com/availablepuppies.php]http://www.boxerbonanza.com/availablepuppies.php[/url]. The part of my code concerned here for that page is:

[code]<hr>
<?php
$pupname = "Hero";
$pupsex = "Male";
$pupdob = "11/22/2006";
$pupprice = "$500.00";
$pupparents = "Laddy and Oliver";
$pupmarkings = "Flashy Brindle";
$puppicsmall = "images/availablepuppies/pup7picsmall.jpg";
$pic1 = "images/availablepuppies/pup7pic1.jpg";
$pic2 = "images/availablepuppies/pup7pic2.jpg";
$pic3 = "images/availablepuppies/pup7pic3.jpg";
$pic4 = "images/availablepuppies/pup7pic4.jpg";
$pic5 = "images/availablepuppies/pup7pic5.jpg";
$pic6 = "images/availablepuppies/pup7pic6.jpg";
include 'pup.php';
?>
<hr>
<?php
$pupname = "Buddy";
$pupsex = "Male";
$pupdob = "11/22/2006";
$pupprice = "$500.00";
$pupparents = "Laddy and Oliver";
$pupmarkings = "Flashy Fawn";
$puppicsmall = "images/availablepuppies/pup8picsmall.jpg";
include 'pup.php';
?>
<hr>[/code]

in my "included" pup.php file I have a link that goes to my pupgallery.php.

how do I get a variable to be defined in my first availablepuppies.php page, and access that same variable over on my pupgallery.php page? Is it possible. Because obviously I can access those variables from the pup.php page, as it is included in the availablepuppies.php page. But how to get it one step further...

I'm a little lost.

If I haven't confused you and you might have some ideas, I'd greatly appreciate!!

Thanks!
Elizabeth
Link to comment
https://forums.phpfreaks.com/topic/33115-using-php-in-a-javascript-code-block/
Share on other sites

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.