569 Posted Topics
| |
Re: Hey, "boolean" is not a data type, look at the correct definition/declartion Also, are you defining the function prototypes before main (since you're using them after main) because if not, the program won't know where to call the fucntions. Hope this helps :) | |
Hey, I might be having a blonde moment but here goes.. I'm trying to split a massive 1D vector into blocks at different places (If that makes sense), it should basically go like this: 0 201 401 601 801 .. .. .., 57201 2 202 402 602 .. .. .. … | |
Re: Hey, Numbers_roman::tonumeral($year); *This looks like a namespace, however, I might be wrong. See: http://php.net/manual/en/language.namespaces.php* and require_once("numbers/roman.php") This this includes the file, but, instead of the "include" function which will only execute an error, this function will die if there is an error. By using the require_once, it will check to … | |
Re: Instead of: if($v) { } Try using: if(isset($v)) { } I don't know which part the final else statement relates to. mhmh! ![]() | |
Re: @LastMitch, I'm confused to what you mean by "Text Editor" :P Ok, back to the OP.. So, you want a profiling system for your users. It's surprisingly simple, I'll guide you through the concepts, and, you can code it or find tutorials out there.. So first off, you need a … | |
Re: @griseindria - Just select it off SESSIONS then..? I.e. <?php if(!isset($_SESSION['user_session'])) exit("You do not have permission to access this page, sorry"); $query = "SELECT * FROM profile WHERE user_id='{$_SESSION['user_id']}'"; $res = mysql_query($query); if(!mysql_affected_rows() == 1) exit("Couldn't find the details"); while($row = mysql_fetch_array($res)) { // only display the users details } … | |
Re: Shouldn't this: <?php while($row = mysql_fetch_array($result)) { echo "<a href='members_profile.php?id=<?php echo $row[0];?>' >" .$row['username'] . ', '; } ?> Be this: <?php while($row = mysql_fetch_array($result)) { echo '<a href="members_profile.php?id=' .$row[0]. '">' .$row['username']. '</a>'; } ?> Also, with this code: <?php session_start(); Connected to database here $sql = "select * from … | |
Re: Hey, why not try mysql_affected_rows()? E.g. //This session value is created at login $username = $_SESSION['valid']; //This is written to the URL $server_id = $_GET['server']; //See if a server exists with this ID and Username $query_server = "SELECT id FROM servers WHERE id='".$server_id."' AND `administrator`='".$username."'"; $result=mysql_query($query_server); if(mysql_affected_rows() == 1) { … | |
Re: Hey I just tried your script, it didn't work for me so I changed it and this works: <?php $filename = 'file.php'; if(file_exists($filename)) { header( 'Location: welcome.php' ) ; } else { echo "NO FILE"; } ?> | |
Re: @EmilyJohnson that could not possibly work. Try avoiding outputting variables in functions, but, return them: <?php function country($country) { return $country; } echo "i am going to " . country("USA") . "<br />"; ?> i am going to USA ![]() | |
Re: Do you mean inheritence? Inheriting methods from one class to another. | |
Re: Before you begin to integrate PHP within this HTML... This is wrong: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name = "description" content = "Wellington Real Estate"/> <meta name = "keywords" content = "home, housing, Karori, Mirimar, Te Aro, Thorndon, Farcourts, Jonnys, Relax"/> <title> Agents … | |
Re: Hey, You need to firstly look into arrays, and, then how to pass (array pointers) into functions, once you've found these things out you can then sort the array (bubble sort e.g.) and find the lowest value. Not allowed to provide a solution to this probem! | |
Re: Yeah, like @Javvy said just use HTML tags.. So something like this: <?php date_default_timezone_set('UTC'); $d = date("M"); echo "<font color='yellow'>$d</font>"; ?> | |
Re: Hey, You're not breaking your cases, after each case you need to have a break otherwise it may just jump to the next case etc. Also, you need to have/suggested that you always have a default case. Here's an example: int main() { int number; switch(number) { case 0: // … | |
Re: Try this, bit different to your script.. Have a look at yours, you have many errors: <html> <head> </head> <body> <table border='1'> <tr> <th>Agent_ID</th> <th>Address</th> <th>Bedrooms</th> <th>Price</th> <?php $connect=mysql_connect("localhost","root",""); mysql_select_db("ong_assesment",$connect); $query = "SELECT Agent_ID,Address/Suburb,Bedrooms/Bathrooms,Price FROM suburbs"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td>'. $row[Agent_ID].'</td>'; … | |
Re: "varchar" is typically associated with MYSQL datatypes.. What field do you want to make/add "varchar" to? | |
Re: Hey, I think I get what you mean: Let's say your radio button had the name of "option" and a value of either true/false <?php $a = $_POST['option']; // this will either store true/false if($a) { echo 'a is true'; //print ("A is true"); }else{ include ('test.php'); } ?> Hopefully … | |
Re: Aha Hello there, I like it, well done for your first project :)! You should look into jQuery/AJAX and see if there are ways in which these languages can help improve it / Make it more "elegant". Your next move to develop it further would look at how to have … | |
Re: I've never done this in PHP, but, by 'Binary', i'm guessing that you're trying to parse a binary image? (I.e. black and white)? | |
Re: When creating your table, did you specify the ID (primary_key) was auto increment? If so, you shouldn't have this problem.. ![]() | |
Re: I think the system should have a feature like "Don't show this again" and then remember it, but, still give them the option (without pop-up) when they create a new thread. I know what you mean! | |
Re: Hey, try this: #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int one; int ran_num; time_t seconds; time (&seconds) ; srand((unsigned int) seconds); ran_num = rand(); cout << ran_num << endl; cout<<"Enter this number: "; cin>> one; if (one == ran_num) { cout<<"\nSparta\n"; }else{ cout << … | |
Re: Just a quick question.. (I'm very tired so might be missing the point)! But if I had this code: <?php global $json_news; var_dump($json_news); echo"<br/>=======================<hr/>"; ?> It would return NULL because although you are defining $json_news as a global, you're not setting it as anything.. Surely, your function whats to return … ![]() | |
Re: @Javvy good idea! Or you could have an hidden attribute inside your form: <input type="hidden" name="submitted" value="TRUE"> Making sure it's after your submit button and then inside PHP: <?php if(isset($_POST['submitted'])) { // SQL // SQL } | |
Re: Hello, I'm not an expert in this field, but, I'm sure you can stream the security camera to a web-server. I don't really /think/ this can be done in PHP and therefore PHP only handles which camera is shown, for example switch between HOUSE 1 and HOUSE 2 and also … | |
Re: >and whats wrong with line 25?? I think @Ancient means it should be int main() rather than void main() | |
Re: What is the error? | |
Re: On the first line of XICS.php you have this line: <?php $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE); sec_session_start(); ?> Well, you're defining the constant "HOST", "USER", "PASSWORD", "DATABASE" in the file, process_login.php - So it looks, from looking at the code it doesn't know where it is.. So in … ![]() | |
Re: Hello, Vectors are arrays, but, arrays are defined in size (memory allocations) whereas Vectors are dynamically assigned, in memory. So for example, if you reach the maximum capacity in an array it will run out of memory whereas vectors will just change it's size dynamically and therefore allocate more memory. … | |
Hello, having a weird problem and wondering if someone can help me.. Basically, I'm trying to read in a .wav file, and I have read in the header information and that's all fine, it's just the data.. Here is the code: bool Wav::readHeader(ifstream &file) { file.read(this->chunkId, 4); file.read(reinterpret_cast<char*>(&this->chunkSize), 4); file.read(this->format, … | |
Re: Yeah, try Google. Why re-invent the wheel? Just get a pre-made one! ![]() | |
| |
Re: Shouldn't ask for homework.. using System; namespace ddggd { class MainClass { public static void Main (string[] args) { char[] characters = new char[8]; for (int i=0; (i < 8); i++) { Console.WriteLine ("Please enter character: " + i); characters [i] = Convert.ToChar (Console.ReadLine ()); } for (int j=0; (j … | |
Re: Ok, hello! Right, first off, you haven't actually said what you want to do in speech recognition, as it is a massive area. So to answer your question: >is this project to large to be done by 4 month? is it that hard to get along with androids frameworks etc. … | |
Re: Hello, Look at this example: #include <iostream> #include <string> using namespace std; string* returnString(const char* filename) { string* names = new string[3]; names[0] = "Hello"; names[1] = "World"; names[2] = "huuhaa"; return names; } int main(int argc, char *argv[]) { string* names = returnString("file.txt"); for(unsigned i=0; (i < 3); i++) … | |
Re: If the file is massive, why not load it inside memory in chucks, then find the patterns? | |
Re: >or more advanced one: >http://www.amazon.co.uk/PHP-MySQL-Dynamic-Web-Sites/dp/032152599X/ref=sr_1_1?ie=UTF8&qid=1345629611&sr=8-1 I learnt from Larry Ullman, good recommendation :) - He's a bit ignorant, but, his books are good! | |
Re: Hey, Please indent your code properly.. Ok, so the only error(s) I could find was that you have a function called "deposit" and a variable with the same name. This code is compiling for me: #ifndef MENU_BUILDER_H #define MENU_BUILDER_H #include<iostream> #include<string> #include<iomanip> #include<cmath> using namespace std; //Define my class class … | |
Re: > a clients home and enter in the dementions, add walls where needed and add the products we offer. I see other websites that offer this option with their products. Any advice, thoughts, suggestions would be helpful. Hey, it depends how advanced you want the system, this will determine which … | |
Hello, I'm just wondering whether or not, it is possible to get the vector Dimensions without them being set? Basically, I'm converting some matlab code and there's a function size(VECTOR) which get's the dimentions of the vector being passed. For example: #include <iostream> #include <vector> using namespace std; int main(int … | |
Hello, I'm trying to read the header information of a .wav file and I'm kind of stuck. Basically, the header information is located at different offsets in the file. So for example: (0-4) = ChunkID (4-8) = ChunkSize (8-12) = Format .. .. .. .. .. .. From this: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ … | |
Re: <?php ob_start(); session_start(); include('./config.php'); //protect SQL injection $username = $_POST['username']; $password = $_POST['password']; $username = stripslashes($username); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $password=hash('sha256',$password); //SQL query that sent login info to database $result = mysql_query ("SELECT * FROM admin WHERE Login ='$username' AND Password ='$password'",$con); $check = mysql_num_rows ($result); if ($check … | |
Hello, wondering if someone can help me. I'm working with a .wav file, and, I need to collect the header information. The header contains (roughly, 20 bits/bytes) before the actual data. And, each of this data is contained at different locations in the file. I need to read a particular … | |
Re: Can you not just take some code, then go onto different forums (Java, C++) etc.. and ask what the code is, if you don't know what the code does, or, even what language it is in; why are you using it? It looks like Perl, or, some other scripting language.. | |
Hello, I'm trying to write the Cooley Turkey algorithm for an FFT. Now, The algorithm works well, but, only for 2 numbers - Nothing else. For example, I have used an online FFT calculated, entered the same data and got the same results. Here is the code for the algorithm: … | |
Hello, I'm wondering if anyone knows if there is a specific way or a library that allows me to read in an audio file in which I can then manipulate and get the different frequencies? I'm basically trying to make an application that uses an FFT for the audio signals … | |
The End.