Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 614 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP Help

Thread title: PHP Help
Closed Thread  
Page 2 of 3 < 1 2 3 >
    Thread tools Search this thread Display Modes  
11-21-2005, 10:42 PM
#11
Aros is offline Aros
Aros's Avatar
Status: Lurker
Join date: Jul 2004
Location: the Netherlands
Expertise:
Software:
 
Posts: 1,074
iTrader: 2 / 100%
 

Aros is on a distinguished road

  Old

I would use the method sketchie posted;

PHP Code:
if (isset($_GET['id']))
{
    switch (
$_GET['id'])
    {
        case 
"about":
            include(
"about.php");
            break;
        case 
"contact":
            include(
"contact.php");
            break;
        default:
            include(
"main.php");
    }

11-21-2005, 10:43 PM
#12
RossJJ is offline RossJJ
Status: RJ
Join date: Dec 2004
Location: Essex
Expertise:
Software:
 
Posts: 1,116
iTrader: 1 / 100%
 

RossJJ is on a distinguished road

Send a message via AIM to RossJJ Send a message via MSN to RossJJ

  Old

It worked better but this comes up

Warning: main(.php): failed to open stream: No such file or directory in /home/linuxin/public_html/selven/msn/index.php on line 101
This is line 101:
PHP Code:
<? include($section ".php"); ?>
Edit: aros, I would I just dont understand how to use that one

11-21-2005, 10:50 PM
#13
Aros is offline Aros
Aros's Avatar
Status: Lurker
Join date: Jul 2004
Location: the Netherlands
Expertise:
Software:
 
Posts: 1,074
iTrader: 2 / 100%
 

Aros is on a distinguished road

  Old

Originally Posted by Blaze
It worked better but this comes up


This is line 101:
PHP Code:
<? include($section ".php"); ?>
Edit: aros, I would I just dont understand how to use that one
Every bit of piece;
PHP Code:
        case "contact"
            include(
"contact.php"); 
            break; 
Stands for including a certain file, for example you want to include the file "funny";
PHP Code:
        case "funny"
            include(
"funny.php"); 
            break; 
Ofcourse all of that within the piece of code I and sketchie posted earlier.

11-21-2005, 10:54 PM
#14
jared is offline jared
jared's Avatar
Status: Member
Join date: Sep 2005
Location: Victoria, TX
Expertise:
Software:
 
Posts: 172
iTrader: 0 / 0%
 

jared is on a distinguished road

Send a message via AIM to jared Send a message via Skype™ to jared

  Old

Blaze, if you want to use the method Aros and sketchie decribed do this

where you want your page to be included put
PHP Code:
<?
if (isset($_GET['section']))
{
    switch (
$_GET['section'])
    {
        case 
"car":
            include(
"car.php");
            break;
        default:
            include(
"main.php");
    }
}
?>
you should be able to keep the link the same

11-21-2005, 10:57 PM
#15
Aros is offline Aros
Aros's Avatar
Status: Lurker
Join date: Jul 2004
Location: the Netherlands
Expertise:
Software:
 
Posts: 1,074
iTrader: 2 / 100%
 

Aros is on a distinguished road

  Old

Originally Posted by Blaze
It worked better but this comes up


This is line 101:
PHP Code:
<? include($section ".php"); ?>
Edit: aros, I would I just dont understand how to use that one
Also... didn't want to do this: http://selven.linuxinit.net/msn/?sec...arcadev2/index

If someone would knew how this arcade system was put together, they could possibly damage it.

11-21-2005, 11:03 PM
#16
RossJJ is offline RossJJ
Status: RJ
Join date: Dec 2004
Location: Essex
Expertise:
Software:
 
Posts: 1,116
iTrader: 1 / 100%
 

RossJJ is on a distinguished road

Send a message via AIM to RossJJ Send a message via MSN to RossJJ

  Old

aros sketchies way works, just when I click the link it stays the same

11-21-2005, 11:07 PM
#17
jared is offline jared
jared's Avatar
Status: Member
Join date: Sep 2005
Location: Victoria, TX
Expertise:
Software:
 
Posts: 172
iTrader: 0 / 0%
 

jared is on a distinguished road

Send a message via AIM to jared Send a message via Skype™ to jared

  Old

post your code so we can see what is going. It is hard to troubleshoot with a blindfold on :P.

you do have a car.php that has some content in the same directory right? ^_^

11-21-2005, 11:09 PM
#18
RossJJ is offline RossJJ
Status: RJ
Join date: Dec 2004
Location: Essex
Expertise:
Software:
 
Posts: 1,116
iTrader: 1 / 100%
 

RossJJ is on a distinguished road

Send a message via AIM to RossJJ Send a message via MSN to RossJJ

  Old

Code:
<HTML>
<HEAD>
<TITLE>MSN Emotions</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #6693CC;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;}
.style3 {color: #A3D02D; font-family: Arial, Helvetica, sans-serif; font-size: 10px;}
body {
	background-color: #A4ABAB;
	background-image: url(images/BG.jpg);
}
-->
</style>
</HEAD>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<TABLE WIDTH=900 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD COLSPAN=9><IMG SRC="images/index_01.gif" WIDTH=900 HEIGHT=24 ALT=""></TD>
  </TR>
  <TR>
    <TD ROWSPAN=8><IMG SRC="images/index_02.gif" WIDTH=83 HEIGHT=781 ALT=""></TD>
    <TD COLSPAN=2 ROWSPAN=2><IMG SRC="images/index_03.gif" WIDTH=222 HEIGHT=84 ALT=""></TD>
    <TD COLSPAN=6><IMG SRC="images/index_04.gif" WIDTH=595 HEIGHT=16 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=3 bgcolor="#FFFFFF"><script type="text/javascript"><!--
google_ad_client = "pub-0842204430602244";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "6693CC";
google_color_url = "A4D02E";
google_color_text = "A3D02F";
//--></script>
      <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
    </TD>
    <TD COLSPAN=3><IMG SRC="images/index_06.gif" WIDTH=127 HEIGHT=68 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=7><IMG SRC="images/index_07.gif" WIDTH=740 HEIGHT=26 ALT=""></TD>
    <TD ROWSPAN=6><IMG SRC="images/index_08.gif" WIDTH=77 HEIGHT=697 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=7><IMG SRC="images/index_09.gif" WIDTH=740 HEIGHT=12 ALT=""></TD>
  </TR>
  <TR>
    <TD ROWSPAN=2 background="images/index_10.gif">&nbsp;</TD>
    <TD COLSPAN=2 valign="top" background="images/index_11.gif"><p><img src="images/blue.jpg" width="219" height="23">
        <span class="style1"><a href="index.php?section=funny">3D STYLE DISPLAY PICTURES</a><br>
		ABSTRACT DISPLAY PICTURES<br>
		ANIMAL DISPLAY PICTURES <br>
		ART / PHOTOGRAPHY DISPLAY PICTURES <br>
		BABE DISPLAY PICTURES <br>
        CAR DISPLAY PICTURES <br>
		COMPUTER DISPLAY PICTURES
		CELEBRITY DISPLAY PICTURES <br>
		FUNNY DISPLAY PICTURES <br>
		GAMES DISPLAY PICTURES <br>
		MUSIC DISPLAY PICTURES <br>
		SCENERY DISPLAY PICTURES <br>
		SPACE DISPLAY PICTURES <br>
		SPORT DISPLAY PICTURES <br>
		OTHER DISPLAY PICTURES </span>
      <p><img src="images/blue2.jpg" width="219" height="23"> </TD>
    <TD><IMG SRC="images/index_12.gif" WIDTH=11 HEIGHT=623 ALT=""></TD>
    <TD COLSPAN=2 valign="top" background="images/index_13.gif"><p><img src="images/green.jpg" width="483" height="23"><br>
        <span class="style3">
        <script type="text/javascript"><!--
google_ad_client = "pub-0842204430602244";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "6693CC";
google_color_url = "A4D02E";
google_color_text = "A3D02F";
//--></script>
        <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
        </span>
      <p><img src="images/green2.jpg" width="483" height="23">
      <center>
<?
if (isset($_GET['section']))
{
    switch ($_GET['section'])
    {
        case "funny":
            include("funny.php");
            break;
        default:
            include("main.php");
    }
}
?> 

      </center>
      <p><img src="images/green.jpg" width="483" height="23"> </TD>
    <TD ROWSPAN=2><IMG SRC="images/index_14.gif" WIDTH=15 HEIGHT=628 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=5><IMG SRC="images/index_15.gif" WIDTH=713 HEIGHT=5 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=7><IMG SRC="images/index_16.gif" WIDTH=740 HEIGHT=26 ALT=""></TD>
  </TR>
  <TR>
    <TD COLSPAN=7><IMG SRC="images/index_17.gif" WIDTH=740 HEIGHT=5 ALT=""></TD>
  </TR>
  <TR>
    <TD><IMG SRC="images/spacer.gif" WIDTH=83 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=12 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=210 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=9 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=11 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=448 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=35 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=15 HEIGHT=1 ALT=""></TD>
    <TD><IMG SRC="images/spacer.gif" WIDTH=77 HEIGHT=1 ALT=""></TD>
  </TR>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>
No I have a page called funny.php with content

11-21-2005, 11:41 PM
#19
Vince4Heisman is offline Vince4Heisman
Status: Sin Binner
Join date: Nov 2005
Location:
Expertise:
Software:
 
Posts: 82
iTrader: 0 / 0%
 

Vince4Heisman is on a distinguished road

  Old

its safe if u use file_exists

<?
$page = $_GET['page'];
if(file_exists("$page.php")){
include"$page.php";
} else {
echo"The file is not on this webserver.";
}
?>

11-22-2005, 04:20 PM
#20
RossJJ is offline RossJJ
Status: RJ
Join date: Dec 2004
Location: Essex
Expertise:
Software:
 
Posts: 1,116
iTrader: 1 / 100%
 

RossJJ is on a distinguished road

Send a message via AIM to RossJJ Send a message via MSN to RossJJ

  Old

Hey like to say thanks to everyone, Ive got it working!

Closed Thread  
Page 2 of 3 < 1 2 3 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed