Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-04-2008, 03:13 AM Site issue...
Skilled Talker

Posts: 87
Location: New York
Trades: 0
A while ago I was using a page system where my main template had this code in the body of it.
PHP Code:
 <?php include("content.inc"); ?>
Which was set up to put specific html from another page into that one.

The "content.inc" file had code like this
PHP Code:
<?php 
if(!$content) include("includes/index.php");
if(
$content == about) include("includes/about.php");
?>
so if i clicked on a click a link with
HTML Code:
index.php?content=about
It would display the file from about.php within my index.php

I have tried to use this tonight and it is not working. Have I lost my mind? lol
NYChaoS is offline
Reply With Quote
View Public Profile Visit NYChaoS's homepage!
 
 
Register now for full access!
Old 03-04-2008, 07:11 AM Re: Site issue...
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
PHP Code:
if ($_GET['content'] == 'about') {
...

__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 03-05-2008, 12:27 AM Re: Site issue...
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
I'm guessing you've upgraded your PHP to 5 where that type of thing has been disabled.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 03-05-2008, 12:50 AM Re: Site issue...
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Which type of thing, Arenlor?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 03-05-2008, 01:03 AM Re: Site issue...
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
I think they're called globals, you have to declare a variable now, before you could do it the way he was and it'd look in al $_REQUEST variables to try to find it.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 04-08-2008, 07:03 PM Re: Site issue...
Skilled Talker

Posts: 87
Location: New York
Trades: 0
yeah i am still confused on this if anyone can help further
NYChaoS is offline
Reply With Quote
View Public Profile Visit NYChaoS's homepage!
 
Old 04-09-2008, 01:51 AM Re: Site issue...
Ultra Talker

Posts: 310
Trades: 0
Replace the code in content.inc with this :

Code:
<?php  
  if(array_key_exists('content', $_GET) && ($_GET['content'] = trim($_GET['content'])) != '' )
  {
    if($_GET['content'] == about) 
    {
      include("includes/about.php"); 
    }
  }
  else
  {
    include("includes/index.php"); 
  }
?>
dman_2007 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Site issue...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26371 seconds with 12 queries