Book on Multiple pages in site :?:

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Wulfgen
Posts: 2
Joined: Sun Aug 09, 2009 6:59 pm

Book on Multiple pages in site :?:

Post by Wulfgen »

Script URL: GBook 1.6
Version of script: 1.6
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: multiple, multiple pages, multiple entries

Write your message below:

How would it be possible to have multiple guestbooks? I have a client with over 27+ product and they want to have a gbook system for each product

Is that possible and that also would mean that each product would have its own entries.txt file - right?

:?:
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

The simplest way would be to install several GBooks, each on it's own folder. For example:
www.domain.com/product1/gbook.php
www.domain.com/product2/gbook.php
www.domain.com/product3/gbook.php
...

A better solution would be to modify the GBook code to accept a new parameter, say "gbook.php?product=product1" which would tell it which entries file to use (product1.txt). This requires PHP knowledge though and it out of the scope of my support 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
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

Took a quick look you should be able to do somthing like this in the GB code. so then it swaps to the file you need for each section that is called.

That way you can then just add a param as Klem said.
This is just my quick example ...

You would prob be best writing it into a func and then use it where you need.

in your url mysite.com/gbook.php?prod=1

In the GB code.

if (isset($_GET['prod'])) $swap = trim(strip_tags($_GET['prod']));
if(file_exists("$swap.txt")){
if ($swap == '1'){
$lines=file("$swap.txt");
}elseif ($swap == '2'){
$lines=file("$swap.txt");
}elseif ($swap == '3'){
$lines=file("$swap.txt");
}else{
$lines=file("default.txt");
}
}

Again just a quick example might get you started but sounds like a lot if you have 27+ my example only shows 3 :-)

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
Post Reply