569 Posted Topics

Member Avatar for izabella.pearson

Hey, Little confused, do you have to ask exam questions and the user answer OR are you given a .txt file with all their grades?

Member Avatar for phorce
0
201
Member Avatar for OsaMasw

You sure you're not setting the SESSION['user_id'] from a $_GET['id']? e.g. <?php $id = $_GET['id']; $_SESSION['user_id'] = $id;

Member Avatar for phorce
0
126
Member Avatar for lolumadbro

Hey, I don't know how much support we can give you on this, because we don't know what your interests are, or, what technologies you are into. Have you done any work with API's? Understanding or using them. These seem to be highly used recently, so maybe base a project …

Member Avatar for phorce
0
245
Member Avatar for szejna

@szjna - In Dev-cpp (I think it's the same compiler) then you need to create a new "Project" rather than just having them in the same folder.

Member Avatar for szejna
0
266
Member Avatar for xbat

@xbat > help with code Really? Did you? I think you're implying that someone does the work for you, rather than hand someone a piece of code.. Please, don't take offence to this but you can't hardly call anyone here (Who, may I add is taking time out of their …

Member Avatar for lolumadbro
-1
307
Member Avatar for GokuLSSJ4

Hey, Everything appears to work, up to the fact that: 1) You don't ask for the input for the mathemtical operator (+, -, / etc..) cin >> symbol; 2) Your conditional if statements are wrong, they should be like: if(symbol == '+') { cout << "Add"; } You should consider …

Member Avatar for GokuLSSJ4
0
341
Member Avatar for Goldfinch

I don't get it? What kind of cron job is it? Are you running a specific file on YOUR server that you want other people to be able to have on their server and execute YOUR FILE from their server?

Member Avatar for Goldfinch
0
224
Member Avatar for kaywt

Yeah, the output is "This is the way to an A Grade - Grade A for Sure" However, I don't think you'll be getting an A grade with this code ;)! @Ancient Dragon is right, you need to pass by reference NOT value. Also, you're assume that there are 8 …

Member Avatar for kaywt
0
227
Member Avatar for Echo89

@diafol Is right, when he says: > store the code as plain text - either in text files or in a DB - or for copying from a page. htmlentities() can probably output safely You should (in a way) be able to upload the files (.cpp, .php., .htm, ...) But …

Member Avatar for phorce
0
308
Member Avatar for LastMitch
Member Avatar for DarkMonarch

