monkeybidz Posted December 20, 2012 Share Posted December 20, 2012 I keep getting an error message on my site that points to this line of code. It is from OSCommerece. Can someone help me clean this line up a bit. Just does not look right to me. I played with it a bit and I get some good results, just not 100Y%. eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');"); Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/272206-code-string-cleanup-help/ Share on other sites More sharing options...
twistedvengeance Posted December 20, 2012 Share Posted December 20, 2012 eval("$keys .= " . $value['set_function'] . "'" . $value['value'] . "','" . $key . "');"); Quote Link to comment https://forums.phpfreaks.com/topic/272206-code-string-cleanup-help/#findComment-1400527 Share on other sites More sharing options...
monkeybidz Posted December 20, 2012 Author Share Posted December 20, 2012 You are in the right direction, it displayed more results than before, but I now get this error: Parse error: syntax error, unexpected '<' Quote Link to comment https://forums.phpfreaks.com/topic/272206-code-string-cleanup-help/#findComment-1400530 Share on other sites More sharing options...
twistedvengeance Posted December 20, 2012 Share Posted December 20, 2012 Then you have an error somewhere else in your code, post 5-10 more lines on either side of the code so we can see what might be causing errors. Or even the entire script if it's not huge. Quote Link to comment https://forums.phpfreaks.com/topic/272206-code-string-cleanup-help/#findComment-1400534 Share on other sites More sharing options...
Christian F. Posted December 20, 2012 Share Posted December 20, 2012 If you do a var_dump () on the three variables for me, I can rewrite it to something proper for you. eval () is evil and should never be used, and using it in the above manner is just bad on all levels. Unfortunately, the OSCommerce code is full of bad stuff. Quote Link to comment https://forums.phpfreaks.com/topic/272206-code-string-cleanup-help/#findComment-1400565 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.