cforms II User Forum

Registration is currently disabled.


Login form protected by Login LockDown.

Lost password?
Advanced Search

— Forum Scope —


— Match —


— Forum Options —


Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Track URL in email
April 11, 2007
9:13 pm

Hey all

I love this plugin and have it appearing on several pages in my site.

My problem however is that I need to know which URL the form is sent from each time I receive a message.

Is there some PHP hidden fields code that will include the URL that the message is sent from in my email?



April 11, 2007
9:35 pm
Munich, Germany
Forum Posts: 6400
Member Since:
March 6, 2005

This works -to an extent- already. Take a look at the email head, that's sent out:

A new submission (form: "Subscription Form")
Submitted on: April 11, 2007 @ 10:26 pm
Via: /test-custom-cform
By (visitor IP)

This information is also saved in the tracking db (if tracking per DB is enabled). To work properly, this requires WP to use permalinks.



April 12, 2007
1:41 pm

I see that it does track via that format but my site relies on using the default permalink structure:

Therefore all my results say they come from /

Is there a way around this to show me the number of the post from which the form was sent from?  

April 12, 2007
9:11 pm
Munich, Germany
Forum Posts: 6400
Member Since:
March 6, 2005

As a permament fix, you can try to replace

$page = substr( $_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'],'?')-1);

$page = (trim($page)=='')?'/':trim($page);


$page = "Post: #".get_the_id();

in cforms.php (line ~351 & ~815).
Let me know if this did the trick.

April 14, 2007
11:02 pm

Hey Oliver

No unfortunately that didn't work.

It simply showed the # but not the number of the post afterwards.

Any other ideas? 

Thanks for your help so far!

Is there a way I can extract the post title from my mysql database and put it in that position?

April 15, 2007
12:41 am
Munich, Germany
Forum Posts: 6400
Member Since:
March 6, 2005

Here is what I tested for the non-ajax form submission:

This line:

$page .= '('.get_the_id().')';

I added right after line 814 (rel. 3.4), disabled ajax support for the form and it produced the desired output in the email:

A new submission (form: "Duplicate of form #2")
Submitted on: April 15, 2007 @ 1:29 am
Via: /2007/03/20/new/(5)
By (visitor IP)

 The post context is maintained when sending, hence it only works without ajax.

To make it work with ajax, one would need to add another hidden form field including the posts' ID/Title and deliver it to the backend send mechanism. Quite a bit of work involved here.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
16 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3762

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5361

Posts: 18742

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)