Jump to ContentJump to Navigation/Login
` ` ` ` ` `

[Register]

Occasional ATutor release updates


No Members Logged In

(9 guests in past 15 min.)

Access Understanding Web Accessibility to learn about accessibility, or Register to take the course for FREE.

Support Forums

ATutor Support

Can you put php in a content page?


You must be signed-in to post.

AuthorSubject
  Page: 1
gtilflm
Subject: Can you put php in a content page?Quote this post in your reply
I have 2.0 installed and I was wondering if it was possible to put php code into a piece of content.

Situation: I have my content dir. in the root of my site (not a web accessible area). In a piece of content, I want to link to a page in the content dir. Normal html links don't seem to be working. So I'd like to do something like...


<?php a href="<?php echo AT_CONTENT_DIR . '/path_to_file_in_content_dir'?>/file.html">file in content dir.</a>
?>





Or perhaps there's a better way to do this?

Thanks.
Posted: 2010-08-02 15:27:23
greg

Avatar for greg
Subject: Re: Can you put php in a content page?Quote this post in your reply
Php in content would be to dangerous to allow.

You should just have to use a relative path. If you have a folder in your file manager called images, the path to its file would be something like:

images/someimage.jpg
Posted: 2010-08-02 15:36:36
gtilflm
Subject: Re: Can you put php in a content page?Quote this post in your reply
Greg,

The content I'm referring to is video content in an html file.

Uploading all of this via file storage would probably be unrealistic as we're talking a lot of files and large files at that.

Can I manually create a dir. in the content folder and use a relative path somehow?
Posted: 2010-08-02 16:05:06
gtilflm
Subject: Re: Can you put php in a content page?Quote this post in your reply
By the way, my installation is in a sub dir. of my site, if it matters.

Thanks.
Posted: 2010-08-02 16:13:15
greg

Avatar for greg
Subject: Re: Can you put php in a content page?Quote this post in your reply
Upload files to any Web accessible directory, then create Weblink content pages that points to them. See content editing in the handbook. Or use the [media] tag to link directly to media files.

You can't link to files in file storage, not to be confused with file manager.

A sub directory makes no difference

In reply to:
Uploading all of this via file storage would probably be unrealistic as we're talking a lot of files and large files at that.

Posted: 2010-08-02 17:03:19
gtilflm
Subject: Re: Can you put php in a content page?Quote this post in your reply
Greg,

As a security measure, I was wanting to place the dir. with the video content outside of the web accessible area so that people couldn't just link to them directly.

Clearly, files in the content dir. that are outside of the web accessible area can be accessed via the content pages. I just need to make that happen for my files. Is there a place that explains how this happens?

Can't use the media tag because I'm linking to a html page that loads and plays an mp4.

In my earlier post I meant subdomain not subdirectory, if it matters. I also was referring to the file manager instead of file storage.


Thanks for your thoughts.
Posted: 2010-08-02 19:29:03
greg

Avatar for greg
Subject: Re: Can you put php in a content page?Quote this post in your reply
I'll point you to the get.php file. You'd need to create yourself something that works like it does.
Posted: 2010-08-03 15:49:18
 Page: 1

You must be signed-in to post.