1 Replies - 323 Views - Last Post: 24 September 2012 - 09:22 PM Rate Topic: -----

#1 adn258  Icon User is offline

  • D.I.C Addict

Reputation: 11
  • View blog
  • Posts: 762
  • Joined: 31-August 11

Can HTML Still Be Stolen Within This PHP?

Posted 24 September 2012 - 08:58 PM

So I frequently see and use the below idea myself to show or not show html code based on certain php conditions and variables etc. I'm assuming that NO CODE is executed is the boolean if else etc. isn't true or false depending on case is this correct? What am I talking about look below!

<?php
if ($bUser)
{
?>
<b>Great It's the User</b>
RANDOM HTML HERE

<?php 
}
else
{
?>
Other Random html to execute on else

<?php
}
?>



Let's say for the above example $bUser was false then technically there's no way so long as this is false that a random user could see the

<b>Great It's the User</b>
RANDOM HTML HERE



Part of the code right? Or that wrong? Is this unsafe? Details?

Is This A Good Question/Topic? 0
  • +

Replies To: Can HTML Still Be Stolen Within This PHP?

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2990
  • Posts: 10,329
  • Joined: 08-August 08

Re: Can HTML Still Be Stolen Within This PHP?

Posted 24 September 2012 - 09:22 PM

HTML is not processed by the server, it's only sent to the browser. If you don't see lines 5 - 7 in your browser when $bUser isn't true (and you shouldn't) then the interpreter hasn't sent it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1