Jump to content

Safe php coding


Gazan

Recommended Posts

Hey there.

 

Alright, i'm a PHP programmer who needs a lesson or two in programming SAFELY (so hackers can't injure). I've got loads of experience doing PHP scripts such as news system and all that.. But i never found out how to really code safely, so hackers can't get around my systems and such. Does anybody have links og anything to tutorials og walk-troughs that explains safe php coding, or can anybody give me some tips on how to code safely?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/142550-safe-php-coding/
Share on other sites

Sessions aren't the answer to everything. As much as you may think so, they aren't. ;)

 

You could use file_get_contents(), perform the search & add in values, then file_put_contents().

 

Search for $db_name, $db_user, $db_pass, $db_table etc...

If the values exist

-change the values to the ones you want to set.

Otherwise (if they messed with the file before hand)

-insert them in

 

Link to comment
https://forums.phpfreaks.com/topic/142550-safe-php-coding/#findComment-747333
Share on other sites

if ur making a config file, just make the first page of the install file -> the creation of the config file...

 

 

Page 1-> Enter Configuration into a form, submit....

Page 2-> Save Configuration silently using fopen/fwrite/fclose, then include() the file, install the script.

Link to comment
https://forums.phpfreaks.com/topic/142550-safe-php-coding/#findComment-747353
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.