<input type="button"
style="height: 40px; width: 185px; background-color:#4863A0;
Color:#FFFFFF;font-weight: bold; text-align:center"
value="Login using facebook"
onClick="parent.location='https://graph.facebook.com/oauth/authorize?type=user_agent&client_id=256953694326584&redirect_uri=**http://www.juboapp.com/**edit.php&scope=email,user_birthday,offline_access'">
Here we need to replace the url "http://www.juboapp.com/" with the variable which store this link. This variable comes from another PHP file.
How can i replace this link with this variable, so that it can redirect on the given link.
Declare the variable and store url in it. and use the following:
$dynamicUrl = "http://www.google.com/";
<input type="button" style="height: 40px; width: 185px; background-color:#4863A0;
Color:#FFFFFF;font-weight: bold; text-align:center" value="Login using facebook"
onClick="parent.location='https://graph.facebook.com/oauth/authorize?type=user_agent&
client_id=256953694326584&redirect_uri=<?php echo $dynamicUrl?>edit.php&
scope=email,user_birthday,offline_access'">
Its nice and simple, replace:
http://www.juboapp.com/
with <?php echo $yourvariable; ?>
However, if the variable is established in another script (script A) you need for it to be readable by the script you want to replace the URL in (script B)- you either need to include or require the first script (script A) in the second (script B), or on your other script (script A) assign the variable to a session or cookie.