plznty Posted December 28, 2008 Share Posted December 28, 2008 <?php // PC Index if ( $_GET['pc'] == index ) { $username = $_GET['username']; $title = include('$username/title.txt'); echo " <title>$title // Cant beat them? Join them..</title> <body link='black' alink='black' vlink='black' bgcolor='black'> <center> <img src='admin/images/clan/pclogo.gif' height='150' width='150'> <p><a href='?pc=home' target='main'><img src='admin/images/clan/home.gif'></a> <a href='?pcforum=1'><img src='admin/images/clan/joinus.gif'></a> <a href='?pc=members' target='main'><img src='admin/images/clan/members.gif'></a> <p><iframe src='?pc=home' name='main' height='50%' width='500' frameborder='no'></iframe>"; } ?> I want the title to display what is in /(GET_USERNAME)/title.txt Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/ Share on other sites More sharing options...
Mark Baker Posted December 29, 2008 Share Posted December 29, 2008 I want the title to display what is in /(GET_USERNAME)/title.txt Include is used to include additional PHP scripts within your code. To read from a text file, you want to look at the fread() function Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725046 Share on other sites More sharing options...
Mchl Posted December 29, 2008 Share Posted December 29, 2008 1. See post above 2. Use double quotes if you want variables to be parsed inside string 3. ./ indicates script's path $title = include("./$username/title.txt"); Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725047 Share on other sites More sharing options...
plznty Posted December 29, 2008 Author Share Posted December 29, 2008 <?php // PC Index if ( $_GET['pc'] == index ) { $username = $_GET["username"]; $title = include("./$username/title.txt"); echo " <title>$title // Cant beat them? Join them..</title> <body link='black' alink='black' vlink='black' bgcolor='black'> <center> <img src='admin/images/clan/pclogo.gif' height='150' width='150'> <p><a href='?pc=home' target='main'><img src='admin/images/clan/home.gif'></a> <a href='?pcforum=1'><img src='admin/images/clan/joinus.gif'></a> <a href='?pc=members' target='main'><img src='admin/images/clan/members.gif'></a> <p><iframe src='?pc=home' name='main' height='50%' width='500' frameborder='no'></iframe>"; } ?> It now says 1 in the title and says what is in (USERNAME)/title.txt at the top of the page. Thanks for your help so far guys just a little bit more please. Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725235 Share on other sites More sharing options...
redarrow Posted December 29, 2008 Share Posted December 29, 2008 what u on about, tell us please what it suppose to do. Full explanation please. Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725237 Share on other sites More sharing options...
plznty Posted December 29, 2008 Author Share Posted December 29, 2008 I want it to contain whatever is in '/(get_username)/title.txt' and simply display it in the title, without it being anywhere else. Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725239 Share on other sites More sharing options...
Mchl Posted December 29, 2008 Share Posted December 29, 2008 Include is used to include additional PHP scripts within your code. To read from a text file, you want to look at the fread() function Or file_get_contents Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725240 Share on other sites More sharing options...
plznty Posted December 29, 2008 Author Share Posted December 29, 2008 Thanks guys, <3 resolved. Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725242 Share on other sites More sharing options...
redarrow Posted December 29, 2008 Share Posted December 29, 2008 Dam got beat lol try this. <?php // PC Index if ( $_GET['pc'] == index ) { $username = $_GET["username"]; $title = include("./$username/title.txt"); $title=file_get_contents($file); echo " <title>$title // Cant beat them? Join them..</title> <body link='black' alink='black' vlink='black' bgcolor='black'> <center> <img src='admin/images/clan/pclogo.gif' height='150' width='150'> <p><a href='?pc=home' target='main'><img src='admin/images/clan/home.gif'></a> <a href='?pcforum=1'><img src='admin/images/clan/joinus.gif'></a> <a href='?pc=members' target='main'><img src='admin/images/clan/members.gif'></a> <p><iframe src='?pc=home' name='main' height='50%' width='500' frameborder='no'></iframe>"; } ?> Link to comment https://forums.phpfreaks.com/topic/138676-solved-php-include-issues/#findComment-725243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.