开发者

000Webhost PHP $_SEND

My problem is the following:

I use 000webhost's free hosting service. I have a dynamic CSS stylesheet by making it PHP and making it choose between one of a few (currently three) stylesheets and using that. It works perfectly fine on my Apache server but not on my 000Webhost site.

It doesn't run at all, but the cookie Is set.

Here's some code from the three PHP pages:

  1. Mainpage.php:
<html>

<head>
<?php include("../public_html/Include/Head.php")

?>

<body>

<?php include("../public_html/top.php"); ?>
  1. Head.php
<?php $Send = $_COOKIE["Theme2"]; ?>
<link rel="stylesheet" type="text/css"

href="../public_html/stylesheet.php?beef=" />

  1. Stylesheet.php (I've put the following: CSSHERE wherever I have cut out CSS code, otherwise it would give people a hard time scrolling down!)
<开发者_JAVA百科;?php header("Content-type: text/css"); ?>

<?php
if ($_GET["beef"]==1)
{
?>

CSSHERE

<?php } 
elseif ($_GET["beef"]==2) { ?>

CSSHERE

<?php } 
elseif ($_GET["beef"]==3) { ?>

CSSHERE

<?php } ?>


The path to the php file has to be accessible by the browser.

i.e. if your website is http://domainname.com

The stylesheet should link to http://domainname.com/stylesheet.php

Try using Chrome developer tools, Safari developer tools, Firefox - firebug

And check the resources/network tabs, and you should see it trying to load your script but not finding it. (My guess anyway, as generally public_html is not part of the URL.)


go into your profile in profile go into genral setting and scroll down and chnge PHP virsion 7 to version 5 .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