889 Posted Topics

Member Avatar for Vineeth K

I remember when I was really young on the Apple II playing games like Taipan (which was a pirates / smuggling game) and Chivalry (where you were a knight who wandered the land and competed in jousting tournaments and the like). It was also around this time that I was …

Member Avatar for GrimJack
3
442
Member Avatar for erlene

Hi erlene and welcome to DaniWeb :) You have posted in the Game Development forum which is a forum for discussing game programming. I think you will have a better response from one of the tech forums on this site. I will say though that there are a number of …

Member Avatar for lisalin
0
126
Member Avatar for karen.tao

The line: [code=java] Criminal criminal = new Criminal(leftInput.name()); [/code] is trying to access the private variable leftInput which doesn't belong to your class. You only have access to the parameter e in this method.

Member Avatar for darkagn
0
267
Member Avatar for SKANK!!!!!

Try adding the following line to your script, anywhere after the line [icode]$dir = $documentroot . '/' . $username;[/icode] but not inside the function: [code=php] rmdir_r($dir); [/code] Basically, the code inside the function doesn't execute until the function is called.

Member Avatar for SKANK!!!!!
0
133
Member Avatar for futhonguy

You need to do this in two separate SQL queries. First, use a select statement to retrieve the location ID given the posted area. Then use this result as the location number when inserting to the device table.

Member Avatar for futhonguy
0
204
Member Avatar for GooeyG

Your error message is telling you what has gone wrong with this line: [code=java] if (hours == 16 && minutes == 23) [/code] Here you are trying to compare your variable hours which is a NumberDisplay object with the number 16, which is an int. That's like saying "If this …

Member Avatar for darkagn
0
470
Member Avatar for intet

Hi intet, We only give help to those who show some effort. What have you tried so far?

Member Avatar for darkagn
0
37
Member Avatar for easyb

Hi easyb and welcome to DaniWeb :) You don't need to use Math.pow at all. Math.pow is used to find the power of a number. I wish that banks would pay interest exponentially but unfortunately... ;) I suggest you revise your notes on iteration and for-loops. I think what you …

Member Avatar for easyb
0
143
Member Avatar for Vikk

Hi Vikk and welcome to DaniWeb :) Have you made an attempt at this query yet? If you post what you have done we might be able to see what you are trying to accomplish and give some pointers.

Member Avatar for darkagn
0
101
Member Avatar for gauravdott

Hi gauravdott and welcome to DaniWeb, For number 1, I would use the mathematical proof by iteration - ie prove the statement true for n=2 then assume true for n=k and prove true for n=k+1. Number 2 is a little trickier but this link might help: http://en.wikipedia.org/wiki/Kruskal's_algorithm Kruskal's algorithm determines …

Member Avatar for ganesh sk
0
97
Member Avatar for harshita

Hi anshads, Just a word of warning - it is [B]very[/B] dangerous to post your personal phone number, address, passport number, credit card number or PIN number on a forum. You can send a private message to a forum-ite by clicking on their name and following the link marked "Send …

Member Avatar for Didipya
3
529
Member Avatar for imano5

I studied scheme at university for a semester and I don't remember much besides lots and lots of brackets. Most of the problems I had with it all boiled down to the fact that I had unbalanced brackets in my statements. Other than that it was relatively straight forward to …

Member Avatar for Rashakil Fol
0
148
Member Avatar for raz0r

Hi raz0r and welcome to DanoWeb :) Not sure exactly what you are trying to do, but the rand function will give you a random number. You can read more about the rand function [URL="http://www.php.net/manual/en/function.rand.php"]here[/URL]. By microtime, do you mean time to the microsecond? If so, this can be achieved …

Member Avatar for darkagn
0
81
Member Avatar for catcoffee

Hi catcoffee and welcome to DaniWeb :) 1) Can be achieved with a [icode]<input type='file'>[/icode] in a PHP/HTML form. PHP then uses an array, $_POST, to retrieve all posted data and the $_FILE array to access uploaded files. 2) By validation do you mean making sure that the inputted data …

