how to get database data from a web page using PHP [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
In this case i want to extract data from this URL:
https://www.aeropuertosgap.com.mx/es/index.php?option=com_infovuelo&Itemid=746
I did use HTML_DOM but it (obviously) only extracts html data, it is just flight information!

You can't really access another person's database directly unless the airline provide some sort of API to help you access it.
The only real way I think you could do this is if you POST data to the form and then filter through the HTML and get the required data.
See How to set POST data to URL and get results in string variable
From looking at the HTML of the webpage, I can see the form is posted to: index.php?option=com_infovuelo&Itemid=746 and the results are under the div with id "info-vuelo-result".
Good Luck!
P.S. This is one weird question!

Agree with Yahya Uddin. You need to write robot, sending form data, then parse the response, using DOM queries.

Is this a theory question or you want us to develop the code for you?
IF THIS IS A THEORY QUESTION:
well I did something like this with a calendar where the provider did not have any API or anything else, so what I did was get the content with file_get_contents and using preg_match and preg_replace I achieved what I wanted to do with it.
Also check CURL.

Related

How to display data from an html form in an html table [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Please forgive me if this has been asked and answered before, but I couldn't find it in the search.
As stated in the title, I have a form built in HTML. I need the user inputted data to be displayed in an HTML table. I know the easiest way to accomplish this is probably to do so using SQL to store and then retrieve the data and PHP to output it in the table itself. For the life of me I cannot get this to actually work. Google is absolutely my friend but literally nothing I've tried actually works. Examples would be wonderful and I seriously appreciate the help! Thanks!
This link could help you: https://stackoverflow.com/a/15251402/4149985
Basically, you need a web server, either locally or via a hosting provider with access to a database.
Your database needs to have a table, which contains records.
You need to use PHP to connect to the database, retrieve the records and then output them as a HTML table.

Scraping data which loaded after scrolling to bottom [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm working with PHP and I want to scrape some data from any website. But I have a problem. I scrape data but these items number are 48. But I know that page has 11K items. Rest of datas extend when you scroll and you get new bunch of datas (48 items).
I'm scraping with simple_html_dom. How can I manipulate scroll and get data ?
Thanks! :)
Sounds like the missing data is loaded via ajax.
Check the Network tab in the Developer Console (by pressing F12). Take a look at the URL which is being called (and the response), and edit it to your needs. Then call this URL instead of the one you are taking now.
It is impossible by this way.
But if you need to scrap this data you can send requests to endpoints which return lazily loaded data. You must research js code of target site.
p.s.
If you want to use really hard approach, you can research browser emulating.

How can I read out of a MySQL database in xcode/swift [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was wondering how could I read data out of my MySQL database into swift/xcode.
I searched all over the internet and i just need to know how to read out of a database that on my webhost. I do understand how PHP works, but I do not know everything about xcode.
If something isn't clear, feel free to ask.
Regards,
Jenoah
I can understand your problem. You can not execute MySQL queries directly from xcode. For that you need to have web-services.
You can create web-services in PHP or any other languages. Pass parameters in your URL (GET or POST). and use those params to deal with your database. Finally, output it in either json or xml.
Now, from xcode side you need to call that URL and fetch response from your json or xml.
There are bunch of libraries out there by which you can call web-services from xcode. I am not into ios programming so, I don't know that much about it. But, you have to create those services by your own. Hope this will help you.
I recommend you to post some parts of your code because your question is not specific.
With that information, I can only tell you that you have to connect your Swift code to a PHP file (using POST) and then in that .php file connect to the database. If you want to read the results from that database, you can use JSON to read the information.
If you show us your code we could helo you better.
Thanks,

How to implement a database like search form into a website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I go about implementing a database like search form into an HTML website? For example, there is a form to enter your zip code and after entering the zip code, it searches a .txt file (for example) and returns results that fall under that specific zip code.
Any help would be greatly appreciated.
Thank you
There are many approaches you could take. It's a very broad question.
As an example solution, you would need to have both client and server side code. The client would submit the form to a server. The server code could be written in a multitude of languages, PHP, ASP, JAVA etc.
The server side code would take the request parameters sent by the form, read the file, calculate any result and pass it back in the http response to the front end, which could be dealt with by displaying a new page or as part of an AJAX refresh.
As you can appreciate though, this is a very broad topic and there are many possible solutions.
Also as #Dagon points out, if you are not restricted to using a text file (although your title probably suggests you are) then using a MySQL or other such database could be a better solution, maybe even Solr as an indexing solution, depending on what you are searching for.

Multiple Blog Feed [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I hope you're having an awesome day.
Today I wanted to implement a blog on my site, write it on bloggr and when I post it, feed it to mysite.com/index.html What would I need to be able to accomplish this! Help would be greatly appreciated!
I was searching around blogger and ended up in a configuration of it,
1st. I get asked for my domain.
Then I have to replace the CNAMES...
-the blog just redirects to my domain with bloggr style...I want the blog to be displayed on one blog.mydomain.com/post-youre-watching
I also want a div with the feed of the last 3 entries(despite the author)...How can I accomplish this? You guys know anywhere where I could find information on how to do this? If so, what information(or language) do I need to learn?
If you want to present the content on your site (rather then making your hostname point to Blogger) then you'll need to actually put it on your site.
The simplest way would be to periodically pull the data from the Atom or RSS feed hosted by Blogger and store the content in a database on your server.
You can then query it with your own server side code to get whichever combinations of data you desire.

Categories