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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger event two when using method POST

Status
Not open for further replies.

bluesauceuk

Programmer
Jan 1, 2001
73
GB
Hello,

I have a provider that uses a POST method to my cfm page to trigger an event on my server.

I would like this in turn to make another descision and then do something but it doesn't work!

<CFSET datesent=&quot;#lcase(dateformat(Now()))#&quot;>
<CFSET timesent=&quot;#timeformat(Now())#&quot;>
<CFSET form.datesent=datesent>
<CFSET form.timesent=timesent>

<CFINSERT ....> THIS WORKS TOO!

<cfmail ..............................>
THIS BIT WORKS!
</cfmail>

<CFOUTPUT> AND THIS WORKS TOO...
WHEN: #datesent# #timesent#<BR>
SENDER: #url.sender# (#form.sender#)<BR>
KEYWORD: #url.keyword# (#form.keyword#)<BR>
MESSAGE: #url.message# (#form.message#)
</CFOUTPUT>
OK


THIS IS THE ONE BIT THAT WON'T TRIGGER EVENT 2...

<CFIF #form.keyword# EQ &quot;trax&quot;>
<CFLOCATION URL=&quot;keyword_trax.cfm&quot;>
</CFIF>

______________-
is this because it is a POST?

Help!

Thanks!
 
try
<CFIF #lcase(trim(form.keyword))# EQ &quot;trax&quot;>

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
I'm not clear on what EVENT 1 or EVENT 2 is... so if you could give a little more information, it would be helpful.

Also, what do you mean by &quot;It won't work&quot;? Are you getting an error message? Or ..?
 
It is all to do with the way &quot;they&quot; are calling this page.

This page (shown above) is called by another system using PHP. This is done the POST way... this way uses the form variables.

An aside... I assume this method is similar to... someone else using a <CFHTTP method=&quot;post&quot;...

So &quot;they&quot; use the POST method to awake my page. (this event is triggered by using a phone message)

Now for some reason.. this will send the email.. but I would like it to call another page. But for some reason the POST thing is stopping the page firing!

any help will be greatfully appreciated?

Thanks :)



BTW: The trim thing didn't work.
 
Check to see if using cfinclude instead of cflocation posts the data.

If this does fix the problem, you may want to add the ADDTOKEN=&quot;Yes&quot; parameter to the cflocation tag - but of course doing so carries some implications.

 
have you tried outputting #form.keyword# to see what comes up?

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
How do you know <CFLOCATION URL=&quot;keyword_trax.cfm&quot;> is not being triggered?

Can you post pertinent code that exists on keyword_trax.cfm? That may help us help you.
 
All that happens is a CFMAIL! I don't want to post this as there is a secuirty issue. But keyword_trax.cfm works!
 
As bombboy said, &quot;have you tried outputting #form.keyword# to see what comes up?&quot;. In other words, maybe the condition &quot;really is&quot; returning false due to form.keyword not being equal to &quot;trax&quot;.

Have you tried to replace cflocation with cfinclude?

For troubleshooting try:
<CFIF form.keyword EQ &quot;trax&quot;>
<CFLOCATION URL=&quot;keyword_trax.cfm&quot;>
<CFELSE>
<CFOUTPUT>#form.keyword#</CFOUTPUT>
</CFIF>

Let us know.
 
I think bombboy had the right idea. The keyword variable probably exists, but isn't in the case that you expect.

Try:
Code:
<CFIF CompareNoCase(trim(form.keyword),&quot;trax&quot;) EQ 0> 
   <CFLOCATION URL=&quot;keyword_trax.cfm&quot;>
</CFIF>

Also... is there a reason why you're trying to SET variables in the FORM scope?
Code:
<CFSET form.datesent=datesent>
<CFSET form.timesent=timesent>
This would be pretty unusual. There are cases where you want to do this... but this doesn't sound like one of those cases.


-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top