/    Sign up×
Community /Pin to ProfileBookmark

submit xml string in the form

<?php
$xml=’
<?xml version=”1.0″ encoding=”iso-8859-1″?>
<Request><Send><Key>123123123</Key><Number>10</Number></Send><BInfo><LName>Pizza</LName><LAddress>somewhere</LAddress><LCity>city</LCity><LState>NY</LState><LZip>112</LZip><LPhone>131313132</LPhone></BInfo></Request>
‘;

<form method=’post’ action=’script.php’>
<input type=’text’ name=’xml’ value='<?=$xml?>’>
<input type=’submit’ name=’submit’ value=’submit’>
<form>

What’s wrong with this code? Why I cannot submit xml through Post.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYDec 17.2005 — replace the ">" and "<" characters by their entites

http://php.net/htmlspecialchars
Copy linkTweet thisAlerts:
@cetonauthorDec 17.2005 — It doesn't help. Still cannot xml string
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYDec 17.2005 — does work for me
[code=php]
<?php
$xml='
<?xml version="1.0" encoding="iso-8859-1"?>
<Request><Send><Key>123123123</Key><Number>10</Number></Send><BInfo><LName>Pizza</LName><LAddress>somewhere</LAddress><LCity>city</LCity><LState>NY</LState><LZip>112</LZip><LPhone>131313132</LPhone></BInfo></Request>
';
$xml = htmlspecialchars($xml);
?>

<form method='post' action='script.php'>
<input type='text' name='xml' value='<?=$xml?>'>
<input type='submit' name='submit' value='submit'>
<form>
[/code]
Copy linkTweet thisAlerts:
@cetonauthorDec 18.2005 — What does script.php gets? xml file?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYDec 18.2005 — what do you want to do?
Copy linkTweet thisAlerts:
@cetonauthorDec 18.2005 — send the file to 'script.php'. So script.php can process the file. In other words, the form should be submitted the by sending POST the the 'script.php'.
×

Success!

Help @ceton 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,
)...