ShawnCplus 456 Code Monkey Team Colleague

Take out the semicolons after the Values ie.,

$sql="INSERT INTO $tbl_name(VeteranName, Address, StateProv, ZipCode, Branch, Dateserved, Comments, guestname, Phonenumber, city)
VALUES('$VeteranName',
'$Address',
'$StateProv',
'$ZipCode',
'$Branch',
'$Dateserved',
'$Comments',
'$guestname',
'$Phonenumber',
$city')";
$result=mysql_query($sql);

Also, don't do $VeteranName = $_GET['VeteranName']; etc.
just do extract($_REQUEST);

ShawnCplus 456 Code Monkey Team Colleague

... I'm not entirely sure why'd you write your own function when the built-in addslashes function works perfectly well.

ShawnCplus 456 Code Monkey Team Colleague

Ezzaral gave quite a nice example. x++ is known as a prefix increment and ++x is a postfix increment. Most commonly you will use a prefix increment (loops and such) ie., for(int i=0;i < 10;i++)

ShawnCplus 456 Code Monkey Team Colleague

heh, just noticed that. Don't have an anchor on a button, just use the onclick attribute of the button.

ShawnCplus 456 Code Monkey Team Colleague

The only thing I could think of is that the href isn't the first thing but for some reason I think that's a longshot. It's worth a shot nonetheless. I'm not, however, familiar with that webbot stuff

ShawnCplus 456 Code Monkey Team Colleague

Well considering you haven't shown us any of the code or a link to the page it's a bit like diagnosing a patient that hasn't told you any symptoms.

ShawnCplus 456 Code Monkey Team Colleague

Just as an example this would stop a submit button from submitting.

<input type="submit" onclick="return confirm("Are You Sure?");" />

If they accept then it continues, if they cancel nothing happens.

ShawnCplus 456 Code Monkey Team Colleague

its a joke right?

Nope, people that use void main are doomed to be forsaken by the appropriate deity, if the case arises that they do not believe in one then they will be forced to watch nothing but reruns of Who's the boss for the rest of eternity.

ShawnCplus 456 Code Monkey Team Colleague

He was referring to Salem's avatar which states that void main'ers are doomed. void main() , main should always return an int ie., int main()

ShawnCplus 456 Code Monkey Team Colleague

You can't use C or C++ to create a web application. You need a server side scripting language for a web application (or a dynamic web page, Eg, registration form, login form, etc). php, asp, jsp, asp.net etc are some server side scripting languages. If your site is static, which has no user interaction, then start it by using html.

Learning php is very easy. You can start right away here. To work with php, you need apache, mysql and ofcourse php, which are all free. You can download a combined pack [php, mysql,apache] here. Just download and install. Check w3schools and start learning!
Cheers,
Nav

Actually you can, many CGI modules support compiled languages like C++ and C

How to check is my site static (i have static ip is that it) ?

By static he means the content wont change based on who looks at it or other factors

ShawnCplus 456 Code Monkey Team Colleague

int main1() should be int main() but as the poster above me stated that particular include file is not necessary. Also, #include "iostream" should be #include <iostream> Quotes are generally used to reference headers that require an absolute path or headers in your project.

ShawnCplus 456 Code Monkey Team Colleague

Here is a decent Drupal book http://www.amazon.com/Pro-Drupal-Development-John-VanDyk/dp/1590597559 however, you might want to pick up an introductory PHP book such as this http://www.amazon.com/Programming-PHP-Rasmus-Lerdorf/dp/0596006810/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1198104311&sr=1-2 As for the second book I love O'Reilly published books they are generally extremely easy to understand while still being very comprehensive.

ShawnCplus 456 Code Monkey Team Colleague

Depending on whether you are Linux or windows. Windows has the WAMP stack www.wampserver.com/en/ if you are Linux there is the LAMP stack http://www.mysql-apache-php.com/

majestic0110 commented: great help, polite and enthusiastic! +1
ShawnCplus 456 Code Monkey Team Colleague

You would need to look to the Apache documentation for that which would most likely be on http://httpd.apache.org/docs/

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

Well mailto links launch the viewer's default email client. It doesn't actually send an email, you would need an emailer in PHP such as the one in the PEAR package for example if you would like an email form.

ShawnCplus 456 Code Monkey Team Colleague

It is done with the title attribute with the link

<a href="blah.com" title="This is blah" >blah</a>

Will show This is blah when hovering over the link

ShawnCplus 456 Code Monkey Team Colleague

Because private is a keyword in PHP. Also, when using a variable inside brackets is also requires the $.

ShawnCplus 456 Code Monkey Team Colleague

Especially with Apache directives like AddType and AddHandler, you can assign custom extensions.

AddType application/x-httpd-php .sos
AddHandler x-httpd-php .sos
ShawnCplus 456 Code Monkey Team Colleague

You can't really interact with a database with JavaScript but PHP can do it quite easily. Read up a bit on PHP and you'll find that the task is quite simple.

ShawnCplus 456 Code Monkey Team Colleague

You must use the $ with the variable inside the brackets or it wont work echo $arr[$data_01] If you are only echoing variables then you don't need quotes.

Also $array_test = array("$data1","$data2","$data3"); You don't need quotes around the variables, in fact I think it will yell at you if you use them.

ShawnCplus 456 Code Monkey Team Colleague

It's definitely possible, use the syntax nav33n used.

ShawnCplus 456 Code Monkey Team Colleague

It's impossible to get data from a database with only HTML/DHTML. If they expect you to then they should be fired. HTML is a completely static language. There are no facilities of a programming language aside from Server Side Includes.

ShawnCplus 456 Code Monkey Team Colleague

case statements are followed by a colon, not a semicolon. case '82';{ should be case '82':{ The same goes for the others

ShawnCplus 456 Code Monkey Team Colleague

In your second attempt you are using Serial in your WHERE clause which is an ambiguous field. So just pick a table and use that as the parent to the field. IE., tblQuotes.Serial

ShawnCplus 456 Code Monkey Team Colleague

Well, for one you are obfuscating your code to an extreme extent by not giving meaningful variable names. friend zz operator-(zz z); Secondly, the - operator is a binary operator. It accepts two operands, the left and the right. (-a) does nothing since you are using a binary operand as a unary operand (--a) which would decrement a if you overload properly, otherwise it decrements the pointer.

So which are you trying to accomplish, the binary operator( a-b ) or the unary operator( --a )?

ShawnCplus 456 Code Monkey Team Colleague

There seems to be a rash of "do it for tomorrow" posts at the moment :icon_rolleyes:

I guess it's better than "Please help this was due yesterday!"

ShawnCplus 456 Code Monkey Team Colleague

In the constructor you are trying to initialize the Day, Month and Year variables to variables which do not exist. In that scope theday, themonth and theyear are not accessible. To fix that you would replace it with the parameter names given ie., day, month, year.

//constructor initializes month, day and year
    Date (int month, int day, int year)
    {
       setMonth (month); //You forgot the delimeter on this
       setDay (day);       // and this
       setYear (year);
    } // end Date constructor

With the following bit I'll point you in the direction of the C++ book that you're using to get a better understanding of the cin/cout commands.

// Why does it say enter the month? These functions display it, not retrieve it from user
   cout << "Enter the month " << month.getMonth()   
        <<"/day"<<day.getDay()
        <<"/year"<<year.getYear()
      << endl;
   cin >> "Enter the date:"// user enters the full date 
//(This doesn't take input from the ser, I'm surprised it compiles since you are trying to insert data into a string literal

This function does not require the parameter

void displayDate(int displayDate)
   {
      // this statement calls getMonth, getDay, getYear to get the date
      cout << "Enter the date" << getMonth() << getDay()<< getYear()
         << endl;
   } // end function displayDate

It can be fixed by:

void displayDate()
   {
      // this statement calls getMonth, getDay, getYear to get the date
      cout << getMonth() <<"/"<< getDay()<<"/"<< getYear() << endl;
   } // end function displayDate

You've also made three superfluous instances of the …

ShawnCplus 456 Code Monkey Team Colleague

If you look at line 137 it calles the MessageBox function which takes the arguments MessageBox(<message to show>, <title>, <buttons to show>, <icon to show>)

How can I make this print the text in the edit box when you push the button instead of "You pushed a button." I have looked all over but I can't figure it out.

#include <windows.h>
#include "resource.h"
HWND hWndButton;
HWND hWndEditBox;
HFONT hFont;

/*  Declare Windows procedure  */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/*  Make the class name into a global variable  */
char szClassName[ ] = "WindowsApp";

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    HWND hWnd;               /* This is the handle for our window */
    MSG messages;            /* Here messages to the application are saved */
    WNDCLASSEX wincl;        /* Data structure for the windowclass */

    /* The Window structure */
    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
    wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
    wincl.cbSize = sizeof (WNDCLASSEX);

    /* Use default icon and mouse-pointer */
    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;                 /* No menu */
    wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
    wincl.cbWndExtra = 0;                      /* structure or the window instance */
    /* Use Windows's default color as the background of the window */
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;

    /* Register the window class, and if it fails quit …
ShawnCplus 456 Code Monkey Team Colleague

It's sending empty messages because $comment doesn't exist. You can get it by replacing $comment with $_POST['comment'] .

Also, you $email in sendmail.php should be replaced with $_POST['email'] the same for $subject, it should be changed to $_POST['subject']

ShawnCplus 456 Code Monkey Team Colleague

Peace, I saw a chat Program on the Net...
The Messages In it automatically shows itselves without reloading the web-page..
I saw that and I wondered....
Does Any one know how to do that?

It's not using a database, it's most likely using AJAX or it's Java applet

ShawnCplus 456 Code Monkey Team Colleague

The GIMP can do this pretty well. Though I usually just make my own in GIMP, I've never tried to convert jpg over. You could try to just open it with GIMP then do a save as... then use .ico, it should bring up a dialog asking which type of icon to use.

ShawnCplus 456 Code Monkey Team Colleague

I would like to make a MUD in C++. So...=) I need to know how i would program it so that other players could attack, see, and trade with each other. I'm gonna host it on my computer, or maybe a remote shell account, so my friends and i can play and work on it. I know i would need to use sockets or something, but not sure =\. Could someone give me a code example of how this would be done? Maybe just like a chat room type thing so I could see how It works??


Thanks ALOT. ~

~Kodiak

Coding sockets aren't just a one-post length thing. Go download SocketMUD which is a C/C++ barebones MUD codebase. It has pretty much nothing but the sockets so you could see how they work that way.

Side Note: I've seen a few posts about making MUDs and you can't imagine how happy I am that people are still finding interest in them with the age of next-gen. *Holds up his fist* Keep the movement alive!

ShawnCplus 456 Code Monkey Team Colleague

Thanks for the assistance:

If I were to do the following, why does it only show the information for Kenez from my inFile?

for (int j=0; j<stunum; j++)
    while (inFile>>stuname>>Test1>>Test2>>Midterm>>Final>>Term);

That line keeps overwriting the values. In the end it is left with only the last values

ShawnCplus 456 Code Monkey Team Colleague

You forgot brackets for the while loop so it's only doing the first if-check

while(condition)
{
    //do this stuff
}
ShawnCplus 456 Code Monkey Team Colleague

School have filters in place for a reason. The state and/or federal government requires the schools to place filters on the network in order to be given certain grants. I remember when I first started working as an Admin at my old school I asked why they put filters on them in the first place and that was the answer I got.

They get grants for new computers and wicked discounts on computers they buy, otherwise school taxes would go through the roof and your parent's would not be pleased. Nor would you if your school couldn't afford new computers having to pay near-retail.

And if you have a good reason to visit a certain website just ask your Net Admin kindly and he will probably unblock it. Sites like Myspace and Facebook should be blocked during school hours, that's what your home computer is for.

ShawnCplus 456 Code Monkey Team Colleague

#include "stdafx.h"

if (x<0001 || x>9999);

Well, you put the if statement in there but you didn't really do anything. Look up if-check syntax in your book it should be:

if (var relation value)
{
     statement;
}

Example:

if (userInput == 93)
{
     cout<<"You entered "<<userInput<< endl;
}

That example is completely useless but it's good enough to show syntax. Though a while loop would probably be better for input validation since it would only show the message once then happily let you input an incorrect value.

ShawnCplus 456 Code Monkey Team Colleague

You want to run that by me again? If i enter a value from the keyboard-doesn't a program automatically do the calculation? You kinna lost me there.

Yes it does but you are trying to do the calculations before you have gotten any input. It is trying to do the math on a number that doesn't exist.

ShawnCplus 456 Code Monkey Team Colleague

Well firstly you are trying to do math with x before it actually has a variable so once it gets the others (a, b, c, d, e, sun) aren't actually giving the correct number

ShawnCplus 456 Code Monkey Team Colleague

You are trying to output the value of x before actually getting the value. IE. You are using cout<<x<< endl; before cin>> x;

ShawnCplus 456 Code Monkey Team Colleague

Well since it will not boot in safe mode the first thing you could do is create/obtain a Windows 2000 Boot disk. Please reply if you need help making one. If you boot from the disk and windows loads successfully then the problem is with one of the following: *Ntldr, *Ntdetect, *boot.ini, or there is a problem(virus) with the Master Boot Record. In which case for the files mentioned with the * they can be replaced by placing the file on a boot floppy and overwriting the old files. However, if the computer still refuses to boot, then it more than likely came with a recovery disk, boot with that and go into the recovery console, and type chkdsk /r at the prompt, if you recieve a message stating there is an invalid MBR, then run fixmbr. There are more steps but until I know the results of these steps they are of no use, reply to this and tell me which you have done and/or what has helped.

ShawnCplus 456 Code Monkey Team Colleague

If you right click on an empty space on your desktop and move to the Appearance tab there will be a drop-down box at the bottom labeled Font size, if you move that to Large or Extra Large that should help significantly. Also in Internet Explorer and Mozilla Firefox you can change the font size by holding CTRL and pressing + on the number pad.

Hope that helps.

ShawnCplus 456 Code Monkey Team Colleague

first of all DRAM isnt the best but it is cheap it constantly needs to be refreshed so it slows it down sram which is used for CACHE on the cpu and off-die COAST is much fast and does not need to be refreshed

ShawnCplus 456 Code Monkey Team Colleague

You can follow janines advice which would be the sure bet or if your cheap do what "Thong_inspector" said and buy a new desktop keyboard if your notebook has a ps/2 port.