Alternative to PHP Include? [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to include an external page onto my main home page of my website. However, when I use include_once or just php include alone, it throws this error at me:
Warning: require_once(../_inc/glob.php) [function.require-once]: failed to open stream: No such file or directory in /home/radisite/public_html/panel/_frontend/requests.php on line 2
I don't want to use iFrame because then it slows my site down completely. Is there any other faster alternative for PHP includes? I've looked at other methods on here and they're confusing me to bits.
Thank you!

It seems that you have a problem with the path of the file. Check your file path and it will work.

You may either specified a wrong path, or have problem with include_path setting; If you are sure your path is formed correctly, then either adjust include_path, or prefix your path with dirname(__FILE__) on PHP < 5.3 or __DIR__ on PHP >= 5.3

use
require_once($_SERVER["DOCUMENT_ROOT"]."/yourfolder/".'glob.php')

Related

PDO Class Caching Issue [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
For a few days now one of my class files doesn't seem to be recognizing the updates I'm making to it, and I can't figure out why. I've verified the server has the most current copy and also tried deleting the file off the server and uploading a clean copy. I've even removed functions entirely from the class and then successfully ran those functions from another file even though I'm positive it was no longer in the class file.
I don't know what the issue is, but I'm guessing it may be some type of cache issue? Tried rebooting the server too, same issue. I've also poured through the code and can't find any errors. Here's a link to the file http://pastebin.com/eiki93GM.
What are some of the possible issues?
There are two
opcode cache with disabled filemtime check.
you are uploading to the wrong server.

php path error in imagejpeg() [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
when i use imagejpeg() it works fine in local while giving error on live
here is the warning message
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://test.ourserv.com/Optfolder/cmp_dd5ac79bcf/20131027_185925.jpg' for writing: No such file or directory in /home3/test/public_html/server/Optfolder/image_re.php on line 36
i had same error with opendir() but when i write path like this it resolved but when i use even this kind of path instead of http it does not work with imagejpeg()
what is the path should i use,why path work locally fine and not on live server in php??
opendir('/home3/test/public_html/server/Optfolder/upload/upload');
use path like this
this will help you
$abs_dir=dirname(__FILE__);

Directory of the page a file is included in [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am including a page in the directory all with the function basename(__DIR__) which is in the directory inc, so echo basename(__DIR__); returns the directory inc, instead of directory all.
How can I fix this?
Maybe, the best way is define some specific constant in file that placed in all folder and then included into other?
define('ALL_PATH', realpath(dirname(__FILE__)));

Error on including a file - Warning: include(connect.php): failed to open stream: No such file or director [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
Here is the image of project file structure -
I added include 'connect.php' in index.php file.
Index.php file is present in register folder. But i get an error 'failed to open stream no such file'.
You could add a simple DOCUMENT_ROOT to your include in which way it will always go for the direct server path to the file.
include $_SERVER["DOCUMENT_ROOT"]."/connect.php";

How to get set up for learning PHP? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have downloaded WAMP to try to learn PHP on, and am having trouble getting it to work as expected whenever trying to follow along in PHP tutorials.
Either what I get back in my browser is raw PHP (as shown below in "PHP Test 1"), or nothing at all (as shown below in "PHP Test 2"). I'm just trying to learn the basics of PHP, and am finding this to be very frustrating. Can anyone help? What do I need to do get PHP working, or what should I try?
Originally I was going to post screen shots to better describe the problem I'm having, as well as to better help others who are experiencing the same problem, but was not allowed to due to something about not having enough "points". Anyway, what I was originally trying to post can be found here:
https://sites.google.com/site/bluedog4678/
You need to start WAMPP then type this in the address bar: localhost/PHP_TEST_1.php.
You are currently opening a simple file without running WAMPP you need to run it through localhost.
You shouldn't access your files directly. Normally with simulated apache-servers you need to type in "localhost" to let it render correctly
EDIT
If you want to select a file it would be "localhost/"

Categories