Server-side parser(?) for specified data [closed] - php

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 8 years ago.
Improve this question
I'm learning php and website development in general. Currently I'm trying to write a script in php that would access a website as Internet Explorer (important) and look for a specified word/pattern everywhere possible. Simply parsing doesn't do the job.
The thing is, I can do that manually - I open website X and press F12 in Internet Explorer->debugging section and I search there. However I have no idea how to implement such a thing in php or any other language.
TL:DR
Need to extract data from a webpage the same way I do it manually (explained in paragraph above). However, simply parsing doesn't do the job. I need to achieve that in php or some other server side language.

In addition to limited approaches such as file_get_contents followed by a string search (or XML parser), you can look into more feature rich libraries such as the SimpleTest Scriptable Web Browser.
You'll want to modify the user agent string in order to simulate a request from Internet Explorer.

Related

Edit a css file from the live 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 6 years ago.
Improve this question
so i want to develop a mini website builder within my website. Have a control panel where users can edit the text in their websites, i want each of those html pages to have its own css file attached to it. Now, i want it so that the user sees something like a button saying "Edit Background color" they are prompted with a color picker and on hitting save, the css file is updated without them knowing that css even exists.
I would like to know what language i can use to make the previous example happen. And if possible a hint of code.
I appreciate your answers, Braulio :)
I didn't downvote you but just for informational purposes, the reason you were probably downvoted is due to the scope of your question, The language you choose depends on what platform you are running your site on. And it is likely possible to do what you want in tons of different languages assuming your platform supports them. For an easy solution check out .net languages like c# with ajax controls for live updates without refreshes. But then again you could use ruby with rails. Or you could do most of it in the client side with jquery and javascript then send the results to the server which could utilize php. It is just to broad a question to really answer without writing the whole thing for you which nobody is going to do.

How do I find out the source from where the website gets its information [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 8 years ago.
Improve this question
As I go through pages of pages from a website filled with information that I know are coming from a database somewhere on the backend, is there a way to find out the php link to where this information is stored through chrome dev tool so I can extract them into an excel sheet? Is this possible?
If front-end scripts recieve data from back-end servers via AJAX calls, you can, for example, see full HTTP requests parameters in the Network tab of Google Chrome Developer tools in Chrome browser (other browsers provide similar functionality).
Open Network tab of Google Chrome Developer tools and perform some actions on site. If your actions do not lead to opening another page, you will see some activity in your Network tab.
PHP is server-side language so you can not get this.
Of course, if the website is vulnerable and you can get access to the "code" then yes, is possible.

Identify user machine with PHP or other language [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 8 years ago.
Improve this question
Does PHP provide a way to identify whether a user machine is a PC with a mouse and keyboard, or a touchscreen laptop?
+1, Good question. Yes, identifying the user is important for better user experience.
Look into user agent detection. This might help you get started. They analyze the user agent (UA) string the browser sends when making requests. However, detection with PHP is probably limited, and Javascript will have to get involved to fullfill what you want.
get_browser() in PHP
Detector
There are various ways to detect whether a browser has a feature
Detecting that the browser has no mouse and is touch-only
Modernizr (used by Detector) this common Javascript library simplifies the task.
Look into conditional html/css/javascript:
Conditional Formatting in HTML Tags
Also, there are css vendor prefixes/extensions for Mozilla, Webkit, used by Chrome and Safari that only apply to a specific browser
Hope this helps you!

ASP.NET and PHP on the same webpage [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 8 years ago.
Improve this question
I'm wondering if there would be any problems using PHP on an ASP file? I plan to develop a website where I'll be inserting PHP code to load some info from a database but i'll be using ASP for the layout of the site.
Thank you in advance!
This is actually quite possible... if completely boneheaded, in this author's opinion, but it's a fun challenge. Here's how you'd do it:
If you'd like to use PHP to process the file initially, and then use ASP.NET, I would begin by using a VirtualPathProvider which uses a HttpClient (if .NET 4.5+) or HttpWebRequest to make the request to the resource that will be processed by PHP, the VirtualPathProvider is a means of making ASP.NET use a virtual filesystem, it's how you can store .aspx and .ascx files in a database, for example.
If you'd like ASP.NET to process the file initially and then use PHP, it's a bit more difficult, but still doable: you'd use ASP.NET as usual, but implement an IHttpModule which intercepts the result from ASP.NET and provides it as stdin to the PHP CGI executable, and then returns the result.
Implementing both proposals is an exercise left to the reader.

Reading Website pages [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
Assume there is a website called http://example.com/a
the website is being developed using PHP, Perl, Ruby and other languages.
I want to be able from my website to read this website pages, execute the code and then analyze the HTML result page tags and getting the content using PHP.
it's like reading news from some news websites and then displays it in my website in different format or different style.
I'm not sure you understand this aspect of web programming, but you cannot access the server-side code which generated the HTML. You can of course parse the HTML which is returned from the server by using one of many HTML parsers.
That may or may not have been what you asked, because your question is a bit vague to me. Note that if you want to collect information from other web pages on your web page, you should make sure your web site doesn't make a request to those other web pages each time a user visits your site. (Phew, that was a handful!) You need to implement some sort of caching of the other web sites' content.

Categories