Php or Html Files or both when writing a website?

Discuss the many weaknesses of browser security and ways to mitigate the threat

Php or Html Files or both when writing a website?

Post by Billh93 on Mon Dec 03, 2012 10:34 am
([msg=71500]see Php or Html Files or both when writing a website?[/msg])

I have a question when you want to make a social network or something of that norm. Will my site be less secure If I write every file in php as oppose to whole html files with php scripts included? I know writing everything in php makes everything much simpler but is it secure as html? Thanks.
Billh93
New User
New User
 
Posts: 15
Joined: Sun Nov 27, 2011 5:26 pm
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by 0phidian on Mon Dec 03, 2012 11:48 am
([msg=71501]see Re: Php or Html Files or both when writing a website?[/msg])

Billh93 wrote:I have a question when you want to make a social network or something of that norm. Will my site be less secure If I write every file in php as oppose to whole html files with php scripts included? I know writing everything in php makes everything much simpler but is it secure as html? Thanks.


If you were making a social networking site then you would have to use php or some kind of server side language and you would also want probably want to store user info in a database. Just HTML would be secure because there is nothing to exploit, however without php you cant really do anything but display info.

HTML code is usually included in the php file. For example index.php would look like this:
Code: Select all
<?php
        php code();
?>

<html>
      <head>
      </head>
      <body>
               <p>text stuff<p>
      </body>
</html>
User avatar
0phidian
Poster
Poster
 
Posts: 270
Joined: Sat Jun 16, 2012 7:04 pm
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by Billh93 on Mon Dec 03, 2012 3:33 pm
([msg=71506]see Re: Php or Html Files or both when writing a website?[/msg])

ahh okay thanks for the input! btw how do I mask the url for my php files. Example: www.site.com/?phpid=34242 into www.site.com/settings .
Billh93
New User
New User
 
Posts: 15
Joined: Sun Nov 27, 2011 5:26 pm
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by 0phidian on Mon Dec 03, 2012 4:45 pm
([msg=71510]see Re: Php or Html Files or both when writing a website?[/msg])

Billh93 wrote:ahh okay thanks for the input! btw how do I mask the url for my php files. Example: http://www.site.com/?phpid=34242 into http://www.site.com/settings .


You dont really, there is not any need to. "index.php" is the file that loads by default when going to a url like http://www.site.com/settings. "?phpid=34242" is a GET variable which are displayed in the url, if you wanted to hide the form data you would use a POST request. POST requested are used for things like username and password input. GET requests are fine for things like "?page=2", just make sure it's not vulnerable to injections.

When creating a secure site it is much more import that you have good code then just trying to hide everything. Dont rely on security through obscurity.
User avatar
0phidian
Poster
Poster
 
Posts: 270
Joined: Sat Jun 16, 2012 7:04 pm
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by limdis on Tue Dec 04, 2012 5:27 am
([msg=71523]see Re: Php or Html Files or both when writing a website?[/msg])

0phidian +1
"The quieter you become, the more you are able to hear..."
"Drink all the booze, hack all the things."
User avatar
limdis
Moderator
Moderator
 
Posts: 1358
Joined: Mon Jun 28, 2010 5:45 pm
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by caracarn001 on Tue Dec 04, 2012 7:33 pm
([msg=71534]see Re: Php or Html Files or both when writing a website?[/msg])

I think it's possible to loose the get-variables alltogether if you turn it into a RESTful site. I've only taken a quick look at it, so I can't be certain.

http://en.wikipedia.org/wiki/Representational_state_transfer

You'll have to plan everything out though.
User avatar
caracarn001
New User
New User
 
Posts: 42
Joined: Thu Nov 04, 2010 5:23 am
Blog: View Blog (0)


Re: Php or Html Files or both when writing a website?

Post by Billh93 on Wed Dec 05, 2012 1:14 pm
([msg=71550]see Re: Php or Html Files or both when writing a website?[/msg])

Oh okayy, thanks guys all of you have been really helpful!
Billh93
New User
New User
 
Posts: 15
Joined: Sun Nov 27, 2011 5:26 pm
Blog: View Blog (0)



Return to Web

Who is online

Users browsing this forum: No registered users and 0 guests