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 13 2298
Heikki wrote:
first. sory about bad english.
me 2
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.
$sivut = array('somethin g');
if (in_array($_GET['sivu'], $sivut)) {
include ($_GET['sivu'] . '.php');
This is not a answer to your asked problem but a answer to a other Problem.
Can you give me the URL of youre Script? Why? Im bad! ;-) What you are
doing here is may good to easy hack youre site/server.
"Examine everything, trust nobody!"
Example:
If i call your script at follow:
?sivu=http://example.com/mybad-script
It will include an *run* my file http://example.com/mybad-script.php if
it is delived in text/plain with usable PHP-Code. So i can do everything.
So never do things like that!
Ulf
--
_,
_(_p Ulf [Kado] Kadner
\<_) Mitglied der Freizeitvögel? ;-)
^^
On Thu, 16 Aug 2007 17:48:15 +0200, Ulf Kadner <dr******@gmx.n etwrote:
Heikki wrote:
>first. sory about bad english.
me 2
I'm more annoyed at the multiposting then the bad english :P
>
>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.
$sivut = array('somethin g'); if (in_array($_GET['sivu'], $sivut)) { include ($_GET['sivu'] . '.php');
This is not a answer to your asked problem but a answer to a other
Problem.
Can you give me the URL of youre Script? Why? Im bad! ;-) What you are
doing here is may good to easy hack youre site/server.
"Examine everything, trust nobody!"
Example:
If i call your script at follow:
?sivu=http://example.com/mybad-script
It will include an *run* my file http://example.com/mybad-script.php if
it is delived in text/plain with usable PHP-Code. So i can do everything.
That's what his/hers? in_array() statement is for, it is actual filtering
on preapproved values, so the OP is OK.
There is something inherently wrong in how he is doing it/what he is
expecting, if I have the time I'll post a proposal later, busy now :)
--
Rik Wasmus
Rik wrote:
I'm more annoyed at the multiposting then the bad english :P
Multi Posting? Am I blind or which you mean? x-)
>>$sivut = array('somethin g'); if (in_array($_GET['sivu'], $sivut))
That's what his/hers? in_array() statement is for,
Really! Its better for me to go sleeping now :-[
Ulf
--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
On Thu, 16 Aug 2007 18:09:02 +0200, Ulf Kadner <dr******@gmx.n etwrote:
Rik wrote:
>I'm more annoyed at the multiposting then the bad english :P
Multi Posting? Am I blind or which you mean? x-)
The OP posted in several groups.
>>>$sivut = array('somethin g'); if (in_array($_GET['sivu'], $sivut))
That's what his/hers? in_array() statement is for,
Really! Its better for me to go sleeping now :-[
Hehe, one of those days... :P
--
Rik Wasmus
so my site is safe from hacking? or not?
does anybody have a solution for my broblem with the code?
Heikki wrote:
so my site is safe from hacking? or not?
Safe. Well, safe from the exploit mentioned anyway.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 57 days, 14:23.]
Elvis http://tobyinkster.co.uk/blog/2007/08/16/elvis/
Heikki wrote:
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.
Because $_GET['sivu'] can only ever take one value at a time, only one of
"something. php" or "stuff.php" can ever be included at once.
Try this in something.php:
<?php
$sivut2 = array('stuff',' stuff2');
if (in_array($_GET['sivu2'], $sivut2))
{
include ($_GET['sivu2'] . '.php');
}
else
{
include('error. php');
}
?>
<a href="index.php ?sivu=something &sivu2=stuf f">stuff</a>
<a href="index.php ?sivu=something &sivu2=stuf f2">stuff2</a>
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 57 days, 14:25.]
Elvis http://tobyinkster.co.uk/blog/2007/08/16/elvis/
....
....
<a href="index.php ?sivu=something &sivu2=stuf f">stuff</a>
<a href="index.php ?sivu=something &sivu2=stuf f2">stuff2</a>
that helped little
now the top link-menu does not disapear.
but the stuff and something pages opens "one on top of the other".
so the links in something and the text in stuff are in confusion.
ideas?
thanks Toby. works grate now This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 ..."
|
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...
|
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;
|
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...
|
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>
| |
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...
|
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).
|
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
|
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%>
****************************************************************************
|
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"
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |