Link to home
Start Free TrialLog in
Avatar of sydneyguy
sydneyguyFlag for Australia

asked on

open a url from a tpl file after correct syntax for the brackets as not to confuse the php compiler

{if $smarty.session.ProSchBth == 'P'}
{* HERE I NEED IT TO OPEN http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1 *}
{* {include file='user_home_stats.tpl'} *}
{* THIS IS WHAT IT DOES NOW WHEN IT RUNS *}
{include file='advprovideredit.tpl'}

{* BUT I NEED IT TO OPEN THIS LINK BELOW INSTEAD BUT NOT SURE OF THE SYNTAX TO PUT
ROUND THE URL LINK *}
<a href="http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1" target="_blank">HTML Help</a>

{elseif $smarty.session.ProSchBth == 'S'}
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

I'm not sure to have understood your question. Want you the right code to print a link if $smarty.session.ProSchBth == 'P'? If so, take a look at this:

if ($smarty.session.ProSchBth == 'P'){
  echo '<a href="http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1" target="_blank">HTML Help</a> ';
}elseif...
Avatar of sydneyguy

ASKER

that give me a link that works but i want it to just open the page insted of the link,
as it is on open the page for the tpl auto loads
but i need the php page to be called and auto load in stead.
so instead of a link i need it to just load the page instead
thanks for the help so far
Do you wish open that link in a new tab/window or in the same tab/window?
same window just when the page is opened depending on the if statment it will auto open the page in the same window, but if i get he syntax for the page running i can play with the rest
What about

if ($smarty.session.ProSchBth == 'P'){
  header("location: http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1");
}elseif...
did not  run, just echo on the page, so this bit of code did not run
User generated image
ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What about?
Sorry, can you give some feedback, please?
sorry about that got side tracked
thanks for the help
Glad to help you and thanks for points. Bye