Hi,

I'm not an expert in html - I understand it a bit but mainly used dreamweaver to do my code.

I have the website www.artaidafrica.org

I was wondering if anyone can help with the following issue:

1. If you go to http://www.artaidafrica.org/ssali-shop.html
2. You can scroll through the 9 pieces of artwork.
3. To buy one you click on the piece and it takes you to a payment page.

What I want to know if there is anyway of pre-filling the "type artist and title" box with data from the previous page. The artist is Ssali and the title is whatever is written in white text at the foot of the black artwork box.

Thanks

Adam

Recommended Answers

All 6 Replies

Hi Adam,

Your standard html doesn't have "variables" that can be used like other server side languages to pass between pages. It would really require using something like PHP to accomplish what you are describing. It might be possible with javascript but that is not my area of specialty.

It looks like each piece of artwork goes to it's own unique page when I click it. Why not just set the values for each one yourself and remove the option to edit the form all together? It wouldn't be too much work unless you had planned on adding a very large number of artwork to the site and then it may get a little over whelming at that point dealing with a bunch of individual unique pages for each art piece.

It would be simple if you were to use PHP though but then I would remove the option for field to be edited by the visitor.

Cheers.

Thanks pixelsoul. I don't know php at all to be honest. The problem is that I have hundreds of pieces of art. They only way I've separated them - to avoid having hundreds of paypal buttons - is by price. So I have a separate paypal button for each price from $50 to $1,200. You will see that depending on which piece you click on, it takes you to pay400.html or pay600.html etc. The user just needs to enter the title and artist and the price is fixed.

I was just hoping I could take away this element and possible human error and let the code do it for me. I see the paypal buttons have something like:

<input type="hidden" name="on0" value="Type Artist" />
<span class="paypaltext">Type Artist</span>

And the text that you type goes through to the paypal payments page. Was hoping I could do something similar!

Hi Adam,

Well I am not sure of the level of your skill set and I would love to be able to tell you how to do it from start to finish but I unfortunately don't have the time. I have created a VERY simple little sample that shows how it could be done. It only shows the core concept of the idea on how to do it. And you should be able to get an idea on how it could apply to what you are trying to do.

Going forward in the future though you will end up wanting a more automated solution that is built entirely of PHP that way you can enter in a art piece and all of this stuff gets created for you :)

Here is a link to the example:
http://pixelsoul.com/data/form_example/

If you click the Example Link you will see some parameters in the query string. You use PHP to grab those from the query string and do what ever you want with them. That way you can always have this ONE page and all you have to do is change the values of the parameters in the query string. Pretty nifty. PHP is pretty easy but just looks intimidating at first glance. If you are planning on going further in web development I would recommend going through some online tutorials and also xhtml, html5, and css would be very good too :)

Cheers.

Hi Adam,

Can you mark this thread solved if my answer was the answer for you :)

Thanks!

Thanks, I'm going to see if I can get this to work. Can I use php and html coding on the same website? Sorry, I'm a bit of a beginner to all this. Hope I can get your solution to work, I was really hoping there was an html solution. I should learn php!

You should have no problem as long as you follow my example and your host has PHP installed (almost every host does these days). You just have to make sure the name of the file has a .php extension on the end so that server knows it has PHP in the file.

PHP is easy if you start with the basics. If you have any programming knowledge it is super easy compared to many other programming languages. Good luck :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.