|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
Passing variables from one page to another ....
10-01-2005, 09:18 AM
|
Passing variables from one page to another ....
|
Posts: 31
|
Hi, I am using Actinic e-commerce to create a selling site and want some help with the following.
Imagine that i have a page, call it P1.html, and on this page there are links, both image and text, to sub-pages, which we can call P1.1.html, P1.2.html, P1.3.html etc
P1
>>>P1.1
>>>P1.2
>>>P1.3
What I want to be able to do, is send the images and text used to indicate P1.1.html on page P1.html to P1.1.html itself, to use as a header.
If this doesn't make sense i can pull an image together, but may need to e-mail it directly to you ??
Else, hope you can help.
|
|
|
|
10-01-2005, 12:29 PM
|
|
Posts: 92
Name: Mike Roq
Location: Lakewood, CO
|
Ok, I do not understand what the hell you are thinking of doing, but you could use frames or an iframe, idk
__________________
CodingHub.com
mikeroquemore.com
|
|
|
|
10-02-2005, 09:40 AM
|
OK, lets start the description again ...
|
Posts: 31
|
Simple 'Contents' and 'Page' type stuff as found in any book you pick up from the library.
In the Contents, you get a list of the contents of the book,
Section 1.0 Some Stuff page X
Section 2.0 Some Other Stuff page Y
on my website you get exactly the same principal and the following;
A thumbnail image for the section, IMAGE
A title for the section, TITLE
A small description of the section, DESCRIPTION
(hopefully you get this, as just about every website i've seen uses this principal)
The idea being when you click on a IMAGE, (or the TITLE), it opens that page and that page is headed with that detail.
Normally this would be easy as I would manually generate the page in DW and add the correct image, title and description.
But i am using a template based package, Actinic ECommerce to blow the html and therefore need to pass variables from one page to the next, and modify an Actinic template with new code.
But I have never done this before and could do with some help.
What I imagine happens is that when i click on my 'image' or 'section title' it actions some code that allocates the image, title and text to three variables, and then when i open my new page it looks for these variables and uses them to reproduce the detail ?
Am I on the right road ?
|
|
|
|
10-02-2005, 10:12 AM
|
|
Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
|
Not sure what you are asking at all!
Unless you are trying to describe in some convoluted way a product category page and a product item page that opens when the product is clicked. Which any standard shopping cart/catalogue will do
If not post a URL of what you are trying to achieve
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
10-02-2005, 10:37 AM
|
|
Posts: 181
|
Quote:
|
Originally Posted by simonwar
What I want to be able to do, is send the images and text used to indicate P1.1.html on page P1.html to P1.1.html itself, to use as a header.
|
Are you asking if it's possible to send variables so you can display something depending on which link the visitor clicked 
|
|
|
|
10-03-2005, 10:26 AM
|
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
It would take you quite a while to do with simple coding. Instead, use the long way round of creating the pages manually. I believe GD can be used, but I am only just getting to grips with PHP basics.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
10-03-2005, 12:15 PM
|
|
Posts: 635
|
I I understand correctly, you can do this like this with javascript, but you can do it similarly with ASP, PHP etc:
Hre's page 1:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<script type="text/javascript"><!--
function goAndPassVar(link,title,img) {
document.location.href = link.href + "?img=" + img + "&title=" + title;
}
//-->
</script>
</head>
<body bgcolor="#ffffff">
<p><a href="p2.html" onclick="goAndPassVar(this,'Google Title Text','http://www.google.com/intl/en/images/logo.gif'); return false;"><img src="http://www.google.com/intl/en/images/logo.gif" alt="" border="0"><br>
Google</a></p>
</body>
</html>
Here's page 2:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Untitled Page</title>
<script type="text/javascript"><!--
function cbegeturlArguments() {
var idx = location.href.indexOf("?");
var params = new Array();
if (idx != -1) {
var pairs = location.href.substring(idx+1, location.href.length).split("&");
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split("=");
params[i] = nameVal[1];
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
function showMyStuff() {
var urlArgs = cbegeturlArguments();
if (urlArgs["img"] != undefined) {
document.getElementById("myImg").src = urlArgs["img"];
}
if (urlArgs["title"] != undefined) {
document.getElementById("myTitle").innerHTML = unescape(urlArgs["title"]);
}
}
//-->
</script>
</head>
<body bgcolor="#ffffff" onload="showMyStuff()">
<p><img src="http://us.yimg.com/i/ww/beta/y3.gif" id="myImg" alt="" border="0"></p>
<h1 id="myTitle">Yahoo Title Text</h1>
<p id="myTitle">One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, it's a pretty story. Sharing everything with fun, that's the way to be. One for all and all for one, Muskehounds are always ready. One for all and all for one, helping everybody. One for all and all for one, can sound pretty corny. If you've got a problem chum, think how it could be.</p>
</body>
</html>
You'll see that if you open page 2, it's got yahoo stuff as default. If you click on the link from page 1 to go to page 2 it passes the img and title to the page and the script in page 2 will replace what's there with your passed data. You dig? Is the what you were looking for?
|
|
|
|
10-03-2005, 01:08 PM
|
A few answers to all of the replies ......
|
Posts: 31
|
to chrishirst
Couldn't have described it much better I'm afraid, but not to worry some of the other guys have got it. Read on it may become clear. Thanks anyway.
to howardroak
Yes is the answer to that one.
If a link on a page os represented as an IMAGE, a TITLE and a DESCRIPTION, and the IMAGE and TITLE a links, then if you click on IMAGE or TITLE on PAGE1, it sends the detail of the IMAGE, TITLE and DESCRIPTION to the 'linked to' page, call it PAGE2. Does ths make sense?
to Twitch
You may be right and I may have to resort to manually dropping the links on to my pages later, but i will look at some of the other advice and see what happens, cheers.
to funkdaddu
OK, I'll try this later and get back you.
|
|
|
|
|
« Reply to Passing variables from one page to another ....
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|