Posts

php - Cannot get POST variables -

i have php file posting variables same page not working. here snippet of page. <?php session_start(); require_once 'connect.php'; require_once 'protect.php'; //$_session['uid'] = 1; if(isset($_post['shout'])) echo 'posted'; if(isset($_post['submit'])) echo 'posted'; ?> <form method="post" action=""> <input type="text" name="shout"> <input type="text" name="name"> <input type="submit" value="shout!"> </form> <input name="submit" type="submit" value="shout!"> name attribute missing

javascript - JS: How to prevent losing session per refresh after logging in in SoundCloud API -

i'm making dashboard , pulling info soundcloud api. i'm relatively new api , got far being able pull soundcloud widget per track listed. problem everytime refresh, signed out (i think). there way session remain if user example refreshes page? have right now: function connecttosoundcloud(){ //intialize auth sc sc.initialize({ client_id: sc_client_id, redirect_uri: sc_redirect_uri }); //initiate auth popup sc.connect(function() { sc.get('/me', function(me) { if (me.username) { document.getelementbyid('btn-disconnectfromsoundcloud').style.display=""; document.getelementbyid('btn-connecttosoundcloud').style.display="none"; } $.ajax({ type: "get", url: "http://api.soundcloud.com/tracks.json?client_id="+sc_client_id+"", error: function(result, status){ ...

java - Read value of outer class from inner class -

public class main { public static string s; string a="hello"; string b="world"; s=a+b; class demo{ string m; m=main.this.s; system.out.println(m); } } output should : hello world i here try understand main thing. main class android activity class extends listactivity , demo class extends asynctask. need read value static string s doinbackground method. an inner class can directly access variables without using object or class name. hence can directly refer outer class's variable without metioning name. instead of m=main.this.s; can directly access variable s m=s; its basic rule of object oriented programming inner class has full access of methods , variables of outter class.

jquery - html textarea replace br tag to \n -

i need edit row's cell in table using new lines characters. editation of these cells make textarea jquery. problem is, textarea using \n new line, html page using br tag. there code: $('#id_textarea').val(cell_string.replace(/<br>\*/gi,'\n')); i know, string has br tag likes ( note-1 ): <br></br> i tried: $('#id_textarea').val(cell_string.replace(/**<br></br>**\*/gi,'\n')); but still cannot understand, how regular expression works. and there picture of issue. note-1 - these br tags make by: content = content.replace(/\n/g, "<br>"); in db there is: <br> in firefox: <br></br> in chrome: <br> why? your regex not right, try: $('#id_textarea').val(cell_string.replace(/<br *\/?>/gi, '\n')); the demo.

iphone - Same facebook key for lite and pro apps -

i have lite , pro version of iphone app, lite app rejected appstore ,they cannot login through facebook. in development mode can able login both pro , lite version through fb. i have used same fb developer key both lite , pro. issue rejection? if need use different developer key lite , pro version of same app? thanks, please check so post . may you. urlschemesuffix string of lowercase letters appended base url scheme used sso. example, if facebook id "350685531728" , set urlschemesuffix "abcd", facebook app expect application bind following url scheme: "fb350685531728abcd". useful if have multiple ios applications share single facebook application id (for example, if have free , paid version on same app) , want use sso both apps. giving both apps different urlschemesuffix values allow facebook app disambiguate url schemes , redirect user correct app, if both free , app installed on device. urlschemesuffix supported on version 3.4....

asp.net - Access files/ folders remotely by authentication via browser/ web -

we have requirements want allow our clients/ users download files/ folders our file server via browser/ web. we have many different directories created on our file server mapped different clients. means that, every client has own directory on our server. have main (root) directory every single client/user. means that, every client’s files/folder created under respective main directory. the thing need sure is, whenever our client make request access/ download file, first need validate credential (username/password stored in our sql server db) , need allow folder mapped specific folder. (the folder mapping again stored in our sql server db) which means that, after applying credential user/clients, can access directory/ files. cannot access other’s files/ directory. would please let me know how achieve this? suggestions appreciated highly. thanks in advance. since different users need authorized access different directories, cannot expose files directly on web. bu...

c# - Why a unique synchronization context for each Dispatcher.BeginInvoke callback? -

i've noticed .net 4.5 each dispatcher.begininvoke / invokeasync callback executed on own unique synchronization context (an instance of dispatchersynchronizationcontext ). what's reason behind change? the following trivial wpf app illustrates this: using system; using system.diagnostics; using system.threading; using system.windows; using system.windows.threading; namespace wpfapplication { public partial class mainwindow : window { public mainwindow() { initializecomponent(); action test = null; var = 0; test = () => { var sc = synchronizationcontext.current; dispatcher.currentdispatcher.invokeasync(() => { debug.print("same context #" + + ": " + (sc == synchronizationcontext.current)); if ( < 10 ) { ...