@joshbaugussnet-1
i use this decision from ancient cforms’ times to our days :))))
it is not too clever, but very stable ??
I do it with help of custom fields, example:
link
<a href="<?php echo get_permalink('123'); ?>?t=<?php echo $post->ID; ?>">book it</a>
123 – ID of page with this form:
for cforms id=1
<?php
$form = cforms2('','');
if ($_GET['t']) {
query_posts("p=".$_GET['t']);
if (have_posts()) {
the_post();
$hotel = htmlspecialchars(get_the_title());
$room1 = htmlspecialchars(get_post_meta($_GET['t'], 'room1', true));
$room2 = htmlspecialchars(get_post_meta($_GET['t'], 'room2', true));
$room3 = htmlspecialchars(get_post_meta($_GET['t'], 'room3', true));
$room4 = htmlspecialchars(get_post_meta($_GET['t'], 'room4', true));
$room5 = htmlspecialchars(get_post_meta($_GET['t'], 'room5', true));
$room6 = htmlspecialchars(get_post_meta($_GET['t'], 'room6', true));
$room7 = htmlspecialchars(get_post_meta($_GET['t'], 'room7', true));
$room8 = htmlspecialchars(get_post_meta($_GET['t'], 'room8', true));
$room9 = htmlspecialchars(get_post_meta($_GET['t'], 'room9', true));
$room10 = htmlspecialchars(get_post_meta($_GET['t'], 'room10', true));
$room11 = htmlspecialchars(get_post_meta($_GET['t'], 'room11', true));
$room12 = htmlspecialchars(get_post_meta($_GET['t'], 'room12', true));
$room13 = htmlspecialchars(get_post_meta($_GET['t'], 'room13', true));
$room14 = htmlspecialchars(get_post_meta($_GET['t'], 'room14', true));
}
}
$form = str_replace('%hotel%',$hotel,$form);
$form = str_replace('%room1%',$room1,$form);
$form = str_replace('%room2%',$room2,$form);
$form = str_replace('%room3%',$room3,$form);
$form = str_replace('%room4%',$room4,$form);
$form = str_replace('%room5%',$room5,$form);
$form = str_replace('%room6%',$room6,$form);
$form = str_replace('%room7%',$room7,$form);
$form = str_replace('%room8%',$room8,$form);
$form = str_replace('%room9%',$room9,$form);
$form = str_replace('%room10%',$room10,$form);
$form = str_replace('%room11%',$room11,$form);
$form = str_replace('%room12%',$room12,$form);
$form = str_replace('%room13%',$room13,$form);
$form = str_replace('%room14%',$room14,$form);
echo $form;
?>
and in form settings:
screenshot
room1,room2… etc – the meta keys of custom fields.
maybe it will be helpful
-
This reply was modified 7 years, 1 month ago by Sonika.
-
This reply was modified 7 years, 1 month ago by Sonika.
-
This reply was modified 7 years, 1 month ago by Sonika.
-
This reply was modified 7 years, 1 month ago by Sonika.
-
This reply was modified 7 years, 1 month ago by Sonika.