Member Avatar for jomanlk
0
217
Member Avatar for j_limboo

This section is commented out: [code=php] <? $host="localhost"; // Host name $username="root"; // Mysql username $password="brijpuja1"; // Mysql password $db_name="newsumo"; // Database name $tbl_name="users"; // Table name $username=$_POST['username']; $oldpass=$_POST['oldpass']; $newpass=$_POST['newpass']; $conpass=$_POST['confirmpass']; $encry_oldpass=md5($oldpass); //encrypting old password echo "$encry_oldpass"; [/code] But I think you need it to connect to the database and …

Member Avatar for j_limboo
0
128
Member Avatar for theo19

Try this: [code=php] $query2 = "SELECT tblclasslist.studentNo FROM acumenchain.tblclasslist JOIN acumenchain.tblregistration ON tblclasslist.studentNo = tblregistration.studentNo JOIN acumenchain.tbllogin ON tblclasslist.studentNo = tbllogin.studentNo AND tbllogin.studentNo = tblregistration.studentNo"; [/code] Does this give the desired result?

Member Avatar for darkagn
0
155
Member Avatar for the_programmer

Not sure what DaniWeb's policy is, but for other forum-type sites that I have contributed to we kept all PM's, emails, forum posts in database tables. If the owner of the message deleted it (by pressing a button for example) then we archived the message to another database table that …

Member Avatar for peter_budo
1
108
Member Avatar for grr

From the PHP Documentation: [QUOTE] Note: Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries …

Member Avatar for Stefano Mtangoo
0
130
Member Avatar for gretty

[code=java] String number = Float.toString(number); [/code] I think what you are trying to do is convert the number n to a string yes? What I would do is this: [code=java] String number = new Float(n).toString(); [/code] Here I create a Float object from my float primitive, then convert it to …

Member Avatar for Jocamps
0
196
Member Avatar for ankiwalia

Hi ankiwalia and welcome to Daniweb :) Your SQL syntax is incorrect. Instead of this: [code=java] String query="select username and password from Registeredusers"; [/code] Try this: [code=java] String query="select username, password from Registeredusers"; [/code]

Member Avatar for ankiwalia
0
209
Member Avatar for kulrik

Your line: [code=java] while (i<=k) [/code] is placed before k is properly initialised. I think you need a line inserted to receive the input that you are prompting for. That is similar to your line that reads: [code=java] x=input.nextDouble(); [/code] but for k instead of x (I'll let you figure …

Member Avatar for darkagn
-1
84
Member Avatar for keekee

Somewhere in your code you are passing a null value when you can't. If I had to guess I would say your problem occurs somewhere near these lines of code: [code=java] URL url = this.getClass().getResource("logo.jpg"); Image img = Toolkit.getDefaultToolkit().getImage(url); [/code]

Member Avatar for masijade
0
189
Member Avatar for seo2005

1/2 is 0 remainder 1 because you have 0 whole divisions into 2. You are correct in saying that it is 0.5, but when doing a conversion between bases we deal only in whole numbers.

Member Avatar for BestJewSinceJC
0
91
Member Avatar for lcyew

Hi lcyew and welcome to DaniWeb :) Do you mean that you want to provide an export facility, or that you need to export your source code to those formats? To provide an export facility you need to: - read the contents of the file to be exported using file_get_contents …

Member Avatar for lcyew
0
1K
Member Avatar for matthewl

Back when I worked for the Australian Defence Department I was writing code that simulated warships communicating with each other. During testing I had 4 pc's talking to each other via UDP and TCP communication. The hardest part about it all was remembering which ship was being simulated by which …

Member Avatar for jbennet
0
301
Member Avatar for surf

