Reply to topic
Creating file path...
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
I have a question, I'm creating a website where users will have their own page on the website for example.

Once you register on our website you will get a link like this "http://www.yyyy.com/Myname"

Do I need to create one folder for each user, or is there a way to map a page to display like that.

http://wwww.yyyy.com/index.cfm?id=9999 can it be http://www.yyyy.com/Myname ?
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
If you were using Rails I believe this would be pretty easy to setup with routing Cool

The main problem I see w/ CF is unless you're on Linux, I can't think of a way to funnel all requests into a specific script that could load data in this way. If you could setup a funnel like that, then you'd basically just push any request into routing.cfm, which would then load user-specific data based off the path from the URL passed in

Other people here can probably help better with the exact code, but that would be the general idea
Rails & CF
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
If you were using Rails I believe this would be pretty easy to setup with routing Cool
Like Paul said, it is hard to route all requests through the same script unless you are using Rails in which case it is really easy ( I did it in 5 minutes). But CF MVC frameworks such as MACH II might have routing. Another possibility would be to have a CF 404 page and route from there, but otherwise it might be hard.
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
humm ok I'm not familiar with that I think what I would do is when the user register on the site, I will create a folder with his username, than I could have http://www.yyyy.com/Hisname

easier...
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
Ennio - You could do that, and assuming the page the user creates is all static, user-created content, it probably wouldn't be a bad solution. But let's say each page needs some dynamic or default content, like using standardized templates, etc. - now you wind up creating x copies of the same code, one in each user's folder. Then the day comes you want to change that code, and instead of using some sort of routing system & changing it in one place, you need to now update the copy for each users site

It's really a question of what you need the setup for
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
yeah that is true...
Where I can find information on how to use rails?

Becuase most of the sites I have we change it every year, so that will be a pain to do using folders....
It will be a tough switch
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
Ennio,
Unfortunately switching to Rails would be much better in the long run because it will increase productivity, stability, and give you this kind of URLs, but in the short term, it will require porting your Coldfusion app, and switching plans. You can find out more about Rails at rubyonrails.org.
Sorry if we couldn't address your problem in Coldfusion. I used to be a Coldfusion user, and struggled from the same problem, and while it was hard in the short term, I had much more possibilities with Rails.
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
I found a solution I will create one folder for every user, and on the folder I will have a page with a single <cfinclude> that will get the script I need, so if I need to change latter I can change a single page, and not all the pages...

One question... what is Ruby on Rails? is this a new web language? I'm still in college and it would be good to leaner something new....Smile
Ruby on Rails
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
One question... what is Ruby on Rails? is this a new web language?
Ruby on Rails is a MVC framework powered by the underlying Ruby language, a truly beautiful language. A Rails application is divided into 3 basic components and easily integrates with databases.
Models are the files that keep track of relations between tables, validate data, and create callbacks. For example, if you have a teachers table and a students table, you can create a teacher.students method giving you all of a teacher's students simply by specifying has_many :students in the teacher model, and belongs_to :teacher in the student model. The controller processes requests, and the view controls layout and design from the data from the controller. Even though CF is a great application, Rails is much easier to program with, and debug, and Ruby doesn't have any twists; everything is expected and seems to flow naturally. One book I recommend is Agile Web Development with Rails 2nd Edition.
Creating file path...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic