Hello friends ajj me apko btaunga ki kis parkar ham url se image import kar sakte hai or us image ko database me store karwa sakte hai..
Yanha ham sabse pehle image ko image url address ke jriye import karege or uske bad import hue image ko mysql database me store karege.
Steps-
1-sabse pehle aap mysql databse me imagescrap name ka ek database bana lijiye
2-ab us database me users name ka ek table bana lijiye jisme 2 field bana lijiye id and new
Ab aap niche diye gye code ko copy karke apne system me index.php name ki file bana lijiye or wanha niche diya gya code paste kar dijiye.or save kar lijiye
<html>
<body><fieldset><center>
<h1> scrap Image from url</h1>
<form method="post" action="">
<input type="text" name="img_url" placeholder="Enter Image URL"><br>
<input type="text" name="new" placeholder="give image name"><br>
<input type="submit" name="submit " value="Submit">
</form>
</body>
</html>
<?php
error_reporting(0);
$conn=mysqli_connect("localhost","root","","imagescrap");
if(isset($_POST[‘submit’]))
{
$url=$_POST['img_url'];
if($data = file_get_contents($url)){
$new = $_POST['new'];
file_put_contents($new, $data);
echo "image address succesfully";
echo "<img src='$new'>";
$sql = "INSERT INTO users (new)
VALUES ('$new')";
mysqli_query($conn, $sql);
}
}
?>
</fieldset>
<center>
Agar apko image import karne me koi problem a rhe hai to aap comment me puch sakte ho
Thank You
Team Gajabwap Web In Hindi
ConversionConversion EmoticonEmoticon