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. Link to comment https://forums.phpfreaks.com/topic/76878-creating-info-file-with-variables/ 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. Link to comment https://forums.phpfreaks.com/topic/76878-creating-info-file-with-variables/#findComment-389232 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\"?> Link to comment https://forums.phpfreaks.com/topic/76878-creating-info-file-with-variables/#findComment-389256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.