Results 1 to 6 of 6
-
7th Jan 2012, 02:54 AM #1OPMemberWebsite's:
xwn2.com imagedy.com xwn2.infosimple variable php question
im trying to call for a variable for part of a link
include ('$themedir; /index.php');
this is not working
the variable is $themedir = '/theme/default';
and is located in a diffent .php that had been included beforezebono2 Reviewed by zebono2 on . simple variable php question im trying to call for a variable for part of a link include ('$themedir; /index.php'); this is not working the variable is $themedir = '/theme/default'; and is located in a diffent .php that had been included before Rating: 5
-
7th Jan 2012, 03:41 AM #2MemberWebsite's:
wiixps.com1. can't call variable inside include
2. for your work, I suggest you do
if (index){
$themedir = '/theme/default';
}else{
$themedir = ' '/theme/default2';
}
load $themedir
hope this will help you guy
-
7th Jan 2012, 04:06 AM #3Respected MemberWebsite's:
DL4Everything.com Soft2050.inWrong, you can use variables inside a include statement
----------------------------
PHP Code:include ('$themedir; /index.php');
PHP Code:include ("$themedir/index.php");
PHP Code:$themedir = '/theme/default';
use realpath() to check whether you are on the right directory or not
http://php.net/manual/en/function.realpath.php
-
7th Jan 2012, 11:51 AM #4MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comsoft2050 is right. just another note, if you get problems about the path, use
PHP Code:include (getcwd() . "/$themedir/index.php");
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
7th Jan 2012, 10:57 PM #5OPMemberWebsite's:
xwn2.com imagedy.com xwn2.infothanks guys i got it working by using
include ("$themedir/index.php");
-
8th Jan 2012, 12:33 AM #6MemberWebsite's:
epicimagehost.comI'm actually not a big fan of double quotes.
Personally I tend to always use single quotes when possible.
Here you have both methods:
PHP Code:<?php
include($themedir . '/index.php'); // Notice the dot
?>
<?php
include("$themedir/index.php");
?>
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
A simple question
By lordofupload in forum File Host DiscussionReplies: 6Last Post: 29th Nov 2011, 04:15 AM -
A Simple Question
By lordofupload in forum Web Development AreaReplies: 3Last Post: 29th Nov 2011, 12:44 AM -
Simple Question ?
By CrOwN. in forum File Host DiscussionReplies: 6Last Post: 9th Nov 2011, 11:52 PM -
[Hiring] Need someone to answer a simple php question.
By daxzor in forum Completed TransactionsReplies: 5Last Post: 14th Jul 2011, 01:52 AM -
Simple VB question
By KaiTrac in forum Technical Help Desk SupportReplies: 1Last Post: 1st Dec 2008, 04:26 PM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...