Couple of simple questions

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

Couple of simple questions

Post by AdRock »

First, how many guestbook entries are there before it puts them on to other pages (I need to fit it within a set page size)

Is there a way I can have the persons name and email address filled in automatically from a session that would have started previously? The user would have been logged in and it seems pointless and frustrating to have to enter that information when it is already stored ina database
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello AdRock,

The standard number of entries on one page is 10. There is a modification posted in the forums that let you change the number of posts on one page.

For your other question. I do not know enough php yet to answer this question. Perhaps Klemen can tell you.

Greetings,
Henrie
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Couple of simple questions

Post by Klemen »

AdRock wrote:Is there a way I can have the persons name and email address filled in automatically from a session that would have started previously? The user would have been logged in and it seems pointless and frustrating to have to enter that information when it is already stored ina database
Well if you have the name/email/etc... stored in a session you could edit the GBook form and add the values from session to the form, try changing and playing around with

Code: Select all

function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$error='') {
You can try for example

Code: Select all

function printSign($name=$_SESSION['name'], $from='', $email=$_SESSION['email'],$url='' , $comments='',$nosmileys='', $isprivate='', $error='') {
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
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

Post by AdRock »

I tried what you said about changing that line but I get this error message now

Parse error: syntax error, unexpected T_VARIABLE in /home/adrock/public_html/gbook/gbook.php on line 686
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Can you post that line (and few lines around it) here?
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
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

Post by AdRock »

Code: Select all

function printSign($name=$_SESSION['name'], $from='', $email=$_SESSION['email'],$url='' , $comments='',$nosmileys='', $isprivate='', $error='') {
global $settings;
$url=$url ? $url : 'http://';
?>
<h3 align="center">Sign guestbook</h3>
<p>Required fields are <b>bold</b>.</p>
<form action="gbook.php" method="POST" name="form">
<input type="hidden" name="a" value="add">
<table class="entries" cellspacing="0" cellpadding="4" border="0">
<tr>
<td>
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Ah, that won't work, forgot you can't assign variable sot variables in function call.

You will have to edit the form itself, for example change the

Code: Select all

value="<?php echo $name; ?>"
to

Code: Select all

value="<?php echo $name ? $name : $_SESSION['name']; ?>
DON'T just use $_SESSION['name'] , use whatever variable your sessions use to store the name.

You do know what variables your session uses, don't you?
If YES: then you shouldn't have problems setting it up from here on :wink:
if NO: sorry, can't help you then, I'm not hear to study other's scripts and teach anyone PHP/HTML
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
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

Post by AdRock »

Yes I do....thanks a lot. That should do what exactly i want now
Post Reply