hi all!
i'm new with php and i have problem. I have a submit form in which every user places code.when they submit it in database its displayed normally there, but when i try to view the data in php there are missing elements , as b<<c or <iostream> etc. is it possible to configure it so it will accept <br> tags as line brakes, and the other code to display as text?
example of the error :
code entered in database or thru form(in database im using varchar):
#include<iostream.h>
int main()
{
int year;
cout<<"year=";
cin>>year;
if(!(year%4)&&(year%100)||!(year%400))
cout<<"error1"; else cout< <"error2";
return 0;
}
code received in php:
#include
int main()
{
int year;
cout<
cin>>year;
if(!(year%4)&&(year%100)||!(year%400))
cout<<
return 0;
}
)
php files im using:
submit.php
<form method="post" action="insert.php">
<p><br>
<b>code:</b><br>
<input type="Text" name="code" size="200">
<input type="Submit" name="submit" value="Enter information">
</p>
</form>
insert.php
<?php
include("contentdb.php"); //here is the connection to db
include("data.php"); //here are declared the variables
$sql = "INSERT INTO $table (code) VALUES ('$code')";
$result = mysql_query($sql);
echo "<br><br>code added to quiz.<br><br>";
?>
<a href="editquizlist.php">Back to list of codes</a>
Please help me all help is appreciated .
sorry for my bad English...