Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" href="index.css" />
- <title>Funn registrert | Alta Botanikkforening</title>
- </head>
- <body class="content">
- <div align="center" class="text">
- <?php ?
- ini_set('date.timezone', 'Europe/Oslo');
- //This is the directory where images will be saved
- $target = "pics/";
- $target = $target . basename( $_FILES['Filename']['name']);
- //This gets all the other information from the form
- $Filename=$_FILES['Filename']['name'];
- $Description=$_POST['Description'];
- $Contact=$_POST['Contact'];
- $Time = gmdate('Y-m-d H:i');
- $Title=$_POST['Title'];
- //Writes the Filename to the server
- if(move_uploaded_file($_FILES['Filename']['tmp_name'], $target)) {
- //Tells you if its all ok
- echo "Filen ". basename( $_FILES['Filename']['name']). " er nå lagt til blant Alta Botanikkforeningens funn.";
- // Connects to your Database
- mysql_connect("localhost", "root", "") or die(mysql_error()) ;
- mysql_select_db("altabotanikk") or die(mysql_error()) ;
- /*
- //Writes the information to the database
- mysql_query("INSERT INTO picture (Filename,Description,Contact,Time,Title)
- VALUES ('$Filename', '$Description', '$Contact', now(), '$Title')") ;
- } else {
- //Gives and error if its not
- echo "Det skjedde noe galt her :/";
- }
- */
- $sql = '
- INSERT INTO picture (
- Filename,
- Description,
- Contact,
- Time,
- Title,
- ) VALUES (
- "'.mysql_real_escape_string($Filename).'",
- "'.mysql_real_escape_string($Description).'",
- "'.mysql_real_escape_string($Contact).'",
- "now()",
- "'.mysql_real_escape_string($Title).'",
- )
- ';
- print '<pre>'.($sql).'</pre>';
- mysql_query($sql);
- print 'err: '.mysql_error();
- die();
- ?>
- <br/><br/>
- <form action="finds.php"><input type="submit" name="submit" value="Tilbake" /></form>
- </div>
- <script>
- parent.document.title = document.title;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement