Contact form/navigation

6 posts by 3 authors in: Forums > CMS Builder
Last Post: October 13, 2009   (RSS)

By dsternalski - October 8, 2009

hi,

I have added a contact form to a site, and it used to work and send emails, however, now when an email is sent i get the error:

Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /var/www/vhosts/janizm.co.uk/httpdocs/contact.php on line 114 Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /var/www/vhosts/janizm.co.uk/httpdocs/contact.php on line 115

Please find attached the contact form code.

I am also experience the problem of the navigation. for example i have two items at a depth = 1 and one item at a depth = 0, however the only one of the secondary items are displaying correctly.

the site is http://www.janizm.co.uk/gallery.php?Janizm-Gallery-1 and as you will see in firefox, there is a page called Gallery, and under gallery, artwork and photographs are meant to sit, but artwork doesnt.

Re: [Damon] Contact form/navigation

By dsternalski - October 11, 2009

hi,

thanks for you reply.

the error on the contact form was a server error, thanks.

Please find attached a html version of the page as to show how the navigation should work.
Attachments:

janizm.html 5K

Re: [dsternalski] Contact form/navigation

By Chris - October 11, 2009

Hi dsternalski,

I think your IF...ELSEIF strategy in navigation.php is causing the problems. For example, if you have two records at depth==1, your code is going to generate an extra </li>, which will break your page layout.

There is a much simpler way. First, replace the getRecords() calls for your Category Menus with getCategories() calls:

list($allGalleryRecords,) = getCategories(array(
'tableName' => 'gallery',
));
list($allLinksRecords,) = getCategories(array(
'tableName' => 'links',
));


Next, replace your foreach's with these foreach's:

<?php foreach ($allGalleryRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['navigation_name'] ?></a>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
<?php foreach ($allLinksRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['navigation_name'] ?></a>
<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>


The _listItemStart and _listItemEnd will take care of adding <ul> and </ul> tags where they're needed depending on the depth of the records displayed.

I hope this helps! Please let us know if you have any more questions.
All the best,
Chris

Re: [chris] Contact form/navigation

By dsternalski - October 12, 2009

Hi

this worked, thank you.

Re: [dsternalski] Contact form/navigation

By Chris - October 13, 2009

Great! Glad to have helped! :)
All the best,
Chris