Jump to content

Recommended Posts

Hi, im new here, trying to learn php.  I am trying to include a file from my index to one located in '/folder/folder2/file.php'.  I am using the absolute url.  However, I keep getting

 

Parse error: parse error, unexpected T_STRING in http://mydomain.com/folder1/folder2/file.php on line 1

 

However, when I visit the page manually, it works fine.  My line 1 is '<?php'

 

This problem is causing me to tear out my hair, I can't continue until its fixed!  It only happens with php files, I can include .html files with no issue.  Please help!

 

EDIT:  The code im using to include is:

<?php
include 'http://mydomain.com/folder1/folder2/file.php';
?>

 

EDIT2: I think it has to do with me using absolute urls.  I have enabled them in my php.ini but I think the host is blocking it.  I have sen't then an email.  MY host is godaddy and they let me use my own php.ini file.  I have set the following:

allow_url_include = on

allow_url_fopen = on

I know its a security risk but I just want to get this working, argh!

 

In the meantime, can somebody please tell me how to include to the directory I need to without a full url?  I have googled and tried different codes to no avail.

Link to comment
https://forums.phpfreaks.com/topic/71430-solved-unexpected-t_string-in-line-1/
Share on other sites

Line one is 
[code=php:0]
<?php

 

Im sorry, what?

 

Anyways, thanks for the help guys but I figured out the problem. Apparently my CMS (e107) does not allow for me to include a php page the way I want.  So im going to have to think of another way.  Thanks again, this forum has quick responses!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.