I'm beginner in PHP. I have some URL data like this https://ibb.co/7kQNTmq
I'd like to work with it. You can see there is a date (DD.MM.YY) and a number. Id like to create to some mathematical operation like arithmetic mean per month, etc.I know as the first step I need to get from that URL. How is that possible please? I learn PHP over a month so be easy please :) Also I'm trying work with Presenters (Nette)
Best
You can use file_get_contents method to get website/file content.
Some documentation: https://www.php.net/manual/en/function.file-get-contents.php
However, it's only work on GET requests. You need to use cURL if you want to send POST or etc.
Related
I'm using Godaddy hosting plan & I create a php page to submit information to my lead buyer using get method. ode is working fine & when I click on submit data, it runs the query but didn't take the complete data with it. S I need to know how I can increase the query length so it takes my complete data with it. Here are few points that might help you understanding my problem.
I tried Chrome, Firefox. Results are same on both browser.
I can't use post method, because it's allowed to do so, So I need to post it using GET method in any way.
I'm attaching the PHP code so you can get the idea what i'm doing exactly.
echo "<td>Submit</td>";
I think you're missing quotes around your href. Try this. Note that you really, really, really, should use POST for this.
echo "<td>Submit</td>";
In PHP, I was wondering how to retrieve specific data from a google search. For example if I wanted to retrieve the price on https://www.google.com/#q=ps3&tbm=shop for the first result. I have experimented with curl and domdocs and am not going any where.
The simplest way to get the contents of a webpage in PHP is to use the file_get_contents function.
http://us2.php.net/file_get_contents
Once you have the data, you'll need to parse it. There have been plenty of great articles about how to approach this, so I'm not going to repeat them. Here's a link to a good one:
http://anchetawern.github.io/blog/2013/08/07/getting-started-with-web-scraping-in-php/
I am very new to programming and need a little help with getting data from a website and passing it into my PHP script.
The website is http://www.birthdatabase.com/.
I would like to plug in a name (First and Last) and retrieve the result. I know you can query the site by passing the name in the URL, but I am having problems scraping the results.
http://www.birthdatabase.com/cgi-bin/query.pl?textfield=FIRST&textfield2=LAST&age=&affid=
I am using the file_get_contents($URL) function to get the page but need help after that. Specifically, I would like to scrape only the results from a certain state if there are multiple results for that name.
Thanks for your help.
Read about POST method and its array ($_POST) ---> reference.
Similarly, there is GET method as well.
Why dont you see POST AND GET method?
Hi friends i am working on JQ-GRID. I want to show Image in specific column, But i don't know how to attach image in JQ-GRID. Can anybody help me or please send me some links, thanks
jqgrid is a feature monster. I tell this everybody who asks about it.
When jqgrid loads, a function is called which actually gets the data you want to display.
This is normally an ajax call to your php. As a result set of this function, you can just use xml or json.
I prefer json, so I build my result array and do a echo json_encode($myarray)
jQuery("#your_grid_id").jqGrid({ url : '/ajax/getjqgriddata.php'})
Now displaying pictures, there are different ways you can do that. You can either generate a <img src="wherever/mypicture1.png"></img>-link and hand it over in your result, or encode your picture binary data with base64 and deliver it with your result.
A more addvanced way is to use an so called formatter and just returning a id for the image.
This depends on you, but I would suggest to get confident with jqgrid, experiment with returning -links to get a feeling how jqgrid works.
There is plenty of good documentation at:
http://trirand.com/blog/jqgrid/jqgrid.html
Just take a look at it.
I'm trying to parse information from fonefinder.net. I was trying to use simplexmlload_file, but couldn't get the page to load successfully.
Now, I'm looking into Curl. But I'm not sure if this will work either.
I basically just want to take the html from the fonefinder page, and parse it to get phone carrier and city.
Is that possible? How?
SimpleXML will only work if the HTML is formatted correctly - and that is rarely the case ;)
You could do a simple cURL call to fetch the data and the easiest thing would probably be using a regular expression to get the information you need.
The solution however is not easy to supply you with, with nothing to go on. But this was an idea.
I Recommend using:
http://www.de.php.net/manual/en/function.file-get-contents.php to get the document
http://www.php.net/manual/en/domdocument.loadhtml.php to load it
http://www.php.net/manual/en/class.domxpath.php to get the information from it
Or use the search function here, that question must have been asked over and over, for example PHP: Fetch content from a html page using xpath()