Jump to content

[SOLVED] PHP Include issues.


plznty

Recommended Posts

<?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

<?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. :)

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>";
     }
     ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.