register_globals On = a bad thing to do ??

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
olle
-


Joined: 17 Apr 2004
Posts: 6

PostPosted: Thu Sep 16, 2004 4:25 am    Post subject: register_globals On = a bad thing to do ?? Reply with quote

i also had problem with that Error 200 with my loginscript :S when i turned register_globals to On, everything did work as it should. Is it bad security when register_globals is On? Shall i keep it on, or can i do some changes in my script?

<?php
$anvandare ="thomas";
$losen ="holmstroem";

if(isset($skicka))
{
if ($anvandarnamn == $anvandare && $losenord == $losen) {
echo "You do have access now :D";
}
else
{
echo "Hmms, trying to hack? :P";
}
}
?>
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Sep 16, 2004 5:36 am    Post subject: Reply with quote

Yes , you can change the script , depending what you need to change , I
have provided some easy ways of doing this , I use this in my PHP code.

$_POST['variable_name']

This will be commonly used as the post method in a
form so make sure its set to post if you use this.

$_GET['variable_name']

This will be commonly used as the get method in a
form so make sure its set to get if you use this.

$_SERVER['env_variable']

This is commonly used when you want to use the built in PHP
Environment Variables so you can track someone's IP Address.

Ok from all the example's above , im going to show you the most easiest
way to add these to your code , this will set normal variables for you. Later!

$post = $_POST['post'];
$get = $_GET['get'];
$serv_env = $_SERVER['serv_env'];

Just place the variables that you changed to the top of your PHP script.

Example:
Code:

<?php
$variable = $_POST['variable'];
echo "Your name is $variable";
?>
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group