Embedding the sedamo address input on your webpage is just adding one line:
<?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>
Now let's read what the sedamo server POSTed to you:
<?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>
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.l
is not set, it will be detected automatically from the browser settings (not by geo coordinates / IP address).