simple script won't work. Please help


Posted on 16th Feb 2014 07:03 pm by admin

I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code executes fine but the html tags in my script are treated as text and displayed on the page.

This is myscript:

<?php

print “Opening the connection to the database server< br />”;

$link = mysql_connect("localhost", "root", "password");

print " Selecting a database< br />" ;

$result = mysql_select_db( "databasename" ) ;

if ( $result )

{

print " Database selected successfully< br />";

}

else

{

print " There was a problem with the database
selection< br />" ;

}

?>


This is the output:

Opening the connection to the database server< br /> Selecting a database< br /> Database selected successfully< br />

Why are the html tags being displayed in the output?

I'm using:

php 5.3.1
apache 2.2.12
mysql 5.0.88

on fedora 10.

Any help would be much appreciated.

Thanks

No comments posted yet

Your Answer:

Login to answer
346 Like 16 Dislike
Previous forums Next forums
Other forums

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

my code does not work.
I have a code problem.

Quote"<a href=index.php?gogo=ureticidetay&'?l={$le

RSS feed - FeedList for WordPress
Hi,

I'm trying to alter the FeedList plugin for WordPress so that I can click on the title of

problems with script
I made a small script wich exchanges points in my website:


<?php
session_start

Pre-Fill out a PHP form...??
This is for work actually (geek squad). We have to fill out this online php form at work over and ov

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

Printer configuration
Hi All,
Suppose one of the user deleted the printer settings unfortunatly ,then what is the pro

Help with usergroups? prolly really quick
So were coding our own forums for a game system we made an we have the users level setup but now I n

Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash