Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentServer Side ScriptingPHP right
  Closed Topic Start new topic
left right
vampirelovr
post Dec 13 2008, 04:51 AM
Post #1


Member
**

Group: Members
Posts: 80
Joined: 18-October 08
From: Canada
Member No.: 65,057



hello. I will make up a script that is similar to the one I am using for my example.

question: am I writing this script right? what I want to do is use a file that is 2 folders in (from the parent folder) and use that file.

require_once mysite_ROOT.'images/'.sitetemplate.'/header.php';

if no please write that correctly it would be greatly appreciated.

@Trippin7464

Sorry about my mistake. I forgot to ask the question:)
Go to the top of the page 
 
  + Quote Post
Andrew
post Dec 13 2008, 05:45 AM
Post #2


Hosting Abuse Staff
*******

Group: Moderators
Posts: 2,933
Joined: 14-February 08
From: Fort Myers FL, USA
Member No.: 10,089



Can you rephrase the question, and to be honest I don't see how that would do anything, but I can't rewrite it without knowing what your doing.

is '.sitetemplate.' supposed to be a variable?
Go to the top of the page 
 
  + Quote Post
Alex
post Dec 13 2008, 12:34 PM
Post #3


zIRC Network Admin
*******

Group: Administrators
Posts: 660
Joined: 10-March 07
From: Swindon, Wilts, UK
Member No.: 6



Provided that "mysite_ROOT" and and "sitetemplate" are both constants which have been defined to generate a valid path to the file you want, yes. You can check if this is the case by switching the require_once into an echo to see what path is being generated.
Go to the top of the page 
 
  + Quote Post
Andrew
post Dec 14 2008, 03:17 AM
Post #4


Hosting Abuse Staff
*******

Group: Moderators
Posts: 2,933
Joined: 14-February 08
From: Fort Myers FL, USA
Member No.: 10,089



Considering your rewrite of the question, why not go for simple:
require_once './folder/folder/file.php'

or as alex has said sitetemplate would work if it's been set as a constant.
if not, you would want to use $sitetemplate

Depends on if you wrote the script yourself, or if you are writing something to be added on to a script someone else wrote.
Go to the top of the page 
 
  + Quote Post
vampirelovr
post Dec 14 2008, 05:59 AM
Post #5


Member
**

Group: Members
Posts: 80
Joined: 18-October 08
From: Canada
Member No.: 65,057



QUOTE(Trippin7464 @ Dec 13 2008, 10:17 PM) *
Considering your rewrite of the question, why not go for simple:
require_once './folder/folder/file.php'

or as alex has said sitetemplate would work if it's been set as a constant.
if not, you would want to use $sitetemplate

Depends on if you wrote the script yourself, or if you are writing something to be added on to a script someone else wrote.


I am editing a script for my friend and that wasn't working correctly so I wanted to see if it was right or not but I will just us e the simple way you suggested trippn.

thanks for all the help
Go to the top of the page 
 
  + Quote Post
Andrew
post Dec 14 2008, 06:21 AM
Post #6


Hosting Abuse Staff
*******

Group: Moderators
Posts: 2,933
Joined: 14-February 08
From: Fort Myers FL, USA
Member No.: 10,089



If you post the script, or a link to download and what file your editing, i'm sure someone here can figure it out
Go to the top of the page 
 
  + Quote Post
vampirelovr
post Dec 14 2008, 06:06 PM
Post #7


Member
**

Group: Members
Posts: 80
Joined: 18-October 08
From: Canada
Member No.: 65,057



QUOTE(Trippin7464 @ Dec 14 2008, 01:21 AM) *
If you post the script, or a link to download and what file your editing, i'm sure someone here can figure it out


well as you said in your 2nd post to just go simple it works and I will just stick with that. thanks so much trippin.
Go to the top of the page 
 
  + Quote Post
 Closed Topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 21st May 2013 - 06:38 AM