My site crash after i add a php code for get a "thanks page"

hey

i m hosting my wordpress website on blue host,
i would like to create a" registration thank you page" for my new members,
so i followed the instruction from this topic https://s2member.com/kb-article/creating-a-registration-thank-you-page/

and each time i add a new php file on my Cpanel, (with the code from the topic) my site crash right after that and i must delete this file,

,
thanks for your help !!!

You’ll need to contact BlueHost support for help with creating PHP files on your BlueHost account.

i contacted them, and apparently i was doing right but they werent able to help me actually ,
this is what i used for the file :

<?php add_action('ws_plugin__s2member_after_configure_user_registration', function($vars = array()) { if (!is_admin() && !empty($vars['processed']) && $vars['processed'] === 'yes') { $_POST['redirect_to'] = $_REQUEST['redirect_to'] = // Custom Thank-You Page URL. "http://www.fairedudropshipping.com/page-de-remerciement/". // « change this value. } });

In “add_action” command as second parameter you should put the name (as string) of the function, not the function itself. You got “syntax error” in PHP, which become “white screen of death” in WP…