Special requirement: password input BEFORE posting

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Chrysanthemum
Posts: 5
Joined: Tue Jul 29, 2008 12:06 pm

Special requirement: password input BEFORE posting

Post by Chrysanthemum »

Script URL:
Version of script: 1.6 modified 14 February 2008
Hosting company: NetBenefit
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: looked on this forum.

Write your message below:

My client has bought a licence for GBook :-) (If you wish to check, Klemen, see exchange of e-mails on 10 August with "Rachel".)

It works fine but, as this is located in part of the client's rebuilt web site and still in the development area, I can't give the URL here.

My client wishes to use the script as a way of having a page to which only an officer of the organisation (the Secretary) can post announcements, eg excerpts from press releases from a member of the organisation.

I'd be grateful if someone could tell me how to cut-and-paste the bit of the script that asks for the password into that part of the script where the messages are composed. Ie so that one has to put in the password before posting as well as before deleting or editing a post.

I think this would be the simplest way of doing it. It would be more elegant if I could put the message composition - ie from

<a href="gbook.php?a=sign">'.$lang['t48'].'</a>

into a separate web page without breaking anything, as well as having the password input required to post a message, but I am not confident of being able to do that successfully.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Well, you could simply delete the <a href="gbook.php?a=sign">'.$lang['t48'].'</a> links and tell your secretary to bookmark (or access) gbook with ?a=sign to get to the sign page, then add something like this for the password:

to the signup form (function printSign from line 818):

Code: Select all

<tr>
<td><b>Password</b></td>
<td><input type="password" name="pass" size="30" /></td>
</tr>
and add a check for password before posting, something like this to line 79, just below

Code: Select all

} elseif($a=='add') {
add

Code: Select all

$pass=gbook_input($_POST['pass'],$lang['e09']);
if ($pass != $settings[apass]) {problem($lang['e16']);} 
Haven't tested anything though so make sure you BACKUP your old files before testing this :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Chrysanthemum
Posts: 5
Joined: Tue Jul 29, 2008 12:06 pm

Post by Chrysanthemum »

Klemen wrote:Well, you could simply ...

Haven't tested anything though so make sure you BACKUP your old files before testing this :wink:
Thank you, Klemen, I have done that, and it works perfectly.

I am very grateful to you for your trouble.
Post Reply