turkman Posted June 27, 2008 Share Posted June 27, 2008 I've just installed apache, mysql and php in windows. Ive got the apache server running and the mysql server running and i assume the php is working. Ive set my intranet as a html/css based page and one of the links on that page is a link to text.php - when this script contains something simple like <?php echo 'this is a test'; ?> then when i click on the link in my intranet and i get the result output onto the new webpage. However if i add something more to it like <?php $dbhost = 'Brnew.home:3306'; $dbuser= 'root'; $dbpass= 'mypass'; $dbname = 'intranet'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error Connecting to mysql'); mysql_select_db($dbname); echo 'database opened'; mysql_select_db('intranet') or die('Cannot select database'); $query = 'CREATE TABLE contacts( '. 'cid INT NOT NULL AUTO_INCREMENT, '. 'cname VARCHAR(20) NOT NULL, '. 'cemail VARCHAR(50) NOT NULL, '. 'cnumber VARCHAR(30) NOT NULL, '. 'cinfo TEXT NOT NULL, '. 'PRIMARY KEY(cid))'; $result = mysql_query($query); mysql_close($conn); ?> Then when i click the link in my intranet it dosent display the page, i get an error saying this page cannot be displayed Quote Link to comment https://forums.phpfreaks.com/topic/112262-very-basic-problem-with-php/ Share on other sites More sharing options...
sdi126 Posted June 28, 2008 Share Posted June 28, 2008 There is most likely an error with that php code. If you are using internet explorer go to tools >> internet options >> click on the advanced tab >> under the browsing tab uncheck the box "show friendly http error messages" and then look at the page...it will show you the php error and not "page cannot be displayed" Quote Link to comment https://forums.phpfreaks.com/topic/112262-very-basic-problem-with-php/#findComment-576461 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.