Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: PHP and MySQL 24-Hour Trainer
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: PHP and MySQL 24-Hour Trainer
This is the forum to discuss the Wrox book PHP and MySQL 24-Hour Trainer by Andrea Tarr ; ISBN: 978-1-1180-6688-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 13th, 2012, 11:47 AM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Quick Tips for PHP and MySQL 24-Hour Trainer

Coming from a strong M$(microsoft) background this book has really helped me a lot although there were learning curves and struggle I would like to thank everyone and Andrea for making me learn PHP quickly. I just want something that I can do with ASP.NET (database,forms,some fancy CSS) that's it, and this book wins.

Here are the quicktips I will share (not all codes can be solved though sometimes the answer is already there or on stackoverflow.com)

1.After DL'ng the codes make sure to check out the errata http://www.wrox.com/WileyCDA/WroxTit...Cd-ERRATA.html but sadly the errata is blank. So check out tarrconsulting's posts (that must be in errata)

2.http://p2p.wrox.com/search.php?searchid=710454

3.For struggling coders that still cannot get the 'Contact not added, unable to add contact' message tarrconsulting posted a reply here lesson28csfinal error (which has to be in errata page I think )

4.I have no idea how your environment is setup in Linux or Windows or whatever but I ran the codes semi-perfectly using UniServer Coral (for Windows) it has PHP,mySQL,Apache easy 3-in-one so we can separate ports and test projects/codes for IIS,apache and/or other web servers :)

5.On the Article Maintenance Part suppose we want to add more fields for example on (content/articlemaint.php)

Title ___________________________

Subtitle ________________________

Summary ____________________________

Category _____________________________

Code:
      <li><label for="subtitle" class="required">Subtitle</label><br />
        <input type="text" name="subtitle" id="subtitle" class="required" 
        value="<?php echo $item->getsubtitle(); ?>" /></li>

        <li><label for="summary" class="required">Summary</label><br />
          <textarea rows="15" cols="80" name="summary" 
            id="summary" class="required"><?php echo 
            strip_tags($item->getsummary(),"<b><div><span><img><p><br><h2><h3><h4><strong><em><ul><ol><li><a>"); ?></textarea></li>

      <li><label for="category" class="required">Category</label><br />
        <input type="text" name="category" id="category" class="required" 
        value="<?php echo $item->getcategory(); ?>" /></li>
6.We'll have to dive in includes/classes/article.php and add new fields also

Code:
  protected $subtitle;  
  protected $summary;  
  protected $category;

  public function getsubtitle() {
  return $this->subtitle;
  }  

  public function getsummary() {
  return $this->summary;
  }  

  public function getcategory() {
  return $this->category;
  }
7.Of course I am assuming you have the same fieldnames on your MySQL subtitle,summary,category Will this work not really even you add the new fields on your INSERT and UPDATE statements on the article.php (I really struggled for this one I want to learn not by watching or reading but by coding)

8. Also add the new fields on the includes\functions.php

Code:
      $item  = array (  'id' => (int) $_POST['id'],
                'subtitle' =>$_POST['subtitle'],
                'summary'  => strip_tags($_POST['summary'], "<b><div><img><span><p><br><h2><h3><h4><strong><em><ul><ol><li><a>"),
				'willupdate_datemodified' => (int) $_POST['willupdate_datemodified'],
				'category' => (int) $_POST['category']
            );
9. It's basically up to us if we want clients to add HTML tags on our posts or not, so it's our control whether we want them to have HTML tags on our fields or not. Other than that everything should be easy.

10. Did I mention this book is great, I don't have to worry too much on SQL injection or bad posts or anything (I said not to worry too much) but it basically covered all this issues. Like any unique coders, I really despised the 'Hello World' example and this book you can do more than the Hello World example.

My problem on 1 post was not entertained yet but that doesn't mean I did not get what I want, maybe it's up to me to find ways to solve it (using PDO prepared statements perhaps or any coding methods)

11.Happy coding ---> With crude PHP knowledge form this book I am able built this site (NO wordpress,joomla tricks) ---> arrowgance.eu.pn
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 php and mysql 24-hour trainer Old Sarge BOOK: PHP and MySQL 24-Hour Trainer 3 April 12th, 2012 08:19 PM
Questions about the Access 2010 24 Hour Trainer Book? Post them here! gjgriffith BOOK: Microsoft Access 2010 24-Hour Trainer 2 January 30th, 2012 05:14 PM
HTML 5 24-Hour Trainer nathan613 BOOK: HTML5 24-Hour Trainer 0 May 23rd, 2011 08:14 PM
HTML 5 24-Hour Trainer nathan613 BOOK: HTML5 24-Hour Trainer 0 May 22nd, 2011 08:02 PM
How to show 24 Hour Time? Edward King Oracle 1 July 31st, 2004 04:44 AM



All times are GMT -4. The time now is 10:43 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.