4,124 Topics
![]() | |
let session = NSURLSession.sharedSession() //1 let downloadTask = session.downloadTaskWithURL( url, completionHandler: { [weak self] url, response, error in // 2 // return } ) Please explain the meaning of [weak self] inside closure . what if we dont declare it as [weak self] ? Thanks / | |
![]() | I am having registration form which is very long so i have divided into two parts at end of first part i have button continue.If user has filled all the fields and data in fields are correct he can click on continue button to fill remaining form.So after doing some … |
Alright everyone, I am at a lost here. I am working with log4net at my work, and have come to learn log4net can pipe its data to a telnet stream. I have setup the config for the log4net like so <appender name="RollingTelnetAppender" type="log4net.Appender.telnetappender"> <port value="1200" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date … | |
Please help me.... I want to upload up to 5 photos and save in database. I want by selecting photo it will upload automatically and then the selected photo will appear in the page. It will occure with one by one photo, up to 5 photos and the photos can … | |
Hello i have created an API account for oauth services. I did it so that our users could log in to our website through their google acount credentials i want to use that google API so that the users could import their contacts to out website and i am getting … | |
I have created an app with simple login authentication, it is actually a twitter clone. The user logs in and access the pages, etc. But when the user posts something from there profile. It gives an error NoMethodError in RibbitsController#create undefined method `userid=' The error is around line 5: class … | |
Hi. Has anyone maybe found this miraculous software. That I could install on Windows/Linux machine (server) and client on my own computer let it be Windows/Linux. And have really great response time and quality? The server would be at 100Mbps, my connection would be at around 50Mbps. If my machine … | |
Hi, I have been getting this error when doing savechanges(). System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session. I read this issue in many places and most are fixed with a .ToList() .First() or similar methods (basically not changing the object while the … | |
session start has been evoked. I need the value of $v. $key = $_SESSION['sys_var_key']; $v = $_SESSION[$key]; echo '<br>key =>'.$key; echo '<br>value =>'.$v; | |
The following on the attachment below are the page feeds with its comments returned by facebook PHP sdk and Graph API. What I want here is to get number of comments per user on each feed. Here are the codes $helper=new FacebookRedirectLoginHelper($url); try{ $session=$helper->getSessionFromRedirect(); if(isset($session)) { $request=(new FacebookRequest($session,"GET","/357971644373038/feed"))->execute()->getGraphObject()->asArray(); $comment=$request["data"]; $counter=count($comment,1); … | |
Good day, I am a PHP beginner, but have managed to set up a shopping cart on my jewelry website (with the help of video tutorials found online). Everything is working well, but I need to add a text box to my product page where people can add the engraving … | |
I'd like to create `/admin.php` page, which would have AJAX request, sent over to `/core/adm/index.php`, that's easy, basic AJAX request will do just that. But I don't want any direct access to `/core/adm/index.php`, I want it to be accessed only by AJAX request from `/admin.php`. Is there a way to … | |
<div class="hor-menu "> <ul class="nav navbar-nav"> <li class="active"> <a href="index.html">Dashboard</a> </li> <li class="menu-dropdown mega-menu-dropdown"> <a data-hover="megamenu-dropdown" data-close-others="true" data-toggle="dropdown" href="javascript:;" class="dropdown-toggle"> Categories <i class="fa fa-angle-down"></i> </a> <ul class="dropdown-menu" style="min-width: 710px"> <li> <div class="mega-menu-content"> <div class="row"> <div class="col-md-4"> <ul class="mega-menu-submenu"> <li> <h3>Level 1</h3> </li> <li> <a href="add_category.php" class="iconify"> <i class="icon-plus"></i> Add Categories … | |
Hello. I want to make a simple login page using MVC4, where both users and admins can log in. The users should be allowed to see their own details, edit their details. The administrators should be able to list all the users, show a specific users details, edit those details … | |
Hi i am currently building a admin section for my website but i am stuck at a certain point, right now my user authentication is working and my form validation is working great, when i log in as admin i want it to display the admin dash and when a … ![]() | |
Hi, i am using setExpirationSeconds() to set the timeout for user. but how to update the timeout timestamp in data base when user session expires automatically due to user inactivity. Regards, Nabin | |
Hey guys, Is there any one who knows how to get a session from access_token? In Facebook PHP SDK v5 I can get access_token, but I don't know how to get a session so as to retrieve feeds. According to Facebook PHP SDK v5 and Graph API v 2.4 documentation([Click … | |
Hi guys i have simple captcha that seems to working but the only problem i have seems to be with the callback function on the validation have a look at the captcha: function index() { $this->load->helper('captcha'); $this->load->library('form_validation'); //Input field, Friendly name, Attributes $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email'); $this->form_validation->set_rules('number', … | |
Hello, I have created many section like update delete etc on the webpage i stored a message in the session variable so when users updates deletes etc on the page a message comes up logo updated sucessfully message posted successfully etc etc so that message is stored in session variaable … ![]() | |
Ok, I am running php 5.4 and when I got the dreaded Fatal error: Function name must be a string in /home2/mydomain/public_html/session.php on line 3 I was like OH, BOY. Here is the code it is referring to. <?php session_start(); session_register("userid"); session_register("name"); //session_register("ID"); //session_register("ID"); ?> <?php session_start(); session_register("adminid"); session_register("adminname"); //session_register("ID"); … | |
How to split session values? I am getting error like "Notice: Array to string conversion in PHP" in session; How to solve that? ![]() | |
Hi all okay so when i click on my home page on my login button it takes me to my login screen that all works well but when i submit the form it just reloads the page and does not redirect to the page specified in my controller. Also the … ![]() | |
How to unlink multiple files in codeigniter? I have to delete records from database. delete records works . what i want, after deleting records also files should get delete form directory(/uploads/deals/) My scripts is below: public function delete($merchant_deals_id) { $deal = $this->admin_deal_model->get_single_deal($merchant_deals_id); $path = './uploads/deals/'; $image1 = $path.$deal['deal_images1']; $image2 = … | |
Sample code: Try Dim constr As String = ConfigurationManager.ConnectionStrings("FileDBConnectionString").ConnectionString Using con As New SqlConnection(constr) Using cmd As New SqlCommand() 'cmd.CommandText = "SELECT fldControlno, fldRecno, fldFileName ,fldDate FROM tblPDSTrainzATemp where fldRecno= ('" & txtrecordno.Text & "')" Convert(varchar, fldDate, 101) ' cmd.CommandText = "SELECT fldcontrolno,fldEmpID,Convert(varchar, fldDate, 101) as [Date],fldPosition, fldSalary, fldAttachType, fldfilename,fldfiletype,fldfiledata … | |
Can anyone help me out ?....... I have written a code for a form. the first five fileds in the form must be filled automatically by capturing the user id from login page. I have been able to capture the data and print it on the screen But, Iam not … | |
Hey guys can I have a problem relating to Graph API, I want to get user profile info but it seems I can't generate a session, I don't know what is the problem. Here is my code.....please help me guys session_start(); require_once "facebook/autoload.php"; use Facebook\FacebookSession; use Facebook\FacebookRequest; use Facebook\GraphUser; use … | |
How can i show user "Your account is not confirmed yet" when the login form check whether confirm column is YES (If yes then tke it to member page & if NO then shows that error message.) I already have error message for invalid details but I want a cofirmation … ![]() | |
Hi i made a jquery mobile website, but when i upload it to Phoegap and test, i can't connect to the database. I'm using the Dreamweaver login form in php, and loading from a database. Code to load from database: <?php // *** Validate request to login to this site. … | |
Hello Experts, I hate PHP when these things comes in front of me every time when i create and insert query I stuck up by viewing everything is ok but not working don't know why. please help me out previewuser.php <?php include_once('includes/header.php'); include_once('includes/session.php'); include_once('includes/functions.php'); include_once('includes/connection.php'); if(isset($_POST["submit"])) { echo add_user(); } … | |
Hi I have written a code for sending a mail, it was working fine before and now it hangs at tranport.send(). Can any one help, here my code `Inline Code Example Here` try { System.out.println("Sending Email initiated..."); Properties properties = System.getProperties(); properties.put("mail.smtp.auth", "false"); properties.put("mail.smtp.starttls.enable", "true"); properties.put("mail.smtp.host", _host); properties.put("mail.smtp.port", _port); properties.put("mail.smtp.connectiontimeout", … | |
Just an accumulation of worldly wisdom in question answer format. Q: "How Do You Get Holy Water?" A: "You Boil The Hell Out Of It." | |
Hi All, I'm trying to setup ssh key authentication on a git server and remove the password authentication. The server and any clients are all local at the moment. The clients are running Windows 7. I've got the ssh key part set up but I'm having trouble preventing the password … | |
I cant seem to understand the issue with this statement, admittedly i have not written this code myself but have found it and modified it to work with what im doing, as most open source code is. This is for a secure login script that will pull a salted password … | |
<?php require_once('includes/dbconn.php'); error_reporting (E_ALL ^ E_NOTICE); session_start(); $userid = $_SESSION['userid']; $username = $_SESSION['username']; ?> <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Home</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <!--Header--> <div class="header"> <div class="logo"> <img src="images/logo.gif" alt="logo" /> </div> </div> <!--Start of content--> <div class="content"> <div class="padding"> <div class="contentarea"> … | |
I am trying to force log out an inactive user from my CMS. The timeout value is stored in a value called PREF_TIMEOUT in my database. Ive borrowed this code and modified it a little. The code does not seem to be doing anything. Does anyone know of a better … | |
In a form, I am displaying a select box value , based on that select box value i show two more select boxes using ajax in div id. And I don not know about session, I want to save that in session using ajax . How to do? | |
Executing Code upto insert users: <?php require('session.php'); require('encrypt.php'); require('mail.php'); $username = $_POST['user_name']; $password = rand(10000, 99999); $name = $_POST['name']; $password = encrypt($password, 'ganesh'); $email = $_POST['email']; $terms = $_POST['terms']; $address = $_POST['address']; $mobile = $_POST['mobile']; $dob = $_POST['birth_year'] . '-' . $_POST['birth_month'] . '-' . $_POST['birth_day']; $ip = $_SERVER['REMOTE_ADDR']; $url … | |
Hello!!! I am a beginner to C++ and linked list and searching algorithm really made me confused. There are 26 errors (which caused by pointer ofc). Can anyone give me idea how to fix these errors??? #include<string> #include<cstdlib> #include<iostream> #include<malloc.h> #include<fstream> #include<time.h> #include<conio.h> using namespace std; #define SIZE 10 class … | |
I got smpp class from [Click Here](http://www.phpclasses.org/package/1373-PHP-Sends-SMS-messages-via-an-SMPP-server.html) i am able to send sms to the single mobile number using SMPP connection but unable to send sms to multiple mobile numbers The code is as follows: <?php include_once('smppclass.php'); /* File: smppexample.php Implements: exmaple for smppclass.php::SMPPCLass() License: GNU Lesser Genercal Public License: … ![]() | |
<?php $this->user_id = $_SESSION['user_id']=$user->id; //create a database connection mysql_connect("host","user","pass") or die("Error:".mysqlerror()); //select database mysql_select_db("db"); ?> <html> <body> <link href="tab.css" rel="stylesheet" type="text/css" media="all" /> <table id="box-table-b"> <tr> <th>User ID</th> <th>Status</th> <th>I.P</th> <th>Offer Id</th> </tr> <?php $result = mysql_query("SELECT * FROM clicks where userId='$id'"); //return the array and loop through each row … | |
Here is my Php script redirect into admin page ...this code working fine in localhost but i will go the server is not redirected i dont know ehy its happening right now ... any help guys... if ($this->session->userdata('admin_login') == 1) redirect(base_url() . 'index.php?admin/dashboard', 'refresh'); | |
Hi I want to send session variable in an array from one JSP page to another using code given below String[] textfield_a =(String[])session.getAttribute("textfield_a"); But i m getting error . plz help | |
need some assistance. I am currently learning vb.net with sql. I have two textboxes (txtValue and txtText) , a dropdownlist (ddl1) and save button (btnAdd). I insert value to txtValue and txtText (eg: txtValue: A and txtText: Apple). when i click button Add, The value will display in dropdownlist (like … | |
I need some assistance here. I currently learning and i would like to create a simple webpage (as a hobby). I have two textboxes (textbox1 and textbox2) , a dropdownlist (ddlist) and save button (btnSave). I insert value to textbox1 and textbox2 (eg: textbox1: A and textbox2: Apple). when i … | |
Hello, sorry - another newbie. I found a lot of similar FQAs and Solutions, but they do not fit ... For some reasons I do not use Visual Studio and not Razor. My code example is a single .aspx page (with no code behind). I would like to get the … | |
Please recommand me a good book or website where i can learn PHP Session. Actually a website will be more better thanks guys. Peace | |
case "remove": if(!empty($_SESSION["cart_item"])) { foreach($_SESSION["cart_item"] as $k => $v) { if($_GET["id"] == $k) { unset($_SESSION["cart_item"][$k]); } if(empty($_SESSION["cart_item"])) { unset($_SESSION["cart_item"]); } } header("location:cart.php"); } break; i m tring to delet item from session array for a shoping cart my function work ehrn i add singel value in cart but when i … | |
I have images generated by while loop php based on how many course user have when user press on one of those images it will send him to that course page but all images send to one course page this my php code in** home page ** <?php $con=mysqli_connect("localhost","FYP","123","FYP"); $sql= … ![]() | |
Working on a Project which have several admins and one super admin.. I have created a common table for admin's. Tables have fields username,password,location and status. I have created a single login page. For admin I need username and location in session.But for super admin I need only username in … | |
I have a page that has 2 forms on it. It's an inventory system. One form is to add items to your inventory. The second form is to update your qty of each item. The first one that adds items to the inventory works fine. But the second one will … |
The End.