/    Sign up×
Community /Pin to ProfileBookmark

Linking Pictures

I have a website where a user uploads a picture to an uploads folder, and supplies a URL. I then display all the pictures in the folder, and I would like it so that they link to the URL that the user supplied. Anyone know how to do this?

Here’s a basis on my file structure.

-success.php has a form that takes the input from the user. Photographs and URL
-getfile.php is called by the form to process the file upload
-The pictures are displayed on a seperate page called photographs.php

Do I have to post to some type of xml document or something? If so, can you be very specific on how to do this, as I have never worked with xml, and don’t know about creating documents/reading documents. Or is there an easier way than this altogether?

Thanks for any input!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachApr 02.2008 — store the image file name and the provided url in a database. Then you can easily link them together.
Copy linkTweet thisAlerts:
@trevzillaauthorApr 02.2008 — Ah, thank you. Now that I know the direction I need to take this, I'm going to ask a quick question about databases. (This may now be in the wrong forum. . .sorry)

Do I only need to create a database once, and then from there the users will just write to the database? I guess, should I just run php command once on my server that creates the database. And then on the webpage that users can connect to have a "write to the database" function. Or, does a database need to be created every time that a user accesses the database. (I guess I just don't know 'where' to put my code. I think I can find the answer to how to code on other threads. . .)

Thanks!
×

Success!

Help @trevzilla spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...