ShoeLace1291 Posted November 11, 2007 Share Posted November 11, 2007 I'm trying to create a file with XML in it which contains user login info. In my script, a line is inserted that will be one type of user information, for example, <loginname>$username</loginname>. When the script runs, it actually inserts the characters $username. How do I make it so it enters in what $username equals, which is $_POST['username'] ? $userinfobody = '<?xml version="1.0"?>\n\<loginname>\"$username\"</loginname>\n\<loginpass>\"$password\"</loginpass>\n\<contactemail>\"$email\"</contactemail>\n\<regdate>\"$todaysdate\"</regdate>'; I am also getting a syntax error now at 1.0. Quote Link to comment Share on other sites More sharing options...
toplay Posted November 11, 2007 Share Posted November 11, 2007 Start and end with double quotes ("), you're already escaping the double quotes correctly. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted November 11, 2007 Share Posted November 11, 2007 You will need to escape the first two double quotes though - <?xml version=\"1.0\"?> Quote Link to comment 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.