|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Execute asp command from a String
I am trying to make our website a bit more dynamic. one of the ways i want to do this is to be able to put in ASP code into our MySQL database (the code would be different for every company) and have it execute when the page is brought up.
We have the potential of having thousands of companies using our website, so having it hard coded will be hard to maintain, and having it save to a file will become cumbersome if there are too many users. Anyone have any ideas on how to execute a piece of ASP code straight from a string varaible? Thank you for your input Steven Haslam ContactPoint Information Technology URL |
|
#2
|
|||
|
|||
|
Personally, I wouldn't put asp code into your MySQL database.
Instead, I'd create an #include file that holds a Sub...End Sub or Function...End Function. Either one of them should have a parameter like the CompanyId for example. Then the code inside the Sub/Function is executed based on the CompanyId. Assuming your store some asp code into your MySQL database, then you get a recordset that holds the code. What next? Do you put it inside a variable? Something like: <% . . . . . . strCodeToExecute = objRst("Code") %> But then what? You'd like to have some sort of eval() like in javascript? Never seen this work, actually don't even know if it can be done(plus I'm coming back from a big lunch so I can't think straight...) that's why I suggest the include file approach. Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
The problem with that is that i want to be able to manage these things right from the website, not have to get into the hard code each and every time a new company is setup. i would rather go into the company settings, and if coding is needed, i would like to edit right there in a text box.
I believe i have found my solution by just playing around with the code. there is an Execute() statement that takes a string and runs it. stringa = "response.write 1" Execute(stringa) and it outputs 1 on the page. i will have to see how it does with some larger commands, but i think it looks hopefull. |
|
#4
|
|||
|
|||
|
hemm
If you really want it in your database, an idea is that mayb you could turn your asp code into hexidecimal form, because that will store real easy, no problems with what you want in the asp code then.
instead of <% response.write "@#(@)#(@#)" %> it would be AH4DH3D5S6A7F8K9J3D2L2F2A2K54F |
|
#5
|
|||
|
|||
|
Re: hemm
Quote:
um... is this forum a joke? i thought it was php-bias'd... but i guess its much more then that... |
|
#6
|
||||
|
||||
|
Quote:
Ah, it works with larger commands too. Quote:
well, Execute() must be a sort of eval(). Thanks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Execute asp command from a String |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|