Advertisement

09.06.2008 at 02:14AM PDT, ID: 23708475
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

Including files and what file they execute against

Asked by Simon336697 in PHP Scripting Language

Hi nice people hope u are all well :>)
Guys hopefully an easy one.

------------
Scenario
------------

Page 1:
menu5_it_scripting_perl_variables_imageskb.php
        <?php include ("includes/specific_includes/images_pages/previewarea_and_carousel.php"); ?>

Page 2:
includes/specific_includes/images_pages/previewarea_and_carousel.php

<?php
$current_loaded_page = basename(__FILE__);                      
$get_correct_folder = explode('_',$current_loaded_page);      
$lose_first_element = array_shift($get_correct_folder);        
$get_correct_folder = implode('/',$get_correct_folder);        
$get_correct_folder = substr($get_correct_folder, 0, -4);      
echo "The value of \$get_correct_folder is: " . $get_correct_folder . "\n";
?>

---------------------
Problem i have:
---------------------
When i load up page1 (eg.menu5_it_scripting_perl_variables_imageskb.php), and see the value of:
echo "The value of \$get_correct_folder is: " . $get_correct_folder . "\n";
it returns the value for being run against page 2, when what I want is all that code ive pasted above to actually run against page 1.

I know I can just "include" directly into the page1 page (menu5_it_scripting_perl_variables_imageskb.php) this code, but that means i will have to do this for a lot of pages.

--------------
Question:
--------------
Is there any way to "include" a reference to a file with the code i have above into page1 (without having to directly place the code in this file), and have that file execute against page1?
Is this where I have to turn the above code into a function, and then call it from within page1?

Any help greatly appreciated.


Start Free Trial
 
Loading Advertisement...
 
[+][-]09.06.2008 at 02:34AM PDT, ID: 22406686

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 02:37AM PDT, ID: 22406687

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Sign Up Now!
Solution Provided By: ddrudik
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.06.2008 at 03:10AM PDT, ID: 22406736

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 08:09AM PDT, ID: 22407779

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2008 at 04:18PM PDT, ID: 22409401

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628