Wrox Programmer Forums
|
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2005, 09:50 PM
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Explain some code on p178

Most of the code in this book so far is very well explained but I have hit a roadblock on p178 (I get a little lost with the do's and the sequence in delete.php)

if ( !isset( $_GET['do'] ) || $_GET['do'] != 1 ){
?>
      <p align="center" style="color:#FF0000">
         Are you sure you want to delete this <?php echo $_GET['type']?>?<br/>
         <a href="<?php echo $_SERVER['REQUEST_URI']?>&do=1">yes</a> or <a
href="index.php">Index</a>


I understand conceptually what is going on here but I can't create a variation of it since I do not understand why the href approval takes pace after the !isset???
 
Old June 3rd, 2005, 09:51 PM
Authorized User
 
Join Date: Jun 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It's checking to see if the $_GET query string variable "do" is set. If not, It's displaying a link to either delete the item, or return to the index. Notice in the href attribute of the link, "do" is set to 1. If you clicked on the link and it posted back to this page, the link choice would not display again, because do would be set, and its value would be 1.

In other words, the isset() function and comparison to 1 wrap the link, to only show it when needed.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone explain this code to me pandu345 Java Basics 2 October 6th, 2006 12:25 PM
could any one explain this code for me ? method Access VBA 1 August 13th, 2005 02:02 AM
explain please rein Javascript 3 January 31st, 2005 09:47 AM
Please explain this code : p131 top para ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 28th, 2005 06:02 PM
Could somebody explain this to me, please? czambran BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 June 7th, 2004 04:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.