Jump to content

chmpdog

Members
  • Posts

    306
  • Joined

  • Last visited

Everything posted by chmpdog

  1. One line of code I recommend for you is: error_reporting(E_ALL);
  2. logically speaking, this code should work. What errors are you getting? PS: There is a html section somewhere on this forum
  3. If I understood you correctly, I would recommend writing the the results from the table into a array. Try this code after the query: $order=mysql_fetch_array($result, MYSQL_ASSOC); echo $order['order_id'];
  4. I use the following code. It will show all errors in error_log.txt. Hope it helps: <?php /* we will do our own error handling. */ error_reporting(0); // Turns off all error reporting. /* user defined error handling function. */ function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { // timestamp for the error entry. $dt = date('Y-m-d H:i:s (T)'); // define an assoc array of error string // in reality the only entries we should // consider are E_WARNING, E_NOTICE, E_USER_ERROR, // E_USER_WARNING and E_USER_NOTICE. $errortype = array ( E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice' ); // set of errors for which a var trace will be saved. $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE); $err = "\n-----------------------\n"; $err .= "\t" .$dt. "\n"; $err .= "\t" .$errno. "\n"; $err .= "\t" .$errortype[$errno]. "\n"; $err .= "\t" .$errmsg. "\n"; $err .= "\t" .$filename. "\n"; $err .= "\t" .$linenum. "\n"; if (in_array($errno, $user_errors)) { $err .= "\tvartrace\t" .wddx_serialize_value($vars, 'Variables'). "\n"; } $err .= "\n"; // save to the error log file, and e-mail me if there is a critical user error. error_log($err, 3, 'error_log.txt'); if ($errno == E_USER_ERROR) { mail('charding407@gmail.com', 'Critical User Error', $err); } } $old_error_handler = set_error_handler('userErrorHandler'); ?>
  5. Do you have to use this code? Because I have a nifty error log that works.
  6. Php dosnt know to include the variable in the function. Either set the variable in the function or use this inside the function: global $myvar;
  7. wait. would it effect the date if it is a local server? Im using wamp. PS: Thanks for all the replies
  8. nope, no javascript. Its all php and html. I was sure because I knew the issues w/ javascript when I made it
  9. hey, On my site, I have a countdown script that counts down to a specific time. [user the time() function] Now I always want it to countdown in eastern time so I put in te code: date_default_timezone_set ("America/New_York"); but if I change the time on my computer it effects the countdown script. How do I set my server time to EDT? Thanks
  10. This would work, but I wouldnt recommend it. If you wanted to show the output of a function you can just do this: echo mycoolfunction();
  11. I would recommend using a php script to do this, partially because I dont know cURL, and partially because there are plenty of great, free php "add to basket" scripts. heres one I found: http://v3.thewatchmakerproject.com/journal/276/building-a-simple-php-shopping-cart
  12. the use of session_register() is deprecated. Therefore, i would still recommend the way I showed earlier...
  13. Hey, So my mom (dont worry im not in her basement) wants me to edit her website for her, but lately this is getting really annoying. I need to find a script that is easy to use / make pages / edit pages, using a database. I was hoping one of you guri (plural form of guru) have stumbled upon something that will suit me earlier. Thanks
  14. The function dosnt know what to output. you must use "return". try this: return $u_row;
  15. it might work if you removed the "item_x_num_suplies" try having just the variable: "x" so like this $_POST[$X] that will work
  16. use: $_SESSION['blah'] = $myvar; and on the next page.. if you want to use myvar then: $myvarfromlastpage = $_SESSION['blah'];
  17. I found the website where it explains it all: http://www.evolt.org/PHP-Login-System-with-Admin-Features
  18. I found this script and I'm pretty sure it has everything you need. http://evolt.org/files/Login_System_v.2.0.zip
  19. Thanks for the post, but im not getting a header error, the real problem is I cant display the page title and meta info until after main_content() has executed.
  20. Hello World, On my site I have a template system that I set up, but I have come to a major problem. I cant write in the headers. I have fiured out why, but I dont know how to fix it, so I thought maybe someone knows an easy way out. My template consists of an index page, the duty of the index page is to include all the template files, and it also includes the file that determines what page the user is on (and what page-contents to include) based on $_GET info. In this file I have set up functions for all the main parts of my page [iE contents_title(), or main_content()] and I take those functions and place them in the template file I included earlier. But that is where the problem arose. In order to get the header data (like title, and meta tags) main_content() has to be run, because the title variable is located inside that (I cant move the var location because the content may need to change based on user input.) . If I put contents_title() after main_content() everything works, but I cant that because the headers have already been sent by the time main_content() has been executed. So Is there any way to pick out several variables from this function, before the headers load? Thank you very much, CHARLES
  21. Thats what I have, except on my index I have php include another file to get variables for the page title and content. It works if I set my variable on index, but it doesn't if it is set in the other file.
  22. two words: google analitics im pretty sure they have what you need
  23. Hi, Earlier this year I started my website, I thought I didn't need a good template engine, so I made one. Well now I have realized that was a bad Idea. I have run into problems w/ headers and page titles, so now I am looking for an easy template engine to implent in my current system. Heres how my system works, I have all the includes in folder, and then there is a variable to set the page title. Do any of you guys know a template engine that operates like this?
  24. I liked the black & white design. Although I would recommend removing the bar at the bottom and moving the text away from the thing at the top so its readable. Good stuf, although needs some tweeking
×
×
  • 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.