0

Reset Password link (Cakephp 3.8.4)

$link = urldecode(
    Router::url(
        array(
            "action" => "resetpassword",
            base64_encode($_REQUEST['phone_email_forgot'])
        ),
        true
    )
);

url :

http://example.in/index/resetpassword/bWQua2F5cmFAZ21haWwuY29t

How I can split the URL above and create variables like $link_1

http://example.in/index/resetpassword/

and $link_2

bWQua2F5cmFAZ21haWwuY29t

I need to use this for Sending SMS purpose as {#var#} accept maximum 30 characters only.

Please help me with this.

Regards, Anand

ndm
  • 59,784
  • 9
  • 71
  • 110
Anand
  • 1
  • 1
  • 2
    Why do you generate a combined URL in the first place? Why not generate the two things separately from the get go? Also why are you using base64 encoded E-Mail addresses if you have a 30 char limit? Addresses can be way longer than 30 chars, and base64 only inflates the number of characters! – ndm Jul 05 '21 at 12:27
  • How to make these two things separately as I want part 1 as host like http://example.in/index/resetpassword/ which concat with part 2 as encrypted code and will use as(#var#) please help – Anand Jul 05 '21 at 14:49
  • I have created variable code for base64 encoded which I want to contact with prefix URL in href tag **$code = urldecode(base64_encode($_REQUEST['phone_email_forgot']),true);** like this but i didnt get any result. Get URL but without $code Please someone help. – Anand Jul 06 '21 at 12:10

0 Answers0