Hi surf and welcome to DaniWeb :) [code=php] echo '<option value=\"$key\">$value </option>\n'; [/code] This line is your problem. Swap all ' with " and vice versa. The problem is that $value is not evaluated inside single quotes. Your code should look like this: [code=php] echo "<option value='$key'>$value </option>\n"; [/code] Note …

Member Avatar for edwinhermann
0
127
Member Avatar for debuitls

Try this: [code=php] <?php // php code here ?> <!-- HTML code here --> <input type='button' name='myButton' id='myButton' onClick="window.open('viewhotel.php?id='<?php echo $row['id']; ?>','mywindow','width=400,height=200')'" /> [/code] Is that what you meant?

Member Avatar for dasatti
0
293
Member Avatar for Tekkno

$results is a resource that can be used to grab an array using any of the mysql_fetch functions: [code=php] while(($nextRow = mysql_fetch_assoc($results)) !== false) { $column1 = $nextRow["column1"]; // etc } [/code] The loop will stop when there are no more records to be fetched.

Member Avatar for Tekkno
0
86
Member Avatar for didyouthink76

Certainly it is important to liase with the end user in any project. If you are managing a database for accountants, then yes you will need to understand what they will use the database for and what information they expect to be able to recall. For your second question, might …

Member Avatar for didyouthink76
0
203
Member Avatar for davrosboy

Hi Davros and welcome to DaniWeb :) So are you trying to change the code that embeds the editor on the fly? If so, according to what criteria? I'm a little confused as to what you want to achieve.

Member Avatar for davrosboy
0
108
Member Avatar for duckman_ca

Hi duckman_ca, I'm fairly new to C# so I don't know xml.InnerText, but XML parsing in PHP is quite simple thanks to several libraries we have available. Take a look at SimpleXML or the standard DOM library as a start, but there are others. For a full list and documentation, …

Member Avatar for darkagn
0
65
Member Avatar for Schoorsteen

Personally I find it difficult to critique UML when I am not sure exactly what you are trying to achieve, but I'll give it a go. It looks good except for a couple of things that I noticed. First of all, you have a User having a Family, I think …

Member Avatar for Schoorsteen
0
79
Member Avatar for DigitalGirl

Can you post the code for your [icode]Record[/icode] class? I suspect the answer might be that you need to override the Equals method, so if you haven't done that I would start there...

Member Avatar for DigitalGirl
0
102
Member Avatar for click here

The code that ivatanako has given you is probably as simple as you can get. It will allow you to connect to your database and run a query. You can extend it if you need, but I can't see how it could be simplified further as you need those steps …

Member Avatar for smartness
0
196
Member Avatar for karthikanov24

Using double quotes in PHP has many advantages, not the least of which is that all variables will be evaluated inside them. Consider the following code: [code=php] for($i=0; $i<10; $i++) echo "$i "; [/code] This will output: 0 1 2 3 4 5 6 7 8 9 The following code: …

Member Avatar for karthikanov24
0
120
Member Avatar for click here

[QUOTE=click here;985787]hi iam tried to send mail but see how it appear iam use mail function when i make 2 line the message appear line one [COLOR="Red"]\n[/COLOR] line 2[/QUOTE] You need to set a new line as <br /> in an HTML email or \r\n in a plain text email. …

Member Avatar for almostbob
0
126
Member Avatar for sim_pack

Also, make sure that you never send unencrypted passwords via GET as they will be visible in the URL. There are also hacking tools which allow the retrieval of POST data, so watch out for that too.

Member Avatar for almostbob
0
323
Member Avatar for click here

This post is just to see the function with formatting, I will try to help you shortly. [code=php] function text_limit($str,$limit=10) { if(stripos($str," ")) { $ex_str=explode(" ",$str); if(count($ex_str)>$limit) { for($i=0;$i<$limit;$i++) { $str_s.=$ex_str[$i]." "; } return $str_s; } else { return $str; } } } [/code]

Member Avatar for click here
-1
89
Member Avatar for ronny22

