Ali25m Posted October 25, 2010 Share Posted October 25, 2010 Hi guys, I've been searching about on this topic for a little while and haven't come across a working answer as of yet. The issue I am having is that after an install of wamp on my 2003 server the php pages are displayed in the browser as text instead of html. I the files have been saved correctly so they are not .txt files and have the correct encoding. The phpmyadmin site loads great and I have created databases so mysql is up and running too. The other strange aspect is that the php files were developed on my local machine and tested/ debugged untill working so again I'm sure its not the files. I have tried a reinstall of wamp with no sucess. So the only conclusion I can come to is it is an issue within the config files either the php.ini or the apache httpd conf or both. What really has me puzzled is that the install process on my local machine was exactly the same as on the 2003 server and they work fine locally????? Any sujestions/ideas are appriciated. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 25, 2010 Share Posted October 25, 2010 phpmyadmin is a php script, so php is working (unless you have a separate web server in addition to what wamp installed.) Post one of your php scripts that does not work, showing the opening php tag being used in the file. Quote Link to comment Share on other sites More sharing options...
Ali25m Posted October 25, 2010 Author Share Posted October 25, 2010 thanks for the quick response, my code is on my machine at work so I'll post a script tomorrow morning. Cheers Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 25, 2010 Share Posted October 25, 2010 Try this code as well, exactly as shown - <?php phpinfo(); ?> Quote Link to comment Share on other sites More sharing options...
Ali25m Posted October 26, 2010 Author Share Posted October 26, 2010 I've already tried phpinfo (); (sorry I should have mentioned that) and it loads as text as well. Here is one of the pages I've created <?php error_reporting(0); include 'sdconnection.php'; $name = $_POST['name']; $issue = $_POST['issue']; $room = $_POST['room']; $date = $_POST['date']; $month = $_POST['month']; $year = $_POST['year']; $title = $_POST['title']; $error = ""; if (empty($_POST['name'])) { $error = $error."<br/><b><font color = 'red'>You must enter a name</b></font>"; } if (empty($_POST['room'])) { $error = $error."<br/><b><font color = 'red'>You must enter a room</b></font>"; } if (empty($_POST['title'])) { $error = $error."<br/><b><font color = 'red'>You must enter a title</b></font>"; } if (empty($_POST['issue'])) { $error = $error."<br/><b><font color = 'red'>You must enter a issue</b></font>"; } if (empty($_POST['date'])) { $error = $error."<br/><b><font color = 'red'>You must enter a date</b></font>"; } if (empty($_POST['month'])) { $error = $error."<br/><b><font color = 'red'>You must enter a month</b></font>"; } if (empty($_POST['year'])) { $error = $error."<br/><b><font color = 'red'>You must enter a year</b></font>"; } if (empty($error)) { $q = "INSERT INTO jobs (name, room, issue, date, month, year, title ) VALUES ('$name', '$room','$issue','$date','$month','$year','$title')"; $res = mysql_query($q) or die (mysql_error()); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <link rel="stylesheet" href="IE8style.css" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 {color: #B90302} --> </style> </head> <body> <div id="wrap"> <div id="header"> <h1> Whickham school service desk requests </h1> </div> <div id="nav"> <ul> <li><a href="index.html" title="home page">home</a></li> <li><a href="" class="selected" title="">staff links</a></li> <li><a href="students.html" title="">student links</a></li> <li><a href="search.html" title="">search engines</a></li> <li><a href="info.html" title="">useful information</a></li> </ul> </div> <ul> </ul> <div id="content"> <div id="page"> <form method="post" action="http://localhost/Unnamed site 1/servicedesk.php"> <label for="name">Name</label> <br/> <input type="text" name="name" id="name"> <br/> <label for="Room">Room</label> <br/><input type="text" name="room" id="room"><br/> <br/> <label for="Title">Title</label> <br/> <input type="text" name="title" id="title"> <br/> <label for="Issue">Issue</label> <br/> <textarea cols="50" rows="10" name="issue" id="issue" ></textarea> <br/> <label for="date">Date</label> <br/> <select name="date" tabindex="6" id="date"> <option></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> </select> <br/> <br/> <label for="Month"><b>Month</b></label> <br/> <select name="month" tabindex="7" id="month"> <option></option> <option>January</option> <option>February</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>August</option> <option>September</option> <option>October</option> <option>Novemeber</option> <option>December</option> </select> <br/> <br/> <label for="year">Year</label> <br/> <select name="year"> <option></option> <option>2010</option> <option>2011</option> <option>2012</option> <option>2013</option> <option>2014</option> </select> <br/> <br/> <input type="hidden" name="hidden" value="1"> <br/> <input type="submit"> <br/><br/> <?php if (isset($error) && $_POST['hidden']==1) { echo $error; } ?> </form> <h3> <script language="JavaScript"> function openWindow(url, name, rs, w, h) { var resize = ""; if (rs) { resize = "resizable,"; } popupWin = window.open(url, name, 'scrollbars=yes,menubar=no,'+ resize + 'width=' + w + ',height=' + h); popupWin.focus(); } </script> </h3> </div> <div id="sidebar"> <h4>Quick Links</h4> <ul> <li><a href="http://www.google.co.uk">Google</a></li> <li><a href="http://www.yahoo.co.uk">Yahoo UK</a></li> <li><a href="http://www.bbc.co.uk">BBC</a></li> <li><a href="http://localhost/servicedesk.php">Service Desk</a></li> <li><a href="http://www.whickhamschool.org/">Whickham School Website</a></li> <li><a href="http://inty/email/index.php">Whickham School Email</a> </li> <li><a href="http://10.10.0.7/__internal__/cmgr/connection.html">Log on to Inty</a></li> </ul> </div> <div id="footer"> </div> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 26, 2010 Share Posted October 26, 2010 Not trying to be insulting, but you are saving these with a .php file extension, right? Quote Link to comment Share on other sites More sharing options...
Ali25m Posted October 28, 2010 Author Share Posted October 28, 2010 yes .php works fine on my local machine have checked all file extensions etc see above post ^^ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.