-
Sure.
It's pretty basic-- not much you can do to simplify if/else statements, unless there's another method (like switches).
But looking into those better string functions is a good idea.
If you're using an include, then should work well.
Good luck.
Are there any specific parts of the code you were wondering about?
-
Yes, there was one in particular. Lines 35 to 47. As stated in the //comment tags there I am not sure all that is needed, since the page that section goes on doesn't have a password input box. It needs to check the session, and load the include if there is no session. It then needs to show the HTML content (the last else{..)
But it only checks for the posted password, so I don't think it needs the array and the post ID sections (exactly lines 38 to 41 I think can just be deleted, but I am not sure).
Also, ALL the pages here that they go to are .html, and I have this part:
PHP Code:
header('Location: http://' . $_SERVER['HTTP_HOST'] . $p[$_POST['id']][1] . '?pass=' . $_POST['pass']);
on both parts, and I would like to NOT have the "?pass=password" in the URL as it is distracting. If I could get rid of that, that would be awesome!
-
Why don't you set a session variable of "pass" to "[password]"? That would eliminate any need for the link and make it more secure.
-
How would that effect the rest of it though? I guess I don't understand what you mean exactly.
-
The only point in sending "password" in the url is to get it to the next page, right? You can do this:
//first page, above header:
$_SESSION['pass'] = $passval;
//next page:
if isset($_SESSION['pass'])....
-
hmm Okay... I will think about that. Thanks!