Hey, throwing this out there. (I spend my time researching/developing Speech Algorithms so don't code much in PHP anymore) but I read an article that said that PDO removes the risk of SQL injections.. So probabily. There's a lot of debate to whether PDO or MYSQLI is more efficient etc.. …

Member Avatar for diafol
0
123
Member Avatar for hwoarang69

So essentially, a cookie is stored on the person's machine, whereas a SESSION is stored onto the server. Ok, it depends on the situation in which you are using and both of them will work in most situations, so for me, it's down to the fact I prefer SESSIONS over …

Member Avatar for diafol
0
188
Member Avatar for Djmann1013

Here is one solution to your problem: <?php function checkPreg($string) { if(preg_match('/^[^\W_]+$/', $string)): return true; else: return false; endif; } $string = "Hello244"; if(checkPreg($string)) { echo 'Yes, its ok'; }else{ echo 'No, its not ok'; } ?> Just use regex with the preg_match, you got the right function. BUT, it …

Member Avatar for Djmann1013
0
212
Member Avatar for Hey90

> But the code I have used does not work to write/save the data to the array. What?

Member Avatar for Hey90
0
251
Member Avatar for sultankhan

It should be like this: 'ano (image id) aphote adteail exactar 6 image 7 image 'cid (comt id) user1(userid) ano (image id) comments 1 10 6 first comment 2 9 6 second comments 3 10 7 nice image 4 1 7 yeah Are you confused with the structure, or, the …

Member Avatar for broj1
0
170
Member Avatar for christinetom

Hey, pointers are pointers to memory locations (You want to do something specific to that memory block etc..) If we're talking about passing arrays to functions, we use pointers: void Funct(int *element) { cout << element[0]; } int main(int argc, char *argv[]) { int *elements = new int[10]; elements[0] = …

Member Avatar for Gonbe
0
144
Member Avatar for TonyG_cyprus

My bucket list: - Write a Fast Fourier Transform (It's quite difficult!) - Finish my Speech Library off - Pay off University fee's - Get a decent job where I'll be happy and make a difference :)! - Country mannor house where and a home in major cities around the …

Member Avatar for jalpesh_007
0
160
Member Avatar for batman189

//notice the addition of iomanip this gives us access to setw // Make sure we initialize the array to known values NOT >=1 OR <= 25 // Zero is good for this case. int array[5][5] = {{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}}; // For each row for (size_t crow = 0; crow < 5; crow++) …

Member Avatar for NP-complete
0
143
Member Avatar for Shatrughan2010
Member Avatar for Dani

@LastMitch - You aren't from the UK are you? (Just asking because it's "Flooding" atm)!

Member Avatar for JorgeM
0
106
Member Avatar for websponge

Try this: $value = .$row[booleanresult]; if ($value) { // if true $value = "YES"; } else { $value = "NO"; }

Member Avatar for websponge
0
763
Member Avatar for eilrac

@L7Sqr >> something that you are familiar with. Starting from scratch and expecting to be successful is not always the best approach. I did my thesis on Signal Processing / Speech Recognition, something I hadn't even touched or researched before.. I get your point though, good advice :)!

Member Avatar for L7Sqr
0
136
Member Avatar for ucvx32

Ok, so I don't know if this is what you are looking for: #include <iostream> using namespace std; template<typename Type> class Events { public: virtual void add() { Type s; s.add(); } }; class Coord { public: void add() { cout << "Added Coord" << endl; } }; class Zone …

Member Avatar for ucvx32
0
134
Member Avatar for MachDelta

First question: Where do you define: for(;i<right && (data[i]<=data[pivot]);i++) { compares++; } compares? Second of all, you have function declartion: vector<int> quickSort(vector<int> &data, int left, int right) { This assumes that it has a return type, so therefore is expecting a vector of ints to be returned. BUT you send …

Member Avatar for ken_taiken
0
229
Member Avatar for mpc123

Insead of: <h2><a href="' . $row['$txt2'] . '/' . $row['$txt2'] . '.php">' . $row['title'] . '</a></h2> </div> Try: <h2><a href="' . $row['txt2'] . '/' . $row['txt2'] . '.php">' . $row['title'] . '</a></h2> </div> I don't understand the purpose of '$txt2' etc here, in this context.

Member Avatar for AndreRet
0
115
Member Avatar for NardCake

Hey, You can use Regex, because you didn't submit any example code, I did an example which hopefully you can follow: <?php $string = "faaf2424_"; if(preg_match('/^[a-z_\-\d]{3,}$/i', $string)) { echo 'Allowed'; }else{ echo 'Not allowed :('; } ?> This would display 'Allowed' whereas if the string was this: $string = "@24@24@"; …

Member Avatar for phorce
0
169
Member Avatar for dean.ong.14

Hey, I tried to run the code you've posted and it shows an indentation error. Is this the way that DaniWeb has formatted it, or, is it your code? I don't get what you're trying to ask, is your question regarding the fact that "random" cannot be imported, or, to …

Member Avatar for dean.ong.14
0
455
Member Avatar for phphelp123

unset the session to determine that someone is signed out? I.e. http://php.about.com/od/advancedphp/ss/php_sessions_3.htm

Member Avatar for Zagga
0
105
Member Avatar for matusekm

Hey, yes! I like to do it this way though, it's personal preference but: <?php if(!isset($_POST['name'])) { echo 'You have not submitted your name'; return 0; }else{ $name = $_POST['name']; } if(!isset($_POST['email'])) { echo 'You have not submitted your email'; return 0; }else{ $email = $_POST['email']; } if(!isset($_POST['message'])) { echo …

Member Avatar for GliderPilot
0
176
Member Avatar for anna.lucas.5680

@anna.lucas - This is not the forum for such questions. "Artifical Remote Enrolement System"? Lol..

Member Avatar for phorce
0
106
Member Avatar for bdl365
Member Avatar for stanleyk

@Dani I didn't know ProgrammingForums existed! Is it owned by DaniWeb?

Member Avatar for Dani
0
80
Member Avatar for london-G
Member Avatar for zeroliken
0
117
Member Avatar for ralph1992

Are you asking how to implement inheritence? If so, such tasks take place primarly in your class definitions (.h) files, so, might be an idea to post them over the class implementation (.cpp). IMO. I don't get it though because inheritence usually has a "IS A", "CAN BE" Are you …

Member Avatar for phorce
0
8K
Member Avatar for adityasingh95

For one, don't use: #include <iostream.h> // this is bad // use this #include <iostream> // Don't use: void main() { } // Use: int main() { } You can't expect to use: cout, cin etc.. without declaring you're using the std namespace, so, before your "main" function, always put …

Member Avatar for L7Sqr
0
238
Member Avatar for nathaniscool99

Yeah, I don't see any other way than what @myk45 said. It's a static variable, meaning it's scope is the class only.

Member Avatar for deceptikon
0
269
Member Avatar for Carpetfizz

Your implementation of function definition is wrong: int zonePick(int foo); // class definition (prototype) The implementation should be the same: int zonePick(int foo) { } This also assumes that you're passing a variable, or a value to it: int zonePick(int foo); int main() { int foo = 10; int valueReturnedFromFunction …

Member Avatar for thendrluca
0
157
Member Avatar for xbat

Yeah @LastMitch is right, MYSQLI is easier to manage. I read somewhere that PDO means that you do not have to worry about SQL injection I don't know how true this is though

Member Avatar for veedeoo
0
223
Member Avatar for <M/>

Why so? I think anything with complex search algorithms that requires in-depth lexical analysis is complicated, so like Google!

Member Avatar for <M/>
1
166
Member Avatar for pars99

So basically: I'm guessing by this line: USHORT triangle, square, rectangle, circle; You're defining variables which can then be compareable, why? Also, your comparision is wrong, like this: if (shape = triangle) { ... } A single "=" indicates to the compiler that you are trying to initalise a variable …

Member Avatar for pars99
0
2K
Member Avatar for fishsticks1907
Member Avatar for shahai.ali

Ok, I kind of know what it is you're trying to achieve. If you're wanting it so when a user types a key down it comes up with suggestions, this is quite simply.. It is done with jQuery/Ajax =) To do the recommended searches is a little more complex, will …

Member Avatar for JorgeM
0
202
Member Avatar for vizz

Try this: (save it as .htaccess) and make sure it's in the correct folder (like localhost, www etc.) RewriteEngine on RewriteRule ^(.*)$ $1.php

Member Avatar for vizz
0
440
Member Avatar for phorce

Hello, So basically, I am trying to create a system based on the Singleton Pattern and I'm confused. If I have an Animal class, as well as a Cat class which is derived from Animal and then using a Singleton class will create a single object of which-ever class has …

Member Avatar for L7Sqr
0
228
Member Avatar for ryan.ingram.54

How are you connecting? Wireless or Wired? Have you tried contacting your ISP directly? If you're using wireless, why not try using wired (ethernet) and see if you disconnect. Hope this helps a bit :)!

Member Avatar for phorce
0
129
Member Avatar for SimonFrance

Hello, Do you expect someone to code this for you, for free? That's just plain cheeky!! There are freelance websites out there, obviously, they'll charge you!!

Member Avatar for SimonFrance
0
108
Member Avatar for eharrell

Hey, I would do this using a SWITCH statement, over an if statement - If I'm honest. I haven't completeled this, but, look at this logic.. It might help you. Re-write the code for your own use, don't just use it! #include <iostream> using namespace std; int hoursToStudy(char grade) { …

Member Avatar for eharrell
0
110
Member Avatar for meby mathew

>>and then apply inheritance in your classes. >>No to both; you've already been told which classes to write, and there is no inheritance relationship involved: Shouldn't some relationship be here though? Ok, so inheritence can have a "Is a"/"Can Be" relationship so obviously "Customer" {is a} "Item" wouldn't work, however, …

Member Avatar for gusano79
0
105
Member Avatar for raj-uk

It's called Google, been around for a very long time and has a really nice UI you can use ;)

Member Avatar for diafol
-2
358
Member Avatar for johnef_sh

This code: if($SM_pro){ Basically is saying if SM_pro == true, however, DM_pro is an array, so, therefore it won't return true/false. You could try: if($SM_pro <= 0) { Alternatively, you could use the mysqi_num_rows() function.. http://www.nusphere.com/kb/phpmanual/function.mysqli-num-rows.htm Hope this helps :)

Member Avatar for phorce
0
580

The End.