De fleste virksomheder har efterhånden bevist, at AI virker.
Pilotprojekter leverer resultater. Medarbejdere bruger generative AI-værktøjer. Nye use cases dukker op på tværs af organisationen.
if ($_POST['completed'] == 1) { // Need to add - check for large upload. Otherwise the code // will just duplicate old file ;-) // ALSO - note that latest.img must be public write and in a // live appliaction should be in another (safe!) directory. if($_FILES['imagefile']['size'] > 1024000) { $errmsg = "Too large!"; } else { $extension = strtolower(end(explode(".",$_FILES['imagefile']['name']))); if(!in_array($extension,$allowPics)) { $errmsg = "Wrong filetype!"; } else { resize($_FILES['imagefile']['tmp_name'],"latest.img",300,300); $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); mysql_query ("insert into pictures (title, imgdata) values (\"".$_POST['whatsit']."\", \"".$image."\")") or die(mysql_error()); } } }
// Find out about latest image
$gotten = mysql_query("select * from pictures order by pid desc limit 1") or die(mysql_error()); if(mysql_num_rows($gotten)>0) { $row = mysql_fetch_assoc($gotten); $title = htmlspecialchars($row['title']); $bytes = $row['imgdata']; } else { $errmsg = "There is no image in the database yet"; $title = "no database image available"; // Put up a picture of our training centre $instr = fopen("./images.jpg","rb"); $bytes = fread($instr,filesize("./images.jpg")); }
// If this is the image request, send out the image
<html> <head> <title>Upload an image to a database</title> <body bgcolor=white><h2>Here's the latest picture</h2> <font color=red><?= $errmsg ?></font> <center><img src=?gim=1><br> <b><?= $title ?></center> <hr> <h2>Please upload a new picture and title</h2> <form enctype="multipart/form-data" method="post"> <input type="hidden" name="completed" value="1"> Please choose an image to upload: <input type="file" name="imagefile"><br> Please enter the title of that picture: <input name="whatsit"><br> then: <input type="submit"></form><br> </body> </html>
og denne kode bruges til at vise billedet:
<?php
require_once("./../members/common.php");
$imgID = mysql_real_escape_string($_GET['id']);
$query = mysql_query("select pic from billeder WHERE id = '".$imgID."' LIMIT 1") or die (mysql_error());
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.