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
Share on other sites

Alright, thanks for that :)

 

Also got another question.. If you wan't to create a CMS with an install file. How do you insert the input from the person who's going to set it up as the main mysql_connect details? you store the information in, what?

Link to comment
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.