Posts

html - Incorrectly redirecting user back to a PHP page after submitting a form -

all, this question has simple answer - i'm overlooking. maybe can tell me look... i have php page ("index.php") simple login form (e.g., username , password). when user clicks "submit" button, form posts values php page ("login.php"). page supposed confirm user's credentials, following: if user's credentials not correct, redirect user error.php, along error message if user's credentials correct, create session , set $_session['authenticated'] = true, redirect him "loggedin.php" [update] then, on loggedin.php, check see isset($_session['authenticated']) returns true. if does, proceed. if not, redirect user index.php. however, here's happens. first time fill out form (with valid creds) , submit it, can see briefly in url bar user sent login.php, loggedin.php, back index.php. but, if re-enter same credentials , submit info second time, works should. so, in short, looks either login.php...

Delphi Interbase Sql Conversion to Sql Server and Oracle -

i have delphi application uses database interbase / firebird. consult , write data use interbase components palette (ibtable, ibquery, ibdataset). i'm performing conversion of system sqlserver / oracle have thousands of queries assembled @ runtime sql instructions specific of database interbase/firebird. know component or tool makes parse commands interbase -> sql server or interbase-> oracle ? what need like: var parser: tparser; outputsql: string; begin parser := tparser.create(); parser.text := 'select first 10 cityname tbcity'; if firebird outputsql := parser.parseto('sqlserver'); if oracle outputsql := parser.parseto('oracle'); componentaccess.sql.text := outputsql; ... the result of: parser.parseto('sqlserver'); will be 'select top 10 cityname tbcity' and parser.parseto('oracle'); will be 'select cityname tbcity rownum <= 10' 1) afaik, librari...

Why to use empty parentheses in Scala if we can just use no parentheses to define a function which does not need any arguments? -

as far understand, in scala can define function no parameters either using empty parentheses after name, or no parentheses @ all, , these 2 definitions not synonyms. purpose of distinguishing these 2 syntaxes , when should better use 1 instead of another? it's question of convention. methods empty parameter lists are, convention, evaluated side-effects. methods without parameters assumed side-effect free. that's convention.

c++ - When to use QThread::exec() -

i've checked satisfying explanation not find. docs mention in order use signals/slots between threads, need use event loops , start them calling exec. however can see w/o using exec(), can still send signals , handle them across threads. what's exact use of it? use qthread::exec() when want run event loop qt provides in qthread class. if don't call exec(), need create own event loop processes qt events (that is, if want signals / slots work). more work it's worth, unless have specific needs. you can still send signals / slots? guess you're not running on different thread. common issue when using qthread. put breakpoint inside code think running on different thread , have @ stack trace - may in shock!

xml - Conditional XPath matching -

i have xml looks this... <tbody> <tr> <td> <h5> <a class="foo" name="bar">this element want condition on.</a> </h5> </td> </tr> <tr> <td> <a href="/generic/generic">this element want match on</a> <td> <td></td> <td></td> </tr> <tbody> how match on second first 's name attribute "bar", using xpath? this expression work... //tr[preceding-sibling::tr/td/h5/a/@name = 'bar']/td/a but there errors in xml. here's edited version: <tbody> <tr> <td> <h5> <a class="foo" name="bar">this element want condition on.</a> </h5> </td> </tr> <tr> <td> <a hr...

confusion: xauth or oauth or my own auth? -

i'm logged in a.com now i'm on b.com b.com accesses localstorage , sees i'm logged in a.com and asks me if want download pictures a.com 1- if don't want b.com know have accounts on local storage? 2- if a.com specifies sites can see token how hell a.com supposed know, sites users go to? 3- prevents b.com not authorizing without asking me (it has access whatever token stored a.com), if token weak one, - what's use of except letting b.com know i'm logged a.com? - if no authorization can occur token how can xauth can compared oauth. because oauth have go a.com , specify want b.com access photos , post wall can not send me emails. , when interaction occur xauth? 4- think oauth , xauth crappy interim solutions replaced totally new or think o/xauth 10.0 solution connected web? 5- suggestion a.com give access b.com - invest time , o/xauth, or write function produces 2 tokens , done it? thanks. ps: i'd appreciate answers people have implemen...

alias - Aliasing a command in vim -

vim preferred text editor when program, , run particularly annoying issue. frequently, when need save buffer , continue on other miscellaneous task, typical :w however, – seems more 50% of time – manage capitalise :w . naturally, vim yells @ me because w invalid command e492: not editor command: w my question how can 1 alias colon-commands in vim . particularly, exemplify how alias w w . i aware of process map keys commands . unfortunately, not i'm looking for. to leave completion untouched, try using cnoreabbrev w w , replace w in command line w , if neither followed nor preceded word character, :w<cr> replaced :w<cr> , :write won't. update here how write now : cnoreabbrev <expr> w ((getcmdtype() is# ':' && getcmdline() is# 'w')?('w'):('w')) as function: fun! setupcommandalias(from, to) exec 'cnoreabbrev <expr> '.a:from \ .' ((getcmdtype() is# ...