I have been programming in PHP with globals enabled since around 2005. I have started to develop on a more professional scale now, and with security at stake, I need to make the change.
Trouble is, I haven't been able to find a tutorial that answers my questions regarding globals (or lack there of) and don't want to have to resort to modifying the php.ini files.
Consider the following:
<form method="post" action="testing.php">
This is the format I used to program in. The tutorials I have all read advised the new 'action' format is now "$_self" or something, and are not be linked to an external php file.
Does this mean that all scripts w/out globals enabled must be sent to the same page?
If this is not actually the case, and it is just a big coincidence, consider the following:
include 'phpconfig.php';
$db = mysql_connect("localhost", $theusername, $thepassword);
mysql_select_db($prefix . "_remixconfig",$db);
$sql="SELECT * FROM images";
$result=mysql_query($sql,$db);
while ($row = mysql_fetch_array($result))
{
$id = $row["id"];
$path = $row["path"];
echo"The file path is: $path. Click <a href=\"delete.php?id=$id\">here</a> to delete.";
}
This is the format showing how I'd usually handle mysql calls.
This code in particular is supposed to call the $row["id"] and $row["path"] feilds, and create a link to delete.php and carry the 'id' variable over.
I used to just be able to call '$id' on delete.php, how easy was that!? This no longer works.
Tutorials I have read, mainly using form posts as their examples, advise of using the function $_POST or $_GET (depending on what method one used) or $_REQUEST as a wild card in terms of type of data send method.
But what I can't seem to figure out is what one would use when following a link? My scripts keep bugging out.
Finaly, if I have the globals enabled in various folders on my webserver, will this new 'anti-global-variable' method of programming still work?
Thanks for your help!