Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

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'}
0
sydneyguy
Asked:
sydneyguy
  • 7
  • 5
1 Solution
 
Marco GasiFreelancerCommented:
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...
0
 
sydneyguyAuthor Commented:
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
0
 
Marco GasiFreelancerCommented:
Do you wish open that link in a new tab/window or in the same tab/window?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sydneyguyAuthor Commented:
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
0
 
Marco GasiFreelancerCommented:
What about

if ($smarty.session.ProSchBth == 'P'){
  header("location: http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1");
}elseif...
0
 
sydneyguyAuthor Commented:
did not  run, just echo on the page, so this bit of code did not run
0
 
sydneyguyAuthor Commented:
page shot
0
 
Marco GasiFreelancerCommented:
You should avoid to output anything else before calling header function. In other words, you should use your if statement with loading other pages before to print Welcome messages

if ($smarty.session.ProSchBth == 'P'){
  header("location: http://localhost/home/hiv/public_html/advprovideredit.php?search_new=1");
}elseif ($smarty.session.ProSchBth == 'S'){
  echo "<h3>Wllcome, Aeirtec Aeirtec (Aeirtec)</h3>";
}
0
 
Marco GasiFreelancerCommented:
What about?
0
 
Marco GasiFreelancerCommented:
Sorry, can you give some feedback, please?
0
 
sydneyguyAuthor Commented:
sorry about that got side tracked
thanks for the help
0
 
Marco GasiFreelancerCommented:
Glad to help you and thanks for points. Bye
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now