NameSilo

How can I secure my application?

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

Porte

VIP Member
Impact
145
Hello guys,

I am looking for help from the programming experts here (and I know they are a lot).

I'm in the process of coding an application with php & mysql databases..I've already planned for the code but I'm so scared because the application will send and receive very sensitive information (e.g. transactions) and I do not know (generally) how can I secure my php-based application and prevent hacking attempts into it?

Is it so difficult for me to secure my application and remove any backdoors in it?
And what is your advice..should I wait until I learn security in php? or is it something I can plug in the code during work?

I know the question sounds so general, so I'm asking only general solutions..or useful tutorials for this case.

(I have no access over server configuration..so I need solutions in the code itself and not in php.ini for example)

--
One more thing:
can something like SourceGuardian fully protect my php application?
---

Best Regards!
:wave:
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
0
Close
Very thankful for this, I've added to favorites and will read this guide soon!

Thanks.
 
0
Close
The link Jim_ posted is definitley a good read. What I'd concern myself with the most is SQL Injection and XSS. Maybe incorporate a similar function to this, this is what I've been using for a bit:
PHP:
<?php

function sanitize($value)
{
  $value = (!get_magic_quotes_gpc()) ? trim(addslashes(strip_tags($value))) : trim(strip_tags($value));
  $search = array('@<script[^>]*?>.*?</script>@si',
                  '@<applet[^>]*?>.*?</applet>@si',
                  '@<object[^>]*?>.*?</object>@si',
                  '@<iframe[^>]*?>.*?</iframe>@si',
                  '@<style[^>]*?>.*?</style>@si',
                  '@<form[^>]*?>.*?</form>@si',
                  '@<[\/\!]*?[^<>]*?>@si',
                  '@([\r\n])[\s]+@',
                  '@&(amp|#38);@i',
                  '@&(lt|#60);@i',
                  '@&(gt|#62);@i'
                 );
  $replace = array('','','','','','','','','','','');
  $value = preg_replace($search, $replace, $value);
  return $value;
}

?>

Hope that helps :)
 
1
Close
Wow, thanks 2v. I'm going to use that now :)
 
0
Close
Thanks V2!
:)
 
0
Close
thanks a lot SV, always been too lazy to make one of those. :) gonna give you some rep.
 
0
Close
No prob, glad to help ;)
 
0
Close
Could you explain some parts of the code please?

What does "@si" do?
What is the point of putting "@" a the beginning of every string?

Thanks 2v! :)
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back