Jump to content

Samiul Haque

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Samiul Haque

  1. one thing you all people kept in your mind that eval is bad, but you never tried to see the good side of it. I dont wanna argue with any one. I could only give to thanks AtomicMaster that at least he has tried to go to deep of it before commenting. And none other than he did ever try to look into it from different angle. I never said this is the solution of every problem , but in certain type of project this is really helpful. As i got it thats why i wanna share with you people. @Sensei before commenting and making any thing worthless please try to understand first what it is ...... then comment like what AtomicMaster did. Knowing his(AtomicMaster) question and comments i could understand clearly that he has at least tried to understand and went throughly in deep of it . I am sorry to say you(@Sensei) that i will be honored if you keep yourself away from my post. @AtomicMaster : I am happy to discuss with you so if you have any more question then please ask . Thank you all
  2. I know using eval is not good. But in real world , means when we had to deal with big project and need to create dynamic page then this eval is only the solution. Now come to the prob: when we put different value to $page then according to its value "case" will match , right ? then the code within that case statement will be executed. What you have done, you put <h2> tag to all case statement, but in reality we likely to use <h2> only once , not put every time under all case block. You are continuously trying to show that, it could be written with out eval but you did not ever try to understand why i have used it. I have already created 2 big project with this approach and its running successfully and serving very good. Its my bad luck that am not able to make understand the world what i want to share with them. And even the creator does not know how a powerful thing he has created. We the software engineer who works on real project always want to use HTML only once, not multiple time. The php section will be used as much as possible. Good luck my friend. Hope one day you will understand what i wanna tried to make you all understand.
  3. The way you are showings its perfect. but if i want the above 3 case condition and i have to use only two <h2> tag in html body instead of using 4 <h2> tag (that you use ) in different cases and want the same out put that your code printing now then how will you do that? lets say: <?php - - - - your php code ?> <html> <body> <h2>Files</h2> <?php //your code?> <h2>User Info</h2> <?php //your code?> </body> </html> and i want the same out put after changing $page value(1/2/3). Please write the code in your way.
  4. @AtomicMaster, did you find the code i have pasted here.? Please check and confirm. I am waiting for your feedback.
  5. @AtomicMaster, Yes, thats a talking of real programmer..I am expecting it from long time thats why I posted my approach to this science forum. I am 100% agree with you and what you have discussed here. But again, i believe , if we get some facility from some thing , then we of course have to sacrifice some thing for it. Here I have just showed a way............so if any one got interested on it then he may add his effort to remove the drawbacks of it. I cant alone change the world. I need all of you so that we could do something for computer science world. Now I am writing complete code for you. Look the post below. <?php /* * Please copy and paste and execute the following code */ /*Look, form_generator_file and form_generator_usr are complete pages that has all properties of a PHP page * that means it could contain everything a php page may contain. * the variable $form hold the code of the page. * So if I echo the variable $form , you will see it will print the code. * But if you want to execute it , you need to use eval(). * */ $form = ' //page 1 function form_generator_file($form_defination = "") { $to_day = @date("m/d/y"); ?> <div style="border: #ff0000 solid 1px;"> <span>Today:</span> <span><?php echo $to_day;?></span> <p style="background-color:#404040; ">File: <?php echo $form_defination;?></p> </div> <?php } ?> '; $form_usr = ' //page2 function form_generator_usr($form_defination = "") { $to_day = @date("m/d/y"); ?> <style> div{ font-size:12pt; background-color:#bcbcbc; color:#fff; width:50%; } </style> <div style="border: #ff0000 solid 1px;"> <span>Today:</span> <span><?php echo $to_day;?></span> <p style="background-color:#404040; ">User : <?php echo $form_defination;?></p> </div> <?php } ?> '; ?> <html> <style> span{ font-weight: bolder; } p{ color:#fff; } </style> <body> <?php $file_form_definition = "file form definition"; $user_form_definition = "user form definition"; ?> <?php $page = 1; switch($page){ case 1: ?> <h2>Files</h2> <?php echo eval("form_generator_file(\"$file_form_definition\");".$form); ?> <h2>User Info</h2> <?php echo eval("form_generator_usr(\"$user_form_definition\");".$form_usr); ?> <?php break; case 2: ?> <h2>Files</h2> <?php echo eval("form_generator_file(\"$file_form_definition\");".$form); ?> <?php break; case 3: ?> <h2>User Info</h2> <?php echo eval("form_generator_usr(\"$user_form_definition\");".$form_usr); ?> <!-- And so forth --> <?php }?> </body> </html>
  6. See , no site in the world is 100% hacker safe. Besides it we could add some penetration preventing code that will save primarily. And I am not expert of this side, its the task of others. Here I want to show you an approach that may help web developer for certain type of task. Thats it. And protecting the site is the job of others. I am really happy that you gave time and showed whats the wrong side of it although i was aware before of that but its not a great deal to get ride of it. Thank you Endy I will write code for you. Just write me some lines what you want to accomplish , and seeing your requirement, i will write complete php, css, html code for you. So that it will help you clearly to understand. Go it ?
  7. You are a foolish one. In message section what ever you want you could add, it may be html, php, css , what ever you want. My system is still safe. Although i did not put safe guard , its a different side. What you are trying to show , you are a great hacker? See maan, if you dont have interest , please dont disturb here. I am here to show you all some thing. Look here:
  8. are you looking my website like this? Please clear? Please see my sample code in worldsenex.in under "See the system approach" link. There you will see how i use the code and yes HTML, CSS ,JS will be neeted in code snippet. My Last request , please try to understand my approach seeing and analysis my sample code in worldsenex.in Good luck
  9. R you joking? where there are 1000 lines of html, php, JS, css code in to a single file and you will write it into printf function.? Please stop this nonsense. I am expecting some brilliant thoughts.
  10. @ AtomicMaster My heartiest thanks to you that you have gone deeply into what i have tried to make you understand all. See , you are seeing this from a single side. Lets try from a broad view. OK? Lets use for webbrowser. <?php function($name) { echo "hello $name"; ?> <!------------------------------------------------------------------------------------------------------------------------------------------ --> i have here 1000 lines of HTML code and some php code inside html tag, this is what happened in reality. example : <tr> <td> <?php echo $name ?></td> <td> <?php echo $address ?></td> <td> <?php echo $message ?></td> </tr> Here you are seeing php and html is marged. And assume, like this we have 1000 lines of html and php code <!------------------------------------------------------------------------------------------------------------------------------------------ --> <?php }; ?> Now say , how you will write using your last coding style? that is simple and shorter, simpler and more secure; ?? Lets think first to build a big building of 100 storied and there are more people in the world to make it strong and safe for earthquake. Clear?
  11. @AtomicMaster: oh my God! , I thought you are expert of php but now its clear you dont know any thing, and even php language grammer. And I think you should go throughly about the manual of PHP eval(). Besides it you have changed my code I have written $BODY = "test_fun($msg,$message_stat);".$snippet10; and you modified it to $BODY = $snippet10($msg,$message_stat); If you have minimal knoweledge of php then you understand why i have written $BODY = "test_fun($msg,$message_stat);".$snippet10; and even why i am using eval(). And one more thing what i want to show the world about the new approach , you are far far away from this. Sorry AtomicMaster , I am expecting reply from best mind of computer science in the world and who are really expert and have depth knoweledge in PHP.
  12. @sensi: "In any serious website, it would means not possible to proper search engine optimizations." I am 100% agree with this words. Remember , This approach is for mainly creating tool like website and not for global purposes. Exampl: Suppose you need 800MB of txt or excel, or dbf or....data to convert and transfer from your local machine to mysql database directly and the db server is in cloud. For accomplish this task you have many more tooll available in the market say dbforge, mysql workbench, heidisql but all are desktop tool. U need to install it in your local and use. But here you will face mainly two problems: You have to install it in your local machine All of your business requirment will not be resolved by any one of the above tool and you obviously face problem in data mapping. Besides this You will have many more prob to face.... So you see we dont need SEO for our tool, right? if you need to advertise then U have to do it manually. @AtomicMaster: Now it looks , u are not so aggressive like the before now. Thanks for that. "Why? There is no necessity to eval that code, the eval mechanism use is completely unnecessary, and extremely prone to security issues." We need eval here. See the code snippet is not just html code into php string. It has php and html. When u create a php page u need to put php and html code right? Here the snippet will help you to understand clear:' Example: test.php and the code is below <?php $snippet10 = ' function test_fun($msg = "",$message_stat = "") { $name = "Samiul"; $address = "world,"; $message = $msg; ?> <table> <tr> <td>Name</td> <td>Address</td> <td>Message</td> </tr> <tr> <td> <?php echo $name ?></td> <td> <?php echo $address ?></td> <td> <?php echo $message ?></td> </tr> </table> <?php }//end of function ?> '; // Now i could create many more snippet like $snippet10, say $snippet11,$snippet12 if($cond == "test1"){ $msg= "WELCOME TO MY WORLD"; $message_stat = 'new_stat'; $BODY = "test_fun($msg,$message_stat);".$snippet10; } elseif($cond == "test2"){ $BODY = "test_fun($msg,$message_stat);".$snippet12; } elseif($cond == "test3"){ $BODY = "test_fun($msg,$message_stat);".$snippet11; }else { - - - } // You could create more variable like $BODY ?> <html> <header></header> <body> <div>Header</div> <div><?php eval($BODY) ?></div> <div>Footer</div> </body> </html> So this code snippet you could not use it with out eval(). Because eval() will convert this($snippet10) php and html code to only html code and will add to the required position. So when ever you need the above code snippet just use $snippet10. And to get the completre HTML from this ($snippet10) you must have to use eval(). Hope you will understand now. The main prob i face is that debugging . Debugging is really tough , and need too much sound knoweledge on php. @Sato : You are partially right. You could also use this approach by saving the code in DataBase. I have just show you an approach and how will use it , that will totally depend on you. Thanks Sato @Endy0816 : if we able to know how eval() works and have deep knoweledge of it then only we could understand the power of eval(). After its birth so many years it left out untouch and some open source and frame work uses it in thei core file for very small purposes. Remember , if we handle and use atomic power with care and for good purposes (not for making the atomic weapon) then it will be the boon for human being. Good luck All
  13. @AtomicMaster:" I read the code, and the pdf is just silly;" My be my problem is that i tried but i did not make you understand clearly as because I am weak in english. eval is still good and helpful if you know how to use it. "instead of <?php eval($BODY) ?> you would have <?php $BODY(); ?>," This question forced me to realise that you did not understand anything of it what I wanted to make you understand. Here i have no other choice instead of using eval(). My aim is that I will not create many more php pages but I have to find out a way so that a code snipet be used as a php page and when ever I need it, just called the holder and that code snipet will be inserted where I want to insert. Suppose , when i need i may call a ceratin function to perform ceratin task, exactlly same what i want just like it. When ever i want i will call that code snippet. Example: scenario 1: <html> <header></header> <body> <div>Header</div> <div>Body</div> <div>Footer</div> </body> </html> In Most of the website the header and footer are static and body part will be changed. Suppose I need 10 different web pages and each page header and footer will be same and only body part will be changed. Then what we could do ? we will create 10 different php pages and insert into <div>Body</div> so the page is like that, body1.php,body2.php.........body10.php, So it will look like this <html> <header></header> <body> <div>Header</div> <div><?php include(body1.php) ?></div> <div>Footer</div> </body> </html> <html> <header></header> <body> <div>Header</div> <div><?php include(body2.php) ?></div> <div>Footer</div> </body> </html> . . . . . . <html> <header></header> <body> <div>Header</div> <div><?php include(body10.php) ?></div> <div>Footer</div> </body> </html> Now my approach is that i will not cretae 10 php pages but 10 code snippet say $snippet1 = '<?php html and php code ?>'; $snippet2 = '<?php html and php code ?>'; $snippet3 = '<?php html and php code ?>'; . . . . . . $snippet10 = '<?php html and php code ?>'; And u will use these code snippet in main code like this: ---------------------------------------------------------------- PAGE1: <?PHP $BODY = $snippet1 ?> <html> <header></header> <body> <div>Header</div> <div><?php eval($BODY) ?></div> <div>Footer</div> </body> </html> --------------------------------------------------------------------- ---------------------------------------------------------------- PAGE2: <?PHP $BODY = $snippet2 ?> <html> <header></header> <body> <div>Header</div> <div><?php eval($BODY) ?></div> <div>Footer</div> </body> </html> --------------------------------------------------------------------- ---------------------------------------------------------------- PAGE3: <?PHP $BODY = $snippet3 ?> <html> <header></header> <body> <div>Header</div> <div><?php eval($BODY) ?></div> <div>Footer</div> </body> </html> --------------------------------------------------------------------- . . . . . .---------------------------------------------------------------- PAGE10: <?PHP $BODY = $snippet10 ?> <html> <header></header> <body> <div>Header</div> <div><?php eval($BODY) ?></div> <div>Footer</div> </body> </html> --------------------------------------------------------------------- Now clear my approach? and hopefully u will understand why I use eval()
  14. I am very sorry so say you that , none of you went throughly to the explanation in pdf and downloaded the sample code. See , personally i am working on this LAMP technology for last 6 years and I found the problem that i have already stated on the website worldsenex.in and this approach is the solution. @Sato : Please go through the explanation properly. Now the answer of your questuion "I don't understand; why are you echoing the actual PHP code?" See this approach is good for the development of the website which will act like desktop application. We can not handle a php and html code that is present in a single file just like a php function. obviously this single file will be small in size(they will be the page of small desk top tool like). And if i need to create php file dynamically on the fly then we have no other choice except this approach. Here eval acting as PHP engine before submiting whole php page to the server. I have already created 3 projects using this approach , they are desktop tool like and could handle 1 GB of data transfer from local to cloud server after some data conversion very easily. This is not a framework or readymade code. This is a guideline only for the web developer of course experience developer. Please try to understand the explanation in pdf and download the sample code run it to your local and follow each line carefully then only u will understand otherwise not. @AtomicMaster Yes eval is evil if you dont handle with care. A tiger is so ferocious but if you able to train him properly then you are the king of your locality !! Good Luck.
  15. Hi, This post is mainly for web developer who work on PHP development. We often face problem when we need to import or export large amount of data in/out web server. If the server is in cloud then it also creates tough hurdle. Here I have thought a new approch for Php developers and tried to solve the issue. Have a look and go throughly each doc and reply what should be done more. http://worldsenex.in/index.php Thanks in advance Samiul Haque
  16. @Sensei I am really thrilled seeing your valuable reply. My concern is for web application and my portal is running on LAMP(Linux Apache Mysql Php)technology.I know 200 mb data processing in c/c++ is not a big deal but feeding 200mb or more data into a web application is still a problem.Even i need to check data at the time of conversion and transfer of .txt or .xls data to mysql data base. Example. txt tada coming in the form of .csv and .xls. So i need to map the field name of mysql table before inserting and checking data to create new data depending on the condition on the fly. So its not direct importing data. .xls file is not as simple of .txt file. Remember the website is in cloud server not in a local machine.
  17. When you are stucked with the following situtaion : When you need to feed your system huge amount of data , say 200 MB or more of data once a month or twice a month then what is your solution? If you need to convert the above amoun of data from txt file or excell file and put it into any data base server say Mysql, MsSql, Postgress Sql then? At the time of converting data, your system have to check multiple condition before inserting into data base of that amount of data then? If your requirment does not supported by tool like mysqlworkbench or dbForge then how you accomplish your task at the time of huge data conversion and transfer on the fly? When you need hybrid technology that will be supported by web as well as desktop then? Guys I am expecting your thougts ideas. Please give few minutes and put your ideas. I want to know when you are in this situation then what is your solution?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.