include

Including an external webpage using PHP

How can I use PHP to include an external webpage? (sort of like the wordpress theme preview.) I want (X)HTML STRICT compliant code - no iFrame and preferably no javascript. The idea is that I am making a sandbox for clients to view webpages in my controlled environment. The other thing is that the webpages being included should not be...

How do compilers know where to find #include <stdio.h>?

I am wondering how compilers on Mac OS X, Windows and Linux know where to find the C header files. Specifically I am wondering how it knows where to find the #include with the <> brackets. #include "/Users/Brock/Desktop/Myfile.h" // absolute reference #include <stdio.h> // system relative reference? I assum...

Question about the PHP include statement

I'm looking through the Zend_View source and I see this: include 'zend.view://' . func_get_arg(0); what does the string "zend.view://" represent and how would the include statement resolve that in php? ...

C++: #include file search?

This MSDN document quotes: look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file Wait, what? What does that actually mean (the bold stuff)? ...

Windows.h error

I am getting error : WINDOWS.H already included. MFC apps must not #include <windows.h> Help needed. ...

Best way to load only specfic functions in PHP.

I'm writing my own content management system for a personal website, it's going to be low traffic, but I'd like to use the best practices for my future knowledge. My plan is to have separate sections, basically the first non-root directory, will have it's own script and will directly control all its subpages. I want everything to be con...

PHP Include Error w/ CSS

I have having difficulties on this one page login.php becuase of the nature of the session it does not allow a $page to be called. I included the header the same way I did on all other pages. The code highlighted between the ===== is my header include with $page defined for the < ul > so I can call a different class each page. But it's n...

PHP Include Error

After changing my include header to a add a function. It disabled my php echo username code. So it went from htp://example.com/register.php?r=username to htp://example.com/register.php?r= <?php function headertop($page) { include('header.php'); } headertop('members'); ?> <div id="myaccount"> <p class="reflink" align="cente...

Entity Framework - Deleted association still appears in the second call

Hi, We have a long entity framework context running (don't ask why...), with a query which retrieves a user entity with its associations: var user = entities.UserSet.Include("UserAddresses") .Where(u => u.Id == 1).FirstOrDefault(); If a row of a user address is deleted from the database (by another process), and we ...

PHP include from URL that redirects

I've inherited a bad sitation where at our network we have many (read: many) hosted sites doing this: include "http://www.example.com/news.php"; Yes, I know that this is bad, insecure, etc, and that it should be echo file_get_contents(...); or something like that (the output of "news.php" is just HTML), but unfortunately this is what t...

Getting a "Fatal error: Cannot redeclare <function>" error

I have a function(this is exactly how it appears, from the top of my file): <?php //dirname(getcwd()); function generate_salt() { $salt = ''; for($i = 0; $i < 19; $i++) { $salt .= chr(rand(35, 126)); } return $salt; } ... And for some reason, I keep getting the error: Fatal error: Cannot redeclare gene...

struts2: jsp include with parameters

when I include jsp either by jsp:include or by s:include and specify parameters - they are perfectly accessible by EL ${param.XXX} but not by OGNL %{#parameters.XXX}. WHY??? What should I use instead in struts tags? ...

Link to CSS files across domains without mixed content warning in IE?

My sites run off a subdomain (yyy.xxx.com), but I'm required to include CSS files from the main domain (xxx.com). We run a CMS that doesn't let me do any server-side stuff during the preview stage, so I'm stuck sending a page over https that includes a CSS import to http. All my IE users get a mixed content warning because of this. Is t...

Cost of an #include in C

Say you #include and never use anything from stdio.h. What are the overhead costs associated with this? I noticed a lot of network code includes all networking related headers they can think of in case they end up using something from one of them, so I was wondering if this is some sort of ease of use vs efficiency trade off or if ther...

How many lines of PHP code is too many for one file?

I'm creating a PHP file that does 2 mysql database calls and the rest of the script is if statements for things like file_exists and other simple variables. I have about 2000 lines of code in this file so far. Is it better practice to include a separate file if a statement is true; or simply type the code directly in the if statement i...

Dynamic Titles question

How would I make it possible to have dynamic(i think thats the word) titles with this setup? For example when I'm viewing a profile I want it to say Viewing profile of USERNAME' inside <title>. How could I make this possible without putting the html top on each indivudual page? Thanks a lot. and please dont start talking about mvc's, i...

php require_once path confusion

Hi, I was writing an web app in php, when i encountered a strange situation. I wish to clear my confusion. To illustrate my problem, consider a web app of this structure: / index.php f1/ f1.php f2/ f2.php contents of these files: index.php: <?php require_once("f1/f1.php"); ?> f1.php: <?php require_onc...

Rails: Limit SQL fields for included table > find(:include => {:select => "id,title"})

I have 2 tables :products and :providers with has_and_belongs_to_many association. I would like to do this @list = Product.find( :select => "id,title", :include => { :providers => { :select => "id,title" } } ) How can specify fields for included table? Thx! ...

PHP How to include files based on creation date?

I want to create a news page that includes a snippet of the latest 3 filea created in the following directory structure: So lets say I have the following files: /news.php /2010/the-latest-article.php /2009/some-long-article-name.php /2009/another-long-article-name.php /2009/too-old-article-name.php /2009/another-old-article-name.php I...

Includes stdafx.h winsock2 redefinition errors

When I include winsock2.h, I get about 60 redefinition errors. I hunted around a bit a found some advice to include winsock2.h b4 including windows.h. I did that and that cleared up the errors. My problem and question concerns exactly how I should go about doing this. I did not explicitly include windows.h, it was done for me in stda...