Notice: Undefined variable: HTTP_REFERER in (some path) on line 186
Notice: Undefined index: SCRIPT_URI in (some path)on line 187
| Command | Action on submit |
|---|---|
| @gform((key:form_key)) | uses google standard action |
| @gform((key:form_key, thanks:thanks message)) | Displays the ‘thanks message’ as typed |
| @gform((key:form_key, thanksURL:URL to redirect after submitting)) | Redirects to the specified URL (URL should be of type some.page.com without the preceding http://) |
| @gform((key:form_key, thanksPage:Page contents to show after submitting)) | Displays contents of RapidWeaver page (similar to a @import) |
<?php
//start session
session_start();
//set a key, checked in mailer, prevents against
//spammers trying to hijack the mailer.
$security_token = $_SESSION['security_token'] = uniqid(rand());
if(!isset($_SESSION['formMessage'])) $_SESSION['formMessage'] =
'Fill in the form below to send me an email.';
if(!isset($_SESSION['formFooter'])) $_SESSION['formFooter'] = '';
if(!isset($_SESSION['form'])) $_SESSION['form'] = array();
function check($field, $type = "", $value = "") {
$string = "";
if(isset($_SESSION['form'][$field])) {
switch($type) {
case "checkbox":
$string = 'checked="checked"';
break;
case "radio":
if($_SESSION['form'][$field] == $value)
$string = 'checked="checked"';
break;
case "select":
if($_SESSION['form'][$field] == $value)
$string = 'selected="selected"';
break;
default:
$string = unescape_string($_SESSION['form'][$field]);
}
}
return $string;
}
function unescape_string($string) {
return stripslashes(@ html_entity_decode($string, ENT_QUOTES));
}
?>
I just came across an amazing little piece of
javacsript
It converts the current page you are on to nicely formatted markdown syntax.
While it's not perfect and can be confused by complex layouts it's a great little tool to help 'import' a site and is a great companion for any of the Markdown tools available for RapidWeaver.
If nothing else it's a great markdown learning tool.