User Profile

Collapse

Profile Sidebar

Collapse
liams
liams
Last Activity: Oct 29 '11, 05:44 PM
Joined: Dec 2 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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?
    See more | Go to post

    Leave a comment:


  • liams
    replied to Getting a really weird compilation error with g++
    in C
    How do I do this in my code?
    See more | Go to post

    Leave a comment:


  • liams
    replied to Getting a really weird compilation error with g++
    in C
    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
    Also, could you explain what you've done to get my code to compile? I'm not very familiar with the stack and the heap(I heard those terms, and I generally know what they are, but I don't -really- know what they do). Why doesn't C++ allow a stack array of i elements? And, why and how did you...
    See more | Go to post

    Leave a comment:


  • liams
    replied to Getting a really weird compilation error with g++
    in C
    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>
    In Euler.cpp, I added
    Code:
    extern
    to sieve().

    Other than that, everything is the same, but still same error.
    See more | Go to post

    Leave a comment:


  • liams
    started a topic Getting a really weird compilation error with g++
    in C

    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++)
    ...
    See more | Go to post

  • liams
    replied to AJAX&PHP form validation doesn't work
    Alright! Thanks!!
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    So what happens if a bad title and body is input? I want to display two error messages. How do I do this?
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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 !!! =D
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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=C
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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
    ...
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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?
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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;
    and
    Code:
    http.open("GET",
    ...
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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'];
    These are the only lines where I grab user-generated data from the forms. Why do I need to send any data? I'm only using AJAX to be able to call a PHP validation script, and display it's...
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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 =/
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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.
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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).
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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....
    See more | Go to post

    Leave a comment:


  • liams
    replied to AJAX&PHP form validation doesn't work
    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 :P
    See more | Go to post

    Leave a comment:


  • liams
    started a topic AJAX&PHP form validation doesn't work

    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"
    ...
    See more | Go to post

  • liams
    replied to Form validation with both PHP and Javascript
    in PHP
    That link is a true saver! thanks!
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...