?
Solved

gettiing a $_GET['prosupad'] value into a smarty template and test with an if statment

Posted on 2011-04-25
11
Medium Priority
?
295 Views
Last Modified: 2012-05-11
have a $_GET['prosupad'] value that i need to test inside a tpl template file and need to then operate on the value found, am having trouble getting the syntax correct, have tried several versions but no good has any one have any ideas
{if $_GET['prosupad'] == 'p'}   // does not work
   // do whats req
{/if}

<?php if $_GET['prosupad'] == 'category'): ?>   // does not work
         // Do fancy stuff!
<?php endif; ?>}
0
Comment
Question by:sydneyguy
  • 6
  • 5
11 Comments
 
LVL 10

Expert Comment

by:honestman31
ID: 35463889
<?php if ($_GET['prosupad'] == 'category') { ?>  
         
<? } ?>
0
 
LVL 10

Expert Comment

by:honestman31
ID: 35463890
<?php if ($_GET['prosupad'] == 'category') { ?>  
       
do something here

<? } ?>
0
 
LVL 10

Accepted Solution

by:
honestman31 earned 2000 total points
ID: 35463895

oops , forgot the php tag

<?php if ($_GET['prosupad'] == 'category') { ?>  
       
do something here

<?php   } ?>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:sydneyguy
ID: 35463897
<?php if ($_GET['prosupad'] == 'p') { ?>  
 do something here
<? } ?>

does not run causes the page to hang
0
 
LVL 10

Expert Comment

by:honestman31
ID: 35463913
Di d you try the last one ?
also can you post what you do  , I'm afraid you are getting the script in an infinite loop
0
 

Author Comment

by:sydneyguy
ID: 35463924
almost there, template needs the <?php changed to {php} ect so got me into the ball park thanks for the help
{php} if ($_GET['prosupad'] == 'p') { {/php}  
    <input type="text" value="F" name="txtlookgender" />
{php} } {/php}
0
 

Author Comment

by:sydneyguy
ID: 35463927
slight change for tpl smarty template
0
 

Author Comment

by:sydneyguy
ID: 35463931
please close quesion and award points
0
 
LVL 10

Expert Comment

by:honestman31
ID: 35463959
Glad I put in the right way . I was just about to tell you to replace <?Php  by {PHP}  as you are using smarty .
I think you should use accept answer not  close question .
thanks
0
 

Author Comment

by:sydneyguy
ID: 35464241
made a mistake needs to be awarded points to honestman31:
0
 

Author Closing Comment

by:sydneyguy
ID: 35464246
done thanks
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question