Hi,
I’m having trouble using the snippets. I’m not a programmer by any means but I was able use the following code to display a form on a regular page when it’s not run through modx. When I try to make it work with snippets nothing even displays, i’m pretty sure it has something to do with returning values but I don’t know how to go about it.
Here’s what I have before any html
[tt]<?php
session_start();
require($DOCUMENT_ROOT.’/partyrsvp/func.php’);
$c = connect_db();
$output = "";
if($_POST[’submitted’] == "submitted" && ($_POST[’fname’] != "" || $_POST[’lname’] != "") && ctype_digit($_POST[’pid’]))
{
parsvp(mysql_real_escape_string($_POST[’fname’]),
mysql_real_escape_string($_POST[’lname’]),
mysql_real_escape_string($_POST[’phone’]),
mysql_real_escape_string($_POST[’email’]),
mysql_real_escape_string($_POST[’guests’]),
mysql_real_escape_string($_POST[’pid’]),
mysql_real_escape_string($_POST[’bday’]),
$id,
$c);
$output .= "Thank you. You have been RSVP’d for the party! See you there!";
}
else
{
$output .= addpar_form("1", $c);
}
close_db($c);
?>[/tt]
...And I stick this wherever I want the form displayed
[tt]<?=$output?>[/tt]
Do I have to create two different snippets for these two parts?
How can I make this work? Thank you in advance.