Page 1 of 2
Stopping Submissions With Empty Fields
Posted: Wed Sep 28, 2011 3:20 am
by cAdams
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
Write your message below:
Since resolving the header issue myself after several days, I have another query.
I've also since changed the guestbook to include the field
Image Title but need to ensure this field isn't left empty so added the following code:
/* Check image title */
if (empty($_POST['image_title']))
{
$error_buffer .= $lang['e26'];
}
elseif ( gbook_input($_POST['image_title']) != $settings['apass'] )
{
$error_buffer .= $lang['e27'];
}
after 'approve Entries' in gbook.php but a blank page comes up with an error message pointing to line 235.
To ensure visitors DON'T leave the new field Image Title empty, what is the correct code to put where in what file pls?
Re: Stopping Submissions With Empty Fields
Posted: Wed Sep 28, 2011 4:55 pm
by Henrie
Hello cAdams,
The self written code you have added is not valid html.
Code: Select all
<input image="" value="" size="45" type="text">
image="" should probably be name="image"
But it takes much more than just adding that code to add an extra field. And because it has to be stored in the entries text-database a new field has to be added there.
It is just to much work and might give problems with updating the GBook script to a newer version, so we do not give support for that here in the forum.
I have helped someone with a previous version to add an extra field (see here
viewtopic.php?p=4318#p4318 ) but version 1.7 is much different so it can not be applied directly. But it will give you an idea about the amount of work.
Greetings,
Henrie
Re: Stopping Submissions With Empty Fields
Posted: Thu Sep 29, 2011 5:57 am
by cAdams
well even after hours i spent tweaking the outdated 'adding fields' info given above Henrie, when the image title IS entered, the error message now comes up to say it's not ie 'Enter The Required Image Title As Bold Donates'
there is also no mention of the entries text-database file in the out-dated link above
hardly encouraging for my avid followers seen as until this is resolved, NO-ONE can submit ANY feedback
given there's only 2 files to look at, surely the missing or incorrect code would be easy enough to spot wouldn't it?????

Re: Stopping Submissions With Empty Fields
Posted: Thu Sep 29, 2011 5:33 pm
by Henrie
I told you that the current GBook 1.7 is much different than the one I had written it for. So my old manual will be hard to use it as a lead for the the current version.
And I really do not have the time now to help you with it in any way.
Greetings,
Henrie
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 12:33 am
by cAdams
ok well i won't be buying you any beers Henrie any time soon
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 2:50 am
by Lisaweb
Aarf! Funny!
cAdams wrote:ok well i won't be buying you any beers Henrie any time soon
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 5:21 am
by Henrie
cAdams wrote:ok well i won't be buying you any beers Henrie any time soon

I did not expect you to.
The problem is that I am waaaaay behind on other things I need to do for my new house. So I just can not find any time to do this.
But maybe you can put the changed file(s) in a zip file for me to download, than I can have a look at the code and see what you forgot to change.
Greetings,
Henrie.
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 12:44 pm
by Klemen
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 10:27 pm
by cAdams
..........But maybe you can put the changed file(s) in a zip file for me to download, than I can have a look at the code and see what you forgot to change.
Greetings,
Henrie.
sorry but it appears i'm unable to attach any files for you to download as you so generously offered Henrie
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 10:29 pm
by cAdams
i'm a
single income solo mortagee on a benefit therefore i cannot afford to hire anyone for any help Klemen
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 10:31 pm
by Lisaweb
Perhaps you may want to try
Dropbox.com. It's free. That's what I use to upload files for others to access. Hope it helps!
cAdams wrote:
sorry but it appears i'm unable to attach any files for you to download as you so generously requested Henrie
Re: Stopping Submissions With Empty Fields
Posted: Mon Oct 03, 2011 10:38 pm
by Henrie
cAdams, you have a website, so you can host the zip-file there (I think). I will let you know when I have downloaded it so you can remove it afterwards.
Or you could use dropbox.com as Lisaweb suggests.
Re: Stopping Submissions With Empty Fields
Posted: Tue Oct 04, 2011 4:13 am
by cAdams
thanx so much for your useful suggestion
Lisaweb and
Henrie which i've heeded and uploaded the files Henrie requested
have also PMed you Henrie

Re: Stopping Submissions With Empty Fields
Posted: Tue Oct 04, 2011 6:12 pm
by Henrie
cAdams,
You tricked me into looking into it earlier than I would have wanted to.
I looked in gbook.php file, you have forgotten to add the ititle field to all the required functions for adding a message to the entries file.
Add it here
Code: Select all
if ($error_buffer)
{
printSign($name,$from,$email,$url,$comments,$sign_nosmileys,$sign_isprivate,$error_buffer,$spamanswer);
}
and here
Code: Select all
/* Create the new entry and add it to the entries file */
$addline = $name.$delimiter.$from.$delimiter.$email.$delimiter.$url.$delimiter.$comments.$delimiter.$added.$delimiter.$isprivate.$delimiter.'0'.$delimiter.$_SERVER['REMOTE_ADDR']."\n";
Be carefull where you put the field, it is very important because the fields depend on their order in the text database. Make sure it is added in the text database after the REMOTE_ADDR field.
And to display it in the guestbook, I think you also need to edit the functions
Code: Select all
function printSign($name='',$from='',$email='',$url='',$comments='',$nosmileys='',$isprivate='',$error='',$spamanswer='')
{
...
}
and
Code: Select all
function printEntries($lines,$start,$end)
{
...
}
So now you can spent some more hours in adding the code. I hope I gave you some direction where to find. Because I really do not have time to add and test the code.
I can only say that when I first added the code for an extra field myself it took 2 full days (of about 10 hours each) because I did not know where to look and because php was very new to me. But I really learned much from the experience.
Luckily since than the guestbook has evolved, and I do not need the extra fields anymore. If I would have needed the extra field myself I could have given you the changes without to much hassle because I would have done it myself already than.
Greetings,
Henrie
Re: Stopping Submissions With Empty Fields
Posted: Wed Oct 05, 2011 3:52 am
by cAdams
As you said yourself Henrie
I will probably not have time to look in on it before thursday or otherwise the weekend. So please be patient.
to which I replied in my PM, '
Whenever you can look at the php files, I'll be grateful Henrie!' so never once have I 'tricked you' into anything.
Secondly I also forewarned the forum at the very beginning I'm a PHP virgin requesting members bear with me because for PHP virgins who have been ran over by a car and left in a coma we weren't expected to come out of Henrie, some things need to be spelt out. Furthermore of my two websites, both of which use php, with a malfunctioning brain I have spent far, far, FAR more than 10hrs/day learning php so if you regard me as a hassle for accepting your offer, I will accept no more.
Finally your suggested modifications haven't worked but thank you for trying all the same and my apologies for wanting to know exactly which image someone is referring to when leaving feedback.