retrieve a web page without images [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 8 years ago.
Improve this question
I am writing a web scraper for a specific site using PHP.
I use file_get_contents function to retrieve web pages.
some pages have images and images are also retrieved with the page.
In my case I don't want images to be there. (I want text only)
my question is, is it possible to retrieve pages without images? if so how?
additional info: I have checked the source of the page. there base tag is defined inside head tag and pointing to the same url.
Edit: I just notice images are base64 encoded.

It is not possible to "retrieve" the page with the images not included. You would need to parse/scrub the contents after retrieving it.
Inline with a previous comment, one method (of several) is this way if you simply need the image tags removed:
$data=file_get_contents();
preg_replace("/<img[^>]+>/i", "(image) ", $content);
echo $content;

Related

Why the carousel doesn't automatically change - PHP [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 2 years ago.
Improve this question
I've created simple page where you can add images to database. Here is my code, where i pull images to website:
enter image description here
in DevTools i can see that all images are pulled correctly:
enter image description here
But when i click next/previous
website is reloading, but picture is still the same, and URL is changed:
enter image description here
Do you have any idea why?
I even add JS script to add intervals to this carousel but it's still doesn't work.
Thank you
It seems the problem about javascript library. it is not loading. You need to add full code to test it.

How to use php in html coding to reduce no. Of .html files? [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
I have made the structure of a website. I have made three .html files named index.html, blog.html, posts.html. index.html is the home page and on that page their is a link for blog.html on the blog.html page thier are some posts heading and i have connected one post to posts.html. But now i'm in trouble that if i have to made one .html file for each post then it would be very difficult so what should i do so that i have to make only one posts.html and anyhow connect it to a php file or something else so that i don't have to make many .html file for every post.
Can i use php for it, is their any command that--> if you click on this post then this page will open and if you click on another post then another page will open. By this i will give the command for all the posts and it will help me alot.
Thank you
Try file_get_contents php, or create a small ajax client to load html.
$your_html_file = file_get_contents('./test.html', FILE_USE_INCLUDE_PATH);

Is it possible to include external content with php? Is it SEO friendly? [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 need to include an external page into my website. How SEO friendly is this? And which will be the right code to use? I came a accross a few different codes and I'm not sure which to use...
Your question as is does not target a specific problem and no code is provided.
You can fetch anything you want and integrate into your website, using output buffers, file_get_contents(), SOAP, REST or cURL.
Search engines do not recognize the fetched content as external, but your page load time might increase if you do not buffer the content which decreases SEO value.
The better question is, does the site you want to fetch from allow using of their content, what licence does it have?

WordPress images [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 am trying to create a WordPress theme and need to be able to change the images on each page outside the WP text editor. Can this be achived without plugins?
Many thanks for you help.
You can use FTP Manager and replace old images with the new ones.
do you mean you don't just want to use the featured image on a page? - you can create a different template for each page with its own image on. For example if your site has three pages, home, about and contact for example, in your themes folder, saving page.php as page-home.php, page-about.php and page-contact.php is one way to do it. - alternatively use different featured images on each page.

How do I to get title, description, image_url of a URL using Ajax like sharing a link on Facebook [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 5 years ago.
Improve this question
I am working on a project where if a user submits a URL, it should grab the title, images, and description from that URL and then give an option to change between images.
When submitted it should post those values.
Facebook, Google+ gets image, title, description from two known ways.
1) Most of the well-know websites gives og tags. It contains title, description, image
http://ogp.me/
2) meta tags inside head tag of html will also be published by many sites. You can make use of that also.
For more explanation see the following link.
https://webapps.stackexchange.com/questions/6745/how-does-facebook-publisher-select-the-image-title-and-content-from-a-shared
I advise that you make a PHP page that parses the information and returns the data to you Ajax function. So to summarize, you'll want to google: "PHP Parsing HTML" and "Ajax PHP Retrieve Data".

Categories