PHP - Image Hosting Website Link
Hello guys, I have created a mini image hosting website. Well, I have successfully coded the file upload, including security to allow certain image extensions and size as a beginner in PHP.
However, only one thing remains is the image link. You can view the website on this address http://mini-image-hosting.99k.org/ where it is currently hosting on a free web hosting account with a free sub-domain. Right now, only the image can be uploaded and is being stored in a directory. Nevertheless, I want that when the person uploads an image, he gets also the link, for example: http://mini-image-hosting.99k.org/xxx.jpg something like that. Can you help me for this? Similar TutorialsHey Friends,
I am new to this forum, and does not know anything about programming. And I require very small help from the experts of forum. I have downloaded free image hosting script from web & it is not working fine, it gets stuck at basic.php (one of the file in script). I am sharing the script here also sharing the website. My website : bsm1313.5gbfree.com
Note : I have uploaded a rar file. Kindly change extension to .rar from .php. as it was not allowing me to upload the rar file.
Any kind of help is highly highly appreciated. Thanks a ton in advance.
Attached Files
easyimagehoster_1.32.php 35.46KB
5 downloads Code: [Select] <div id="recent"> <p class="title"><?php echo "Staff Picks"; ?></p> <div id="gallery"> <?php $i = 0; while($album = mysql_fetch_row($recent)): ?> <?php if(++$i%4 == 1): ?><div><?php endif; ?> <?php $image = mysql_fetch_row(mysql_query('SELECT `id`, `extension` FROM `image` WHERE `album_id`='.$album[0].' ORDER BY `id` DESC LIMIT 0,1')); ?> <a href="<?php echo WEB; ?>a/<?php echo alphaID($album[0]); ?>"> <img src="<?php echo WEB; ?>small/<?php echo alphaID($image[0]); ?>.<?php echo $image[1]; ?>" alt=""/> </a> <?php if($i%4 == 0): ?></div><?php endif; ?> <?php endwhile; ?> <?php if($i%4 != 0): ?></div><?php endif; ?> </div> I have this code, which on my image hosting website, displays a grid of the latest albums of images that users upload. I really have no experience in Php. I to change this code to simply display a grid of albums that i choose, not the latest. Like 'staff picks' instead of 'most recent'. Any help would be greatly appreciated. Hi I've got this database I created with fields ProductId ProductName Image I've managed to get it to list the ID,productname, and Image urls in a list. My next step is to have the image field actually display an image and make it clickable: heres what I've done so far: Code: [Select] <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("productfeed", $con); $result = mysql_query("SELECT * FROM productfeeds"); echo "<table border='0'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Image</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; echo "<td>" . $row['ImageURL'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Heres what I want to do: Code: [Select] while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ProductID'] . "</td>"; echo "<td>" . $row['ProductName'] . "</td>"; // my changes beneath echo "<td>" . <a href="<?php echo $row['ImageURL'];?>"> <img src="<?php echo $row['LinkURL']; ?>"> </a>. "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> Can you guys point me in the right direction? Many thanks This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=344960.0 Is it possible to have a link like this, http://www.somesite.com/?id=243 and transfer the "id" (or another query string) into the website from the link but at the same time, not affect the website (since "id" isn't a query string originally used in the website's URL)? I hope that makes sense.. I have a line like this it prints text link but I prefer image link how should i edit it I would appreciate some feedback Code: [Select] $templates['etiket'] = array('name' => t('ETİKET'), 'module' => 'uc_invoice_pdf', 'path' => $templates_uc_invoice_pdf_path, 'pdf_settings' => $pdf_settings); Hi, I've read a lot of places that it's not recommended to store binary files in my db. So instead I'm supposed to upload the image to a directory, and store the link to that directory in database. First, how would I make a form that uploads the picture to the directory (And what kinda directories are we talking?). Secondly, how would I retrieve that link? And I guess I should rename the picture.. I'd appreciate any help, or a good tutorial (Haven't found any myself). Hello, I am new. I have created a very simple webpage that has content the changes when a link is clicked. The site works perfectly on my "localhost". I am running Apache 2.2 and PHP 5.3 on localhost. When I upload to my GoDaddy shared hosting, ( I beleive Apahe 1.3 and PHP 5.2) my "index.php" displays fine on load. However, when any of the links are clicked the content area where it is supposed to change disapeears. Here is a sample of the code that I am using: // These are the links in the index.php html code... <li><a href="index.php?id='home'" id="home" name="home">Home</a></li> <li><a href="index.php?id='form'" id="form" name="form">Register</a></li> <?php include("form1.php"); getPage(); ?> html.... Then on the form1.php page is the following code... function getPage() { $linkID = $_GET['id']; if ($linkID == NULL) { changeBool("'home'"); } else changeBool($linkID); } //end example The function "changeBool()" has a switch structure that is determined by the $_GET[] var. I beleive this has something to do with the php.ini settings, possibly the apache settings...any ideas would be greatly appreciated. Hello, we got a site running in to different servers, the other one is a sub domain that will be use as internal pages and the other one is external. As of that I need to pass session to see if a user details.
Is there a another secure way to pass session data to other server without storing on the database?
Hi; I had an email from my hosting company which said that my account was hacked and one script in images folder is trying to send thousands of spams(file name : "/public_html/images/sm5vy7.php"). they blocked my account and asked me to check if there is any script or code that may cause this problem. The only server side page I had was a contact.php file that has mail() function in it. the code is like this; "if( isset($_POST['submit'])) { $name=$_POST['name']; $comment=$_POST['comment']; $email=$_POST['email']; $phone=$_POST['phone']; $to = "sample@gmail.com"; $subject = "sample"; $message = "sample"; $from = "$email"; $headers = "Content-type:text;charset=utf-8" . "\r\n"; $headers .= "From: $from" . "\r\n"; mail($to,$subject,$message,$headers); }" My question is "can the code I used cause any security problem that someone be able to create a php file in my images folder or someone has accessed my account?" Thank you in advance I'm really in a big trouble Hello - I have usually run my own servers, and always drop my .php files with MYSQL connection strings in a directory like /var, with webroot being /var/www/mysite. I now find myself in a shared hosting environment for a client and wondering the safety of my connection string .php files. Unfortunately they are sitting in a folder in the root of my hosting directory right now, and they feel vulnerable. It seems the only thing I could do would be to put the root of my hosting into a subdirectory, point the site there, and then put my connection strings on directory back. But seems the problem is they are still in my shared hosting. What's the best way to secure this type of sensitive info in a shared environment? I'm also getting ready to explore credit card processing via an API, and wondering if shared hosting is even worth it. Thanks!! I'm running about 50 domains on a private host that's going out of business, so I need to move providers soon. The Amazon or Google cloud platforms are intriguing. Does anyone have any experience using either for website hosting?
My current solution is a Plesk management interface. So, I'm hoping to install the same wherever I go (because migrating 50 domains manually ...)
I launched my new website about a month ago. I switched from one web host to another due to poor hosting performance. Now I'm running into the same issue again -- poor web hosting performance.
My first web host was Hostgator. My current web host is AT&T. I hate the thought of switching to a different web host every month trying to find one that will reliably host my site. Does anyone here have a reliable web host that they use and would recommend?
My question is relative since what is reliable for a simple web site, may not be reliable for one that is more complex. For this reason, I can't simply trust web host reviews.
My website isn't overly complicated, but it's more complex than just basic HTML. It uses a lot of PHP, as well as a MySQL database that only has two small tables. The website uploads and downloads small text files regularly. It also sends E-mail attatchments quite often.
Because I just launched, my website isn't getting a ton of traffic -- about 10 users per day. However, I'm beginning to run into the same problem as before. My web host's server is starting to show itself as being unreliable. As with my first web host, it seems as if it may be due to overcrowding on the shared server.
Do any of you run any moderately complex websites? If so, who do you use for a reliable web host?
I've considered setting up my own server with a LAMP configuration and hosting the site myself. However, I don't know a lot about Linux or Apache, and so would like to avoid this. But because the computer would only be hosting my own website, and no one else's, I have to believe that a LAMP setup would be more reliable than a shared server that is overcrowded.
A reliable web host is really what I'm looking for. But I don't want to keep going down the road of trial and error. If anyone uses a web host that reliably supports their moderately-complex website, then I would love to hear from you. I'm sick of my site failing due to server issues. Like the Duracel commercial says, "It just has to work!"
Please forgive me if you feel that my post doesn't correctly fit the forum category. I tried to figure out which category best fits this topic, but none of them seemed to be perfectly suitable.
Thank you for your time, as well as for any suggestions.
I'm wanting to extract an image from an external website and save to a location on my web server automatically. The scenario: 1. A user has an order form on our website with a field to paste the URL of a website in; 2. The user visits an external website page, which includes an image; 3. The user copies the URL out of the address bar, goes back to our website and pastes the link into the order form; 4. The user clicks next, and this extracts the image from the external website and uploads it to our website so the image can be seen alongside the order. My questions a a. Can this be done? b. If it can't physically download the image and copy to my web server, can I read the html source of the external website and grab the full URL to use to show the image on my website? Thanks for your help. Forbidden You don't have permission to access /cgi-bin/sendmail.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I was not sure on which board to put this thread, so please move it if there is a more appropriate board. I am wanting to create a website that displays images which I have put into a database. I would like the number of images on one page not to exceed 10, for example, and when the number of images in the database exceeds this number, a new page will be created. I would like it to function similar to Google Images where the number of pages is dictated by the number of images in the database. I cant figure out how to achieve this, so any pointers or thoughts would be great Thanks, Matlab Hi: I have a site hosted (shared) on 1and1.com hosting, and they seem to have a file upload limit of 2MB. Is there a way to overwrite this? I have been trying a .htaccess and php.ini file, but can't get it to work. The folder with the upload form is called "admin," in the ROOT of the site. Been trying (in both the ROOT and the "admin" folder): php.ini Code: [Select] ; Maximum size of POST data that PHP will accept. post_max_size = 8M ; Maximum allowed size for uploaded files. upload_max_filesize = 8M ini_set('memory_limit','128M'); .htaccess (in both the ROOT and the "admin" folder): Code: [Select] php_value memory_limit 24M That is all the code in each file - am I missing some code? Can this be done? Thank you. Hello, I was thinking of using this image upload script on my website: http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/ The question I have are the following: - 1. Do I need to take in consideration the $type="image/pjpeg" on this script or would it work anyway? - 2. When is the pjpeg actually used, is it only on certain PC browsers. Where can I find info about this? Thanks, df I want to get image background removal with core php like(remove.bg website without using any API)
i want to do it with code any guidance how can i do this with programmatically in php. |