Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

PHP question about global variables and form requests -


this stupid question ask anyway sine have no idea.

i have written basic php code serve forms. have login page , serve using login.php page , called in login.html page -

<form action="login.php" method="post"> 

by implied every post needs own php file, doesn't it? kind of feels weird. there way have single file, code.php, , have each of forms functions instead?

edit: specifically, have 5 forms used 1 after other in application. after login user a, b, c , d tasks each of sent server post request. instead of having a.php, b.php, c.php , d.php have single code.php , have a(), b(), c() , d() functions. there way this?

also on same note, how deal global array (e.g. array of logged in users) across multiple forms? want without writing db. know better write db , query possible global array? reason thinking having form functions in 1 file use global array.

thanks, - pav

sure, no problem, post forms same .php file , have deal incoming post data. there's nothing keeping doing it.

usually forms send different data though , each form needs bit of custom handling. if put logic same handler file, it'll become reaaaally long, messy piece of code. it's better separate code different files if different things.

you can , should abstract common parts database connection handling functions or objects , include them in each post handler though.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -