Creating links out of dynamic data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Creating links out of dynamic data

Post by ninja2222 »

PLEASE HELP! I want to make a the data that is populating my accounts page to be a link to itself. How can I do this.d
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Creating links out of dynamic data

Post by Benjamin »

Your question is rather vague.
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Re: Creating links out of dynamic data

Post by ninja2222 »

VERY FUNNY. HAHAHA. I'M TRYING TO BUILD AN 'accounts' PAGE AND THE KEY TO THIS PART OF THE SITE IS THAT
THE CLIENTS WILL BE ABLE TO VIEW THEIR UPDATED EXCEL REPORTS. I WANT TO UPLOAD THESE FILES AND THEN SHOW
THEM ON THE 'accounts' PAGE AS LINKS TO THE NEWLY UPDATED FILE. I AM USING A MYSQL DATABASE THAT
VERIFIES THE USER LOGIN, THEN AFTER THE USER IS LOGGED IN THEY ARE DIRECTED TO THE 'LOGIN' PAGE. THEN
ON THIS PAGE I WANT TO POPULATE IT WITH THE USERS NAME(WHICH IS EASILY DONE AS DYNAMIC DATA ALSO FROM THE DATABASE) AND SPECIFIC LINKS TO THESE REPORTS. I SAW THAT BLOBBING MIGHT BE AN OPTION AND FROM A
DIFFERENT SOURCE I WAS TOLD THAT I WILL NEED A DATA GENERATOR. PLEASE HELP! :mrgreen:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Creating links out of dynamic data

Post by Benjamin »

I wasn't joking. Incidentally, studies have shown that typing in all capital letters slows down the brains ability to interpret words, hence slowing down reading speed and decreasing readability. Reference http://www.stcsig.org/usability/topics/readability.html

If you can post any code you have already written we'll be happy to help you where you are stuck.
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Re: Creating links out of dynamic data

Post by ninja2222 »

I thought your message to me was to be one with my code. I realized that it is and auto response. That's what I was refering to.
Jaggeh
Forum Newbie
Posts: 16
Joined: Sat Jul 05, 2008 12:59 am
Location: Canada
Contact:

Re: Creating links out of dynamic data

Post by Jaggeh »

ninja2222 wrote:I thought your message to me was to be one with my code. I realized that it is and auto response. That's what I was refering to.
Actually it was his signature (displays after every post unless specified else wise).
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Re: Creating links out of dynamic data

Post by ninja2222 »

Same deal. Thank you. :twisted:
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Creating links out of dynamic data

Post by Eran »

Your question is rather vague.
An understatement...
THEN ON THIS PAGE I WANT TO POPULATE IT WITH THE USERS NAME(WHICH IS EASILY DONE AS DYNAMIC DATA ALSO FROM THE DATABASE) AND SPECIFIC LINKS TO THESE REPORTS.
When you upload the excel files save their path and filename in the database along with the appropriate user identifier, preferably in a one-to-many table (one user to many excel files). Then along with the users retrieve the associated file name and output them as links in your page.
I thought your message to me was to be one with my code
By the way, you usually won't get code here unless you have a very specific question / problem. This is a complete process to program and you should be doing that by yourself. If you have more questions / problems be sure to post here and get help on that.
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Re: Creating links out of dynamic data

Post by ninja2222 »

wonderful, a place where I finally found highly knowledgeable people, and they're telling me to do it by myself however to ask for help as well. What?(confusion) :?
My specific question is unclear to even myself because I'm just learning as I go(obviously). I have been through many issues and conquerred them on my own, however this one is taking so much of my time that I'm am losing productivity. :offtopic:

So, an exact question is how should I upload these files(as blobs, text, etc.). Then should I upload the file name and path?
Then how do I show these files as dynamic links. :D
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Creating links out of dynamic data

Post by Benjamin »

Save them to the file system, store the file name in the database, then generate links by contencating the url path to the file names.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Creating links out of dynamic data

Post by Eran »

So, an exact question is how should I upload these files(as blobs, text, etc.). Then should I upload the file name and path?
Then how do I show these files as dynamic links. :D
In order:
1. You upload files as regular files, not database fields. Here is a complete guide to uploading files with PHP - http://www.php.net/features.file-upload
2. After you upload the files, store the filenames you saved them as to a database table along with the associated user identifier. For this you would have to know basic SQL and how to use it with PHP. Here's a short tutorial - http://www.w3schools.com/PHP/php_mysql_intro.asp
3. Fetch uploaded files from the previously mentioned file table by the user for which you want to display them. Iterate over the results and output the filenames inside HTML links. The previous tutorial also covers this.

Hope this helps
ninja2222
Forum Newbie
Posts: 17
Joined: Wed Jun 18, 2008 1:42 pm

Re: Creating links out of dynamic data

Post by ninja2222 »

Thank you for that help. I will try that ASAP. I'll let you know if it helped. Thank you again :lol:
Post Reply