 |
|
|
06-26-2009, 02:25 PM
|
|
#1
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Pulling Data In A Popup
I have a site that I'm wanting to sell goods on. On a particular page, I want a user to be able to click on a "purchase" link and have a popup show with a form to fill out that gets sent to me via email (Im going to be using PayPal for the processing). The url for each item is different because the last digit is the unit number of the item.
Here is an example: http://www.sthompsonphoto.com/index.php?showimage=17
How can I add "17" to a field in the form when the pop-up happens? Any ideas?
Thank you very much in advance!
Scott T.
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-26-2009, 02:36 PM
|
|
#2
|
 |
|
Aspirant (Level 2)
Join Date: Jun 2009
Location: Madurai, India
Posts: 10
|
Append the url using Javascript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--
function changeURL(n)
{
window.open("http://www.sthompsonphoto.com/index.php?showimage=" + n);
}
//-->
</script>
</head>
<a href="javascript :changeURL(1)">1</a> <a href="javascript :changeURL(2)">2</a> <a href="javascript :changeURL(3)">3</a>
</body>
</html>

|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-26-2009, 03:28 PM
|
|
#3
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Im a tad on the confused side. Would this be the code for the popup or the code for the page that I sent you? Sorry.
OH! I see now what you've done. But, all I need is this:
You make your way to http://www.sthompsonphoto.com/index.php?showimage=17 and decide you want to buy it. You click on "purchase" and a popup shows up with a form containing fields for your name, email, address, AND a field for the item number. I want that item number to be pulled from the URL, in this case "17".
OR, can you, instead of the URL, pull a word from the actual site? Or in the HTML?
Hope that makes more sense. Sorry if I didnt explain it correctly! 
Last edited by scottdog129a : 06-26-2009 at 03:44 PM.
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-27-2009, 05:08 AM
|
|
#4
|
 |
|
Aspirant (Level 2)
Join Date: Jun 2009
Location: Madurai, India
Posts: 10
|
Get URL Parameters (QueryStrings) using Javascript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--
function changeURL(n)
{
window.open("http://www.sthompsonphoto.com/index.php?showimage=" + n);
}
function getQuerystring(key, default_)
{
if (default_==null) default_="";
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
if(qs == null)
return default_;
else
return qs[1];
}
function showParameters()
{
alert(getQuerystring('showimage'));
}
//-->
</script>
</head>
<body onload="showParameters()">
<a href="javascript :changeURL(1)">1</a> <a href="javascript :changeURL(2)">2</a> <a href="javascript :changeURL(3)">3</a>
</body>
</html>
Hope this will help u...

|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 11:00 AM
|
|
#5
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Thanks for the post, but its giving me a Javascript error when I test it. Also, there is no popup. It just goes to my website.
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 12:44 PM
|
|
#6
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Actually, it might be easier to just pull the picture name off the site. I think there is a tag in the HTML that is named <IMAGE_NAME>. Can THAT be used to fill in the image name field in the form that pops up?
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 12:51 PM
|
|
#7
|
 |
|
~ bald headed old fart ~
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,919
|
Hi there Scott,
check out the attachment, starting at "brief notes". 
__________________
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 01:34 PM
|
|
#8
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
This is AMAZING!! Thank you! IS there a possible way to use the image name? The only reason that I ask is because when you first go to the site, the URL doesnt show a number. Also, it might be a little easier down the road.
Last edited by scottdog129a : 06-29-2009 at 01:40 PM.
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 01:51 PM
|
|
#9
|
 |
|
~ bald headed old fart ~
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,919
|
Hi there Scott,
no problem, here is the revision...
__________________
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 02:05 PM
|
|
#10
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Hey coot. Thank you so much, but its just displaying the image FILE name, not the actual name. Is this even possible? The photoblog software Im using uses the tag <IMAGE_NAME> to display the image on my site. Can this be used?
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 02:08 PM
|
|
#11
|
 |
|
~ bald headed old fart ~
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,919
|
Hi there Scott,
just in case you meant that you don't want the "link_to_index.html", then use this...
__________________
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 02:22 PM
|
|
#12
|
 |
|
~ bald headed old fart ~
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,919
|
Hi there Scott,
Quote:
|
..its just displaying the image FILE name, not the actual name
|
You are moving the goal posts again.
We started with a simple... "17" ...then moved on to... "20090623164710_pic17.jpg" ...and now you want some... "IMAGE_NAME". Where, actually, in the "index.php" do we find this... "IMAGE_NAME".
__________________
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 02:29 PM
|
|
#13
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Im so sorry for being a pain. I apologize. Im not much of a php person, but Im guessing its around line 474 of the php file. I could be wrong and most likely am.
You can view the file that I change to change the site here:
http://www.sthompsonphoto.com/templa..._template.html
And its <IMAGE_TITLE>, not <IMAGE_NAME>. My bad.
Thank you SO VERY MUCH for your help! 
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 03:26 PM
|
|
#14
|
 |
|
~ bald headed old fart ~
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 7,919
|
Hi there Scott,
Right, I see that you require the title attribute of the image to be sent to the form. 
This, again presents no problem.
Note:-
IE will display "Coffee House Street" the others "Coffee%20House%20Street". 
__________________
|
|
Add to del.icio.us
Can you digg it?
|
|
|
06-29-2009, 04:16 PM
|
|
#15
|
 |
|
Swordman (Level 9)
Join Date: Sep 2008
Location: Reno, Nevada USA
Posts: 89
|
Coothead, I swear I owe you big time! Thank you so very much for ALL your help! 
|
|
Add to del.icio.us
Can you digg it?
|
|
|
KEEP TABS |
|
SPONSORS |
| |
|
| |
|
|
| |
|