7 Replies - 1891 Views - Last Post: 08 April 2009 - 10:43 AM Rate Topic: -----

#1 grapevinefires  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 07-April 09

Very basic question about URL variables

Post icon  Posted 07 April 2009 - 07:54 AM

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 ...) :

<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


<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: 07 April 2009 - 07:56 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Very basic question about URL variables

#2 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Very basic question about URL variables

Posted 07 April 2009 - 09:24 AM

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.adob...iguring_07.html
Was This Post Helpful? 0
  • +
  • -

#3 iamjesus1342027  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 41
  • Joined: 31-March 09

Re: Very basic question about URL variables

Posted 07 April 2009 - 11:28 AM

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.
Was This Post Helpful? 0
  • +
  • -

#4 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Very basic question about URL variables

Posted 07 April 2009 - 12:39 PM

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>
Was This Post Helpful? 0
  • +
  • -

#5 xheartonfire43x  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 454
  • Joined: 22-December 08

Re: Very basic question about URL variables

Posted 08 April 2009 - 08:40 AM

View Postsansclue, on 7 Apr, 2009 - 11:39 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#6 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Very basic question about URL variables

Posted 08 April 2009 - 10:09 AM

View Postxheartonfire43x, on 8 Apr, 2009 - 07:40 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#7 xheartonfire43x  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 454
  • Joined: 22-December 08

Re: Very basic question about URL variables

Posted 08 April 2009 - 10:27 AM

View Postsansclue, on 8 Apr, 2009 - 09:09 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

#8 sansclue  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 316
  • Joined: 21-November 07

Re: Very basic question about URL variables

Posted 08 April 2009 - 10:43 AM

View Postxheartonfire43x, on 8 Apr, 2009 - 09:27 AM, said:

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1