473,800 Members | 2,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variables initialized - does register_global s on matter?

I have been unsuccessful turning register_global s off. I've tried
several ideas. I'm thinking it may not be possible with my hosting
company. If I initialize all variables, using $_POST, does that make
my script relatively secure?

Thanks,

Peter

Oct 12 '05 #1
2 1464
peter wrote:
I have been unsuccessful turning register_global s off. I've tried
several ideas. I'm thinking it may not be possible with my hosting
company. If I initialize all variables, using $_POST, does that make
my script relatively secure?


Depends. If variable initializations can be bypassed, then you'll have
problem. For example, say you're initializing a bunch of global
variables in config.php. The file is included in index.php, which,
incidently, includes other files:

<?

include("config .php");

switch($_GET['page']) {
case 'forum':
include("forum. php");
break;
case 'about':
include("about. php");
break;
}

?>

If forum.php or about.php is accessed directly, then the configuration
variables wouldn't get initialized.

Oct 12 '05 #2
Oh, I see what you mean. Thanks, Chung!

Oct 12 '05 #3

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

Similar topics

21
2384
by: Thomas Mlynarczyk | last post by:
Hello, My provider has set register_globals = On and I can't change the php.ini file. Is there a way to unset all the imported get/post etc. variables at the beginning of my script? Thomas
6
1959
by: Dave | last post by:
Hi folks, I seem to be using these newsgroups a good bit and probabely will be for the next three or so months. I wonder if there is a workaround to a problem I'm having. PHP always says that variables are undefined for the first time I visit a page. I have register_globals on and on the second visit a page when a certain post variable 'has' a value and been defined. Here's a bit of code I'm working with now.
22
6730
by: steve | last post by:
i've setup a include page that's responsible for building the basic layout of my web pages (header, menus, etc.). each page includes this "sysheader.php". the first page i've built with this header is having odd results. its job is to add users to the system. the variables i expect to be there are: id, userName, password...stuff like that. after the require_once "sysheader.php", i've put an "exit;" statement. the header shows perfectly....
7
2040
by: Nicole | last post by:
Hi I'm trying to use a function to set a session variable. I have three files: The first file has: <?php session_start(); // This connects to the existing session ?> <html> <head>
9
2505
by: vp | last post by:
Can I safely assume that all static variables are initialized as NULL or zero, depending on the types of the variables, no matter on which platform that app is compiled ? Thanks for your help, DT
28
4647
by: Dennis | last post by:
I have a function which is called from a loop many times. In that function, I use three variables as counters and for other purposes. I can either use DIM for declaring the variables or Static. Would the performance be better using Static versus Dynamic. I would think it would be quicker with STATIC declarations since the variables would only have to be created once. Can anyone confirm this. Thanks. -- Dennis in Houston
27
2818
by: Madhav | last post by:
Hi all, I did not understand why do the global vars are initialized to NULL where as the block level variables have random values? I know that the C standard requires this as was mentioned in a recent thread. I want to know why this descrimination is in place. Can't all the variables be initialised to NULL automatically by the compiler? This would make programming a little easier.
5
2125
by: WhatsPHP | last post by:
Hi For some reason, at random posts, the post variables don't get thru to the server. For example, if there is are two text fields: name and email... (I have register_globals on)... When I try to update the database with a query and use $name, $email, the $name is missing or the $email is missing. I am building an intranet application and all the 20 or so clients run IE. This happens very rarely. Something like once in 100 updates.
1
29387
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have called it polluting the global namespace. This article explores what happens when the global namespace becomes polluted and how to avoid this condition. The opinions expressed in this article are those of the author alone although many have...
0
9690
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
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10273
jinu1996
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...
1
10250
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
9085
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
7574
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
6811
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
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2944
bsmnconsultancy
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...

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.