Solved

PHP5/ZEND: css not found problem by using header in controller

Posted on 2011-09-17
2
368 Views
Last Modified: 2013-11-10
hello all,

i would like to open a file in public folder within a zend controller. all work fine except the css file losed, the page is display but the css which used in the page is losed. any suggestion?

codes are below.

thanks.
wantime

if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
		$uri = 'https://';
	} else {
		$uri = 'http://';
	}
	$uri .= $_SERVER['HTTP_HOST'];
	header('Location: '.$uri.'/folderInPublicfolder/readme.phtml/');
	exit;

Open in new window

0
Comment
Question by:wantime
2 Comments
 

Author Comment

by:wantime
Comment Utility
btw,  i linked the css file in the readme.phtml, it seems the link doesn't work when i call this page from controller. But if i open this readme.phtml directly in browser, the css works without problem.

 <LINK REL=StyleSheet HREF="../mycssfolder/my.css" TYPE="text/css" >  </LINK>

and when i attach the whole css inside the readme.phtml, the problem is resolved and the page is displayed as i wish.

now the question is: are there any way to let the LINK work? because i don't want to attach css content in the readme.phtml.

thanks.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
I've used this successfully:

<style type="text/css" media="all">
@import url("style.css");
</style>

The file "style.css" is in the WWW root directory.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now