This topic is locked

Best way to hide Register Link

11/13/2017 10:48:46 PM
PHPRunner General questions
J
justmelat author

What is the best method for hiding the "register" link that appears on the login page, after user has completed, successfully, the registration process?

J
justmelat author 11/14/2017



What I think I want to do is something like this:
I have set a session variable on the "successful registration event". Once that var is set to true, i want to hide the register link that appears on the login page:
On the "After application initialized" event page, how can I or can I write and if-statement that achieves the following:



if ($registered == true){

[data-brick="bsloginregister"] {

display: none;

}


I tried the above, but it's not working, not sure what/how to get it working. Any insight would be appreciated.

J
justmelat author 11/14/2017





why does the code below not work in the javascript onload event or in the editor code snippet? How can I resolve?

if($_SESSION["alreadyRegistered"] == true){

echo "yeah";

$(".new_reg_link").hide();

//(".new_reg_link").css('display','none');

}else {

echo("nope");// Put your code here.

}
romaldus 11/14/2017



why does the code below not work in the javascript onload event or in the editor code snippet? How can I resolve?

if($_SESSION["alreadyRegistered"] == true){

echo "yeah";

$(".new_reg_link").hide();

//(".new_reg_link").css('display','none');

}else {

echo("nope");// Put your code here.

}



You cannot use php code in javascript onload event

J
justmelat author 11/16/2017



You cannot use php code in javascript onload event



ok, tried a thousands possible solutions, none of which are working.
How do I hide the register link/button, that appears on the login page, based on a session_var that I have created and set when first successful registration has been completed

For example:

//this would be placed in the "after application init" event

if(_session_var == true){

hide register link/button;

}