Jump to content
TNG Community
Sign in to follow this  
tngrlkrz

Need a Language Variable for box header

Recommended Posts

tngrlkrz

Hoping someone can give me a coding tip. Currently have this line of code:

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>RESEARCH POPULAR SITES   <br />;
<select onchange=submit() multiple name=\"researchlink\" size=\"3\" style=\"vertical-align:text-top;\">
<option value=$callres[0] >$rv[0]</option>  
......more options
</select>
</form>";

-----

giving me this:

2017-09-28_19-27-02.jpg

I wish to have a cust_text variable in various languages I support, in the form $text[rm-header] = "Research Popular Sites".  I've tried various ways such as :

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b><?php echo $text['rm-header'] ; ?><br />;

but no luck.

I tinker in coding, but could use help on this.

Thanks,

Ron

Share this post


Link to post
Share on other sites
Ken Roy
48 minutes ago, tngrlkrz said:

Hoping someone can give me a coding tip. Currently have this line of code:

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>RESEARCH POPULAR SITES   <br />;
<select onchange=submit() multiple name=\"researchlink\" size=\"3\" style=\"vertical-align:text-top;\">
<option value=$callres[0] >$rv[0]</option>  
......more options
</select>
</form>";

-----

giving me this:

2017-09-28_19-27-02.jpg

I wish to have a cust_text variable in various languages I support, in the form $text[rm-header] = "Research Popular Sites".  I've tried various ways such as :

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b><?php echo $text['rm-header'] ; ?><br />;

but no luck.

I tinker in coding, but could use help on this.

Thanks,

Ron

Try using

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>$text['rm-header']</b><br />;

 

Share this post


Link to post
Share on other sites
tngrlkrz

Thanks Ken,

I think I tried that earlier, thought it would work, ..but I get this error:

2017-09-28_20-49-26.jpg

Ron

Share this post


Link to post
Share on other sites
tngrlkrz

Ken,

Redefining the variable as following is working for me, don't really know why, but now can do my languages.  What I did notice, is that any variable with text > 8 characters, will not print/display between the " > <" arrows of the <form method = 'post'.

$rmheader=$text['rm-heade'];
$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b> $rmheade</b><br />;

Ron

 

Share this post


Link to post
Share on other sites
Ken Roy

Not sure that it has to do with the length.  I forgot that quoted variables within another php variable need to be within braces so the correct syntax would be

$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>{$text['rm-header']}</b><br />;

 

Share this post


Link to post
Share on other sites
tngrlkrz
1 hour ago, Ken Roy said:

Not sure that it has to do with the length.  I forgot that quoted variables within another php variable need to be within braces so the correct syntax would be


$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>{$text['rm-header']}</b><br />;

 

OK, for clarification, will try that and post results, though I may have tried braces as well.  I misstated the limitation; it was the variable name (in brackets) , not the text itself, that, through experimentation, was not displaying when over 8 characters, e.g, $rmheader worked, but $rm-header would not (no $text and brackets/braces).  The actual text could be any length.

Ron

 

Share this post


Link to post
Share on other sites
tngrlkrz
2 hours ago, Ken Roy said:

Not sure that it has to do with the length.  I forgot that quoted variables within another php variable need to be within braces so the correct syntax would be


$resstuff="<form method=\"post\" action='kicker.php' target='_blank'><b>{$text['rm-header']}</b><br />;

 

Thanks Ken, that does work, regardless of variable name length. Not sure what  syntax I was violating that encountered the 8 character barrier.

Ron

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×