?
Solved

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

Posted on 2011-09-17
2
Medium Priority
?
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:wantime
ID: 36553646
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 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 36554263
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

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

800 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