Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing URL variables - among others 1

Status
Not open for further replies.

krosshair

Programmer
Feb 28, 2003
34
GB
I am currently making a newsreader and have run into a few problems.

The biggest one seems to be that I can't seem to figure out why CF is not passing the {method} through the URL from my viewnews.cfm page to newsManager.cfm page - I really have tried everything I can think of and it is just not happening.

Also my when I try and update the db - even though I think my code is correct it is just not working.

I could try and explain all this but I think looking at the code would be better...

is there anyway someone could possibly take a peek at my code and maybe give me a hand on what is going wrong??


it's in a zipped file - much appreciated!!
 
Try to change the #method# with #url.method#.
regards
 
Try to add the <cfoutput> and change url.method to #url.method#.
regards
 
On the 'newsmanager.cfm' page on line 6 you will want to make changes to your sql query.

Currently you have:
SELECT poster, item, &quot;date&quot;, title, story
FROM News
WHERE item = item

Change it to:
SELECT poster, item, &quot;date&quot;, title, story
FROM News
WHERE item = #url.item#
 
Thanks!! all - That was a real result.

So now I have successfully passed my variable from the 'viewNews' page to the 'newsManager' page (thanks to your help!)- But when I edit an item my newsManagerProcess page is giving me nothing besides a Item Manager:post/Get and the remaining code is not processing.

If you guys can help me with what is wrong here I will be eternally grateful as the entire application will work!


Thanks!
 
After I edited a story, the newsmanagerprocess.cfm page displays -

*******
» View news in the database
» Add a new item to the database

Item manager: Edit
Item number:2 has been updated in the database
*******

Which corresponds to the code that you have written.

Inferring from your post, I suspect that you are not seeing the part of code that displays:

****
Item number:2 has been updated in the database
****

If I'm understanding your question correctly, then you must have made a change to the url variable name (method) or maybe you change the code on newsmanager.cfm that changes the <CFIF method EQ &quot;Edit&quot;> condition on newsmanagerprocess.cfm to evaluate as false.

Repost your updated code and I'll take a gander at it.

btw: I highly recommend that you start scoping your variables: ie. <cfif url.method eq &quot;edit&quot;> instead of <cfif method eq &quot;edit&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top