Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

quanganhct

macrumors member
Original poster
Dec 29, 2010
31
0
Hi all,

I have an exercice in class, which is to write an bash file like this :

PHP:
#!/bin/sh
cat <<EOF
Content-Type: text/html; charset=utf-8

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Page HTML dynamique indiquant la date</title>
</head>
<body>
Voici la date d'aujourd'hui :
<br />
EOF
date
echo '</body></html>'

# Envoyer "<br />" permet d'afficher la date en dessous de la ligne
# "Voici la date d'aujourd'hui".
# Mettre une ligne vide dans le texte HTML 
# ne provoquerait pas l'affichage en deux lignes par le navigateur,
# car il identifie espace et saut de ligne.

and run it on a browser.
But, instead of display date, it download the script. My teacher said that I must re-configuration httpd.conf (I'm not sure about this).

So would you please help me to make my script run on browser ? Thanks alot
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.