View previous topic :: View next topic |
Author |
Message |
olle -
Joined: 17 Apr 2004 Posts: 6
|
Posted: Thu Sep 16, 2004 4:25 am Post subject: register_globals On = a bad thing to do ?? |
|
|
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 |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Sep 16, 2004 5:36 am Post subject: |
|
|
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 |
|
 |
|