Displaying an image from database [closed] - mysql

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I realize that this is probably going to be a duplicate question, but I have searched and searched for an answer and am unable to find the right answer. I want to display an image uploaded to my database on a web page. I have tried about a zillion different ways and just can't get it. I would hard code it, but I'm using a "base" page for all the pages so all the information is shown dynamically. I hope this makes sense. I just don't know how to make the image show up? Is this a more than one step process? I'm still fairly new to all this, so it has quite confused me. Thanks for any help!

When a page displays text, this is what happens
A URL ie https://audaxing.wordpress.com/2013/05/20/600km-stage-by-stage/ does a request to a web server
The server sends back a header saying "here comes some html text"
The server finds the appropriate content
the server sends back the text with the content, in html format
For an image
A URL ie http://audaxing.files.wordpress.com/2013/05/img_20130518_194100.jpg?w=500&h=375 does a request to a web server
The server sends back a header saying "here comes an image" including the image format type
The server finds the appropriate content, which will be binary data in a image format such as jpeg
The server sends the binary data back
So all you have to do is send an appropriate header, select the data for the image from the database and then "print" the data like you would a page. You may need to use a special binary mode for the data printing
The exact details depend on the platform (php, scala play, django etc etc) that you are using

Related

Applying AJAX to refresh contents of a table designed in HTML and Perl [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am having issue in applying AJAX so as to refresh certain contents of a table designed in HTML and Perl.
Say, if the contents of the following cells
{R2,C3},{R3,C4},{R4,C(5-7)}, {R(7-10),C(8-11)}
need to be refreshed every 10 seconds,
what shall be the corresponding PERL code for the same?
Millie a Thanks for sharing your Kowledge and Time.
Get the data you want (how you do this depends on how it is stored).
Convert it to JSON (the JSON module is well documented) … assuming you want to use JSON, although it is a common choice.
Output a Content-Type: application/json header (how you do this depends on the method by which you are interacting with your web server, it will be different between Plack / a framework / mod_perl / raw CGI / etc) … the same assumption applies.
Output the JSON text (ditto).
There is a simple example using FastCGI.
You need to build a JS method to Asynchronously obtain content from server side
You need a server side module (pearl in this case) to produce that content, there is no special code requiered on the same . you can use your existing PERL server-side module.

Question on submit and push buttons. and also the scripting language in HTML [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Iam working on HTML.and As for now Im going well.But the thing I want to know is about the submit button.I have created user and password and a submit button and a register button.The basic question on my mind for now is, how and where the user names and password are stored and how they are retrieved back to check if they exist or no ? Where do they save the user names and passwords?
and How do i save the user name and the password that is entered through submit button in some other file? I have written perl scripts and c programs for saving and retreiving passwords using file concepts.But how do i manage them in HTML.Do they also save these data in some file and search for the user and password using some python or perl script and send back the result?
because searching and sorting techniques are powerful with the above scripts.I dont know how to use them in HTML and also the question is,can we use them in HTML?
Please let me know How to make it through.And can we also redirect to some links when we use click button and push buttons ?
Can we use scripting languages like perl in my HTML file if so how?
The <script> element lets you embed any langage you like in an HTML document for client side processing.
The languages supported by browsers are:
JavaScript (universal among browsers that support scripting at all)
VBScript (Internet Explorer only)
PerlScript (Internet Explorer with a plugin that ActiveState used to distribute)
Perhaps some others with support that is about as common as that of PerlScript
So, effectively, client side you can use JavaScript and only JavaScript.
Server side, you can use any language you like. The webserver just needs to be able to communicate (and, while inefficient, CGI just depends on STDIN/OUT and environment variables).

In which language is made a page ".shl"? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Pages like this:
http://info.abril.com.br/noticias/carreira/ibm-da-curso-gratuito-de-ingles-a-distancia-06092010-37.shl
are make in which language? Is "shl" a language? I didn't found more about..
File extensions on the web can be misleading. Webservers can be configured to treat extensions any way they want. There's nothing stopping a webmaster from naming all their HTML files ".exe" and calling their PHP scripts ".aspx"
Check that server's output headers. maybe there's a language signature. e.g. PHP can put in an "X-Powered-By" header if the webmaster so chooses.
It doesn't have to be a specific language, it depends on the configuration of the webserver. I would hunt for clues on the page, as the file extension is no help concerning finding out the underlying technology.
Well all webpages - including the example page you link to - are written in HTML and javascript. What the server-side language is that generates (or simply returns) that HTML and javascript could be practically anything.
However, the file ending .shl doesn't necessarily mean the server side language is .shl related. You can have your URLs ending with anything you like.
As far as what .shl file extension might be, I don't know. A google search throws up this: "Inno Setup String Tables file format" but i have no idea what this is.

Is it possible to get database contents from any website without having DB access? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I want to retrieve the database contents from a website and use it in another website. Is it possible to access the database contents using any scripts ? There are totally 500 + products in the website and they are going to remove those contents now. So before they remove them i want to download all the data and host it in my website. It is not possible to visit each and every page and write down the products information. It will be helpful if I get any kind of script to access the database and download all of them in a specified format.
For eg: We have leech software for forums to get content from another forums.
No!!!!The question is not whether it is possible or not. It is whether you are allowed to copy from the site or not.
You cannot connect to the databse without the details.
Why don't you contact the website owners to send you the data they are going to remove it anyway?
No, it is not possible. I would recommend trying to get in contact with the site owner and explain why you want their database and such and they may let you have it. Otherwise your best bet is to crawl the site and get a copy of every page and then manually populate(or attempt to automate it somehow) your own database from it.
I'm assuming you don't have administrative privileges to their site, in which case you can't just issue queries to their database. Their web page acts as a front-end to the database (and their business logic) thus preventing users from ever interacting directly with the data. That set-up is intentional.
The leech software you mention is generally implemented as a scraper of sorts. It downloads the contents of a forum as just a webpage, no different from how a search engine would crawl the Internet. If need be, the leech might store/mimic a cookie in case the forum requires a logged-in user. But in no case does the leech access the site's underlying database.
So your choices are to either write your own crawler, or email the site's administrator (as others have suggested). I'm not going to get into the issues of whether what you're asking for can be considered fair use; you should any legal ramifications before you attempt scraping.
if you have any permission to that sites or you are administrator of that site, may be you can SQLdumb or any package for dumping data. But if have not a permission you cant do that.

How to easily insert Excel spreadsheet into web page? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would like to insert an Excel spreadsheet into a Web page but would like to change some of the data at the same time to make them more user friendly.
Is it easily possible?
Thank you for your help.
Excel can export HTML files directly ("Save as...") What modification exactly do you want to do? Can you do them by hand? Do you want to automate them (how often you want to do the export?)
For small modifications, it's relatively easy to write a VBA macro (or just record it..).
If you don't mind the security risks, you can activate ActiveX and embed the Excel spreadsheet in the web page using the <object> element (see these forum posts for some pointers). Don't browse the Internet with ActiveX enabled! You will get a virus or Trojan.
Note that the spreadsheet must be on a network drive that is accessible by all users.
If that isn't an option, then try Zoho Sheet or Google Docs. Drawback: You must give your previous data to a third party.
Last option: Use a web server to convert the Excel into HTML and use a JavaScript grid control.