473,322 Members | 1,522 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,322 software developers and data experts.

How to enable register_globals on a host that has disabled it.

117 100+
OMG, my users cant login now since 5 days ago my free host turned off Register Globals and when i try to turn it on it says "server misconfiguration"

How can i fix this.....
Sep 20 '07 #1
8 2904
Atli
5,058 Expert 4TB
Hi.

I would recommend re-writing the code that requires register_globals to be enabled. It is a security risk, which is most likely the reason it was disabled on your server, and having your code depend upon it is very very bad!

If, however, you are willing to risk it, check out the extract() function, which can be used to extract the super-globals at runtime, much like the register_globals property does.
Sep 20 '07 #2
Atli
5,058 Expert 4TB
I've edited the title of this thread to make it a little clearer.
Please avoid using words like 'help' in your thread titles, as they make it less appealing to the Experts, as well as our other members.

Check out the What makes a Good Thread Title part of the Posting Guidelines for tips on how to make good thread titles.

Moderator
Sep 20 '07 #3
Breana
117 100+
I would recommend re-writing the code that requires register_globals to be enabled. It is a security risk, which is most likely the reason it was disabled on your server, and having your code depend upon it is very very bad!
How do i re-rite it? Or where do i start the register globals requirement was in the code before i started...

[PHP]<?php
session_start();
$login = $_REQUEST['login'];
$password = $_REQUEST['password'];
$sql = "select * from users where login = '$login' and password = '" . sha1($password) . "'";
$result = mysql_query($sql ,$db);

if ($myrow = mysql_fetch_array($result)) {

do {

$uid = $myrow["userid"];
$uname = $myrow["login"];

} while ($myrow = mysql_fetch_array($result));

$loggedin = true;
$upwd = $password;
$msg = "<p align='center'><font size='2' face='Arial'><br />
<b>Welcome back</b>, You will be redirected in <font color='#FF0000'>3</font> seconds!<br />
<br />
<img src='images/ajax_loading.gif' alt='Loading' width='32' height='32' /><br />
<br />
Or <a href='index.php'>Click here</a> if you don't want to wait!</font></p>";
session_register("loggedin");
session_register("upwd");
session_register("uid");
session_register("uname");

} else {
$loggedin = false;
$upwd = "";
$uid = "";
$uname = "";
$msg = "<img src='images/invalid.gif' width='402' height='107' /><br /><b><font color='#FF0000'>Sorry,</font></b> that ID or Password is not valid.<br /><br /><br />If you have forgotten your password <a href='forgot.php'>Reset Password</a>. <br />If you are a new user you will need to <a href='newuser.php'>Create A New Account!</a>";


}

session_register("loggedin");
session_register("upwd");
session_register("uid");
session_register("uname");

?>[/PHP]

What do i need to change?
Sep 20 '07 #4
Breana
117 100+
* Bump Topic Anyone....
Sep 20 '07 #5
what about using .htaccess to reactivate them again?
Sep 20 '07 #6
Breana
117 100+
No i tried it, "Internal Server Error"

Plus he said it is bad so i guess i need to make it better :)
Sep 20 '07 #7
mwasif
802 Expert 512MB
Use the following code in .htaccess
Expand|Select|Wrap|Line Numbers
  1. php_flag register_globals on
Sep 20 '07 #8
Breana
117 100+
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [removed] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Sep 21 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: toufik toufik | last post by:
Hi, In the setting of my host, the variable register_globals is set to On, I like to set it to Off in my solution, is it possible? I've tried in my code: ini_set("register_globals","0"); but it...
10
by: John | last post by:
Hello. I am a newbie to PHP. I am over halfway through my first book that I'm learning with and have just created login pages etc. I just wondered, if I am running php/mysql/apache locally,...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
6
by: wonder | last post by:
Hi, The CRM application said that need to add an option "REGISTER_GLOBALS=On" to the php.ini file, so I did what it told. But I still can't get rid off the following error: The PHP variable...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
4
by: yodertony | last post by:
Hi, bona-fide php newbie here. I have a very cheap php-enabled linux hosting account. Unfortunately, this host does not have some extensions enabled which I need, namely, the dom-xml and xslt...
12
by: Dave | last post by:
In PHP 4.4, what is the most secure server configuration while keeping REGISTER_GLOBALS on?
6
by: Anshul | last post by:
I want to check through perl whether javascript is enabled or disabled in mozilla browser. If it is disabled I want to display a message to user to enable it. What code can I use please help. I...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.