hatred Posted February 27, 2009 Share Posted February 27, 2009 Can you use/execute a php script like (echo"test" that you $get from a mysql table? Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/ Share on other sites More sharing options...
Maq Posted February 27, 2009 Share Posted February 27, 2009 Can you use/execute a php script like (echo"test";) that you $get from a mysql table? What do you mean $get from a mysql table? You can store file names/paths in the DB and call the scripts whenever you want. I'm not exactly sure what you mean. Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772701 Share on other sites More sharing options...
hatred Posted February 27, 2009 Author Share Posted February 27, 2009 Like say i create a database table called "scripts" and insert a new row, and in 1 row have echo"blah"; If i could in my php code, call for that row, and use that code Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772704 Share on other sites More sharing options...
Mark Baker Posted February 27, 2009 Share Posted February 27, 2009 I've a horrible feeling that this is a poster wanting to know about eval() and who should be severely dissuaded from trying to use PHP code in this way Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772725 Share on other sites More sharing options...
hatred Posted February 27, 2009 Author Share Posted February 27, 2009 Thats what I was looking for. Why should I be dissuaded from trying to use it? Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772730 Share on other sites More sharing options...
Mark Baker Posted February 27, 2009 Share Posted February 27, 2009 Why should I be dissuaded from trying to use it? To start with, it slows down your scripts. In addition, you lose control over the code that is being executed by your scripts, especially if you allow users to write their own PHP code that you then eval() which means that joe hacker could get your script to execute malicious code. Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772735 Share on other sites More sharing options...
aebstract Posted February 27, 2009 Share Posted February 27, 2009 Why not just put the "blah" part in your database and echo the results of that row in your page? Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772753 Share on other sites More sharing options...
hatred Posted February 27, 2009 Author Share Posted February 27, 2009 I don't want to use it a lot, and it wouldn't be used by players, just myself. It's more complex then just typing blah, that was just an example. Thanks for the help guys! Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772775 Share on other sites More sharing options...
Maq Posted February 27, 2009 Share Posted February 27, 2009 I don't want to use it a lot, and it wouldn't be used by players, just myself. It's more complex then just typing blah, that was just an example. Thanks for the help guys! If you describe exactly what you're trying to accomplish, we can give you a better solution. Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772777 Share on other sites More sharing options...
hatred Posted February 27, 2009 Author Share Posted February 27, 2009 I'd like to give ya a better description but I don't really wanna give out to much details. Been programming for 6 years, and I did think of another way. Was just looking at my options and that came to mine, made me curious if it was possible or not. Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-772784 Share on other sites More sharing options...
Mark Baker Posted February 28, 2009 Share Posted February 28, 2009 Was just looking at my options and that came to mine, made me curious if it was possible or not. Well for one, why not simply have a set of include files, each of which is a block of code that you would otherwise store on the database... but executed when you do the include() rather than eval().... or dynamically created functions generated and called within your code Quote Link to comment https://forums.phpfreaks.com/topic/147198-solved-wondering-if-possible/#findComment-773184 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.