User Profile
Collapse
-
That is exactly what I did but it's not working. Maybe I'm not using correct compiling options. How do I tell g++ to correctly include it in my project? -
-
I added a function prototype in main.cpp, just as you said, but now I'm getting:
Code:Euler.cpp:1: error: expected initializer before ‘<’ token
Leave a comment:
-
Thanks for the reply, but I'm still getting the same error. Code changed to this:
/**REMOVED EULER.H**/
main.cpp:
Removed the Euler.h include, and instead put:
Code:#include "Euler.cpp" #include <vector>
Code:extern
Other than that, everything is the same, but still same error.Leave a comment:
-
Getting a really weird compilation error with g++
I have three files: main.cpp, Euler.h, and Euler.cpp. In Euler.cpp, I have a function that calculates prime numbers using Euler's sieve:
Code:vector<int> sieve(vector<int>& primelist, int i) { bool primes[i]; primes[0] = false; primes[1] = false; for (int j = 2; j < i; j++) primes[j] = true; for (int j = 2; j * j < i; j++)
-
-
So what happens if a bad title and body is input? I want to display two error messages. How do I do this?Leave a comment:
-
Awesome!! Thanks!! it works now!! Just one more question!
It only displays one of the exceptions caught. If more than 1 is caught, how do I display them correctly?
Thanks !!! =DLeave a comment:
-
When I wrote A as the email, B as the subject, and C as the title in my form it gave:
e=A&s=B&b=CLeave a comment:
-
I moved all files to the same directory. Paths are correct now, and it seems that the "error" <span> does change but there's no text. Only a new line is inserted into the "error" <span>. I seriously have no idea what's the problem. And I mean..really... .It should work! Also, the URL stays the same as if the parameters and GET are ignored completely!
FULL CODE:
index.html
Code:<!DOCTYPE
Leave a comment:
-
Now after changing it to type="button" I'm getting a wonderful Not Found error. But hey, at least I'm getting it on the same page, and in green too.
Not Found
The requested URL /send.php was not found on this server.
Amazingly enough, send.php is on the same folder main.js is. Not same as index.html though. Perhaps this causes the problem?Leave a comment:
-
Well, I tried changing my code but still no luck!
main.js changed:
Code:function getObject(f) { var http; var url = "send.php"; var email = f.elements['recipient']; var subject = f.elements['title']; var body = f.elements['body']; var parameters = "e=" + email + "&s=" + subject + "&b=" + body;
Code:http.open("GET",
Leave a comment:
-
But I don't even send any data. My PHP code gets the data directly from the form, there's no need to send it. Or is there?? Because in these few lines:
Code:$to = $_POST['recipient']; $subject = $_POST['title']; $message = $_POST['body'];
Leave a comment:
-
It's going to take me some time to go over all that. In the meanwhile, I would like to try to fix my current code. I'll deal with staying on the same page later, it's just that I just checked and http.responseTe xt is just nothing! It outputs as " ". I can't fix it =/Leave a comment:
-
I want to understand JS events as much as I can. My goal is to be good.
About the page, I don't use any external hosting. I run it with my Apache server.Leave a comment:
-
Thanks for the reply:D
Can you give me any example for a code that actually works? I have no idea how to work with event attributes(I only recently started doing websites.. I'm more of a desktop guy).Leave a comment:
-
I did this according to this example:
http://www.tizag.com/ajaxTutorial/aj...ttprequest.php
Why does it stay on the same page for them, and not for me? I would really like to avoid doing such things like preventing the form from submitting.
Edit:
I removed the action="/scripts/send.php" from index.html. However, it is still not working. I'm getting no output....Leave a comment:
-
Thanks for the reply!
How could I fix the problem with getObject() so that I will be able to display what I want, the way I want(in the same page). I know this is a simple question, but I'm not very familiar with how AJAX works :PLeave a comment:
-
AJAX&PHP form validation doesn't work
Hi, I recently learned how to use AJAX, but I'm having a problem with it. What I'm trying to do is validate a form with PHP, and write the output of the validation in the same page. From the last question I have asked in bytes.com, I was introduced to AJAX(well, I always knew it, but I never used it). So, I wrote the following code accordingly:
index.html:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-
No activity results to display
Show More
Leave a comment: