Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. I am signing off for the time being. If you are unable to figure this out then PM me the login information to the site..the name of the page and a link. When that happens I will go ahead and try to work you through it manually if you are still having problems. Only PM me if you have tried everything else and no-one is able to help you work through it yourself.
  2. There are no syntax errors. I just ran your code. Most likely your INI file or server are setup to not show error messages so when you start it up it runs a problem at the very start. I am almost sure it's you database connection information. Have you verified your username, password, and host information are all accurate based off of your webhost. Have you also verified the DB name as well. Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql312.byethost33.com' (10060) in C:\xampp\htdocs\test.php on line 5 Could not connect: Can't connect to MySQL server on 'sql312.byethost33.com' (10060) That is my response when I run the code so there are no abnormal syntax errors or strange output errors. It's simply a connection error. If your connection information is wrong then that could be causing the blank page.
  3. Ok do this. Clear out all your code (back it up first and try this. echo 'hello'; Tell us if it outputs hello. If not try phpinfo(); and tell us if that outputs. If none of that works then there is something wrong with your server configuration, ini file, or something that is preventing PHP pages from running.
  4. It sounds like your server/ini have error reporting and outputing disabled. Use the following url: http://us.php.net/error_reporting and cut on the error reporting temporarily (at the top of your code). Afterwards verify the Database name in your code is the same as your database name on the server. Also your connection information...make sure it's the same as your web host. Not all hosts allow you to connect using "localhost" what webhost are you using right now?
  5. I have just told you what one of the problems where. The number of fields you have does not equal the number of values you are trying to put in. You listed 7 fields and you are only filling out 6 values. It will not allow that to go through. You need to put down one more value to match the number of fields you are entering or drop off one of the fields (either one).
  6. Values != fieldnames. uname, gname, icon, dsc, cat, body, score (7) test, test, test, 1, test, 0 (6) You need as many values as you need fields.
  7. If you want to turn off error reporting: http://tinyurl.com/ccx7kj
  8. * Cycle through all of the files. * http://www.totallyphp.co.uk/code/date_file_last_modified.htm <- Use that on each file. * Put them in an array as you go. * Sort the array by time. * Grab the last 2 that were updated. * Get the file information and your done.
  9. You can eliminate the errors by testing isset before you test if the variable is empty. <?php if (isset($variable) && $variable != '') { // Do something. } ?> This way it tests if it's set...if it's not then it stops running. If it is set then it moves onto the next statement. Checking if something == '' or != '' will throw an undefined error if the variable is not defined. That's why you should always test if it's set before anything else. Edit: Also try putting a more descriptive title when posting in the forums. It will increase the chances of getting help. Edit Part 2: I also do not advise using extract on $_POST.
  10. Those two PHP files seem fine. They are exactly handling the vartaxes the same on both pages. What you need to do is copy/paste the code for the form(s) that are used to submit this data into the php files. I want to see how the data is getting passed. My guess is it's passing it a little bit different in the two types of payment methods and I would like to take a look at it and see if there is a way to tell.
  11. The "Basic" stuff adds together to form the advanced stuff. It's like anything else: "You have to learn to crawl before you can learn to walk". It just takes some time. You need to understan PHP at it's basic level, Mysql (Sql) at it's basic level and go from there. Once you know the basics you can start putting the basics together in a variety of ways in order to be able to do the bigger stuff later on.
  12. I found some online sample code that I was going to play with: /* * A function to list all contents of a given directory * author: Danny Battison * contact: gabehabe@hotmail.com */ #include <dirent.h> // directory header #include <cstdio> void listdir (const char *path) { // first off, we need to create a pointer to a directory DIR *pdir = NULL; // remember, it's good practice to initialise a pointer to NULL! pdir = opendir (path); // "." will refer to the current directory struct dirent *pent = NULL; if (pdir == NULL) // if pdir wasn't initialised correctly { // print an error message and exit the program printf ("\nERROR! pdir could not be initialised correctly"); return; // exit the function } // end if while (pent = readdir (pdir)) // while there is still something in the directory to list { if (pent == NULL) // if pent has not been initialised correctly { // print an error message, and exit the program printf ("\nERROR! pent could not be initialised correctly"); return; // exit the function } // otherwise, it was initialised correctly. let's print it on the console: printf ("%s\n", pent->d_name); } // finally, let's close the directory closedir (pdir); } /** EXAMPLE USAGE **/ int main () { listdir ("C:\\"); return 0; } Basically this throws an error about cannot find header file dirent.h. I tried to look this up online and it's a valid class and should be available. I added that include. I am using Visual C++ 2008...and I have the project created and the cpp file created (I have made a bunch of test apps before and they worked). the only error I am recieving is cannot find header file. Any advice is appreciated.
  13. Ah ok. That makes sense. thanks again for the feedback.
  14. Sorry to be asking so many questions tonight (knee deep in studying). This'll be the last one I ask tonight. This one is a "Which is better syntax" question. string firstname; cout << "What is your first name?"; std::getline(std::cin, firstname); cin.ignore(); or string firstname; cout << "What is your first name?"; getline(cin, firstname); cin.ignore(); The difference here is the std::getline can be used whether the namespace is included or not. However the cin getline can't be called unless it is. Out of these two which is the best method to get use to. Using the std::funcname or just funcname. Which is best overall because this'll be what I model my overall syntax ideas from.
  15. All I am wondering is why is cin cutting out my spaces. If I type "Time to die" into the command line it returns "time". If I type "Today is the time I am performing this test" it returns "Today". This is kind of strange. Any reason why spaces are being cut out..or more of it finds the first space and everything after it is removed. #include <iostream> #include <string> using namespace std; int main() { string time; cout<<"What time is it? \n"; cin>>time; cout<<"Now that you entered the time...it is \n"; cout<<time << "\n"; system("PAUSE"); return 1; }
  16. You can't cut off uploading dependent files. When you change that option you are telling it to not ask you and upload dependent files automatically. So it happens like this. Either Dreamweaver asks you and you say yes/no. Or you cut off the option and Dreamweave just does it for you without asking. There is no-way to turn this off as of version CS3. I have tried to find a way and there was none (not without hacking dreamweavers code.
  17. Oh no, I don't "know" C++. PHP is my main language. I am finally to the point where I am ready to branch out. I have learn a few other languages but never C++. This is one I have wanted to know awhile. I know basics...like how the data types work (to an extent) and starting to learn control structures and functions. I already had my code work and had a basic calculator..I used strcmp instead of == and that worked for now. I will build on that knowledge later on. RIght now I am writing two more apps. One to go to a website and get some data and analyze it then another one to take a person's name, some other information then analyze there name for various properties. Basically I am trying to learn so I am presenting myself with situations adn trying to program my way out of them so I have some practical application of the language. I learn long ago that simply reading about a language takes forever and it's must faster to just jump in and get stuck a few times to really forge knowledge of the language faster. Thank you again for the help.
  18. Also to answer your question I am using "Visual C++ 2008 Express Edition".
  19. I finally got: #include <iostream> #include <string> using namespace std; int main() { // Setup Basic Parameters int number1; int number2; int number3; char type[10]; cout<<"Calculation Type (Add, Subtract, Multiply, or Divide):"; cin>>type; cin.ignore(); cout<<"Please enter a number: "; cin>>number1; cin.ignore(); cout<<"Please enter a second number: "; cin>>number2; cin.ignore(); if (strcmp(type, "Add") == 0) { number3 = number1 + number2; }else if (strcmp(type, "Subtract") == 0) { number3 = number1 - number2; }else if (strcmp(type, "Multiply") == 0) { number3 = number1 * number2; }else if (strcmp(type, "Divide") == 0) { number3 = number1/number2; }else { number3 = '0'; } cout<<"Your number added up to: "<<number3 <<"\n"; cin.get(); } to work instead. However I looked at your code..i can't get it to work using string even after I try to include <string> Not to mention I have no idea what int main(int argc, const char* argv[]) I just have gotten into C++ not too long ago. I am just bouncing around writing a couple of app's here and there while I start picking up the language.
  20. Do you see anything wrong with: #include <iostream> using namespace std; int main() { // Setup Basic Parameters int number1; int number2; int number3; string type; cout<<"Calculation Type (Multiply, Add, or Subtract):"; cin>>type; cin.ignore(); cout<<"Please enter a number: "; cin>>number1; cin.ignore(); cout<<"Please enter a second number: "; cin>>number2; cin.ignore(); if (type == "Add") { number3 = number1 + number2; }else if (type == "Subtract") { number3 = number1 - number2; }else if (type == "Multiply") { number3 = number1 * number2; } cout<<"Your number added up to: "<<number3 <<"\n"; cin.get(); } I tried char type; as well but no matter what it's throwing errors around the if/else statement. Something like... "error C2040: '==' : 'int' differs in levels of indirection from 'const char [9]'" Any advice would be appreciated.
  21. After trying tons of things I decided to try something. I checked the div that contained the image instead of the image and it worked fine.
  22. Further Enlightenment: * if (lh.isVisible()) { - This is working in both browsers * if (!lh.getEl().contains(e.getTarget())) { - This is working in both browsers. Just letting you know I tested those two lines and they are working correctly in both browsers. So basically the only one so far messing up is the one checking the image.
  23. I am using EXTJS and I took there datepicker system and rebuilt it with some new functionality. The whole thing is going great but there is one problem. I have a little icon (image html tag) that shows a datepicker icon. It is clicked on and it creates the datepicker and puts it into a div specified for that calendar. That all works great. Over a period of 24 hours I had gone through and programmed new features into the calendar as needed as well as giving it more interactivity. When I was done I set back and noticed that the calendar opens...and when you click a date it adds the date into the input field and closes the datepicker (works as needed). However when you click outside of the calendar (and it loses focus) the calendar sticks around forever. This would be horrible front-end design so I decided to try away to fix it. What I did was get on there forums and got some advice. Using some code they gave me I was able to rewrite it for my situation and reduplicate it for a variety of logic rules. The end result of the code turned out to be: Ext.getBody().on('click', function(e) { if (lh.isVisible()) { if (!lh.getEl().contains(e.getTarget())) { if (!Ext.get(image_id).contains(e.getTarget())) { if (!Ext.get(datepicker_id).contains(e.getTarget())) { $('#'+datepicker_id).html(''); lh.destroy(); } } } } }); Just for reference the two API links for the contains and get function are listed below: Get: http://extjs.com/deploy/dev/docs/ - Do a search for "get" and it'll be the first option there. Contains: http://extjs.com/deploy/dev/docs/ - Do a search for "Contains" GetTarget: http://extjs.com/deploy/dev/docs/ - Do a search for "getTarget" Those are the references for those 3 functions. What this code does is very simple in theory. lh is the datepicker object. When the datepicker is created it does the following. Ext.getBody().on('click', function(e) { - This sets a click event onto the body of the document. if (lh.isVisible()) { - If the calendar is currently showing then we are going to run the following code. if (!lh.getEl().contains(e.getTarget())) { - If your NOT clicking on the calendar we are going to run the following code. if (!Ext.get(image_id).contains(e.getTarget())) { - If your NOT clicking on the image calendar icon we are going to run the code if (!Ext.get(datepicker_id).contains(e.getTarget())) { - If you are NOT clicking on the div for the calendar we are going to run the code (safety check) $('#'+datepicker_id).html(''); - If everything works out we clear the div. lh.destroy(); - And destroy the date object. Now this code is good...it works great in IE6 and IE7. However in Firefox these aren't being compared the same way. They are the same type of object but they are not being compared the same way. Just one example for the line that states if (!Ext.get(image_id).contains(e.getTarget())) { If your in IE and click on the image it returns false..if you click off the image it returns true. That is how it is suppose to work. However in Firefox it is returning False whether you are clicking on the image or off. I know this one is messing up and I think some of the other's are as well. So my question..is there anything in this code that might be making everything work perfectly in IE but not work in Firefox.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.