jakebur01 Posted June 30, 2011 Share Posted June 30, 2011 Any idea what would cause this error? It doesn't matter what code I have or whether I use <? ?> or <?PHP ?>. It always throws this error in a third party program I have called PopMonger that will allow you to run a php script to handle a returned e-mail. Name cannot begin with the '' character, hexadecimal value 0x20. Line 1. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 30, 2011 Share Posted June 30, 2011 0x20 is a space, you must have a space somewhere.... (?) Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted June 30, 2011 Author Share Posted June 30, 2011 I changed my code to this: <?$Popmonger = new Popmonger();$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$myFile = "vsifax_failures.txt";$fh = fopen($myFile, 'a') or die("can't open file");$stringData = "$faxnumber\n";fwrite($fh, $stringData);fclose($fh);?> I am still getting: Name cannot begin with the '' character, hexadecimal value 0x20. Line 1. Position 12. The error is always Line 1. Position 12. no matter what I put in the file. Quote Link to comment Share on other sites More sharing options...
xyph Posted June 30, 2011 Share Posted June 30, 2011 <?php $Popmonger = new Popmonger();$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$myFile = "vsifax_failures.txt";$fh = fopen($myFile, 'a') or die("can't open file");$stringData = "$faxnumber\n";fwrite($fh, $stringData);fclose($fh);?> Does not give me this error on my machine. It's a server issue, not a PHP code issue. Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted July 1, 2011 Author Share Posted July 1, 2011 Could it be the file type or the type of encoding used? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted July 1, 2011 Share Posted July 1, 2011 it is saying you can not start a name with a space. Basically you have a space somewhere, where it should not be. Quote Link to comment Share on other sites More sharing options...
jakebur01 Posted July 1, 2011 Author Share Posted July 1, 2011 I opened it notepad and this is what I have: <?php $Popmonger = new Popmonger();$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$body = $Popmonger->BodyText();$pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i';preg_match($pattern, $bodytext, $matches);$faxnumber = trim($matches[0]);$myFile = "vsifax_failures.txt";$fh = fopen($myFile, 'a') or die("can't open file");$stringData = "$faxnumber\n";fwrite($fh, $stringData);fclose($fh);?> But, if I only put tags in there, I get the same error. I have tried posting to the support group from the company, but I have yet to receive a response. http://support.mach5.com/showthread.php?tid=139 Quote Link to comment Share on other sites More sharing options...
xyph Posted July 4, 2011 Share Posted July 4, 2011 I'm not getting an error on my server with the code I posted. It's your text editor or server. 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.