C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 4th, 2008, 01:54 PM
esrrms esrrms is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 esrrms User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 31 sec
Reputation Power: 0
Web programming in C question.

In ruby on rails, you can send requests to certain functions of the program depending on what the URL is, and you can put information to send to the function in the URL. For example...

.com/profile/18

In one program, that request could be sent to the view profile function, and the 18 can be sent as the ID of the profile to view.

I believe you can also do this same thing with Java servlets. Is there anything that will do this with CGI programs in C? Something that allows me to route request that I want, but will still allow Apache to handle the request that I don't want to handle?

The routing to different functions part isn't so important, I more want to be able to put information into the URL.

Thank you.

Reply With Quote
  #2  
Old May 4th, 2008, 06:40 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 h 5 m 45 sec
Reputation Power: 797
Yes you can do this, but not as a CGI program. For this, you would want to write an Apache module and hook to the URI Translation event or Header Parsing event and then you can work from there. Note that an apache module works way faster than a CGI does. Matter of fact, it is often faster than serving a static page!

IIS has a similar feature where you can write an ISAPI dll which can hook to the event and work from there.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old May 4th, 2008, 07:04 PM
esrrms esrrms is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 esrrms User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 31 sec
Reputation Power: 0
After I posted this I started reading about Apache modules, but I was hoping I wouldn't have to write one. Well at least now I know where I gotta start. Thanks!

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Web programming in C question.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway