Johnain Posted November 27, 2007 Share Posted November 27, 2007 Hi all In my form indexfr.php I have this code ... <?php $langg ="FR"; include_once($_SERVER['DOCUMENT_ROOT'].'/scripts/inctagline.php'); ?> In my file '/scripts/inctagline.php' I have this code <?php if ($_GET['langg']=="EN"){ echo "<p>Training and supporting the horse and rider.</p>"; } elseif ($_GET['langg']=="FR"){ echo"<p>Formant et soutenant le cheval et le cavalier</p>" ; } else { echo "<p>Training and supporting the horse and rider default</p>" ; } ?> It is picking up the default third line so not readingthe variable value. Can anyone tell me why please? It seems so simple !! ... and by the way ...do I have to put the starting <?php and the ending ?> in the include file? Quote Link to comment Share on other sites More sharing options...
Orio Posted November 27, 2007 Share Posted November 27, 2007 Why are you using get? Simply use $langg... Orio. Quote Link to comment Share on other sites More sharing options...
Johnain Posted November 27, 2007 Author Share Posted November 27, 2007 I tried without but no result. At that time I was using case instead of if, I'll try it again now as a pure reference though. Quote Link to comment Share on other sites More sharing options...
Johnain Posted November 27, 2007 Author Share Posted November 27, 2007 That worked absolutely fine. Thanks a lot. It just shows how one cangebogged down and too close. Do I need to put the <?php and the terminating ?> in the include file? Quote Link to comment Share on other sites More sharing options...
trq Posted November 27, 2007 Share Posted November 27, 2007 Do I need to put the <?php and the terminating ?> in the include file? Yes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.