School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,477 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,752 people online right now. Registration is fast and FREE... Join Now!




Very basic question about URL variables

 

Very basic question about URL variables

grapevinefires

7 Apr, 2009 - 06:54 AM
Post #1

New D.I.C Head
*

Joined: 7 Apr, 2009
Posts: 1

Hi there.

I am actually a newbie to coldfusion and I am just getting to grips with the code, so go easy on me!

Firstly when I installed the developer edition of CF I had to select a port of 8080 because my machine would not allow port 80 because it was adamant that another program was using it. I thought it was skype but I changed that but it still wouldn't work so I had to use 8080. I am not sure as to whether this a fundamental issue.


I have been doing a basic exercise on webucator.com 'Passing Variables via the Query String'.

I thought that this would be fairly straightforward however it is proving difficult.

This is the code that I am placing in the html document HelloWho.html within my wwwroot folder (C:\inetpub\wwwroot ...) :

CODE
<html>
<head>
    <title>Greeting the Beatles</title>
</head>
<body>
    Choose a Beatle to greet.
    <ul>
    <li><a href="HelloWho.cfm?greet=Paul">Paul</a></li>
    <li><a href="HelloWho.cfm?greet=John">John</a></li>
    <li><a href="HelloWho.cfm?greet=George">George</a></li>
    <li><a href="HelloWho.cfm?greet=Ringo">Ringo</a></li>
    </ul>
</body>



and in the cfm page, HelloWho.cfm

CODE


<html>
<head>
    <title>Hello <cfoutput>#URL.greet#</cfoutput></title>
</head>

<body>

<cfoutput>Hello #URL.greet#</cfoutput>

</body>

</html>


When I test this in the browser, if I click on one of the links, it displays :
Hello #URL.greet#

Even when I placed, in the cfm page, the cfoutput tags around the html tags it still did not work. It displayed all the html coding as written above.


I hope someone might be able to help, I know this may seem fairly basic but it's driving me nuts! If someone could palm me off to a more apt forum that would also be helpul.

Thanks!

This post has been edited by grapevinefires: 7 Apr, 2009 - 06:56 AM

User is offlineProfile CardPM
+Quote Post


sansclue

RE: Very Basic Question About URL Variables

7 Apr, 2009 - 08:24 AM
Post #2

D.I.C Regular
***

Joined: 21 Nov, 2007
Posts: 316



Thanked: 28 times
My Contributions
Unfortunately, I can't help you with IIS issues. But it is likely some sort of configuration problem. So the webserver is just displaying the CF code (not executing it). You might try reviewing the configuration instructions here

http://livedocs.adobe.com/coldfusion/8/htm...iguring_07.html

User is offlineProfile CardPM
+Quote Post

iamjesus1342027

RE: Very Basic Question About URL Variables

7 Apr, 2009 - 10:28 AM
Post #3

New D.I.C Head
*

Joined: 31 Mar, 2009
Posts: 41

if you add the following at the top of the page it should work.

<cfparam name="url.greet" default="None">

this code takes it out of the url and then you can use that variable on the page.
User is offlineProfile CardPM
+Quote Post

sansclue

RE: Very Basic Question About URL Variables

7 Apr, 2009 - 11:39 AM
Post #4

D.I.C Regular
***

Joined: 21 Nov, 2007
Posts: 316



Thanked: 28 times
My Contributions
QUOTE

this code takes it out of the url and then you can use that variable on the page.


Not quite. Cfparam sets a default value for a parameter if it does not exist.

On second thought ... are you seeing just:

1)
Hello #URL.greet#

... or also the cfoutput tags?

2)
Hello <cfoutput>#URL.greet#</cfoutput>


User is offlineProfile CardPM
+Quote Post

xheartonfire43x

RE: Very Basic Question About URL Variables

8 Apr, 2009 - 07:40 AM
Post #5

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 260



Thanked: 2 times
My Contributions
QUOTE(sansclue @ 7 Apr, 2009 - 11:39 AM) *

QUOTE

this code takes it out of the url and then you can use that variable on the page.


Not quite. Cfparam sets a default value for a parameter if it does not exist.

On second thought ... are you seeing just:

1)
Hello #URL.greet#

... or also the cfoutput tags?

2)
Hello <cfoutput>#URL.greet#</cfoutput>


What I will bet that it is is that you need to configure your coldfusion server to point to C:/inetpub/wwwroot/ for your webrrot folder. By default it points to C:/ColdFusion8/wwwroot/. Try putting the file in there and then running it. It is probably looking at the .cfm page and running it just like a .htm page which would never be picked up by ColdFusion.

The problem with the installation on port 8080 is that I believe when Adobe built ColdFusion's developer server they built it so that it could not be run on port 80. That way people can't steal the program by just using the port 80.
User is offlineProfile CardPM
+Quote Post

sansclue

RE: Very Basic Question About URL Variables

8 Apr, 2009 - 09:09 AM
Post #6

D.I.C Regular
***

Joined: 21 Nov, 2007
Posts: 316



Thanked: 28 times
My Contributions
QUOTE(xheartonfire43x @ 8 Apr, 2009 - 07:40 AM) *

What I will bet that it is is that you need to configure your coldfusion server to point to C:/inetpub/wwwroot/ for your webrrot folder. By default it points to C:/ColdFusion8/wwwroot/. Try putting the file in there and then running it. It is probably looking at the .cfm page and running it just like a .htm page which would never be picked up by ColdFusion.

The problem with the installation on port 8080 is that I believe when Adobe built ColdFusion's developer server they built it so that it could not be run on port 80. That way people can't steal the program by just using the port 80.


Hmm. I was assuming since they are using c:/inetpub that they are using IIS for there webserver, not the built in CF webserver which runs off of 8500 by default. I am pretty sure you can run off of port 80 when using an external web server. But I am not much help with IIS questions.
User is offlineProfile CardPM
+Quote Post

xheartonfire43x

RE: Very Basic Question About URL Variables

8 Apr, 2009 - 09:27 AM
Post #7

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 260



Thanked: 2 times
My Contributions
QUOTE(sansclue @ 8 Apr, 2009 - 09:09 AM) *



Hmm. I was assuming since they are using c:/inetpub that they are using IIS for there webserver, not the built in CF webserver which runs off of 8500 by default. I am pretty sure you can run off of port 80 when using an external web server. But I am not much help with IIS questions.


It sounds like he is using it on his personal computer if he is running skype off of it. If that is the case then the firewall won't let you run internet and an application server out of the same port. It sounds like he is using his personal computer just like any development server except that is isn't a server.
User is offlineProfile CardPM
+Quote Post

sansclue

RE: Very Basic Question About URL Variables

8 Apr, 2009 - 09:43 AM
Post #8

D.I.C Regular
***

Joined: 21 Nov, 2007
Posts: 316



Thanked: 28 times
My Contributions
QUOTE(xheartonfire43x @ 8 Apr, 2009 - 09:27 AM) *

It sounds like he is using it on his personal computer if he is running skype off of it. If that is the case then the firewall won't let you run internet and an application server out of the same port. It sounds like he is using his personal computer just like any development server except that is isn't a server.


Yes, I assumed he was using his personal computer as well. My point was just that it matters which webserver he is using along side of CF. It could be the CF built in server, IIS, Apache, etc. Which one he is using determines what changes to the configuration need to be made.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:32AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month