DAIBOLA

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:sedamo:web_address_input [2018/08/31 03:32] – created adminen:sedamo:web_address_input [2018/09/01 23:29] (current) admin
Line 1: Line 1:
 +=== sedamo address input ===
 +
 +Embedding the sedamo address input on your webpage is just adding one line:
 +
 +<file php php_sedamo_address_input_example_step_1.php>
 +<?php
 +  $theURL = 'https://sedamo.info/sam.php?a=w&u=testuser&p=12345678&l=en&e=' . rawurlencode("user@example.com") . '&d=' . rawurlencode("http://www.example.com/address_done.html") . '&s=' . rawurlencode("http://www.example.com/mystyle.css");
 +  // a = action = w
 +  // u = user = testuser
 +  // p = password = 12345678
 +  // l = language = en
 +  // e = eMail = rawurlencode("user@example.com");
 +  // d = destination = rawurlencode("http://www.example.com/address_done.html");
 +  // s = stylefile = rawurlencode("http://www.example.com/mystyle.css");
 +?>
 +<!DOCTYPE HTML>
 +<html>
 +<head>
 +  <title>sedamo embedding example</title>
 +</head>
 +<body>
 +  <p>Contents above the embedded frame</p>
 +  <iframe src="<?php echo $theURL; ?>" name="sedamoframe" width="100%" height="100%" marginheight="3" marginwidth="3" frameborder="0">
 +    <p>
 +      Your browser does not support embedded frames.
 +      <a href="<?php echo $theURL; ?>" target="_blank">Please click here to open the address input field in a new window.</a>
 +      </p>
 +  </iframe>
 +  <p>Contents below the embedded frame</p>
 +</body>
 +</html>
 +</file>
 +
 +Now let's read what the sedamo server POSTed to you:
 +
 +<file php php_sedamo_address_input_example_step_2.php>
 +<?php
 +  function array_item($ar, $key) 
 +  {
 + if(array_key_exists($key, $ar))
 + return($ar[$key]); 
 +  }
 +  $nameline1 = array_item($_POST, 'nameline1');
 +  $nameline2 = array_item($_POST, 'nameline2');
 +  $sedamo = array_item($_POST, 'sedamo');
 +  $sex = array_item($_POST, 'sex');
 +  $birthday = array_item($_POST, 'birthday');
 +  $phone = array_item($_POST, 'phone');
 +  $email = array_item($_POST, 'email');
 +?>
 +<!DOCTYPE HTML>
 +<html>
 +<head>
 + <title>Success!</title>
 +</head>
 +<body>
 +  <p>Your address has been added to the list of club members! The data you entered:</p>
 +  <ul>
 +    <li>name: <?php echo $nameline1; ?></li>
 +    <li>company: <?php echo $nameline2; ?></li>
 +    <li>sedamo: <?php echo $sedamo; ?></li>
 +    <li>sex: <?php echo $sex; ?></li>
 +    <li>birthday <?php echo $birthday; ?></li>
 +    <li>phone: <?php echo $phone; ?></li>
 +    <li>e-Mail: <?php echo $email; ?></li>
 +  </ul>
 +</body>
 +</html>
 +</file>
 +
 +== Hints ==
 +  * The language parameter ''l'' can be any 2-letter ISO language code, e.g. ''l=zh'' for Chinese. If the language is not supported, a fall-back to English will occur.
 +  * If the language parameter ''l'' is not set, it will be detected automatically from the browser settings (//not// by geo coordinates / IP address).
 +  * You can start with any username/password without registration for testing purposes.