Jump to content
Stef's Coding Community

parapet74

Member
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About parapet74

  • Rank
    New member
  1. Thanks for the reply and sample code. I wasn't able to get it to work, probably due to not knowing quite where to put things. I've had minimal success with jquery by inserting the code in the <head> between <script> tags. My code now looks like this: function render_products_from_mysql() { $products = get_mysql_products() ; if ($products == FALSE) { $output = '<table class="products">' ; $output.= '<tr><td>No products to display.</td></tr>' ; $output.= '</table>' ; } else { $output = '<div class="shoptable">' ; $output.= ' &
  2. I am modifying the Shopping Cart tutorial to create multiple rows, with one product per row (like a spreadsheet). Each row begins with the img of a large, empty checkbox (emptychk.jpg) and ends with the usual "add to cart" <a href> tag. When someone clicks the add-to-cart <a href> at the end of any product row, I would like to: A - change the anchor tag to "remove from cart" ; and B - change img emptychk.jpg to a different image (greenchk.jpg) C - Ideally, I would like clicking on the empty checkbox <img> (at the start of any row) to do the same thing as clicking &
  3. Thanks -- I hadn't heard about FirePHP. Installed it and enabled the NET panel in FireBug, but still no success. I am now getting this message in the view: Notice: Use of undefined constant console - assumed 'console' in C:\xampp\htdocs\wmp\inc\mysql.class.php Does my code look correct? Do I need to do something else to "start" FirePHP? -- EDIT -- Found the solution(s) - FirePHP is not a simple Firefox add-on... I've now downloaded the FireHPCore folder and installed it as per instructions on the garish http://www.firephp.org/HQ/Learn.htm page, and ... it's working. Quite
  4. Another tutorial that would be of great benefit would be a comprehensive overview of website security, "for dummies", aimed at the Shopping Cart and PHP customers. As a novice php-er, I realize there are security issues I must learn about. For eg, I've seen the term "SQL injectors" mentioned in various places. Also, that passwords should be encrypted using MD5 (how does one do that??) A video, or a text article, that covers the following would be of great interest: - quick overview of web site security, from the HOSTED programmer perspective * eg. What is my responsibility, and
  5. This function is being called and does log me into the SQL db, but I don't see the success message in Firebug's console: function connectToDb () { // Make connection to MySQL server if (!$this->dbConn = @mysql_connect($this->host, $this->dbUser, $this->dbPass)) { trigger_error('Could not connect to server'); $this->connectError=true; // Select database } else if ( !@mysql_select_db($this->dbName,$this->dbConn) ) { trigger_error('Could not select database'); $this->connectError=true; } else { console.log("Successful connection to MySQL database"); } }
  6. Trying to understand some php code... What do the ? and : operators do? What will be in $s? $cart = $_SESSION['cart']; $items = explode(',',$cart); $s = (count($items) > 1) ? 's':'';
  7. parapet74

    Tutorial Request

    I purchased your complete Php programmer course and am working through it. I need more info regarding debugging. I've watched Ben's video on debugging php, which was pretty basic, but Jon's videos also cover using print_r() and the Firefox Firebug add-in with its console.log command. However, the code he writes doesn't work on my system -- I don't get any output to the Firebug console. Perhaps it's because I use Windows... or maybe versionitis. It would be really great if you guys could put together a comprehensive debugging tutorial, covering the most helpful tools. For example, A
  8. Thanks for the speedy reply. Yes to all of your questions. EXCEPT... as I'm thinking about it... the third one. I was entering this address into the address bar: file:///c:/xampp/htdocs/killerphp/index.php -- which *is* on my localhost... but your reply got me thinking... Typing http://localhost/killerphp/index.php worked. Embarrassingly basic. Thanks for the brain nudge.
  9. Php code is not being executed. My config: WinXP P5 2Gb/500Gb XAMPP (latest DL) -- also tried with WAMPSERVER (latest DL) Firefox, Chrome, Opera and Safari (all current) HTML renders, but php is skipped. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset utf-0" /> <title>SESSIONS TUTORIAL</title> </head> <body> <h2&
×
×
  • Create New...