473,805 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

php include problem

first. sory about bad english.

my index.php has link-menu in a right side, that opens something.php
next to the menu.

something.php has a link link-menu at the top of the page that should
open stuff.php under this last menu.

the broblem is that stuff.php opens to the place of something.php. so
the top link-menu disapears.

I think this is a conflict between index.php and something.php, but I
don t know how to fix it...


code in index.php:

<?php
$sivut = array('somethin g');

if (in_array($_GET['sivu'], $sivut)) {
include ($_GET['sivu'] . '.php');
}
else
{
include('error. php');
}
?>

<a href="index.php ?sivu=something ">something </a><br>


this works good....
code in something.php:

<?php
$sivut = array('stuff',' stuff2');

if (in_array($_GET['sivu'], $sivut)) {
include ($_GET['sivu'] . '.php');
}
else
{
include('error. php');
}
?>

<a href="index.php ?sivu=stuff">st uff</a>
<a href="index.php ?sivu=stuff2">s tuff2</a>
so is it about these $sivut or['sivu'] codes. I tried to change those
but didn t help.

and how to define what page opens first?
whitout klickings....
should be something like this:

if ($sivu ==""){
$sivu = "firstpage" ;

how do I put it there
thanks

Aug 16 '07
13 2303
well one more thing.
how to define what page opens first?
whitout klickings....
should be something like this:

if ($sivu ==""){
$sivu = "firstpage" ;

how do I put it there

....because now when I go to my http://example.com/index.php
the error.php opens next to the right link-menu.

Aug 17 '07 #11
Rik
On Fri, 17 Aug 2007 14:22:30 +0200, Heikki <he********@gma il.comwrote:
well one more thing.
how to define what page opens first?
whitout klickings....
should be something like this:

if ($sivu ==""){
$sivu = "firstpage" ;

how do I put it there

...because now when I go to my http://example.com/index.php
the error.php opens next to the right link-menu.

$sivu = (isset($_GET['sivu']) && !empty($_GET['sivu'])) ? $_GET['sivu'] :
'firstpage';
$sivut = array('somethin g');
if (in_array($ivu, $sivut)) include ($sivu.'.php');

--
Rik Wasmus
Aug 17 '07 #12
Rik
On Fri, 17 Aug 2007 14:28:53 +0200, Rik <lu************ @hotmail.comwro te:
if (in_array($ivu, $sivut)) include ($sivu.'.php');
if (in_array($sivu , $sivut)) include ($sivu.'.php');
--
Rik Wasmus
Aug 17 '07 #13
On 17 elo, 15:29, Rik <luiheidsgoe... @hotmail.comwro te:
On Fri, 17 Aug 2007 14:28:53 +0200, Rik <luiheidsgoe... @hotmail.comwro te:
if (in_array($ivu, $sivut)) include ($sivu.'.php');

if (in_array($sivu , $sivut)) include ($sivu.'.php');

--
Rik Wasmus
thanks wery much!
works!

Aug 17 '07 #14

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

Similar topics

11
3000
by: Yannick Turgeon | last post by:
Oups! I did a typing error in my last post. Fixed. ----------- Hello all, We are currently changing our web server and, in the process, updating PHP version from 4.3.0 to 4.3.5. The problem we've got is that our way to include some files in other ones is no more working properly. The message we are getting looks like: "PHP Warning: main(..\db.inc.php): failed to open stream: No such file or directory in ..."
43
5134
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is relative NOT to the immediate script that is including it, but is relative to the top-level calling script. In practice, this means that you have to constantly worry and adjust paths in includes, based on the startup scripts that call these...
6
7068
by: alan | last post by:
Dear all, I have written my own function by C. And my development platform is W2k with VC6.0. Then I also defined a header file to extern declare this function. After that, I include this header file. The function is stored in C:\temp\myfun.c int func(){ return 1;
6
9582
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and i have also other functions defined in that file, i can use the global in all functions, but once i split up the rest of the function in other files, i cannot use the global? Isn't that strange, all the files compiled should be treated as one...
60
8326
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header associated with this source file For example, in a file hello.c: #include <stdio.h>
5
2513
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to very carefully define the order in which paths are searched with command line options on the compiler. Both can cause problems, especially when dealing with complex software distributions. It occurs ot me that by extending the C include...
0
1213
by: Francois | last post by:
Hi, I think I found a bug with VS, and I've included a project example of the problem I got. I've got a project deep into a set of folders. The project have an additional include library directory which is pretty long and expressed relative to the project (with ..\..\ and directory names).
3
2713
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include directories contain a file named "cppfile1.h". In my main project I #include "cppfile1.h". I rely on the order of paths in additional include directories list to get file cppfile1.h from ProjectA and
6
2129
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file = ...\includes\StaffingHeaders.inc -->" </Script> <%=ClientName%> ****************************************************************************
5
2226
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h" #include "dialog2.h"
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.