Aquachip Posted August 1, 2011 Share Posted August 1, 2011 I am wanting to make something along the lines of: <?php if ($value = "1") {OUTPUT "/var/www/3.list";} ?> 3.list would just be a text file or simple html file. Is there a syntax to do that and if so, what is it called so I can look it up in PHP documentation to see how its done? Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/ Share on other sites More sharing options...
manix Posted August 1, 2011 Share Posted August 1, 2011 if ($value==1) { include ( or require ) 'file path here'; } Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/#findComment-1250362 Share on other sites More sharing options...
voip03 Posted August 1, 2011 Share Posted August 1, 2011 <? Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/#findComment-1250363 Share on other sites More sharing options...
Aquachip Posted August 1, 2011 Author Share Posted August 1, 2011 Thanks for the links and the example man! Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/#findComment-1250369 Share on other sites More sharing options...
The Little Guy Posted August 1, 2011 Share Posted August 1, 2011 If you want to print out the content of that file, you would do this: <?php if ($value = "1") { readfile("/var/www/3.list"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/#findComment-1250380 Share on other sites More sharing options...
Maq Posted August 1, 2011 Share Posted August 1, 2011 I remember pointing this out in another thread, don't use the assignment operator but the logical operator '==' to compare values. Your current condition will always evaluate to true. Quote Link to comment https://forums.phpfreaks.com/topic/243510-wanting-to-know-the-technical-name-of-a-syntax/#findComment-1250408 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.