It looks like you're new here. If you want to get involved, click one of these buttons!
<HTML>
<HEAD></HEAD>
<BODY>
<?php
if (
$_POST['uname'] == "test123" ||
$_POST['uname'] == "someUser" ||
$_POST['uname'] == "otherUser"
)
{
$myfile = fopen("Story.html", "r") or die("Unable to open file!");
echo fread($myfile,filesize("Story.html"));
fclose($myfile);
}
else{
?>
<form action="index.php" method="post"> P: <input type="text" name="uname" />
<input type="submit" />
</form>
<?php
}
?>
</BODY>
</HTML>
Paste that into a new file called index.php and you are all set.
Comments
i hope there's no issue about this, this will be awesome 8) good job
HTML, CSS and Javascript are interpreter based languages so if the browser has access to the source of your story then the user has access to the source of your story, it is that simple.
note: I edited the above line because I realized that I implied that this problem has a solution and it doesn't.
There are many tricks you can use to make it harder for someone to access the source code but all they do is increase the effort that someone needs to go through to get the source. They also increase the effort the developer needs to go to to create their product but more importantly they increase the risk of the application not working correctly for the paying customer.
You have me curious about the other part though. When I look at the source code, that's ALL I SEE (the thing I pasted in).
Do you see more of it?
This pane contains the HTML elements currently being displayed, place your mouse cursor over the line near the top that starts with <html then use the right mouse button to show a context menu. If you select the Edit as HTML option you will have access to the HTML of the current page which you can cut-n-paste into a file.
note: This is only one of the ways to get access to the source.
[quote]When you say MAY work... for the view-source option, is that because some browsers will view source differently than another
yes.
p.s. I edited my previous post to remove a part that implied that there is a solution to this issue.
If you make your creation available to your potential customers at a reasonable price (for the content they are getting) and use payment methods that are accessible to them then the average customer will pay for it.