Php Script Question, am I wrting this script correctly? |
||
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.
Zymic Webmaster Forums Web Design & Development Server Side Scripting PHP |
||
![]() |
Php Script Question, am I wrting this script correctly? |
||
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:) |
|
|
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? |
|
|
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.
|
|
|
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. |
|
|
Dec 14 2008, 05:59 AM
Post
#5
|
|
|
Member ![]() ![]() Group: Members Posts: 80 Joined: 18-October 08 From: Canada Member No.: 65,057 |
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 |
|
|
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
|
|
|
Dec 14 2008, 06:06 PM
Post
#7
|
|
|
Member ![]() ![]() Group: Members Posts: 80 Joined: 18-October 08 From: Canada Member No.: 65,057 |
|
|
|
![]() |
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 22nd May 2013 - 02:25 PM |