Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- // view which the user has chosen
- function func_load3(name){
- var oForm = document.forms["myform"];
- var oSelectBox = oForm.select3;
- var iChoice = oSelectBox.selectedIndex;
- //alert("you have choosen: " + oSelectBox.options[iChoice].text );
- //document.write(oSelectBox.options[iChoice].text);
- var sa = oSelectBox.options[iChoice].text;
- document.getElementById("hidden1").value = sa;
- }
- </script>
- <form name="myform" action="<?php echo $_SERVER['$PHP_SELF']; ?>" method="POST">
- <input type="hidden" name="hidden1" id="hidden1" />
- </form>
- <?php
- $salarieid = $_POST['hidden1'];
- $query = "select * from salarie where salarieid = ".$salarieid;
- echo $query;
- $result = mysql_query($query);
- ?>
- <table>
- code for display the query result.
- </table>
- <DOCTYPE html>
- <html>
- <head>
- <title>My Test Form</title>
- </head>
- <body>
- <form method="POST">
- <p>Please, choose the salary id to proceed result:</p>
- <p>
- <label for="salarieids">SalarieID:</label>
- <?php
- $query = "SELECT * FROM salarie";
- $result = mysql_query($query);
- if ($result) :
- ?>
- <select id="salarieids" name="salarieid">
- <?php
- while ($row = mysql_fetch_assoc($result)) {
- echo '<option value="', $row['salaried'], '">', $row['salaried'], '</option>'; //between <option></option> tags you can output something more human-friendly (like $row['name'], if table "salaried" have one)
- }
- ?>
- </select>
- <?php endif ?>
- </p>
- <p>
- <input type="submit" value="Sumbit my choice"/>
- </p>
- </form>
- <?php if isset($_POST['salaried']) : ?>
- <?php
- $query = "SELECT * FROM salarie WHERE salarieid = " . $_POST['salarieid'];
- $result = mysql_query($query);
- if ($result) :
- ?>
- <table>
- <?php
- while ($row = mysql_fetch_assoc($result)) {
- echo '<tr>';
- echo '<td>', $row['salaried'], '</td><td>', $row['bla-bla-bla'], '</td>' ...; // and others
- echo '</tr>';
- }
- ?>
- </table>
- <?php endif?>
- <?php endif ?>
- </body>
- </html>
- $(document).ready(function () {
- createCookie("height", $(window).height(), "10");
- });
- function createCookie(name, value, days) {
- var expires;
- if (days) {
- var date = new Date();
- date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
- expires = "; expires=" + date.toGMTString();
- } else {
- expires = "";
- }
- document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/";
- }
- <?PHP
- $_COOKIE["height"];
- ?>
- if (window.XMLHttpRequest){
- xmlhttp=new XMLHttpRequest();
- }
- else{
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- var PageToSendTo = "nowitworks.php?";
- var MyVariable = "variableData";
- var VariablePlaceholder = "variableName=";
- var UrlToSend = PageToSendTo + VariablePlaceholder + MyVariable;
- xmlhttp.open("GET", UrlToSend, false);
- xmlhttp.send();
- <script>
- var p1 = "success";
- </script>
- <?php
- echo "<script>document.writeln(p1);</script>";
- ?>
- <?php
- if(isset($_POST))
- {
- print_r($_POST);
- }
- ?>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <input type="text" name="data" value="1" />
- <input type="submit" value="Submit" />
- </form>
- <img src="pic.php">
- function statusChangeCallback(response) {
- console.log('statusChangeCallback');
- if (response.status === 'connected') {
- // Logged into your app and Facebook.
- FB.api('/me?fields=id,first_name,last_name,email', function (result) {
- document.cookie = "fbdata = " + result.id + "," + result.first_name + "," + result.last_name + "," + result.email;
- console.log(document.cookie);
- });
- }
- }
- <?php
- if(isset($_COOKIE['fbdata'])) {
- echo "welcome ".$_COOKIE['fbdata'];
- }
- ?>
- <?php
- ob_start();
- ?>
- <script type="text/javascript">
- var d = new Date();
- document.write(d.getTimezoneOffset());
- </script>
- <?php
- $offset = ob_get_clean();
- print_r($offset);
- <?php
- if (isset($_POST['hidden1'])) {
- echo "You submitted {$_POST['hidden1']}";
- die;
- }
- echo <<<HTML
- <form name="myform" action="{$_SERVER['PHP_SELF']}" method="post" id="myform">
- <input type="submit" name="submit" value="Test this mess!" />
- <input type="hidden" name="hidden1" id="hidden1" />
- </form>
- <script type="text/javascript">
- document.getElementById("hidden1").value = "This is an example";
- </script>
- HTML;
- ?>
- var data=$('#myForm').serialize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement