/    Sign up×
Community /Pin to ProfileBookmark

Echo data into text fields…

Wowza… have a problemo here!

if you go to [url]http://scott.loddonexplorers.co.uk/index_admin.php[/url] you will see!
From what i can see, all the text should be in text fields…

Here is my code!

[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Untitled Document</title>
</head>

<body>
<?
require ‘xxx’;

$query=”SELECT * FROM Front_Page”;
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num)
{
$Nav_Bar=mysql_result($result,$i,”Nav_Bar”);
$Next_Meeting=mysql_result($result,$i,”Next_Meeting”);
$Next_Meeting_Text=mysql_result($result,$i,”Next_Meeting_Text”);
$Program_Title=mysql_result($result,$i,”Program_Title”);
$Program_Text=mysql_result($result,$i,”Program_Text”);
$Iceland_Title=mysql_result($result,$i,”Iceland_Title”);
$Iceland_Text=mysql_result($result,$i,”Iceland_Text”);
$Images_Title=mysql_result($result,$i,”Images_Title”);
$Images=mysql_result($result,$i,”Images”);

$i++;
}
?>
<input name=”Nav_Bar” type=”text” value=”<?php echo $Nav_Bar ?>” />
<input name=”Next_Meeting” type=”text” value=”<?php echo $Next_Meeting ?>” />
<input name=”Next_Meeting_Text” type=”text” value=”<?php echo $Next_Meeting_Text ?>” />
<input name=”Program_Title” type=”text” value=”<?php echo $Program_Title ?>” />
<input name=”Program_Text” type=”text” value=”<?php echo $Program_Text ?>” />
<input name=”Iceland_Title” type=”text” value=”<?php echo $Iceland_Title ?>” />
<input name=”Iceland_Text” type=”text” value=”<?php echo $Iceland_Text ?>” />
<input name=”Images_Title” type=”text” value=”<?php echo $Images_Title ?>” />
<input name=”Images” type=”text” value=”<?php echo $Images ?>” />
</body>
</html>
[/code]

And some of the fields in the data base contain pure HTML if you needed to know that…

Thanks in advance!
Fet

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 28.2006 — One approach would be to use htmlentities either before data insertion into MySQL or on extraction:[code=php]<input name="Nav_Bar" type="text" value="<?php echo htmlentities($Nav_Bar) ?>" /> [/code]
×

Success!

Help @scottyrob spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...