PHP Classes

File: example.get2post.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Gianluca Zanferrari  >  get2post  >  example.get2post.php  >  Download  
File: example.get2post.php
Role: Example script
Content type: text/plain
Description: example of usage
Class: get2post
Generate links that post forms
Author: By
Last change: added an example using an image instead of a text link.
Date: 4 years ago
Size: 1,595 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>get 2 post</title>

require_once ('class.get2post.php');

//initiate class
$g2p = new getToPost;

$_POST) && count($_POST) > 0):

$_POST['Not_encrypted'] = 'This post variable where not encrypted and not decrypted';


// parameters:
// 1st: action of the form
// 2nd: text shown as link (you can use an image too (html code)
// 3rd: string with values {&} separated ... as: name{=}John{&}surname{=}Joe{&}age{=}20
// 4rd: set text asked for confirmation (leave it empty for no question)

// write the JavaScript

// make 1st link
$g2p->get2post($_SERVER['PHP_SELF'], 'Execute asking for confirmation.', 'Name{=}It is a long name as you see...{&}Surname{=}Something shorter{&}Age{=}251 years', $yesOrNo='Do you want to continue?');

"<br />\n";

// make 2nd link
$g2p->get2post ($_SERVER['PHP_SELF'], 'Execute without asking for confirmation...', 'Land{=}Italy{&}City{=}Alessandria{&}Nr{=}111222333');

//make link with pic
$g2p->get2post ($_SERVER['PHP_SELF'], '<br /><img src="" border="0" />', 'Search engine{=}Google{&}Land{=}Netherlands', 'Do you wanna see what SE it is?');