473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

incude in while-switch-loop

I have a system used for multiple sites.
Most functions are standard, but some sites have some extra functions.
I want the extra functions in a file by itself, so the files containing the
standard functions can be the same in all sites.

I tried
while (..) {
switch ($op)
case "std1":
...
break
case "std2":
...
break
@include "custom_functions.php";
default:
....
break;
}

custom_functions.php:
<?
case "custom1":
...
break;
?>
But custom_functions.php are never included.
It appears that the include takes place at run-time. Is there some way to
include at compile-time?
Or other neat way to accomplish what I want: To have custom bits in separate
file.

Leif
Jul 17 '05 #1
2 1672
"Leif Neland" <le***@neland.dk> wrote in message
news:40*********************@dread11.news.tele.dk. ..
I have a system used for multiple sites.
Most functions are standard, but some sites have some extra functions.
I want the extra functions in a file by itself, so the files containing the standard functions can be the same in all sites.

I tried
while (..) {
switch ($op)
case "std1":
...
break
case "std2":
...
break
@include "custom_functions.php";
default:
....
break;
}

custom_functions.php:
<?
case "custom1":
...
break;
?>
But custom_functions.php are never included.
It appears that the include takes place at run-time. Is there some way to
include at compile-time?
Or other neat way to accomplish what I want: To have custom bits in separate file.


Nope, can't be done.
Jul 17 '05 #2
"Leif Neland" <le***@neland.dk> wrote in message
news:40*********************@dread11.news.tele.dk. ..
I have a system used for multiple sites.
Most functions are standard, but some sites have some extra functions.
I want the extra functions in a file by itself, so the files containing the standard functions can be the same in all sites.

I tried
while (..) {
switch ($op)
case "std1":
...
break
case "std2":
...
break
@include "custom_functions.php";
default:
?>
But custom_functions.php are never included.


That's because the include statement is in a position where it will never be
called.

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dariusz | last post by:
I have a database where I use the while() command to iterate through each row and their resultant arrays to populate a table as the while() command is executed. I would like to have in the...
4
by: James E Koehler | last post by:
I can't get the WHILE statement to work in MySQL. The version of MySQL that I am using is: Ver 12.16 Distrib 4.0.6-gamma, for Win95/Win98 (i32) running on Windows MX. Here is the relevant...
27
by: Yan | last post by:
A lot of times when reading open software, i come across macros that are defined as follows: #define CALL_FUNCS(x) \ do { \ func1(x); \ func2(x); \ func3(x); \ } while (0);
36
by: invni | last post by:
I have a nested while. How do I go from the inner while to the beginning of the outer while? Can this be done without using goto? while_1() { some codes here while_2() { if true go to the...
147
by: Michael B Allen | last post by:
Should there be any preference between the following logically equivalent statements? while (1) { vs. for ( ;; ) { I suspect the answer is "no" but I'd like to know what the consensus is
12
by: Howard | last post by:
Hello everyone (total VB.NET beginner here), I'm reading the "SAMS Teach Yourself VB.NET In 21 Days" book, and came across an exercise that I can't get to work. The exercise asks that you create...
2
by: Carl Cerecke | last post by:
Well, it doesn't quite rule them all, but it is fast: About three times faster than using one function per state. Faster than using generators. Faster than using code objects. Some, possibly...
14
by: Aleramo | last post by:
I don't understand the reason cos this cycle: do { printf ("\nCome devono essere posizionati gli elementi?\n") ; printf ("* premere E, nel caso di posizionamento sul piano E\n") ; printf...
13
by: Scorpio | last post by:
hi, I'm trying to run a bubble-sort. But the while() in main doesn't work. Can somebody tell me why? thanks a lot~~~ here is the code #include <stdio.h> #include <stdlib.h> #include <time.h>...
2
by: kya2 | last post by:
I am not able to create following store procedure. CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT ) RESULT SETS 1 LANGUAGE SQL BEGIN part1 DECLARE TOTAL_LEFT INT DEFAULT 0; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.