I would like to submit some values that a user enters in a Dialog-form. He clicks on the button, gives his name, first name, email and submit.
When he submits, I would like to store these values in a DB. I have a php script that is supposed to get these values from the user... but I don't know how to send these values once submitted to my php script.
Thanks for your help.
---php script------> so far just printing, no DB storing but printing is not working
<?php
$name= $_POST["name"];
$firstName= $_POST["firstName"];
$email = $_POST["email"];
print("$name+ $firstName+ $email<br>");
?>
-----------------------HTML page------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
<title>
Dojo
</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<link rel="stylesheet" type="text/css" href="../js/dojo/resources/dojo.css">
<link rel="stylesheet" type="text/css" href="../js/dijit/themes/claro/claro.css">
<style type="text/css"> body {margin-left: 10px; margin-top: 10px;} </style> <script type="text/javascript" src="../js/dojo/dojo.js" djconfig="parseOnLoad:true, isDebug: true"></script>
<script type="text/javascript">
dojo.require("dijit.form.Button");
dojo.require("dojo.parser");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dojox.validate.regexp");
dojo.addOnLoad(function() {
form = dijit.byId("subscription");
dojo.connect(dijit.byId("button1"), "onClick", form, "show");
});
</script>
`enter code here`</head>
<body class="claro">
<div dojotype="dijit.Dialog" id="subscription" title="subscription form" execute="alert('Transmitted');">
<table>
<tr>
<td>
Name:
</td>
<td>
<input dojotype="dijit.form.TextBox" type="text" name="name" id="name">
</td>
</tr>
<tr>
<td>
FirstName:
</td>
<td>
<input dojotype="dijit.form.TextBox" type="text" name="firstName" id="firstName">
</td>
</tr>
<tr>
<td>
Email :
</td>
<td>
<input type="text" name="mail" id="mail" dojotype="dijit.form.ValidationTextBox"
regexpgen="dojox.validate.regexp.emailAddress">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<button dojotype="dijit.form.Button" type="submit" onclick="return dijit.byId('subscription').isValid();">OK</button>
<button dojotype="dijit.form.Button" type="button" onclick="dijit.byId('subscription').hide();">Annuler</button>
</td>
</tr>
</table>
</div>
<button id="button1" dojotype="dijit.form.Button" type="button">Sign</button>
</body>
</html>