- 0
Uploading Photos, creating directory and updating row in table.
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By Hamid Ganji · Posted
A coalition of publishers sued OpenAI and Microsoft over scraping content without consent by Hamid Ganji Image via Depositphotos.com AI companies often rely on readily available internet content to train their chatbots and provide users with instant answers. This method of AI training is fast and relatively inexpensive, but using a website’s content without permission or compensation is not something publishers like to see, and this is exactly why Microsoft and OpenAI are now being sued. As reported by Bloomberg, a group of publishers that collectively own nearly 400 newspapers has filed a lawsuit against OpenAI and Microsoft. The coalition argues that the two companies scraped their content to build AI chatbots like ChatGPT and Copilot without paying any compensation. The complaint, filed in the U.S. District Court for the Southern District of New York, argues that while AI products have generated billions of dollars in market value using publishers’ work, none of that value has been shared with the publishers. The plaintiffs are seeking statutory damages and injunctive relief for alleged copyright infringement and violations of the Digital Millennium Copyright Act. “Defendants systematically and secretly crawled the Publishers’ websites—including content behind paywalls and other access restrictions—and copied the Publishers’ articles, stories, and other original works onto their own servers without authorization,” the complaint states. The publishers also described the AI boom as a “death knell for local journalism” if AI companies that scrape content for free are not held accountable. Former New Jersey Attorney General Matthew Platkin and his law firm, Platkin LLP, are representing the publishers. “Our models empower innovation, are trained on publicly available data, and are grounded in fair use,” OpenAI spokesperson Drew Pusateri told Bloomberg. This is not the first lawsuit involving the unauthorized use of publishers’ content by AI firms, but it is one of the largest coalitions ever formed against the free use of content by AI chatbots. In 2024, OpenAI and Microsoft also faced a similar lawsuit from eight newspapers that claimed AI products were benefiting from their content without permission. -
By hellowalkman · Posted
Rufus alternative Ventoy now supports Windows 11's mandatory update, fixes major boot bug by Sayan Sen While Microsoft has its own official Media Creation Tool used for making bootable USB media, there are some popular third-party utilities as well which offer additional options like bypassing system requirements, Microsoft Account creation, and more. One of these is Ventoy, and the software has received its latest update today. In fact, the app actually got a slew of updates over the last couple of days, three version releases in total, to be specific. The first release, version 1.1.13, was pulled as there was some unspecified error in the update, and as such, the corrected version 1.1.14 was pushed out. Following that on very short notice, 1.1.15 was published as well. For those unfamiliar, Ventoy is an open-source utility that lets users create a bootable USB drive once and then simply copy ISO, WIM, IMG, VHD, or EFI files onto it without repeatedly formatting the drive. It supports both legacy BIOS and UEFI boot modes, Secure Boot, and a wide range of operating systems, making it one of the most versatile tools in the category. The biggest change in version 1.1.14 is an updated Secure Boot shim file aimed at resolving the UEFI CA 2023 issue, which is basically a compatibility problem that has affected Secure Boot environments on some systems. If you recall, we reported about severe boot issues on HP devices following the release of updated Secure Boot 2023 keys. For anyone who may not be aware, back in early 2024, Microsoft announced that it was updating Secure Boot keys as they were going to become 15 years old in 2026, which is also when they are set to expire. As such, the new 2023 certificates have been rolling out with the newest Windows 11 updates. Updated boot manager and Secure Boot certificates are crucial for protection against malware like bootkits. These are mandatory updates. Alongside that, the VentoyPlugson graphical plugin configurator was updated in sync with the release. The update also introduces a new VTOY_SECURE_BOOT_POLICY option within the Global Control plugin, giving users more flexibility in managing Secure Boot behavior. Ventoy has also received a fix for a startup issue when Secure Boot was disabled. Microsoft does officially allow users to boot systems without Secure Boot as long as the PC is Secure Boot capable. The full changelog is given below: Update secure boot shim file to solve the UEFI CA 2023 issue. The new release use a new CA, so you need to enroll the new key for the first boot time. VentoyPlugson update synchronously. Global control plugin add a VTOY_SECURE_BOOT_POLICY option. Fix the boot issue when Secure Boot is disabled in the UEFI firmware. You can download the latest version of the app here on Ventoy's official GitHub repo or from Neowin software stories. -
By grunger106 · Posted
Windows 11 is fine, no issues on any of the machines I've run it on since release. The stricter security requirements are a good thing, sometimes the baseline needs to change and people will winge, but it is what it is. Happened with the move from 9x to NT - broke compatability Happened with XP SP2 when security started to become a serious consideration Certainly happend with Vista that brought in UAC, the concept of not running as admin (something that has been the norm in Linux/Unix from pretty much the start) and a completely new driver stack. Windows 11 will probably get looked back at as the point where even consumer and SMB IT was dragged kicking and screaming into a somewhat secure by default configuration. -
By matthiew · Posted
Bluestacks has been emulating Android on Windows for fifteen years. It's janky and riddled with ads though, so WSA looked like it was going to be a huge improvement over the emulator experience. Too bad Microsoft dropped the ball on that. -
By James W. · Posted
Classic. China would be nothing without Western, Japanese, and South Korean technology.
-
-
Recent Achievements
-
krychek57 went up a rank
Rookie
-
Jaybonaut went up a rank
Grand Master
-
Philsl earned a badge
One Year In
-
Scoobystu earned a badge
Dedicated
-
Tom Schmidt earned a badge
First Post
-
-
Popular Contributors
-
Tell a friend
Question
seb86
I am trying to update a table row by adding photos. Now everything in the code below works, except it cannot work fully until I can get the $name = $_GET['name']; to read from the row in the table. If someone can help get it to detect this part then the rest should work.
These are the errors I get because I do not have the name displaying from the property details when creating the directory.
If you read the code below carefully you will see that the other POST fields are there becuase they are not to be overwritten.
This is the full page:-
<? $sql = mysql_query("SELECT * FROM properties WHERE property_id='$id' AND username = '$session->username'"); while($propertyRow = mysql_fetch_array($sql)) { $id = $propertyRow['property_id']; $status = $propertyRow['status']; $saletype = $propertyRow['sale_type']; $category = $propertyRow['category']; $name = $propertyRow['name']; $address = $propertyRow['address']; $village = $propertyRow['village']; $long = $propertyRow['long']; $lat = $propertyRow['lat']; $department = $propertyRow['department']; $postcode = $propertyRow['postcode']; $price = $propertyRow['price']; $featured = $propertyRow['featured']; $dateentered = $propertyRow['date_entered']; $sec = substr($propertyRow['date_entered'],17,2); $minute= substr($propertyRow['date_entered'],14,2); $hour = substr($propertyRow['date_entered'],11,2); $day = substr($propertyRow['date_entered'],8,2); $month = substr($propertyRow['date_entered'],5,2); $year = substr($propertyRow['date_entered'],0,4); $date_entered = $day."/".$month."/".$year." ".$hour.":".$minute.":".$sec; } ?> <form action="write-photos.php?mode=update&?id=<? echo $id; ?>" method="post" enctype="multipart/form-data" style="border:0px; padding:0px; margin:0px;"> <? if($_GET['mode'] == "update") { $id = $_GET['property_id']; $name = $_GET['name']; ///// Upload Photos ///// foreach ($_FILES["photo"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK){ $tmp_name = $_FILES["photo"]["tmp_name"][$key]; $photo = $_FILES["photo"]["file"][$key]; mkdir("$SITEurl/photos/properties/$session->username/$name",0777); $file = preg_replace("/([^a-z0-9])+/i", "-", $photo); move_uploaded_file($tmp_name, "$SITEurl/photo/properties/$session->username/$name"); chmod("$SITEurl/photo/properties/$session->username/$name", 0777); $picno = $key; $PHOTO[] = $photo; $sqlphoto = "UPDATE properties SET photo$picno = '$name' WHERE property_id = '$id'"; if(@mysql_query($sqlphoto)){ $msg = "Photo ".$picno." ".$photo." uploaded.</br>"; }else{ echo mysql_error(); } } } ///// Add Properties to DB ///// $dateentered = date("Y:m:d H:i:s"); $status = $_POST['status']; $sale_type = $_POST['sale_type']; $category = $_POST['category']; $name = addslashes($_POST['name']); $address = $_POST['address']; $village = $_POST['village']; $lng = $_POST['lng']; $lat = $_POST['lat']; $department = $_POST['department']; $telephone = $_POST['telephone']; $mobile = $_POST['mobile']; $email = $_POST['email']; $description_fr = addslashes($_POST['description_fr']); $description_en = addslashes($_POST['description_en']); $price = $_POST['price']; $bedrooms = $_POST['bedrooms']; $bathrooms = $_POST['bathrooms']; $view = $_POST['view']; $meters = $_POST['meters']; $terrain = $_POST['terrain']; $pool = $_POST['pool']; $garage = $_POST['garage']; $garage_size = $_POST['garage_size']; $front_garden = $_POST['front_garden']; $rear_garden = $_POST['rear_garden']; $int_features = $_POST['int_features']; $ext_features = $_POST['ext_features']; $fees = $_POST['fees']; $tax = $_POST['tax']; if(isset($_POST['username'])) { $username = serialize($_POST['username']); }else { $username = ""; } if(isset($_POST['int_features'])) { $int_features = serialize($_POST['int_features']); }else { $int_features = ""; } if(isset($_POST['ext_features'])) { $ext_features = serialize($_POST['ext_features']); }else { $ext_features = ""; } $sql = "UPDATE properties SET ('$id', '$session->username', '$dateentered', '$status', '$sale_type', '$category', '$name', '$address', '$village', '$lng', '$lat', '$department', '$postcode', '$telephone', '$mobile', '$email', '$description_fr', '$description_en', '$price', '', '$bedrooms', '$bathrooms', '$view', '$meters', '$terrain', '$pool', '$garage', '$garage_size', '$front_garden', '$rear_garden', '$int_features', '$ext_features', '$video_tour', 'no', '$fees', '$tax', '$PHOTO[1]', '$PHOTO [2]', '$PHOTO[3]', '$PHOTO[4]', '$PHOTO[5]', '$PHOTO[6]', '$PHOTO[7]', '$PHOTO[8]', '$PHOTO[9]', '$PHOTO[10]', '$PHOTO[11]', '$PHOTO[12]', '', '', '', '1')"; if(@mysql_query($sql)) { $msg = "Your have succesfully added your photos to the property"; }else{ $msg = "There was an error uploading the photos, please contact <a href=\"mailto:[email protected]\">administrators</a> for help!"; } } ?> <div id="content"> <? echo "<h3>".$msg."</h3>"; ?> <div id="sidebar-left"> <ul id="post_options"> <li class="current">Brief Details on Property</li> <li>ID: <? echo $id; ?><br>Name: <? echo $name; ?><br>Department: <? echo $department; ?><br>Price €<? echo $price; ?><br><br>Date Posted: <? echo $dateentered; ?></li> <li class="finish">Finished Adding Photos?</li> <li><select id="post_status" name="status" onchange="if (this.selectedIndex==1){this.form ['check'].style.visibility='visible'}else {this.form['check'].style.visibility='hidden'};"> <option value="">no</option> <option value="">yes</option> </select></li> <li> <b><font color="#0099FF">Please double check your photos are in order as you want them before attaching to the property.</font></b><br><br> <input type="checkbox" name="check" style="visibility:hidden;" onclick="this.form.Submit.disabled = ! this.checked;">Enable Save<br><br> <input class="save" name="Submit" type="submit" value="Save" disabled="disabled"></li> <li class="related"><b>Related Links</b></li> <li><a href="manage.php">Manage All Your Properties</a></li> <li><a href="manage-draft.php">View Your Drafts</a></li> </ul> </div> <div id="write-property"> <script type="text/javascript"> /* This function is called when user selects file in file dialog */ function checkext(upload_field) { var re_text = /\.jpeg|\.jpg/i; var filename = upload_field.value; /* Checking file type */ if (filename.search(re_text) == -1) { alert("Please select a JPEG file."); upload_field.value = ''; } return true; } </script> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td>Main Photo</td> <td><input name="photo[1]" type="file" id="photo[1]" title="This field is required" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 2</td> <td><input name="photo[2]" type="file" id="photo[2]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 3</td> <td><input name="photo[3]" type="file" id="photo[3]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 4</td> <td><input name="photo[4]" type="file" id="photo[4]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 5</td> <td><input name="photo[5]" type="file" id="photo[5]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 6</td> <td><input name="photo[6]" type="file" id="photo[6]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 7</td> <td><input name="photo[7]" type="file" id="photo[7]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 8</td> <td><input name="photo[8]" type="file" id="photo[8]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 9</td> <td><input name="photo[9]" type="file" id="photo[9]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 10</td> <td><input name="photo[10]" type="file" id="photo[10]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 11</td> <td><input name="photo[11]" type="file" id="photo[11]" size="30" onChange="return checkext(this)"></td> </tr> <tr> <td>Photo 12</td> <td><input name="photo[12]" type="file" id="photo[12]" size="30" onChange="return checkext(this)"></td> </tr> </table> </div> </div> <input name="MAX_FILE_SIZE" type="hidden" value="<?php echo $MAXimagesize; ?>"> </form>This is the part that needs fixing:-
if($_GET['mode'] == "update") { $id = $_GET['property_id']; $name = $_GET['name']; ///// Upload Photos ///// foreach ($_FILES["photo"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK){ $tmp_name = $_FILES["photo"]["tmp_name"][$key]; $photo = $_FILES["photo"]["file"][$key]; mkdir("$SITEurl/photos/properties/$session->username/$name",0777); $file = preg_replace("/([^a-z0-9])+/i", "-", $photo); move_uploaded_file($tmp_name, "$SITEurl/photo/properties/$session->username/$name"); chmod("$SITEurl/photo/properties/$session->username/$name", 0777); $picno = $key; $PHOTO[] = $photo; $sqlphoto = "UPDATE properties SET photo$picno = '$name' WHERE property_id = '$id'"; if(@mysql_query($sqlphoto)){ $msg = "Photo ".$picno." ".$photo." uploaded.</br>"; }else{ echo mysql_error(); } } }Now if the error was to show again because of something else the warning should read like this:-
Warning: mkdir(http://www.site.com/photos/properties/username/name) [function.mkdir]: No such file or directory in
/home/account/public_html/panel/write-photos.php on line 158
Warning: move_uploaded_file(http://www.site.com/photo/properties/username/name) [function.move-uploaded-file]: failed to open
stream: HTTP wrapper does not support writeable connections. in /home/account/public_html/panel/write-photos.php on line 160
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpv1BtAb' to
'http://www.site.com/photo/properties/username/name' in /home/account/public_html/panel/write-photos.php on line 160
Warning: chmod() [function.chmod]: No such file or directory in /home/account/public_html/panel/write-photos.php on line 161
Notice name in bold, that part is not reading from the table, that is whats missing. I would really like to get this to work.
Link to comment
https://www.neowin.net/forum/topic/649976-uploading-photos-creating-directory-and-updating-row-in-table/Share on other sites
20 answers to this question
Recommended Posts