Skip Navigation

[Resolved] PHP in CRED Form SimpleModal Login Pop Up

This thread is resolved. Here is a description of the problem and solution.

Problem:

Output current page URL in a link, for example:

<a href="/wp-login.php?redirect_to=php echo $_SERVER['REQUEST_URI'];" class="simplemodal-login">Log In</a>

>

Solution:

You can not use PHP codes in the post content directly.

I assume you are going to pass parameter of current page URL, and current page is a wordpress post/page, you can retrieve the current post/page URL value with Views shortcode [wpv-post-url], so you can use it in your code, like this:

<a href="/wp-login.php?redirect_to=[wpv-post-url]" class="simplemodal-login">Log In</a>

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url
Outputs the URL to the current post.

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#637718
SIMPLEMODALLOGIN.png

Hi
I am using SimpleModal Login to login the users on my form page. This is the tag I am adding inside my CRED form

SimpleModal Login

<a href="/wp-login.php?redirect_to=<?php echo $_SERVER['REQUEST_URI']; ?>" class="simplemodal-login">Log In</a>

But after login it gets redirected to

hidden link;\%27REQUEST_URI\%27];%20?--%3E

In the CRED Form REQUEST_URI is displaying as RED.

#638188

Hello,

You can not use PHP codes in the post content directly.

I assume you are going to pass parameter of current page URL, and current page is a wordpress post/page, you can retrieve the current post/page URL value with Views shortcode [wpv-post-url], so you can use it in your code, like this:

<a href="/wp-login.php?redirect_to=[wpv-post-url]" class="simplemodal-login">Log In</a>

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url
Outputs the URL to the current post.

#641754

Thanks Luo that worked Great.

#642005

You are welcome

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.