Browser interpreting PHP code as HTML after -> sign. How can I stop it?
-
I am working on a website using XAMPP. PHP is configured correctly. There is no syntax error in the code. File extension ends in .php. I point to it by http://localhost/file.php. Here is the code: <?php include_once('simpleDom.php'); $target_url = "http://www.example.com"; $html = new simpleDom(); $html->load_file($target_url); foreach($html->find('img') as $img) { echo $img->src."<br />"; echo $img."<br/>"; } ?>
-
Answer:
please check that there are no short tags in the code such as <? ?> because short tags are off by default in xampp, you can either turn them on or remove short tags and use <?php ?> i nstead
Faizan Ali at Quora Visit the source
Other answers
Did you make sure it's not ALL getting sent to the browser? The results you describe are consistent with how a browser would display that content.
Peter Gee
Make sure apache loaded php module (uncomment php5_module in httpd.conf)
Roman Piekarski
I got the Answer: It was all text editors fault. Thanks anyways all of you.
Furqan Shafi
Related Q & A:
- How can I stop only for one month my period menstruation?Best solution by glamcheck.com
- How can I stop my Yahoo logging out?Best solution by Yahoo! Answers
- How can I stop my browser from redirecting?Best solution by Yahoo! Answers
- How can I stop a player in chess from freezing my game when I am winning in the middle or at the end of a game?Best solution by chess.com
- Whenever I get a runny nose, I bleed from my nose. How can I stop this?Best solution by healthtap.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.