You have three entries in your $_POST array that are themselves arrays. The addslashes function expects a string and can't parse the array. Try this to see what is going on: [code=php] if (isset($_POST)) { echo "<pre>"; print_r($_POST); echo "</pre>"; [/code] This will print out your $_POST array in a …

Member Avatar for darkagn
0
156
Member Avatar for Zack_G

You need to iterate through each of the table rows like so: [code=php] $sql = "SELECT * FROM ddcart_products"; $result = mysql_query($sql); $totalweight = 0; while($data = mysql_fetch_assoc($result)) { echo '<br />'; echo $data['name']; echo '<br />'; echo 'Weight: '.$data['weight']; echo '<br />'; echo 'Qty: '.$value; echo '<br />'; $weight …

Member Avatar for digital-ether
0
111
Member Avatar for jay_412

You don't need to "put" your stored procedure somewhere, you create one by executing a [icode]CREATE PROCEDURE[/icode] statement. As cwarn23 mentioned, you will need a database with tables etc for your procedure to be able to do anything.

Member Avatar for darkagn
0
204
Member Avatar for vbCNEW

[QUOTE=firstPerson;982988]They are not rigged. Do research before you answer some question that you are not 100% sure.[/QUOTE] In Australia the law states that gaming machines must have a return to player ratio of at least 86%. That is, over the long term, every $1 spent wins 86 cents (or loses …

Member Avatar for rob-lozyniak
0
114
Member Avatar for Rurik16

In addition to what Ez has said, I would change your forever loop (that is your [icode]for(;;)[/icode] ) to [icode]while(cash > 0)[/icode], that way when the player runs out of cash the game is over.

Member Avatar for Rurik16
0
177
Member Avatar for Salem

>If you specify an invalid language, it defaults to using the one from the >current forum. csharp is now invalid in favor of C#. For c++, you can do >C++ or cpp. code=php is not working in the PHP forum. EDIT: Just went back to get a screenshot to post, …

Member Avatar for MosaicFuneral
1
984
Member Avatar for andym67

Hi andym67 and welcome to DaniWeb :) A better approach is this: [code=php] if(isset($_SESSION["namevalue"])) $val = $_SESSION["namevalue"]; else $val = ""; // maybe do some validation on $val here echo "<input name='fname' type='text' class='textfield' id='fname' value='$val' />"; [/code] or: [code=php] <?php if(isset($_SESSION["namevalue"])) $val = $_SESSION["namevalue"]; else $val = ""; // …

Member Avatar for andym67
0
17K
Member Avatar for gouthamvel

Hi gouthamvel and welcome to DaniWeb :) I think we may need a bit more information to help you on this one. Can you please post the code for the select tag that this option tag is a part of? What do you mean by the script won't work? Does …

Member Avatar for cwarn23
0
128
Member Avatar for andrewnim

Are you sure that your $_SESSION['SESS_ORDERNUM'] is set correctly? Try echo'ing your sql statement before you send it to mysql_query and see...

Member Avatar for andrewnim
0
126
Member Avatar for lonestar23

So is $title the title of a single RSS feed item? If so, you can do something like: [code=php] $count = 0; foreach($rssFeedItems as $title) { if(empty($title)) echo ++$count; // a prepend increment will add one to $count before it is used else echo $title; } [/code]

Member Avatar for darkagn
0
160
Member Avatar for Aamit

I must admit that javascript is not my strong suit, but I will try to help. The line [code=html] tbl2 = tbl2 + GenerateRow() [/code] What happens in javascript if you call a function without the parameter in the method signature? Also you appear to be missing several ;'s to …

Member Avatar for darkagn
0
131
Member Avatar for i_need_help2009

The key to solving this problem is how the form is submitted when the user selects from the first drop down. When the form is submitted, their selection is placed in the superglobal array [icode]$_POST[/icode] with the array key equal to the name parameter of your select tag. Your form …

Member Avatar for darkagn
0
75

The End.