- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 4
- Posts with Downvotes
- 1
- Downvoting Members
- 4
42 Posted Topics
I have a search in my drupal website which searches for users registered in my website (finder module). Upon clicking any user from the user search result, it takes to that user's profile page. At the top of that page, a text 'Relationship' is displayed. Under it, a link saying … ![]() | |
We are planning to develop a small embedded product, which will be touch-screen and loaded with few applications which we will develop. Those applications will be contacting a database through wi-fi, and displaying data, and also update the database sometimes. The available flash or ROM memory will be limited, around … | |
I have a html with a checkbox and 3 radio buttons. I want to disable and deselect all radio buttons when the checkbox is unchecked, and select the first radio button when checkbox is checked. I have the below code but it does not seem to be working. //html <input … ![]() | |
Re: Any changes to the UI during run time must always be made inside a Thread. Example, inside ActionListener, if you want to update UI like adding label or disable button, it must be done inside a thread. Example: Thread r = new Thread(new Runnable() { public void run() { button1.setEnabled(false); … | |
I found a C# script to copy any irregular portion from an image (using free hand drawing) and put it on another image. I have never worked with C#. All I want is to copy the irregular part and save it as a new image with transparent background (png format) … | |
I am trying to connect mysql from within PHP function. The credentials are stored in a separate PHP file, which I am including it inside the function. But when I run the script, I am getting following error: Warning: mysql_query(): A link to the server could not be established in … | |
I wanted to vertically align a div inside another div. For this I was using line-height (= height of the div) and vertical-align: middle. But if I specify the line-height value in % instead of px, it doesn't work. I tried googling it but could not find. What can be … | |
I have a class which extends JFrame and this class is made singleton (private constructor, public static method to create instance if null). But still I get one more frame when already one is open. Can someone help? | |
Re: In line 10 above, change as below: echo "if (strlen($cellno == 11) && preg_match(\"[0-9]\", $cellno)"; What you typed above is not correct...double quote within another double quote can be written as \" (escape sequence) | |
Re: For this, you have to use Servlets or Struts or Spring (to write controllers) because you have to retrieve the value(column name input by user) from the text box and inside the controller you have to write JDBC code to create table using the retrieved values. | |
Need an Hello world example of how to add an item in the context/pop-up menu in eclipse plugin development. (menu should pop-up when we right-click anywhere in the workspace). | |
Re: Create an array of Integers instead of an array of ints. Java 1.5+ supports autoboxing and unboxing so an array of Integer will accept int values. | |
Re: Try the following code: import java.util.*; import java.io.*; public class BackUpSql { public static void main(String[] args) { try { Runtime rt = Runtime.getRuntime(); rt.exec("cmd.exe /c start C:\\ab.bat"); System.exit(0); } catch(Exception ex) { ex.printStackTrace(); } } } Here is the ab.bat: set path=%path%;C:\Program files\MySQL\MySQL Server 5.0\bin; mysqldump -uroot -proot register … | |
Re: Try the following code: import java.util.*; import java.io.*; public class BackUpSql { public static void main(String[] args) { try { Runtime rt = Runtime.getRuntime(); rt.exec("cmd.exe /c start C:\\ab.bat"); System.exit(0); } catch(Exception ex) { ex.printStackTrace(); } } } Here is the ab.bat: set path=%path%;C:\Program files\MySQL\MySQL Server 5.0\bin; mysqldump -uroot -proot register … | |
Re: Upon submit, call a javascript function where you set a jsp session variable as 1. In the body of the jsp, check the session variable. if it is 1, proceed with displaying the form. | |
Re: use JSTL taglib tags...example below: <c:foreach var="a" list="studentList"> ID: ${a.id} - NAME: ${a.name} </c:foreach> id and name are fields in the student object. Dont forget to import JSTL taglib at top of page. | |
In the below code, I want to know the significance of 10 while creating a PrioriyQueue. I know its the initial capacity but what does it mean?? I replace 10 with any positive number and the output remains same. import java.util.*; class Test { static class PQsort implements Comparator<Integer> { … | |
public class Twisty { { index = 1; } //need clarification here int index; public static void main(String[] args) { new Twisty().go(); } void go() { int [][] dd = {{9,8,7}, {6,5,4}, {3,2,1,0}}; System.out.println(dd[index++][index++]); } } In the above code, inside the instance initialization code, index is used. But it … | |
Re: after logging in, store the user id in session ($_SESSION['userid'] = "nchy13"). Access the session variable from any other page as long as the user is online. | |
Re: Hi rotten69. You are getting this issue because of resolution problems in different screens. I suggest you use percentage (%) instead of pixels (px) in your css styles. This will almost solve your problem. :) happy coding. | |
Re: First, your form wont submit. You should use <input type="submit"> instead of type="button". Now to accomplish what you want, we can do in 2 ways. 1) Upon selecting a value, print the result <html> <head> <script type="text/javascript"> function printResult() { var selectedVal = document.forms[0].list.options[document.forms[0].list.selectedIndex].value; document.getElementById("showResult").innerText = "Your number is: " … | |
I'm getting user's profile picture along with their name from database and populating them in a div inside an anchor tag. The <a> tag is used so that we can click on any result and it takes to that user's profile page. I tried many codes to traverse the search … | |
Re: If you are getting undefined index error, it means the $_COOKIE array does not contain the 'user' index, which in turn means that $_POST['remember'] is not set. Can you provide the html part of the code? Just want to check if you have used form method="post" or "get"...If it is … | |
Re: The following can be used. I saw this in one of the websites of Stack Exchange. The server sends a random salt string in the login page which gets appended to the password in javascript in the browser and the SHA1 hash of the result then gets submitted back to … | |
Re: you can use php header as below, header("location: http://localhost/fi.php"); | |
Re: Use a form textfield. On click, display jQuery date picker. Select the date and it auto updates in the textfield. Then upon submit, the date will be stored in MySQL. | |
Re: $_POST should be used to retrieve data only when data is submitted through forms. Since you are using a link, data is passed in the URL. so you have to use $_GET to retrieve 'nid'. | |
Re: In the logout script, use unset(name_of_session_variable) to invalidate session. Plus, in all pages, before displaying the output, use an if condition and check if the session variable exists. Example: in logout script, unset ( $_SESSION ['name'] ); In all other pages, if(isset($_SESSION['name'])) { //display data echo "success"; } else { … | |
Hi..Earlier i was using Windows XP and used to access my company mails through MS Outlook. Now i'm using Ubuntu 11.10 and want to access my company mails. I thought of using Mozilla Thunderbird. During creating a mail account in Thunderbird, it is asking for various details like incoming server(IMAP … | |
I'm very much depressed with the following code. As for me, everything is correct. But the Goddamn code doesn't work. I've a html form with radio buttons and a hidden field. On clicking Submit, the form does not submit. Trying print_r($_POST) on the submitted radio button variable, it returns an … | |
I have to design a database where one requirement says "For each project, for each user, for each skill, store the marks gained". Initially, i had a table where each skill was a column(proj_id, user_id, skill1, skill2, ......., skill_N) I felt this was a bad design because the number of … | |
I have to design a database where one requirement says "For each project, for each user, for each skill, store the marks gained". Initially, i had a table where each skill was a column(proj_id, user_id, skill1, skill2, ......., skill_N) I felt this was a bad design because the number of … ![]() | |
Re: Use the below code for all your <li> <li><a href="http://www.hackstavastergard.com/gasthem.html"><img class="imgstyle" src="source of the image you want"></a></li> replace "source of the image you want" with the actual image url (example: [url]http://www.mycircle.freevar.com/image4.jpg[/url]) then, remove css code for li and add for imgstyle as below img.imgstyle{ width:40; height:40; border:none; } | |
I have installed ajaxim chat SNIP in my website at SNIP I downloaded the minified version(size: 78K) The chat at bottom right corner always shows "You are currently not connected" (when mouse is moved over it). My database settings are all correct but still i'm getting this message. Also the … | |
Here is my problem. I have a site into which users can login. It has a logout button to let the user log out. My problem is when they close the browser without logging out, how can I close the logged in entry in the database?? I need a way … ![]() | |
Re: have a html form for users to enter the answer: form method=post action=abc.php input type="text" name="answer" input type="submit" value="submit" /form Then, use php to obtain the value entered in field: $value=$_POST['answer']; if($value!=2){ echo "sorry!! Answer wrong!!"; } ![]() | |
Re: Try this.....i use this in my website. Note: $_SESSION['userid'] must be set already. <?php session_start(); $user=$_SESSION['userid']; $imgname=$_POST['imagename']; function findexts1 ($filename) { $filename = strtolower($filename) ; $exts1 = split("[/\\.]", $filename) ; $n = count($exts1)-1; $exts1 = $exts1[$n]; return $exts1; } $ext1 = findexts1 ($_FILES['userfile']['name']) ; $imagename = md5(rand() * time()); $ran … | |
I have a php file, for example abc.php file whose output will be an image(profile pic) and below it a set of links(navigation links). When i click any of those links, it displays the output of destination file(output of file mentioned in "href" attribute of anchor tag). But i want … | |
echo '<a href="javascript:void(0)" onClick="javascript:chatWith('.$result[3].')">'.$result[3].'</a>'; only the $result[3] between the <a> and </a> gets displayed....i want to display also the $result[3] within the javascript function call....is thr any error in it?? | |
[url]http://www.mycircle.freevar.com[/url] This is my website. Whenever a user logs in using correct username and password, a field(flag=1) in the database is updated to show that the user is online(for chat). When user logs out, it is set to flag=0 to indicate offline. This works properly. Consider the situation. The user … | |
Re: Use the following in all pages..... 1. session_start() in the first line after <?php 1. check if session exists using if condition as below: if(isset($_SESSION["your_session_variable"])) { do all coding within this block; } else { display login page; } The login page can be displayed as below: header("Location:your_loginpage_address"); | |
I have a website whose homepage has 4 frames. 1 at top(horizontal) and 3 vertical below it. The middle vertical frame displays all the contents of pages when links in other frames are clicked. I have a link in top frame to logout the user when clicked. In this link's … |
The End.