Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Table Struct
- CREATE TABLE `wolfplex`.`webhosting` (
- `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
- `nick` VARCHAR( 50 ) NOT NULL ,
- `mail` VARCHAR( 50 ) NOT NULL ,
- `plus` TEXT NOT NULL ,
- `minus` TEXT NOT NULL ,
- `next` TEXT NOT NULL ,
- `date` DATE NOT NULL
- ) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_bin;
- */
- if ( isset($_POST["send"]) )
- {
- $host="127.0.0.1";
- $user="root";
- $password="";
- $db="wolfplex";
- $table="webhosting";
- // Row Name
- $idRow="id";
- $nickRow="nick";
- $mailRow="mail";
- $plusRow="plus";
- $minusRow="minus";
- $nextRow="next";
- $dateRow="date";
- if ( isset($_POST["nick"]) ) { $nick=$_POST["nick"]; }
- else { $nick=""; }
- if ( isset($_POST["mail"]) ) { $mail=$_POST["mail"]; }
- else { $mail=""; }
- if ( isset($_POST["plus"]) ) { $plus=$_POST["plus"]; }
- else { $plus=""; }
- if ( isset($_POST["minus"]) ) { $minus=$_POST["minus"]; }
- else { $minus=""; }
- if ( isset($_POST["next"]) ) { $next=$_POST["next"]; }
- else { $next=""; }
- if ( isset($_POST["date"]) ) { $date=$_POST["date"]; }
- else { $date="0000-00-00"; }
- try
- {
- $serverConnection = mysql_connect($host, $user, $password);
- $dbConnection = mysql_select_db($db, $serverConnection);
- $request = "INSERT INTO ".$table." VALUES ('', '".$nick."', '".$mail."', '".$plus."', '".$minus."', '".$next."', '".$date."');";
- $result = mysql_query($request, $serverConnection);
- mysql_close($serverConnection);
- }
- catch(Exception $e)
- {
- $errorCode = "Code : ".$e->getCode()." <br> Reason : ".$e->getMessage()." <br>";
- }
- }
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
- <title>
- Web Hosting Workshop Feedback
- </title>
- <style type="text/css">
- <!--
- body{
- font-size: 13px;
- font-family: Verdana, Geneva, sans-serif;
- background:#999;
- color:#333;
- border:hidden;
- }
- h1.title {
- color:#000;
- text-decoration:underline;
- }
- td.desc {
- font-size: 13px;
- text-align: right; padding-top:4px;
- }
- input.shell, textarea.shell{
- font-size: 13px;
- font-family: Verdana, Geneva, sans-serif;
- background:#CCC;
- border:double;
- }
- input.shell:hover, textarea.shell:hover {
- border-color:#6C0;
- }
- -->
- </style>
- </head>
- <body>
- <h1 class="title">
- Web Hosting Workshop Feedback
- </h1>
- <font lang="fr">
- <p class="notes">
- <div style="text-decoration:underline">FR: </div>
- Bonjour à tous, le but de ce formulaire est simplement de nous permettre d'avoir un feedback et d'améliorer la qualité des workshops.<br />
- Le mail et le pseudo ne sont pas requis, ne floodez le serveur avec ce script svp ^^<br />
- Merci pour vos remarques, l'equipe du wolfplex hackerspace.<br />
- A bientôt pour la suite.
- </p>
- </font>
- <font lang="en">
- <p class="notes">
- <div style="text-decoration:underline">EN: </div>
- Hi folk's, the goal of this form is simply to allow us to have feedback to improve the quality of ours workshops.<br />
- The mail address and the nick aren't required, please don't flood our servers with this script ^^<br />
- Thank's for your comments, the wolfplex hackerspace team.<br />
- See you soon for next.
- </p>
- </font>
- <br />
- <?php
- if (isset($errorCode))
- {
- echo '<p style="color:#F00">';
- echo $errorCode;
- echo '</p>';
- }
- else
- {
- echo 'Merci pour votre retour / Thank\'s for your feedback';
- }
- ?>
- <form action="index.php" method="post" name="postfeedback">
- <table border="0">
- <tr>
- <td valign="top" class="desc">Pseudo/Nick</td>
- <td ><input name="nick" type="text" class="shell"/></td>
- </tr>
- <tr>
- <td valign="top" class="desc">Email</td>
- <td><input name="mail" type="text" class="shell"/></td>
- </tr>
- <tr>
- <td valign="top" class="desc">+</td>
- <td><textarea name="plus" cols="80" rows="5" class="shell"></textarea></td>
- </tr>
- <tr>
- <td valign="top" class="desc">-</td>
- <td><textarea name="minus" cols="80" rows="5" class="shell"></textarea></td>
- </tr>
- <tr>
- <td valign="top" class="desc">Pour les workshops <br /> suivants ? <br /> <br /> For the next <br /> workshops ?</td>
- <td><textarea name="next" cols="80" rows="5" class="shell"></textarea></td>
- </tr>
- <tr>
- <td valign="top" class="desc">Date</td>
- <td class="desc">
- <input name="date" type="radio" value="2011-01-15" checked="checked"> 15/01/2011
- </td>
- </tr>
- <tr>
- <td valign="top" class="desc"></td>
- <td><input name="send" type="submit" value="Envoyer/Send" class="shell"/></td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement